#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 atoi(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int test_atoi(void) {
  do {
    if (!(0 == atoi(""))) {
      printf("expression '%s' untrue at %d\n", "0 == atoi(\"\")", 56);
      return 0;
    }
  } while (0);
  do {
    if (!(0 == atoi("0"))) {
      printf("expression '%s' untrue at %d\n", "0 == atoi(\"0\")", 57);
      return 0;
    }
  } while (0);
  do {
    if (!(9 == atoi("9"))) {
      printf("expression '%s' untrue at %d\n", "9 == atoi(\"9\")", 58);
      return 0;
    }
  } while (0);
  do {
    if (!(42 == atoi("42"))) {
      printf("expression '%s' untrue at %d\n", "42 == atoi(\"42\")", 59);
      return 0;
    }
  } while (0);
  do {
    if (!(-42 == atoi("-42"))) {
      printf("expression '%s' untrue at %d\n", "-42 == atoi(\"-42\")", 60);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeee(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1164 <test_atoi+0x44>
lea    0xeb9(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x38,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1291 <test_atoi+0x171>
jmp    1169 <test_atoi+0x49>
jmp    116e <test_atoi+0x4e>
lea    0xeb7(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     11aa <test_atoi+0x8a>
lea    0xe73(%rip),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x39,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1291 <test_atoi+0x171>
jmp    11af <test_atoi+0x8f>
jmp    11b4 <test_atoi+0x94>
lea    0xe82(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
je     11f3 <test_atoi+0xd3>
lea    0xe2a(%rip),%rdi
lea    0xe62(%rip),%rsi
mov    $0x3a,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1291 <test_atoi+0x171>
jmp    11f8 <test_atoi+0xd8>
jmp    11fd <test_atoi+0xdd>
lea    0xe5c(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    $0x2a,%eax
cmp    %ecx,%eax
je     123c <test_atoi+0x11c>
lea    0xde1(%rip),%rdi
lea    0xe28(%rip),%rsi
mov    $0x3b,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1291 <test_atoi+0x171>
jmp    1241 <test_atoi+0x121>
jmp    1246 <test_atoi+0x126>
lea    0xe12(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    $0xffffffd6,%eax
cmp    %ecx,%eax
je     1285 <test_atoi+0x165>
lea    0xd98(%rip),%rdi
lea    0xdf4(%rip),%rsi
mov    $0x3c,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1291 <test_atoi+0x171>
jmp    128a <test_atoi+0x16a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_atoi>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [14 x i8] c"0 == atoi(\22\22)\00"
@.str.3 = [2 x i8] c"0\00"
@.str.4 = [15 x i8] c"0 == atoi(\220\22)\00"
@.str.5 = [2 x i8] c"9\00"
@.str.6 = [15 x i8] c"9 == atoi(\229\22)\00"
@.str.7 = [3 x i8] c"42\00"
@.str.8 = [17 x i8] c"42 == atoi(\2242\22)\00"
@.str.9 = [4 x i8] c"-42\00"
@.str.10 = [19 x i8] c"-42 == atoi(\22-42\22)\00"
define i32 @test_atoi() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @atoi(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 0, %3
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 56)
store i32 0, i32* %1
br label %37
7: ; preds = %2
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
%10 = call i32 @atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 0, %10
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 57)
store i32 0, i32* %1
br label %37
14: ; preds = %9
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15
%17 = call i32 @atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i32 9, %17
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 58)
store i32 0, i32* %1
br label %37
21: ; preds = %16
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
%24 = call i32 @atoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%25 = icmp eq i32 42, %24
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i32 59)
store i32 0, i32* %1
br label %37
28: ; preds = %23
br label %29
29: ; preds = %28
br label %30
30: ; preds = %29
%31 = call i32 @atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%32 = icmp eq i32 -42, %31
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 60)
store i32 0, i32* %1
br label %37
35: ; preds = %30
br label %36
36: ; preds = %35
store i32 1, i32* %1
br label %37
37: ; preds = %36, %33, %26, %19, %12, %5
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
define i32 @test_atoi() {
ret i32 1
}