#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int myAtoi(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char **argv) {
  printf("input:%s output:%d \n", "", myAtoi(""));
  ;
  printf("input:%s output:%d \n", "   -04f", myAtoi("   -04f"));
  ;
  printf("input:%s output:%d \n", "2147483648", myAtoi("2147483648"));
  ;
  printf("input:%s output:%d \n", "-2147483649", myAtoi("-2147483649"));
  ;
  printf("input:%s output:%d \n", "-1", myAtoi("-1"));
  ;
  printf("input:%s output:%d \n", " b11228552307", myAtoi(" b11228552307"));
  ;
  printf("input:%s output:%d \n", "     010", myAtoi("     010"));
  ;
  printf("input:%s output:%d \n", "9223372036854775809",
         myAtoi("9223372036854775809"));
  ;
  printf("input:%s output:%d \n", "      -11919730356x",
         myAtoi("      -11919730356x"));
  ;
  printf("input:%s output:%d \n", "    -00134", myAtoi("    -00134"));
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xeb5(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xe94(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xe73(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xe52(%rip),%rdi
lea    0xe73(%rip),%rsi
call   1030 <printf@plt>
lea    0xe73(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xe31(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   1030 <printf@plt>
lea    0xe55(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xe10(%rip),%rdi
lea    0xe40(%rip),%rsi
call   1030 <printf@plt>
lea    0xe42(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xdef(%rip),%rdi
lea    0xe2d(%rip),%rsi
call   1030 <printf@plt>
lea    0xe2a(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xdce(%rip),%rdi
lea    0xe15(%rip),%rsi
call   1030 <printf@plt>
lea    0xe1d(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xdad(%rip),%rdi
lea    0xe08(%rip),%rsi
call   1030 <printf@plt>
lea    0xe10(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%edx
lea    0xd8c(%rip),%rdi
lea    0xdfb(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee9(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
lea    0xec6(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xec7(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xea2(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xe92(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xe79(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xe6b(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xe58(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xe50(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xe48(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoi@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"input:%s output:%d \0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c" -04f\00"
@.str.3 = [11 x i8] c"2147483648\00"
@.str.4 = [12 x i8] c"-2147483649\00"
@.str.5 = [3 x i8] c"-1\00"
@.str.6 = [14 x i8] c" b11228552307\00"
@.str.7 = [9 x i8] c" 010\00"
@.str.8 = [20 x i8] c"9223372036854775809\00"
@.str.9 = [20 x i8] c" -11919730356x\00"
@.str.10 = [11 x i8] c" -00134\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @myAtoi(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @myAtoi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 @myAtoi(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 @myAtoi(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = call i32 @myAtoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%16 = call i32 @myAtoi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %16)
%18 = call i32 @myAtoi(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %18)
%20 = call i32 @myAtoi(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %20)
%22 = call i32 @myAtoi(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %22)
%24 = call i32 @myAtoi(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"input:%s output:%d \0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c" -04f\00"
@.str.3 = [11 x i8] c"2147483648\00"
@.str.4 = [12 x i8] c"-2147483649\00"
@.str.5 = [3 x i8] c"-1\00"
@.str.6 = [14 x i8] c" b11228552307\00"
@.str.7 = [9 x i8] c" 010\00"
@.str.8 = [20 x i8] c"9223372036854775809\00"
@.str.9 = [20 x i8] c" -11919730356x\00"
@.str.10 = [11 x i8] c" -00134\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @myAtoi(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @myAtoi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @myAtoi(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @myAtoi(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @myAtoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 @myAtoi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%14 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 @myAtoi(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%16 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = tail call i32 @myAtoi(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%18 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = tail call i32 @myAtoi(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%20 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = tail call i32 @myAtoi(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%22 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 %21)
ret i32 0
}