#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 myAtoL(char *);
int /*<<< orphan*/ printf(char *);
void testmyAtoL() {
  printf("Testing myAtoL\n");
  assert(myAtoL("6746") == 6746);
  assert(myAtoL("6746") == 6746);
  assert(myAtoL("222") == 222);
  assert(myAtoL("-4736") == -4736);
  assert(myAtoL("-746562") == -746562);
  printf("Testing myAtoL Passed\n");
}


x86 assembly (clang, -O0):
<testmyAtoL>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
call   1040 <myAtoL@plt>
cmp    $0x1a5a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xeab(%rip),%rdi
call   1040 <myAtoL@plt>
cmp    $0x1a5a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe92(%rip),%rdi
call   1040 <myAtoL@plt>
cmp    $0xde,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe78(%rip),%rdi
call   1040 <myAtoL@plt>
cmp    $0xffffed80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe60(%rip),%rdi
call   1040 <myAtoL@plt>
cmp    $0xfff49bbe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmyAtoL>:
push   %rbx
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
call   1040 <myAtoL@plt>
xor    %edi,%edi
cmp    $0x1a5a,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <myAtoL@plt>
xor    %edi,%edi
cmp    $0x1a5a,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe8a(%rip),%rdi
call   1040 <myAtoL@plt>
xor    %edi,%edi
cmp    $0xde,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe72(%rip),%rdi
call   1040 <myAtoL@plt>
xor    %edi,%edi
cmp    $0xffffed80,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe5c(%rip),%rdi
call   1040 <myAtoL@plt>
xor    %edi,%edi
cmp    $0xfff49bbe,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe57(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Testing myAtoL\0A\00"
@.str.1 = [5 x i8] c"6746\00"
@.str.2 = [4 x i8] c"222\00"
@.str.3 = [6 x i8] c"-4736\00"
@.str.4 = [8 x i8] c"-746562\00"
@.str.5 = [23 x i8] c"Testing myAtoL Passed\0A\00"
define void @testmyAtoL() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @myAtoL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 6746
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @myAtoL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 6746
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @myAtoL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 222
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @myAtoL(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i32 %14, -4736
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @myAtoL(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i32 %18, -746562
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"6746\00"
@.str.2 = [4 x i8] c"222\00"
@.str.3 = [6 x i8] c"-4736\00"
@.str.4 = [8 x i8] c"-746562\00"
@str = [15 x i8] c"Testing myAtoL\00"
@str.6 = [22 x i8] c"Testing myAtoL Passed\00"
define void @testmyAtoL() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @myAtoL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 6746
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @myAtoL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 6746
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @myAtoL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 222
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32 @myAtoL(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i32 %14, -4736
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32 @myAtoL(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i32 %18, -746562
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0))
ret void
}