GCC with -O3 might try to unroll this loop into a single constant. O(0) is pretty fast.
But if you had to do it manually, loop unrolling and SIMD instructions (although not part of standard C) would be good bets and can probably get you an order of magnitude.
sub rsp, 8
mov rdi, QWORD PTR [rsi+8]
mov edx, 10
xor esi, esi
call strtol <-- atoi
xor eax, eax <-- zero return value
add rsp, 8
ret <-- return from main
Interestingly enough it does not elide the entire function body. 000000000400400 <main>:
400400: 48 83 ec 08 sub $0x8,%rsp
400404: 48 8b 7e 08 mov 0x8(%rsi),%rdi
400408: ba 0a 00 00 00 mov $0xa,%edx
40040d: 31 f6 xor %esi,%esi
40040f: e8 dc ff ff ff callq 4003f0 <strtol@plt>
400414: 31 c0 xor %eax,%eax
400416: 48 83 c4 08 add $0x8,%rsp
40041a: c3 retq
40041b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
Which I'm not a fan of. I've always wanted "add (store), (get)" but could never get that."O(0)" is pretty much meaningless.