xunge/DecIR huggingface dataset:
int C_Utils_compare_ulonglong_ptr(const unsigned long long *item1,
                                  const unsigned long long *item2) {
  unsigned long long i1 = *item1;
  unsigned long long i2 = *item2;
  if (i1 == i2)
    return 0;
  return i1 < i2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_ulonglong_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <C_Utils_compare_ulonglong_ptr+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1157 <C_Utils_compare_ulonglong_ptr+0x57>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_ulonglong_ptr>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setae  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @C_Utils_compare_ulonglong_ptr(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = icmp eq i64 %3, %4
%6 = icmp ult i64 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
void gdk_screen_get_rgb_visual() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_rgb_visual() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ASN1_OCTET_STRING_free(void *);
void ocsp_nonce_free(void *a) { ASN1_OCTET_STRING_free(a); }


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

x86 assembly (clang, -O2):
<ocsp_nonce_free>:
jmp    1030 <ASN1_OCTET_STRING_free@plt>

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

LLVM IR (-O2):
define void @ocsp_nonce_free(i8* %0) {
%2 = tail call i32 @ASN1_OCTET_STRING_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_s1();
int /*<<< orphan*/ take_struct_s1(int /*<<< orphan*/);
void test_struct_s1() { take_struct_s1(return_struct_s1()); }


x86 assembly (clang, -O0):
<test_struct_s1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_struct_s1@plt>
mov    %eax,%edi
call   1040 <take_struct_s1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_s1>:
push   %rax
xor    %eax,%eax
call   1030 <return_struct_s1@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <take_struct_s1@plt>

LLVM IR (-O0):
define void @test_struct_s1() {
%1 = call i32 (...) @return_struct_s1()
%2 = call i32 @take_struct_s1(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_s1() {
%1 = tail call i32 (...) @return_struct_s1()
%2 = tail call i32 @take_struct_s1(i32 %1)
ret void
}
int max(int num1, int num2) {
  if (num1 > num2) {
    return num1;
  } else {
    return num2;
  }
}


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

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

LLVM IR (-O0):
define i32 @max(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 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(char *);
int /*<<< orphan*/ g(char *);
void h(char c[]) {
  f(c);
  g(c);
}


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

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    %rdi,%rbx
call   1030 <f@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <g@plt>

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

LLVM IR (-O2):
define void @h(i8* %0) {
%2 = tail call i32 @f(i8* %0)
%3 = tail call i32 @g(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version() { printf("%s\n", "0.2"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"0.2\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
signed test_success(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_success() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void error(char *errstring) {
  fputs(errstring, stderr);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void osd_antiflicker_task_stop(void) {
  printk("-- osd_antiflicker depends on GE2D module!\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"-- osd_antiflicker depends on GE2D module!\0A\00"
define void @osd_antiflicker_task_stop() {
%1 = call i32 @printk(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"-- osd_antiflicker depends on GE2D module!\0A\00"
define void @osd_antiflicker_task_stop() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_179() {
  Assert_real((isqrt(179) == 13),
              "/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",
              900, ("Integer square root of 179 should be 13"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_179>:
push   %rax
mov    $0xb3,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x384,%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 179 should be 13\00"
define void @t_sqrt_179() {
%1 = call i32 @isqrt(i32 179)
%2 = icmp eq i32 %1, 13
%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 900, 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 179 should be 13\00"
define void @t_sqrt_179() {
%1 = tail call i32 @isqrt(i32 179)
%2 = icmp eq i32 %1, 13
%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 900, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
RCU_DEF_TEST_FUNC(user_f2, param) { RCU_FAIL("user_f2"); }


x86 assembly (clang, -O0):
<RCU_DEF_TEST_FUNC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <RCU_FAIL@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RCU_DEF_TEST_FUNC>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <RCU_FAIL@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"user_f2\00"
define i32 @RCU_DEF_TEST_FUNC(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @RCU_FAIL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"user_f2\00"
define i32 @RCU_DEF_TEST_FUNC(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @RCU_FAIL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_combinatorics();
void run_tests() { test_combinatorics(); }


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

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

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

LLVM IR (-O2):
define void @run_tests() {
%1 = tail call i32 (...) @test_combinatorics()
ret void
}
void sub(int *x, int *y, int *result) { *result = *x - *y; }


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

x86 assembly (clang, -O2):
<sub>:
mov    (%rdi),%eax
sub    (%rsi),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @sub(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @sub(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = sub nsw i32 %4, %5
store i32 %6, i32* %2
ret void
}
int test_imm_D7uint32_reg(unsigned int val) {
  return ((val) & (0xD7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D7uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D7uint32_reg>:
test   $0xd7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D7uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 215
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_D7uint32_reg(i32 %0) {
%2 = and i32 %0, 215
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ quit_shell();
void shell_sigint_watchdog(int signr) { quit_shell(); }


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

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

LLVM IR (-O0):
define void @shell_sigint_watchdog(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @quit_shell()
ret void
}

LLVM IR (-O2):
define void @shell_sigint_watchdog(i32 %0) {
%2 = tail call i32 (...) @quit_shell()
ret void
}
/* Type definitions */
struct leaf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct leaf *);
void leaf_delete(struct leaf *node) { free(node); }


x86 assembly (clang, -O0):
<leaf_delete>:
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):
<leaf_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.leaf = type { i32 }
define void @leaf_delete(%struct.leaf* %0) {
%2 = alloca %struct.leaf*
store %struct.leaf* %0, %struct.leaf** %2
%3 = load %struct.leaf*, %struct.leaf** %2
%4 = call i32 @free(%struct.leaf* %3)
ret void
}

LLVM IR (-O2):
%struct.leaf = type { i32 }
define void @leaf_delete(%struct.leaf* nocapture %0) {
%2 = tail call i32 @free(%struct.leaf* %0)
ret void
}
__attribute__((unused)) __attribute__((__always___)) int xtest(void) {
  unsigned char out;
  asm volatile(".byte 0x0f,0x01,0xd6 ; setnz %0" : "=r"(out)::"memory");
  return out;
}


x86 assembly (clang, -O0):
<xtest>:
push   %rbp
mov    %rsp,%rbp
xtest
setne  %al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtest>:
xtest
setne  %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @xtest() {
%1 = alloca i8
%2 = call i8 asm sideeffect ".byte 0x0f,0x01,0xd6 ; setnz $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @xtest() {
%1 = tail call i8 asm sideeffect ".byte 0x0f,0x01,0xd6 ; setnz $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
%2 = zext i8 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ DriveReg0_SaveConfig();
void DriveReg0_Sleep(void) { DriveReg0_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @DriveReg0_Sleep() {
%1 = tail call i32 (...) @DriveReg0_SaveConfig()
ret void
}
__attribute__((always_)) int abs(int value) { return __builtin_abs(value); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    %eax,%ecx
cmp    $0x0,%eax
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = icmp slt i32 %3, 0
%6 = select i1 %5, i32 %4, i32 %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int cmp96(uint32_t *a, uint32_t *b) {
  return (a[0] - b[0]) | (a[1] - b[1]) | (a[2] - b[2]);
}


x86 assembly (clang, -O0):
<cmp96>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
sub    0x4(%rdx),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x10(%rbp),%rdx
sub    0x8(%rdx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp96>:
mov    (%rdi),%eax
sub    (%rsi),%eax
mov    0x4(%rdi),%ecx
sub    0x4(%rsi),%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
sub    0x8(%rsi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp96(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = sub nsw i32 %14, %17
%19 = or i32 %11, %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = sub nsw i32 %22, %25
%27 = or i32 %19, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmp96(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = sub nsw i32 %7, %9
%11 = or i32 %10, %5
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 2
%15 = load i32, i32* %14
%16 = sub nsw i32 %13, %15
%17 = or i32 %11, %16
ret i32 %17
}
void EC_POINT_get_affine_coordinates_GFp(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_get_affine_coordinates_GFp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x8f() {
  Assert_real((islower(143) == 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_islower.c",
              720, ("islower should be 0 for 0x8f"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x8f>:
push   %rax
mov    $0x8f,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d0,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x8f\00"
define void @t_islower_0x8f() {
%1 = call i64 @islower(i32 143)
%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 720, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x8f\00"
define void @t_islower_0x8f() {
%1 = tail call i64 @islower(i32 143)
%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 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ target_init();
int main() {
  target_init();
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <target_init@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @target_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @target_init()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ *wgetparent(int /*<<< orphan*/ const *);
WINDOW *ncurses_wgetparent(const WINDOW *win) { return wgetparent(win); }


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

x86 assembly (clang, -O2):
<ncurses_wgetparent>:
jmp    1030 <wgetparent@plt>

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

LLVM IR (-O2):
define i32* @ncurses_wgetparent(i32* %0) {
%2 = tail call i32* @wgetparent(i32* %0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void b_putchar_64(long idx, long *cells, int size) { putchar((int)cells[idx]); }


x86 assembly (clang, -O0):
<b_putchar_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_putchar_64>:
mov    (%rsi,%rdi,8),%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @b_putchar_64(i64 %0, i64* nocapture %1, i32 %2) {
%4 = getelementptr inbounds i64, i64* %1, i64 %0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 @putchar(i32 %6)
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double log10(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @log10(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ func_15(int, char *, unsigned long);
void func_14(int a, char *b, unsigned long c) { func_15(a, b, c); }


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

x86 assembly (clang, -O2):
<func_14>:
jmp    1030 <func_15@plt>

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

LLVM IR (-O2):
define void @func_14(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_15(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello, world.\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world.\0A\00"
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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pig_shout(int volume) { printf("heng heng %d\n", volume); }


x86 assembly (clang, -O0):
<pig_shout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pig_shout>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"heng heng %d\0A\00"
define void @pig_shout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"heng heng %d\0A\00"
define void @pig_shout(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void adts_set_home(uint8_t *p_adts, bool b_home) {
  if (!b_home)
    p_adts[3] &= ~0x10;
  else
    p_adts[3] |= 0x10;
}


x86 assembly (clang, -O0):
<adts_set_home>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1127 <adts_set_home+0x27>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,0xc(%rax)
jmp    1134 <adts_set_home+0x34>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
or     $0x10,%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_set_home>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    0xc(%rdi),%ecx
and    $0xffffffef,%ecx
shl    $0x4,%eax
or     %ecx,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @adts_set_home(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 3
%10 = load i32, i32* %9
%11 = and i32 %10, -17
store i32 %11, i32* %9
br label %17
12: ; preds = %2
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 3
%15 = load i32, i32* %14
%16 = or i32 %15, 16
store i32 %16, i32* %14
br label %17
17: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
define void @adts_set_home(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = getelementptr inbounds i32, i32* %0, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, -17
%7 = select i1 %3, i32 0, i32 16
%8 = or i32 %6, %7
store i32 %8, i32* %4
ret void
}
/* Variables and functions */
int LINES;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ term_clrtoeol();
int /*<<< orphan*/ term_move(size_t, int /*<<< orphan*/);
int /*<<< orphan*/ term_refresh();
void term_close(void) {
  term_move((size_t)(LINES - 1), 0);
  term_clrtoeol();
  term_refresh();
  endwin();
}


x86 assembly (clang, -O0):
<term_close>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rdi
xor    %esi,%esi
call   1030 <term_move@plt>
mov    $0x0,%al
call   1040 <term_clrtoeol@plt>
mov    $0x0,%al
call   1050 <term_refresh@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_close>:
push   %rax
mov    0x2ea0(%rip),%rax
movslq (%rax),%rdi
add    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   1030 <term_move@plt>
xor    %eax,%eax
call   1040 <term_clrtoeol@plt>
xor    %eax,%eax
call   1050 <term_refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <endwin@plt>

LLVM IR (-O0):
@LINES = global i32 0
define void @term_close() {
%1 = load i32, i32* @LINES
%2 = sub nsw i32 %1, 1
%3 = sext i32 %2 to i64
%4 = call i32 @term_move(i64 %3, i32 0)
%5 = call i32 (...) @term_clrtoeol()
%6 = call i32 (...) @term_refresh()
%7 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@LINES = global i32 0
define void @term_close() {
%1 = load i32, i32* @LINES
%2 = add nsw i32 %1, -1
%3 = sext i32 %2 to i64
%4 = tail call i32 @term_move(i64 %3, i32 0)
%5 = tail call i32 (...) @term_clrtoeol()
%6 = tail call i32 (...) @term_refresh()
%7 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void freqtab_usage() {
  fprintf(stderr, "usage: freqtab granularity [histogram]\n");
}


x86 assembly (clang, -O0):
<freqtab_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<freqtab_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"usage: freqtab granularity [histogram]\0A\00"
define void @freqtab_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"usage: freqtab granularity [histogram]\0A\00"
define void @freqtab_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int main(int, char **);
int main_argv_indirect(void) {
  int argc = 1;
  char *argv[2];
  argv[0] = (char *)"./test/c89/main_with_parameters.exec";
  argv[1] = (char *)0;
  return main(argc, argv);
}


x86 assembly (clang, -O0):
<main_argv_indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <main@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_argv_indirect>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1030 <main@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"./test/c89/main_with_parameters.exec\00"
define i32 @main_argv_indirect() {
%1 = alloca i32
%2 = alloca [2 x i8*]
store i32 1, i32* %1
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 1
store i8* null, i8** %4
%5 = load i32, i32* %1
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%7 = call i32 @main(i32 %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [37 x i8] c"./test/c89/main_with_parameters.exec\00"
define i32 @main_argv_indirect() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @main(i32 1, i8** %3)
ret i32 %5
}
unsigned char voltearBits(unsigned char o) {
  unsigned char orig = o, tmp1, final = 0, i;
  for (i = 7; i > 0; i--) {
    tmp1 = orig & 1;
    tmp1 <<= i;
    final = tmp1 | final;
    orig >>= 1;
  }
  return final;
}


x86 assembly (clang, -O0):
<voltearBits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movb   $0x0,-0x4(%rbp)
movb   $0x7,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jle    1160 <voltearBits+0x60>
movzbl -0x2(%rbp),%eax
and    $0x1,%eax
mov    %al,-0x3(%rbp)
movzbl -0x5(%rbp),%ecx
movzbl -0x3(%rbp),%eax
shl    %cl,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x4(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0x4(%rbp)
movzbl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x2(%rbp)
mov    -0x5(%rbp),%al
add    $0xff,%al
mov    %al,-0x5(%rbp)
jmp    1118 <voltearBits+0x18>
movzbl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<voltearBits>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x54,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @voltearBits(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %2
%7 = load i8, i8* %2
store i8 %7, i8* %3
store i8 0, i8* %5
store i8 7, i8* %6
br label %8
8: ; preds = %33, %1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %36
12: ; preds = %8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = and i32 %14, 1
%16 = trunc i32 %15 to i8
store i8 %16, i8* %4
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = shl i32 %20, %18
%22 = trunc i32 %21 to i8
store i8 %22, i8* %4
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = load i8, i8* %5
%26 = zext i8 %25 to i32
%27 = or i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %5
%29 = load i8, i8* %3
%30 = zext i8 %29 to i32
%31 = ashr i32 %30, 1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %3
br label %33
33: ; preds = %12
%34 = load i8, i8* %6
%35 = add i8 %34, -1
store i8 %35, i8* %6
br label %8
36: ; preds = %8
%37 = load i8, i8* %5
ret i8 %37
}

LLVM IR (-O2):
define zeroext i8 @voltearBits(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
%3 = and i8 %2, -2
ret i8 %3
}
/* Variables and functions */
int CHAR_BIT;
int main(void) {
  int s = sizeof(unsigned) * CHAR_BIT;
  ((unsigned)1) << s;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @CHAR_BIT
%4 = sext i32 %3 to i64
%5 = mul i64 4, %4
%6 = trunc i64 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = shl i32 1, %7
ret i32 0
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int c = __VERIFIER_nondet_int();
  if (c != 0) {
    return 1;
  }
  while (x >= 0) {
    x += c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    116d <main+0x5d>
jmp    114e <main+0x3e>
cmpl   $0x0,-0x8(%rbp)
jl     1166 <main+0x56>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ disp_str(char *);
void clock_handler(int irq) { disp_str("#"); }


x86 assembly (clang, -O0):
<clock_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <disp_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
define void @clock_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
define void @clock_handler(i32 %0) {
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fromHex(int);
void call_fromHex_200_Good() {
  char arr[16];
  int idx = fromHex(200);
  if (idx >= 0) {
    arr[idx] = 'H';
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xc8,%edi
call   1030 <fromHex@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1138 <call_fromHex_200_Good+0x28>
movslq -0x14(%rbp),%rax
movb   $0x48,-0x10(%rbp,%rax,1)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call_fromHex_200_Good() {
%1 = alloca [16 x i8]
%2 = alloca i32
%3 = call i32 @fromHex(i32 200)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 %8
store i8 72, i8* %9
br label %10
10: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @call_fromHex_200_Good() {
%1 = tail call i32 @fromHex(i32 200)
ret void
}
/* Variables and functions */
int STC3115_ReadByte(int);
int STC3115_WriteByte(int, int);
int STC3115_SetPowerSavingMode(void) {
  int res;
  res = STC3115_ReadByte(0x00);
  res = STC3115_WriteByte(0x00, (res | 0x01));
  if (res != 0)
    return (res);
  return (0);
}


x86 assembly (clang, -O0):
<STC3115_SetPowerSavingMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <STC3115_ReadByte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
or     $0x1,%esi
xor    %edi,%edi
call   1030 <STC3115_WriteByte@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1157 <STC3115_SetPowerSavingMode+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <STC3115_SetPowerSavingMode+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_SetPowerSavingMode>:
push   %rax
xor    %edi,%edi
call   1040 <STC3115_ReadByte@plt>
or     $0x1,%eax
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <STC3115_WriteByte@plt>

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

LLVM IR (-O2):
define i32 @STC3115_SetPowerSavingMode() {
%1 = tail call i32 @STC3115_ReadByte(i32 0)
%2 = or i32 %1, 1
%3 = tail call i32 @STC3115_WriteByte(i32 0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printSampleDataError() {
  fprintf(stderr, "Corrupted sample data in the file\n");
}


x86 assembly (clang, -O0):
<printSampleDataError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSampleDataError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Corrupted sample data in the file\0A\00"
define void @printSampleDataError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Corrupted sample data in the file\0A\00"
define void @printSampleDataError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int syscall(int, int, void const *);
int shmdt(const void *addr) { return syscall(117, 22, addr); }


x86 assembly (clang, -O0):
<shmdt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x75,%edi
mov    $0x16,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmdt>:
mov    %rdi,%rdx
mov    $0x75,%edi
mov    $0x16,%esi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @shmdt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @syscall(i32 117, i32 22, i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @shmdt(i8* %0) {
%2 = tail call i32 @syscall(i32 117, i32 22, i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
uint8_t halReadReg8(uintptr_t physicalAddress) {
  volatile uint8_t *ptr = (uint8_t *)physicalAddress;
  return *ptr;
}


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

x86 assembly (clang, -O2):
<halReadReg8>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @halReadReg8(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @halReadReg8(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ embedded_ltoa(char *, unsigned long, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/, char);
unsigned int embedded_prints(char *, int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int print_ulong(unsigned long number) {
  char buffer[36];
  embedded_ltoa(buffer, number, 10, 0, 0, 0, 'a');
  return embedded_prints(buffer, 0, 0);
}


x86 assembly (clang, -O0):
<print_ulong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xa,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x61,(%rsp)
call   1030 <embedded_ltoa@plt>
lea    -0x30(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <embedded_prints@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ulong>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rsi
movl   $0x61,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <embedded_ltoa@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <embedded_prints@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_ulong(i64 %0) {
%2 = alloca i64
%3 = alloca [36 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [36 x i8], [36 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i32 @embedded_ltoa(i8* %4, i64 %5, i32 10, i32 0, i32 0, i32 0, i8 signext 97)
%7 = getelementptr inbounds [36 x i8], [36 x i8]* %3, i64 0, i64 0
%8 = call i32 @embedded_prints(i8* %7, i32 0, i32 0)
ret i32 %8
}

LLVM IR (-O2):
define i32 @print_ulong(i64 %0) {
%2 = alloca [36 x i8]
%3 = getelementptr inbounds [36 x i8], [36 x i8]* %2, i64 0, i64 0
%4 = call i32 @embedded_ltoa(i8* %3, i64 %0, i32 10, i32 0, i32 0, i32 0, i8 signext 97)
%5 = call i32 @embedded_prints(i8* %3, i32 0, i32 0)
ret i32 %5
}