#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 /*<<< orphan*/ assert(int);
int my_atoi(char *);
void test() {
  assert(0 == my_atoi("-00000"));
  assert(-89 == my_atoi("-89"));
  assert(890 == my_atoi("0890"));
  assert(890 == my_atoi("+0890"));
  assert(890 == my_atoi("    0890"));
  assert(890 == my_atoi("    +0890"));
  assert(-890 == my_atoi("    -0890"));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xebd(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%ecx
mov    $0xffffffa7,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea3(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%ecx
mov    $0x37a,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe8a(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%ecx
mov    $0x37a,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe5b(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%ecx
mov    $0x37a,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe42(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%ecx
mov    $0x37a,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe2a(%rip),%rdi
call   1030 <my_atoi@plt>
mov    %eax,%ecx
mov    $0xfffffc86,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <my_atoi@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xec6(%rip),%rdi
call   1030 <my_atoi@plt>
xor    %edi,%edi
cmp    $0xffffffa7,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb4(%rip),%rdi
call   1030 <my_atoi@plt>
xor    %edi,%edi
cmp    $0x37a,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xea1(%rip),%rdi
call   1030 <my_atoi@plt>
xor    %edi,%edi
cmp    $0x37a,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe78(%rip),%rdi
call   1030 <my_atoi@plt>
xor    %edi,%edi
cmp    $0x37a,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe65(%rip),%rdi
call   1030 <my_atoi@plt>
xor    %edi,%edi
cmp    $0x37a,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe53(%rip),%rdi
call   1030 <my_atoi@plt>
xor    %edi,%edi
cmp    $0xfffffc86,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"-00000\00"
@.str.1 = [4 x i8] c"-89\00"
@.str.2 = [5 x i8] c"0890\00"
@.str.3 = [6 x i8] c"+0890\00"
@.str.4 = [9 x i8] c" 0890\00"
@.str.5 = [10 x i8] c" +0890\00"
@.str.6 = [10 x i8] c" -0890\00"
define void @test() {
%1 = call i32 @my_atoi(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 0, %1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @my_atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 -89, %5
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @my_atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 890, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @my_atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 890, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @my_atoi(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i32 890, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @my_atoi(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%22 = icmp eq i32 890, %21
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i32 @my_atoi(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i32 -890, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"-00000\00"
@.str.1 = [4 x i8] c"-89\00"
@.str.2 = [5 x i8] c"0890\00"
@.str.3 = [6 x i8] c"+0890\00"
@.str.4 = [9 x i8] c" 0890\00"
@.str.5 = [10 x i8] c" +0890\00"
@.str.6 = [10 x i8] c" -0890\00"
define void @test() {
%1 = tail call i32 @my_atoi(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @my_atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, -89
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @my_atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 %9, 890
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @my_atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 %13, 890
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @my_atoi(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i32 %17, 890
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @my_atoi(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%22 = icmp eq i32 %21, 890
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @my_atoi(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i32 %25, -890
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
ret void
}