int main() {
  char b[100];
  char c[] = "!dlrow ,olleH";
  printf("%s %d\n", my_itoa(55689, b), my_atoi("-668"));
  printf("%s\n", my_reverse(c));
  printf("%d\n", strindex(c, "world!"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x7e(%rbp)
mov    0xe95(%rip),%eax
mov    %eax,-0x76(%rbp)
mov    0xe8f(%rip),%ax
mov    %ax,-0x72(%rbp)
lea    -0x70(%rbp),%rsi
mov    $0xd989,%edi
mov    $0x0,%al
call   1040 <my_itoa@plt>
mov    %eax,-0x84(%rbp)
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <my_atoi@plt>
mov    -0x84(%rbp),%esi
mov    %eax,%edx
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x7e(%rbp),%rdi
mov    $0x0,%al
call   1070 <my_reverse@plt>
mov    %eax,%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x7e(%rbp),%rdi
lea    0xe3d(%rip),%rsi
mov    $0x0,%al
call   1060 <strindex@plt>
mov    %eax,%esi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movabs $0x48656c6c6f2c20,%rax
mov    %rax,0x6(%rsp)
movabs $0x2c20776f726c6421,%rax
77 20 2c
mov    %rax,(%rsp)
lea    0x10(%rsp),%rsi
mov    $0xd989,%edi
xor    %eax,%eax
call   1040 <my_itoa@plt>
mov    %eax,%ebx
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1030 <my_atoi@plt>
lea    0xe71(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <my_reverse@plt>
lea    0xe5e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe52(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <strindex@plt>
lea    0xe34(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.c = [14 x i8] c"!dlrow ,olleH\00"
@.str = [7 x i8] c"%s %d\0A\00"
@.str.1 = [5 x i8] c"-668\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [7 x i8] c"world!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [14 x i8]
store i32 0, i32* %1
%4 = bitcast [14 x i8]* %3 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @my_itoa to i32 (i32, i8*, ...)*)(i32 55689, i8* %5)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @my_atoi to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @my_reverse to i32 (i8*, ...)*)(i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%13 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strindex to i32 (i8*, i8*, ...)*)(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.c = [14 x i8] c"!dlrow ,olleH\00"
@.str = [7 x i8] c"%s %d\0A\00"
@.str.1 = [5 x i8] c"-668\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [7 x i8] c"world!\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [14 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%5 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @my_itoa to i32 (i32, i8*, ...)*)(i32 55689, i8* %3)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @my_atoi to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @my_reverse to i32 (i8*, ...)*)(i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strindex to i32 (i8*, i8*, ...)*)(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %10)
ret i32 0
}