xunge/DecIR huggingface dataset:
g(b, s, x, y, i, j) char *b, *s;
double x, y;
{
  if (x != 1.0 || y != 2.0 || i != 3 || j != 4)
    abort();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    %ecx,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117e <g+0x6e>
jp     117e <g+0x6e>
movsd  -0x28(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117e <g+0x6e>
jp     117e <g+0x6e>
cmpl   $0x3,-0x2c(%rbp)
jne    117e <g+0x6e>
cmpl   $0x4,-0x30(%rbp)
je     1183 <g+0x73>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
jne    1135 <g+0x25>
jp     1135 <g+0x25>
ucomisd 0xee3(%rip),%xmm1
jne    1135 <g+0x25>
jp     1135 <g+0x25>
cmp    $0x3,%edx
jne    1135 <g+0x25>
cmp    $0x4,%ecx
jne    1135 <g+0x25>
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @g(i8* %0, i8* %1, double %2, double %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store double %2, double* %10
store double %3, double* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%14 = load double, double* %10
%15 = fcmp une double %14, 1.000000e+00
br i1 %15, label %25, label %16
16: ; preds = %6
%17 = load double, double* %11
%18 = fcmp une double %17, 2.000000e+00
br i1 %18, label %25, label %19
19: ; preds = %16
%20 = load i32, i32* %12
%21 = icmp ne i32 %20, 3
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load i32, i32* %13
%24 = icmp ne i32 %23, 4
br i1 %24, label %25, label %26
25: ; preds = %22, %19, %16, %6
unreachable
26: ; preds = %22
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @g(i8* nocapture readnone %0, i8* nocapture readnone %1, double %2, double %3, i32 %4, i32 %5) {
%7 = fcmp une double %2, 1.000000e+00
%8 = fcmp une double %3, 2.000000e+00
%9 = or i1 %7, %8
%10 = icmp ne i32 %4, 3
%11 = or i1 %9, %10
%12 = icmp ne i32 %5, 4
%13 = or i1 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %6
tail call void @abort()
unreachable
15: ; preds = %6
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ l;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ testit(int *);
int main(int argc, char *argv[]) {
  int l[] = {1, 2, 3};
  printf("SIZE * / SIZE 0: %lu/%lu\n", sizeof(l), sizeof(l[0]));
  testit(l);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    0xec2(%rip),%rdi
mov    $0xc,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rdi
call   1040 <testit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xecb(%rip),%rdi
mov    $0xc,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <testit@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.l = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [26 x i8] c"SIZE * / SIZE 0: %lu/%lu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [3 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [3 x i32]* %5 to i8*
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 12, i32 4)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%9 = call i32 @testit(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.l = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [26 x i8] c"SIZE * / SIZE 0: %lu/%lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 12, i32 4)
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%7 = call i32 @testit(i32* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void version() { printf("MIDIMonster %s\n", "v0.7-dist"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"MIDIMonster %s\0A\00"
@.str.1 = [10 x i8] c"v0.7-dist\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"MIDIMonster %s\0A\00"
@.str.1 = [10 x i8] c"v0.7-dist\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int f91(int n) {
  if (n == 0)
    return 0;
  if (n <= 100)
    return f91(f91(n + 11));
  if (n >= 101)
    return n - 10;
}


x86 assembly (clang, -O0):
<f91>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <f91+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1168 <f91+0x58>
cmpl   $0x64,-0x8(%rbp)
jg     1155 <f91+0x45>
mov    -0x8(%rbp),%edi
add    $0xb,%edi
call   1030 <f91@plt>
mov    %eax,%edi
call   1030 <f91@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <f91+0x58>
cmpl   $0x65,-0x8(%rbp)
jl     1168 <f91+0x58>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f91>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
je     113a <f91+0x2a>
mov    %edi,%eax
nopl   0x0(%rax)
cmp    $0x64,%eax
jg     1135 <f91+0x25>
add    $0xb,%eax
mov    %eax,%edi
call   1030 <f91@plt>
test   %eax,%eax
jne    1120 <f91+0x10>
jmp    113a <f91+0x2a>
add    $0xfffffff6,%eax
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f91(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %21
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 100
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 11
%13 = call i32 @f91(i32 %12)
%14 = call i32 @f91(i32 %13)
store i32 %14, i32* %2
br label %21
15: ; preds = %7
%16 = load i32, i32* %3
%17 = icmp sge i32 %16, 101
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 10
store i32 %20, i32* %2
br label %21
21: ; preds = %6, %10, %18, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @f91(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %6
%4 = phi i32 [ %8, %6 ], [ %0, %1 ]
%5 = icmp slt i32 %4, 101
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = add nsw i32 %4, 11
%8 = tail call i32 @f91(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %3
10: ; preds = %3
%11 = add nsw i32 %4, -10
br label %12
12: ; preds = %6, %1, %10
%13 = phi i32 [ %11, %10 ], [ 0, %1 ], [ 0, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_menu() {
  printf("-- UAF Playground Menu ----------------------\n"
         "1. Make a string\n"
         "2. Make a number\n"
         "3. Delete a string\n"
         "4. Delete a number\n"
         "5. Print a string\n"
         "6. Print a number\n"
         "7. Quit\n"
         "---------------------------------------------\n"
         "Enter Choice: ");
}


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

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

LLVM IR (-O0):
@.str = [223 x i8] c"-- UAF Playground Menu ----------------------\0A1. Make a string\0A2. Make a number\0A3. Delete a string\0A4. Delete a number\0A5. Print a string\0A6. Print a number\0A7. Quit\0A---------------------------------------------\0AEnter Choice: \00"
define void @print_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [223 x i8] c"-- UAF Playground Menu ----------------------\0A1. Make a string\0A2. Make a number\0A3. Delete a string\0A4. Delete a number\0A5. Print a string\0A6. Print a number\0A7. Quit\0A---------------------------------------------\0AEnter Choice: \00"
define void @print_menu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ os_read_key(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ os_set_text_style(int /*<<< orphan*/);
int /*<<< orphan*/ os_stop_sample(int /*<<< orphan*/);
int /*<<< orphan*/ print_string(char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ scroll(int /*<<< orphan*/);
int /*<<< orphan*/ scrollok(int /*<<< orphan*/, int);
int /*<<< orphan*/ stdscr;
void os_reset_screen(void) {
  os_stop_sample(0);
  os_set_text_style(0);
  print_string("[Hit any key to exit.]\n");
  os_read_key(0, 0);
  scrollok(stdscr, 1);
  scroll(stdscr);
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<os_reset_screen>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1080 <os_stop_sample@plt>
xor    %edi,%edi
call   10a0 <os_set_text_style@plt>
lea    0xe67(%rip),%rdi
call   1040 <print_string@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <os_read_key@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1060 <scrollok@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1090 <scroll@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_reset_screen>:
push   %rbx
xor    %edi,%edi
call   1080 <os_stop_sample@plt>
xor    %edi,%edi
call   10a0 <os_set_text_style@plt>
lea    0xe6a(%rip),%rdi
call   1040 <print_string@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <os_read_key@plt>
mov    0x2e3d(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1060 <scrollok@plt>
mov    (%rbx),%edi
call   1090 <scroll@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <endwin@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"[Hit any key to exit.]\0A\00"
@stdscr = global i32 0
define void @os_reset_screen() {
%1 = call i32 @os_stop_sample(i32 0)
%2 = call i32 @os_set_text_style(i32 0)
%3 = call i32 @print_string(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @os_read_key(i32 0, i32 0)
%5 = load i32, i32* @stdscr
%6 = call i32 @scrollok(i32 %5, i32 1)
%7 = load i32, i32* @stdscr
%8 = call i32 @scroll(i32 %7)
%9 = call i32 (...) @refresh()
%10 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"[Hit any key to exit.]\0A\00"
@stdscr = global i32 0
define void @os_reset_screen() {
%1 = tail call i32 @os_stop_sample(i32 0)
%2 = tail call i32 @os_set_text_style(i32 0)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @os_read_key(i32 0, i32 0)
%5 = load i32, i32* @stdscr
%6 = tail call i32 @scrollok(i32 %5, i32 1)
%7 = load i32, i32* @stdscr
%8 = tail call i32 @scroll(i32 %7)
%9 = tail call i32 (...) @refresh()
%10 = tail call i32 (...) @endwin()
ret void
}
void iwl_dump_nic_error_log(struct iwl_priv *priv) {}


x86 assembly (clang, -O0):
<iwl_dump_nic_error_log>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.iwl_priv = type opaque
define void @iwl_dump_nic_error_log(%struct.iwl_priv* %0) {
%2 = alloca %struct.iwl_priv*
store %struct.iwl_priv* %0, %struct.iwl_priv** %2
ret void
}

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define void @iwl_dump_nic_error_log(%struct.iwl_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x3c() {
  Assert_real((isascii(60)),
              "/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_isascii.c",
              305, ("isascii should be 1 for <"));
}


x86 assembly (clang, -O0):
<t_isascii_0x3c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x131,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x3c>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x131,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for <\00"
define void @t_isascii_0x3c() {
%1 = call i32 @isascii(i32 60)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 305, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for <\00"
define void @t_isascii_0x3c() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 305, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ close(int);
int errno;
int /*<<< orphan*/ printf(char *, int);
void closeSerial(int portHandle) {
  if (close(portHandle) != 0) {
    printf("Error closing serial port. Error: %d\n", errno);
  }
}


x86 assembly (clang, -O0):
<closeSerial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     1152 <closeSerial+0x32>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeSerial>:
push   %rax
call   1040 <close@plt>
test   %rax,%rax
je     1141 <closeSerial+0x21>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Error closing serial port. Error: %d\0A\00"
@errno = global i32 0
define void @closeSerial(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Error closing serial port. Error: %d\0A\00"
@errno = global i32 0
define void @closeSerial(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_find();
int /*<<< orphan*/ test_findPointerVersion();
int /*<<< orphan*/ test_findRecursiveVersion();
int main() {
  printf("---array版本！-----\n");
  test_find();
  printf("---Pointer版本！-----\n");
  test_findPointerVersion();
  printf("---Recursive版本！-----\n");
  test_findRecursiveVersion();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test_find@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_findPointerVersion@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_findRecursiveVersion@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <test_find@plt>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <test_findPointerVersion@plt>
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <test_findRecursiveVersion@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"---array\E7\89\88\E6\9C\AC\EF\BC\81-----\0A\00"
@.str.1 = [26 x i8] c"---Pointer\E7\89\88\E6\9C\AC\EF\BC\81-----\0A\00"
@.str.2 = [28 x i8] c"---Recursive\E7\89\88\E6\9C\AC\EF\BC\81-----\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_find()
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @test_findPointerVersion()
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @test_findRecursiveVersion()
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"---array\E7\89\88\E6\9C\AC\EF\BC\81-----\00"
@str.3 = [25 x i8] c"---Pointer\E7\89\88\E6\9C\AC\EF\BC\81-----\00"
@str.4 = [27 x i8] c"---Recursive\E7\89\88\E6\9C\AC\EF\BC\81-----\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_find()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (...) @test_findPointerVersion()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 (...) @test_findRecursiveVersion()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ libc_printf(char *, int, double, double, double);
int /*<<< orphan*/ roots_nearZero(double);
void AssertR(double a, double b) {
  if (!(roots_nearZero(a - b))) {
    libc_printf(
        (char *)"error assert failed: %g should equal %g difference is %g\\n",
        58, a, b, a - b);
  }
}


x86 assembly (clang, -O0):
<AssertR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1040 <roots_nearZero@plt>
cmp    $0x0,%eax
jne    116f <AssertR+0x4f>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
lea    0xe9b(%rip),%rdi
mov    $0x3a,%esi
call   1030 <libc_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssertR>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x10(%rsp)
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <roots_nearZero@plt>
test   %eax,%eax
je     1147 <AssertR+0x27>
add    $0x18,%rsp
ret
lea    0xeb2(%rip),%rdi
mov    $0x3a,%esi
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
add    $0x18,%rsp
jmp    1030 <libc_printf@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"error assert failed: %g should equal %g difference is %g\\n\00"
define void @AssertR(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call i32 @roots_nearZero(double %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fsub double %13, %14
%16 = call i32 @libc_printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 58, double %11, double %12, double %15)
br label %17
17: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"error assert failed: %g should equal %g difference is %g\\n\00"
define void @AssertR(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @roots_nearZero(double %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @libc_printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 58, double %0, double %1, double %3)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x84() {
  Assert_real((isupper(132) == 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_isupper.c",
              665, ("isupper should be 0 for 0x84"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x84>:
push   %rax
mov    $0x84,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x299,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x84\00"
define void @t_isupper_0x84() {
%1 = call i64 @isupper(i32 132)
%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 665, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x84\00"
define void @t_isupper_0x84() {
%1 = tail call i64 @isupper(i32 132)
%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 665, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SmcConn;
typedef int /*<<< orphan*/ SmPointer;

/* Variables and functions */
void SaveCompleteCB(SmcConn smcConnm, SmPointer clientData) { ; }


x86 assembly (clang, -O0):
<SaveCompleteCB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SaveCompleteCB(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @SaveCompleteCB(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inputGpio();
void releaseBus(void) { inputGpio(); }


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

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

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

LLVM IR (-O2):
define void @releaseBus() {
%1 = tail call i32 (...) @inputGpio()
ret void
}
unsigned long insert_bd(insn, value, errmsg)
unsigned long insn;
long value;
const char **errmsg;
{ return insn | (value & 0xfffc); }


x86 assembly (clang, -O0):
<insert_bd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0xfffc,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bd>:
mov    %rsi,%rax
and    $0xfffc,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @insert_bd(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = and i64 %8, 65532
%10 = or i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @insert_bd(i64 %0, i64 %1, i8** nocapture readnone %2) {
%4 = and i64 %1, 65532
%5 = or i64 %4, %0
ret i64 %5
}
/* Variables and functions */
int convert0To5Rec(int);
int convert0To5(int num) {
  if (num == 0)
    return 5;
  else
    return convert0To5Rec(num);
}


x86 assembly (clang, -O0):
<convert0To5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <convert0To5+0x21>
movl   $0x5,-0x4(%rbp)
jmp    113c <convert0To5+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <convert0To5Rec@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert0To5>:
test   %edi,%edi
je     1119 <convert0To5+0x9>
jmp    1030 <convert0To5Rec@plt>
mov    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @convert0To5(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @convert0To5Rec(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 5, %1 ]
ret i32 %6
}
/* Variables and functions */
double RAND_MAX;
double rand();
int randval(int i) { return ((double)i * rand() / (RAND_MAX + 1.0)); }


x86 assembly (clang, -O0):
<randval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
mov    0x2ea1(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randval>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec0(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xecc(%rip),%xmm1
mulsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @randval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double (...) @rand()
%6 = fmul double %4, %5
%7 = load double, double* @RAND_MAX
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %6, %8
%10 = fptosi double %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @randval(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double (...) @rand()
%4 = fmul double %3, %2
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
int isPerfect(int n) {
  int perfect = 0;
  int i = 1;
  int sum = 0;
  while (sum <= n) {
    sum += i;
    if (sum == n)
      perfect = 1;
    i++;
  }
  return perfect;
}


x86 assembly (clang, -O0):
<isPerfect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1152 <isPerfect+0x52>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1144 <isPerfect+0x44>
movl   $0x1,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <isPerfect+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPerfect>:
test   %edi,%edi
js     112d <isPerfect+0x2d>
mov    $0x1,%ecx
xor    %edx,%edx
mov    $0x1,%esi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %esi,%edx
add    $0x1,%esi
cmp    %edi,%edx
cmove  %ecx,%eax
jle    1120 <isPerfect+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPerfect(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %10
store i32 1, i32* %3
br label %18
18: ; preds = %17, %10
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %6
21: ; preds = %6
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @isPerfect(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 1, %1 ]
%6 = phi i32 [ %9, %3 ], [ 0, %1 ]
%7 = add nuw nsw i32 %4, %5
%8 = icmp eq i32 %7, %0
%9 = select i1 %8, i32 1, i32 %6
%10 = add nuw nsw i32 %5, 1
%11 = icmp sgt i32 %7, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ writech(char);
int writeline(char *line) {
  while (*line) {
    writech(*line);
    line++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<writeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <writeline+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <writech@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <writeline+0xc>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeline>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <writeline+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <writech@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <writeline+0x10>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @writeline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call i32 @writech(i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %3
13: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
define i32 @writeline(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @writech(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 1
}
int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
                            int (*read_fn)(struct seq_file *seq, void *data)) {
  return 0;
}


x86 assembly (clang, -O0):
<brcmf_debugfs_add_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brcmf_debugfs_add_entry>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.brcmf_pub = type opaque
%struct.seq_file = type opaque
define i32 @brcmf_debugfs_add_entry(%struct.brcmf_pub* %0, i8* %1, i32 (%struct.seq_file*, i8*)* %2) {
%4 = alloca %struct.brcmf_pub*
%5 = alloca i8*
%6 = alloca i32 (%struct.seq_file*, i8*)*
store %struct.brcmf_pub* %0, %struct.brcmf_pub** %4
store i8* %1, i8** %5
store i32 (%struct.seq_file*, i8*)* %2, i32 (%struct.seq_file*, i8*)** %6
ret i32 0
}

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
%struct.seq_file = type opaque
define i32 @brcmf_debugfs_add_entry(%struct.brcmf_pub* nocapture readnone %0, i8* nocapture readnone %1, i32 (%struct.seq_file*, i8*)* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void inc_reg32(int reg32) { put8(0x40 + reg32); }


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

x86 assembly (clang, -O2):
<inc_reg32>:
add    $0x40,%edi
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @inc_reg32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 64, %3
%5 = call i32 @put8(i32 %4)
ret void
}

LLVM IR (-O2):
define void @inc_reg32(i32 %0) {
%2 = add nsw i32 %0, 64
%3 = tail call i32 @put8(i32 %2)
ret void
}
void glLightModelf(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLightModelf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
run_program(char *exe) { system(exe); }


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

x86 assembly (clang, -O2):
<run_program>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @run_program(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void print(FILE *fout, char **s) {
  while (*s)
    fprintf(fout, "%s\n", *s++);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1157 <print+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%edx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1120 <print+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%rdx
test   %rdx,%rdx
je     1147 <print+0x37>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x8,%rbx
lea    0xed2(%rip),%r15
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%rdx
add    $0x8,%rbx
test   %rdx,%rdx
jne    1130 <print+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %9, %2
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %4
%13 = load i8*, i8** %11
%14 = ptrtoint i8* %13 to i32
%15 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print(i32* nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %12, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = ptrtoint i8* %6 to i64
%10 = trunc i64 %9 to i32
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %8
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int svg_end(FILE *f) {
  fprintf(f, "</svg>\n");
  return 0;
}


x86 assembly (clang, -O0):
<svg_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svg_end>:
push   %rax
mov    %rdi,%rcx
lea    0xee5(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"</svg>\0A\00"
define i32 @svg_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"</svg>\0A\00"
define i32 @svg_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int a[3] = {1, 3, 4};
  printf("%d %d", sizeof(a), sizeof(int));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    0xec9(%rip),%rdi
mov    $0xc,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xc,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getch@plt>

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 3, i32 4]
@.str = [6 x i8] c"%d %d\00"
define void @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 12, i32 4)
%4 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 12, i32 4)
%2 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world!");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t bsd_imax(int32_t a, int32_t b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<bsd_imax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <bsd_imax+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <bsd_imax+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsd_imax>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @bsd_imax(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int test_128() { return 128; }


x86 assembly (clang, -O0):
<test_128>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_128() {
ret i32 128
}

LLVM IR (-O2):
define i32 @test_128() {
ret i32 128
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int clear_dobldobl_tracker(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc(510, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<clear_dobldobl_tracker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1fe,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_dobldobl_tracker>:
mov    $0x1fe,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @clear_dobldobl_tracker() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 510, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_dobldobl_tracker() {
%1 = tail call i32 @_ada_use_c2phc(i32 510, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_hex_memory(uint8_t *mem, uint32_t size) {
  uint32_t i;
  for (i = 0; i < size; i++) {
    printf("0x%02x ", mem[i]);
  }
}


x86 assembly (clang, -O0):
<print_hex_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115e <print_hex_memory+0x4e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_hex_memory+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex_memory>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <print_hex_memory+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_hex_memory+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"0x%02x \00"
define void @print_hex_memory(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glTexGendv_size(int /*<<< orphan*/);
__attribute__((visibility("internal"))) __attribute__((pure)) GLint
__glTexGeniv_size(GLenum e) {
  return __glTexGendv_size(e);
}


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

x86 assembly (clang, -O2):
<__glTexGeniv_size>:
jmp    1030 <__glTexGendv_size@plt>

LLVM IR (-O0):
define hidden i32 @__glTexGeniv_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__glTexGendv_size(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define hidden i32 @__glTexGeniv_size(i32 %0) {
%2 = tail call i32 @__glTexGendv_size(i32 %0)
ret i32 %2
}
void SSMR3HandleGetAfter(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3HandleGetAfter() {
ret void
}
/* Variables and functions */
bool nrf52_errata_24(void) { return false; }


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

x86 assembly (clang, -O2):
<nrf52_errata_24>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nrf52_errata_24() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_24() {
ret i32 0
}
void FREE() {
  asm volatile("movq $0x2c, %%rdi\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r15, %%rsp\n\t"
               "callq *%%r12\n\t"
               "movq %%rsp, %%r15\n\t"
               "movq %%r13, %%rsp\n\t"
               "addq $0x08, %%rsp\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<FREE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FREE>:
mov    $0x2c,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @FREE() {
tail call void asm sideeffect "movq $$0x2c, %rdi\0A\09movq %rsp, %r13\0A\09movq %r15, %rsp\0A\09callq *%r12\0A\09movq %rsp, %r15\0A\09movq %r13, %rsp\0A\09addq $$0x08, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}