xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ callee3(char *);
void callee2(int intarg, char *strarg) { callee3(strarg); }


x86 assembly (clang, -O0):
<callee2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <callee3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callee2>:
mov    %rsi,%rdi
jmp    1030 <callee3@plt>

LLVM IR (-O0):
define void @callee2(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @callee3(i8* %5)
ret void
}

LLVM IR (-O2):
define void @callee2(i32 %0, i8* %1) {
%3 = tail call i32 @callee3(i8* %1)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
void foo(char *ptr) {
  ptr = malloc(255);
  strcpy(ptr, "Hello World");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xff,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0xff,%edi
call   1040 <malloc@plt>
lea    0xece(%rip),%rsi
mov    %rax,%rdi
pop    %rax
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @malloc(i32 255)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define void @foo(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(255) i8* @malloc(i32 255)
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(double const, double const, double const, int);
void glWindowPos3dv(const double v[3]) { glWindowPos4f(v[0], v[1], v[2], 1); }


x86 assembly (clang, -O0):
<glWindowPos3dv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    $0x1,%edi
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos3dv>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
mov    $0x1,%edi
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos3dv(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = call i32 @glWindowPos4f(double %5, double %8, double %11, i32 1)
ret void
}

LLVM IR (-O2):
define void @glWindowPos3dv(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = tail call i32 @glWindowPos4f(double %2, double %4, double %6, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initializeMemoryBlock(void **, int, int const);
void initializeMemoryBlocks(int memory_amount, void **memory_pointer) {
  const int Byte = 1;
  const int KiloByte = Byte * 1024;
  const int MegaByte = KiloByte * 1024;
  int memory_block_index = 0;
  for (memory_block_index = 0; memory_block_index < memory_amount;
       memory_block_index++)
    initializeMemoryBlock(memory_pointer, memory_block_index, MegaByte);
  return;
}


x86 assembly (clang, -O0):
<initializeMemoryBlocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x400,-0x18(%rbp)
movl   $0x100000,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116d <initializeMemoryBlocks+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    $0x100000,%edx
call   1030 <initializeMemoryBlock@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1142 <initializeMemoryBlocks+0x32>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeMemoryBlocks>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1136 <initializeMemoryBlocks+0x26>
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
nop
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x100000,%edx
call   1030 <initializeMemoryBlock@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1120 <initializeMemoryBlocks+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @initializeMemoryBlocks(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
store i32 1024, i32* %6
store i32 1048576, i32* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %8
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i8**, i8*** %4
%15 = load i32, i32* %8
%16 = call i32 @initializeMemoryBlock(i8** %14, i32 %15, i32 1048576)
br label %17
17: ; preds = %13
%18 = load i32, i32* %8
%19 = add nsw i32 %18, 1
store i32 %19, i32* %8
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @initializeMemoryBlocks(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @initializeMemoryBlock(i8** %1, i32 %5, i32 1048576)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
int imax(int x, int y) { return x < y ? y : x; }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <imax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @imax(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x9a() {
  Assert_real((ispunct(154) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              775, ("ispunct should be 0 for 0x9a"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x9a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9a,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x307,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x9a>:
push   %rax
mov    $0x9a,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x307,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x9a\00"
define void @t_ispunct_0x9a() {
%1 = call i64 @ispunct(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x9a\00"
define void @t_ispunct_0x9a() {
%1 = tail call i64 @ispunct(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int is_num_checker(char c) {
  if ((c >= '0') && (c <= '9'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_num_checker>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_num_checker+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_num_checker+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_num_checker+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num_checker>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_num_checker(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_num_checker(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ swab(unsigned char *, unsigned char *, unsigned long long);
void yuyv2uyvy(unsigned char *src, unsigned char *dest,
               unsigned long long int NumPixels) {
  swab(src, dest, NumPixels << 1);
}


x86 assembly (clang, -O0):
<yuyv2uyvy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shl    $0x1,%rdx
call   1030 <swab@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuyv2uyvy>:
add    %rdx,%rdx
jmp    1030 <swab@plt>

LLVM IR (-O0):
define void @yuyv2uyvy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = shl i64 %9, 1
%11 = call i32 @swab(i8* %7, i8* %8, i64 %10)
ret void
}

LLVM IR (-O2):
define void @yuyv2uyvy(i8* %0, i8* %1, i64 %2) {
%4 = shl i64 %2, 1
%5 = tail call i32 @swab(i8* %0, i8* %1, i64 %4)
ret void
}
/* Variables and functions */
unsigned long long cast(long double);
unsigned long long int myround(long double value) {
  unsigned long long int intpart = cast(value);
  return ((value -= intpart) < 0.5) ? intpart : intpart + 1;
}


x86 assembly (clang, -O0):
<myround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cast@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
test   %rax,%rax
sets   %al
movzbl %al,%eax
mov    %eax,%ecx
fildll -0x20(%rbp)
lea    0xeb4(%rip),%rax
flds   (%rax,%rcx,4)
faddp  %st,%st(1)
fldt   -0x10(%rbp)
fsubp  %st,%st(1)
fld    %st(0)
fstpt  -0x10(%rbp)
flds   0xea7(%rip)
fucomip %st(1),%st
fstp   %st(0)
jbe    117d <myround+0x6d>
jmp    1170 <myround+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1189 <myround+0x79>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myround>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <cast@plt>
mov    %rax,0x10(%rsp)
xor    %ecx,%ecx
test   %rax,%rax
sets   %cl
fildll 0x10(%rsp)
lea    0xec2(%rip),%rdx
fadds  (%rdx,%rcx,4)
fldt   0x1c(%rsp)
fsubp  %st,%st(1)
flds   0xebb(%rip)
xor    %ecx,%ecx
fucomip %st(1),%st
fstp   %st(0)
setbe  %cl
add    %rcx,%rax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i64 @myround(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call i64 @cast(x86_fp80 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = uitofp i64 %6 to x86_fp80
%8 = load x86_fp80, x86_fp80* %2
%9 = fsub x86_fp80 %8, %7
store x86_fp80 %9, x86_fp80* %2
%10 = fcmp olt x86_fp80 %9, 0xK3FFE8000000000000000
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i64, i64* %3
br label %16
13: ; preds = %1
%14 = load i64, i64* %3
%15 = add i64 %14, 1
br label %16
16: ; preds = %13, %11
%17 = phi i64 [ %12, %11 ], [ %15, %13 ]
ret i64 %17
}

LLVM IR (-O2):
define i64 @myround(x86_fp80 %0) {
%2 = tail call i64 @cast(x86_fp80 %0)
%3 = uitofp i64 %2 to x86_fp80
%4 = fsub x86_fp80 %0, %3
%5 = fcmp uge x86_fp80 %4, 0xK3FFE8000000000000000
%6 = zext i1 %5 to i64
%7 = add i64 %2, %6
ret i64 %7
}
/* Variables and functions */
void *mclpARinit(void *);
void *mclpARinit_v(void *mclpar) { return mclpARinit(mclpar); }


x86 assembly (clang, -O0):
<mclpARinit_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mclpARinit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mclpARinit_v>:
jmp    1030 <mclpARinit@plt>

LLVM IR (-O0):
define i8* @mclpARinit_v(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @mclpARinit(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @mclpARinit_v(i8* %0) {
%2 = tail call i8* @mclpARinit(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long long f4(unsigned long long x,
                                                   unsigned long long y) {
  unsigned long long r = x + y;
  if (y >= r)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1141 <f4+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
cmp    %rsi,%rbx
ja     1123 <f4+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @f4(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = icmp uge i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @f4(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ugt i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_222() {
  Assert_real((isqrt(222) == 14),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1115, ("Integer square root of 222 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_222>:
push   %rbp
mov    %rsp,%rbp
mov    $0xde,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x45b,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_222>:
push   %rax
mov    $0xde,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x45b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 222 should be 14\00"
define void @t_sqrt_222() {
%1 = call i32 @isqrt(i32 222)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1115, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 222 should be 14\00"
define void @t_sqrt_222() {
%1 = tail call i32 @isqrt(i32 222)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1115, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *mystrcpy(char *dest, char *src) {
  char *ret_ptr = dest;
  if (dest && src) {
    while (*src) {
      *dest++ = *src++;
    }
  }
  return ret_ptr;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1168 <mystrcpy+0x68>
cmpq   $0x0,-0x10(%rbp)
je     1168 <mystrcpy+0x68>
jmp    112f <mystrcpy+0x2f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <mystrcpy+0x63>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    112f <mystrcpy+0x2f>
jmp    1168 <mystrcpy+0x68>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    %rdi,%rax
test   %rdi,%rdi
je     1130 <mystrcpy+0x30>
test   %rsi,%rsi
je     1130 <mystrcpy+0x30>
mov    (%rsi),%cl
test   %cl,%cl
je     1130 <mystrcpy+0x30>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <mystrcpy+0x20>
ret

LLVM IR (-O0):
define i8* @mystrcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %24
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %24
12: ; preds = %9
br label %13
13: ; preds = %17, %12
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
%20 = load i8, i8* %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
store i8 %20, i8* %21
br label %13
23: ; preds = %13
br label %24
24: ; preds = %23, %9, %2
%25 = load i8*, i8** %5
ret i8* %25
}

LLVM IR (-O2):
define i8* @mystrcpy(i8* returned writeonly %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8 [ %15, %9 ], [ %7, %6 ]
%11 = phi i8* [ %14, %9 ], [ %0, %6 ]
%12 = phi i8* [ %13, %9 ], [ %1, %6 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %11
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ test45_M_bar__E();
int /*<<< orphan*/ test45_M_foo__E();
int /*<<< orphan*/ test45_Q_cycle__E();
int /*<<< orphan*/ test45_Q_reset__E();
void test45_Test6_test__I() {
  test45_M_foo__E();
  test45_M_bar__E();
  test45_Q_cycle__E();
  test45_Q_reset__E();
}


x86 assembly (clang, -O0):
<test45_Test6_test__I>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test45_M_foo__E@plt>
mov    $0x0,%al
call   1040 <test45_M_bar__E@plt>
mov    $0x0,%al
call   1060 <test45_Q_cycle__E@plt>
mov    $0x0,%al
call   1030 <test45_Q_reset__E@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test45_Test6_test__I>:
push   %rax
xor    %eax,%eax
call   1050 <test45_M_foo__E@plt>
xor    %eax,%eax
call   1040 <test45_M_bar__E@plt>
xor    %eax,%eax
call   1060 <test45_Q_cycle__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test45_Q_reset__E@plt>

LLVM IR (-O0):
define void @test45_Test6_test__I() {
%1 = call i32 (...) @test45_M_foo__E()
%2 = call i32 (...) @test45_M_bar__E()
%3 = call i32 (...) @test45_Q_cycle__E()
%4 = call i32 (...) @test45_Q_reset__E()
ret void
}

LLVM IR (-O2):
define void @test45_Test6_test__I() {
%1 = tail call i32 (...) @test45_M_foo__E()
%2 = tail call i32 (...) @test45_M_bar__E()
%3 = tail call i32 (...) @test45_Q_cycle__E()
%4 = tail call i32 (...) @test45_Q_reset__E()
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int i = 0;
  while (i < atoi(argv[1])) {
    printf("%d\n", i++);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1179 <main+0x59>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    113d <main+0x1d>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
test   %eax,%eax
jle    115a <main+0x3a>
xor    %esi,%esi
lea    0xec3(%rip),%r14
nopl   (%rax)
lea    0x1(%rsi),%ebp
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
mov    %ebp,%esi
cmp    %eax,%ebp
jl     1140 <main+0x20>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %14, %2
%8 = load i32, i32* %6
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = icmp slt i32 %8, %12
br i1 %13, label %14, label %18
14: ; preds = %7
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %7
18: ; preds = %7
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2, %7
%8 = phi i32 [ %9, %7 ], [ 0, %2 ]
%9 = add nuw nsw i32 %8, 1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%11 = load i8*, i8** %3
%12 = tail call i32 @atoi(i8* %11)
%13 = icmp slt i32 %9, %12
br i1 %13, label %7, label %14
14: ; preds = %7, %2
ret i32 1
}
unsigned xrop3_155_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_155_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_155_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %edi,%esi
or     %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_155_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_155_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = or i32 %4, %6
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ cat_usage(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void cat_help(void) {
  cat_usage(stdout);
  fputs("Print a resource from a file's resource fork to standard output.\n",
        stdout);
}


x86 assembly (clang, -O0):
<cat_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <cat_usage@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat_help>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
call   1040 <cat_usage@plt>
mov    (%rbx),%esi
lea    0xec8(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [66 x i8] c"Print a resource from a file's resource fork to standard output.\0A\00"
define void @cat_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @cat_usage(i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [66 x i8] c"Print a resource from a file's resource fork to standard output.\0A\00"
define void @cat_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @cat_usage(i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int creat(char const *, int);
int mus_file_create(const char *arg) {
  int fd;
  fd = creat(arg, 0666);
  return (fd);
}


x86 assembly (clang, -O0):
<mus_file_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1b6,%esi
call   1030 <creat@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_file_create>:
mov    $0x1b6,%esi
jmp    1030 <creat@plt>

LLVM IR (-O0):
define i32 @mus_file_create(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @creat(i8* %4, i32 438)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @mus_file_create(i8* %0) {
%2 = tail call i32 @creat(i8* %0, i32 438)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ssh_free(void *p) { free(p); }


x86 assembly (clang, -O0):
<ssh_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ssh_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @ssh_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WI_endStats();
void WI_End(void) { WI_endStats(); }


x86 assembly (clang, -O0):
<WI_End>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <WI_endStats@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WI_End>:
xor    %eax,%eax
jmp    1030 <WI_endStats@plt>

LLVM IR (-O0):
define void @WI_End() {
%1 = call i32 (...) @WI_endStats()
ret void
}

LLVM IR (-O2):
define void @WI_End() {
%1 = tail call i32 (...) @WI_endStats()
ret void
}
void uDMAChannelRequest(unsigned long ulChannel) {
  ;
  (*((volatile unsigned long *)(0x400FF014))) = 1 << ulChannel;
}


x86 assembly (clang, -O0):
<uDMAChannelRequest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff014,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelRequest>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff014
40
ret

LLVM IR (-O0):
define void @uDMAChannelRequest(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
store volatile i64 %6, i64* inttoptr (i64 1074786324 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelRequest(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1074786324 to i64*)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ testassert();
int /*<<< orphan*/ testdl();
int /*<<< orphan*/ testenv();
int /*<<< orphan*/ testlog(char **);
int /*<<< orphan*/ testqsort();
int /*<<< orphan*/ testregex();
int /*<<< orphan*/ teststrtok2();
int main(int argc, char *argv[]) {
  testlog(argv);
  testenv();
  testregex();
  testdl();
  teststrtok2();
  testqsort();
  testassert();
  return EXIT_SUCCESS;
}


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)
mov    -0x10(%rbp),%rdi
call   1040 <testlog@plt>
mov    $0x0,%al
call   1090 <testenv@plt>
mov    $0x0,%al
call   1070 <testregex@plt>
mov    $0x0,%al
call   1050 <testdl@plt>
mov    $0x0,%al
call   1030 <teststrtok2@plt>
mov    $0x0,%al
call   1060 <testqsort@plt>
mov    $0x0,%al
call   1080 <testassert@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdi
call   1040 <testlog@plt>
xor    %eax,%eax
call   1090 <testenv@plt>
xor    %eax,%eax
call   1070 <testregex@plt>
xor    %eax,%eax
call   1050 <testdl@plt>
xor    %eax,%eax
call   1030 <teststrtok2@plt>
xor    %eax,%eax
call   1060 <testqsort@plt>
xor    %eax,%eax
call   1080 <testassert@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = load i8**, i8*** %5
%7 = call i32 @testlog(i8** %6)
%8 = call i32 (...) @testenv()
%9 = call i32 (...) @testregex()
%10 = call i32 (...) @testdl()
%11 = call i32 (...) @teststrtok2()
%12 = call i32 (...) @testqsort()
%13 = call i32 (...) @testassert()
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @testlog(i8** %1)
%4 = tail call i32 (...) @testenv()
%5 = tail call i32 (...) @testregex()
%6 = tail call i32 (...) @testdl()
%7 = tail call i32 (...) @teststrtok2()
%8 = tail call i32 (...) @testqsort()
%9 = tail call i32 (...) @testassert()
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
void song_fix_config(void) { return; }


x86 assembly (clang, -O0):
<song_fix_config>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<song_fix_config>:
ret

LLVM IR (-O0):
define void @song_fix_config() {
ret void
}

LLVM IR (-O2):
define void @song_fix_config() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ timer_t;
struct itimerspec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
                  struct itimerspec *ovalue) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<timer_settime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_settime>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.itimerspec = type { i32 }
@ENOSYS = global i32 0
define i32 @timer_settime(i32 %0, i32 %1, %struct.itimerspec* %2, %struct.itimerspec* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.itimerspec*
%8 = alloca %struct.itimerspec*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.itimerspec* %2, %struct.itimerspec** %7
store %struct.itimerspec* %3, %struct.itimerspec** %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
%struct.itimerspec = type { i32 }
@ENOSYS = global i32 0
define i32 @timer_settime(i32 %0, i32 %1, %struct.itimerspec* nocapture readnone %2, %struct.itimerspec* nocapture readnone %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int ioctl(int, int, void *);
int mar_block_ioctl(int fd, int request, void *arg) {
  int r;
  do
    r = ioctl(fd, request, arg);
  while (-1 == r && EINTR == errno);
  return r;
}


x86 assembly (clang, -O0):
<mar_block_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    -0x14(%rbp),%ecx
mov    %al,-0x15(%rbp)
jne    1161 <mar_block_ioctl+0x51>
mov    0x2e8a(%rip),%rax
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1122 <mar_block_ioctl+0x12>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mar_block_ioctl>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eb2(%rip),%r15
mov    0x2eb3(%rip),%r12
nopl   (%rax)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    114a <mar_block_ioctl+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <mar_block_ioctl+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EINTR = global i64 0
@errno = global i64 0
define i32 @mar_block_ioctl(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @ioctl(i32 %9, i32 %10, i8* %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 -1, %14
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @EINTR
%18 = load i64, i64* @errno
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@EINTR = global i64 0
@errno = global i64 0
define i32 @mar_block_ioctl(i32 %0, i32 %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @ioctl(i32 %0, i32 %1, i8* %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @EINTR
%8 = load i64, i64* @errno
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
void ModemStateNotified() {}


x86 assembly (clang, -O0):
<ModemStateNotified>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ModemStateNotified>:
ret

LLVM IR (-O0):
define void @ModemStateNotified() {
ret void
}

LLVM IR (-O2):
define void @ModemStateNotified() {
ret void
}
int imax(int x, int y) {
  if (x > y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <imax+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imax(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void set_cachedir(filename) char *filename;
{
  if (chdir(filename) < 0) {
    cache_perror("Cannot chdir", filename);
    exit(73);
  }
}


x86 assembly (clang, -O0):
<set_cachedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <chdir@plt>
cmp    $0x0,%eax
jge    116c <set_cachedir+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <cache_perror@plt>
mov    $0x49,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cachedir>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <chdir@plt>
test   %eax,%eax
js     1141 <set_cachedir+0x11>
pop    %rbx
ret
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <cache_perror@plt>
mov    $0x49,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Cannot chdir\00"
define void @set_cachedir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @cache_perror to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Cannot chdir\00"
define void @set_cachedir(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @cache_perror to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void @exit(i32 73)
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("Hello"); }


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define void @hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
extern void gui_ksys_put_image_window(char *p, int x, int y, int sizex,
                                      int sizey) {
  __asm__ __volatile__("shll $16,%%ecx\n\t"
                       "shll $16,%%edx\n\t"
                       "addl %%esi,%%ecx\n\t"
                       "addl %%edi,%%edx\n\t"
                       "int $0x40"
                       :
                       : "a"(7), "b"(p), "c"(sizex), "d"(x), "S"(sizey),
                         "D"(y));
}


x86 assembly (clang, -O0):
<gui_ksys_put_image_window>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x1c(%rbp),%ecx
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%edi
mov    $0x7,%eax
shl    $0x10,%ecx
shl    $0x10,%edx
add    %esi,%ecx
add    %edi,%edx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_put_image_window>:
push   %rbx
mov    %edx,%r9d
mov    %esi,%edx
mov    %rdi,%rbx
mov    $0x7,%eax
mov    %r9d,%edi
mov    %r8d,%esi
shl    $0x10,%ecx
shl    $0x10,%edx
add    %esi,%ecx
add    %edi,%edx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define void @gui_ksys_put_image_window(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %9
%13 = load i32, i32* %7
%14 = load i32, i32* %10
%15 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
define void @gui_ksys_put_image_window(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
tail call void asm sideeffect "shll $$16,%ecx\0A\09shll $$16,%edx\0A\09addl %esi,%ecx\0A\09addl %edi,%edx\0A\09int $$0x40", "{ax},{bx},{cx},{dx},{si},{di},~{dirflag},~{fpsr},~{flags}"(i32 7, i8* %0, i32 %3, i32 %1, i32 %4, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ messWithStringFunctions();
int main(int argc, const char *argv[]) {
  messWithStringFunctions();
  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)
mov    $0x0,%al
call   1030 <messWithStringFunctions@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <messWithStringFunctions@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @messWithStringFunctions()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @messWithStringFunctions()
ret i32 0
}
int is_leap_year(int year) {
  return ((year & 3) == 0) && ((year % 100 != 0) || (((year / 100) & 3) == 0));
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1151 <is_leap_year+0x51>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114b <is_leap_year+0x4b>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
and    $0x3,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1,%eax
cmp    $0x28f5c28,%ecx
ja     1108 <is_leap_year+0x8>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x25,%rcx
add    %eax,%ecx
xor    %eax,%eax
test   $0x3,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 100
%13 = and i32 %12, 3
%14 = icmp eq i32 %13, 0
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ true, %6 ], [ %14, %10 ]
br label %17
17: ; preds = %15, %1
%18 = phi i1 [ false, %1 ], [ %16, %15 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = sdiv i32 %0, 100
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = and i32 %6, 3
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %8, %1
%13 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
long double scalbnl(long double, int);
long double ldexpl(long double x, int n) { return scalbnl(x, n); }


x86 assembly (clang, -O0):
<ldexpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <scalbnl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexpl>:
jmp    1030 <scalbnl@plt>

LLVM IR (-O0):
define x86_fp80 @ldexpl(x86_fp80 %0, i32 %1) {
%3 = alloca x86_fp80
%4 = alloca i32
store x86_fp80 %0, x86_fp80* %3
store i32 %1, i32* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load i32, i32* %4
%7 = call x86_fp80 @scalbnl(x86_fp80 %5, i32 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @ldexpl(x86_fp80 %0, i32 %1) {
%3 = tail call x86_fp80 @scalbnl(x86_fp80 %0, i32 %1)
ret x86_fp80 %3
}