xunge/DecIR huggingface dataset:
long long test_func_06(long long a) { return __builtin_bswap64(a); }


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

x86 assembly (clang, -O2):
<test_func_06>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @test_func_06(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.bswap.i64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test_func_06(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _fatal_error(char *error_message) {
  printf("FATAL ERROR: %s \n", error_message);
  exit(1);
}


x86 assembly (clang, -O0):
<_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_fatal_error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"FATAL ERROR: %s \0A\00"
define void @_fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"FATAL ERROR: %s \0A\00"
define void @_fatal_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ findtarget(int, char *);
void xlcontinue(void) { findtarget(32, "not in a break loop"); }


x86 assembly (clang, -O0):
<xlcontinue>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
lea    0xee0(%rip),%rsi
call   1030 <findtarget@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlcontinue>:
lea    0xee9(%rip),%rsi
mov    $0x20,%edi
jmp    1030 <findtarget@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"not in a break loop\00"
define void @xlcontinue() {
%1 = call i32 @findtarget(i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"not in a break loop\00"
define void @xlcontinue() {
%1 = tail call i32 @findtarget(i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rt_InitInfAndNaN(unsigned int);
void PPB_ann_initialize(void) { rt_InitInfAndNaN(8U); }


x86 assembly (clang, -O0):
<PPB_ann_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <rt_InitInfAndNaN@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PPB_ann_initialize() {
%1 = call i32 @rt_InitInfAndNaN(i32 8)
ret void
}

LLVM IR (-O2):
define void @PPB_ann_initialize() {
%1 = tail call i32 @rt_InitInfAndNaN(i32 8)
ret void
}
void *mymalloc(x)
long x;
{
  void *mem;
  mem = (void *)malloc(x);
  if (!mem)
    memerror();
  return (void *)mem;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <mymalloc+0x2b>
mov    $0x0,%al
call   1030 <memerror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <mymalloc+0x15>
xor    %eax,%eax
call   1030 <memerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mymalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @memerror()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @mymalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @memerror()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int f();
int main(int argc, char **argv) { return f(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @f()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @f()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ preferences_set_languagepath(char const *);
void save_preferences(const char *filepath) {
  preferences_set_languagepath(filepath);
}


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

x86 assembly (clang, -O2):
<save_preferences>:
jmp    1030 <preferences_set_languagepath@plt>

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

LLVM IR (-O2):
define void @save_preferences(i8* %0) {
%2 = tail call i32 @preferences_set_languagepath(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int get_pin(int pin) {
  fprintf(stderr, "get p%d <- 0\n", pin);
  return pin;
}


x86 assembly (clang, -O0):
<get_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pin>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"get p%d <- 0\0A\00"
define i32 @get_pin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"get p%d <- 0\0A\00"
define i32 @get_pin(i32 returned %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ from_libb();
void test_liba(void) { from_libb(); }


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

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

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

LLVM IR (-O2):
define void @test_liba() {
%1 = tail call i32 (...) @from_libb()
ret void
}
int ls_costN_nm7_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_costN_nm7_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_costN_nm7_n_out() {
ret i32 2
}
unsigned long get_max_hide(unsigned long fsize) { return ((fsize) / 8); }


x86 assembly (clang, -O0):
<get_max_hide>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max_hide>:
mov    %rdi,%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @get_max_hide(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 8
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_max_hide(i64 %0) {
%2 = lshr i64 %0, 3
ret i64 %2
}
/* Variables and functions */
int int_input();
int /*<<< orphan*/ printf(char *);
int prompt_year(void) {
  int temp_value = 0;
  printf("Enter Year: ");
  temp_value = int_input();
  return temp_value;
}


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

x86 assembly (clang, -O2):
<prompt_year>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <int_input@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Enter Year: \00"
define i32 @prompt_year() {
%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))
%3 = call i32 (...) @int_input()
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"Enter Year: \00"
define i32 @prompt_year() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @int_input()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ GDD_Demo_DrawText();
int /*<<< orphan*/ GDD_Demo_Listbox();
int /*<<< orphan*/ GDD_Demo_MoveWindow();
int /*<<< orphan*/ GDD_Demo_Progressbar();
int /*<<< orphan*/ GDD_Demo_Timer();
int /*<<< orphan*/ GDD_Demo_ZigBee();
int /*<<< orphan*/ Hello_Word();
void gdd_test(void) {
  while (1) {
    Hello_Word();
    GDD_Demo_DrawText();
    GDD_Demo_Listbox();
    GDD_Demo_MoveWindow();
    GDD_Demo_Timer();
    GDD_Demo_ZigBee();
    GDD_Demo_Progressbar();
  }
}


x86 assembly (clang, -O0):
<gdd_test>:
push   %rbp
mov    %rsp,%rbp
jmp    1179 <gdd_test+0x9>
mov    $0x0,%al
call   1080 <Hello_Word@plt>
mov    $0x0,%al
call   1050 <GDD_Demo_DrawText@plt>
mov    $0x0,%al
call   1090 <GDD_Demo_Listbox@plt>
mov    $0x0,%al
call   1030 <GDD_Demo_MoveWindow@plt>
mov    $0x0,%al
call   1070 <GDD_Demo_Timer@plt>
mov    $0x0,%al
call   1040 <GDD_Demo_ZigBee@plt>
mov    $0x0,%al
call   1060 <GDD_Demo_Progressbar@plt>
jmp    1179 <gdd_test+0x9>

x86 assembly (clang, -O2):
<gdd_test>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <Hello_Word@plt>
xor    %eax,%eax
call   1050 <GDD_Demo_DrawText@plt>
xor    %eax,%eax
call   1090 <GDD_Demo_Listbox@plt>
xor    %eax,%eax
call   1030 <GDD_Demo_MoveWindow@plt>
xor    %eax,%eax
call   1070 <GDD_Demo_Timer@plt>
xor    %eax,%eax
call   1040 <GDD_Demo_ZigBee@plt>
xor    %eax,%eax
call   1060 <GDD_Demo_Progressbar@plt>
jmp    1180 <gdd_test+0x10>

LLVM IR (-O0):
define void @gdd_test() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @Hello_Word()
%3 = call i32 (...) @GDD_Demo_DrawText()
%4 = call i32 (...) @GDD_Demo_Listbox()
%5 = call i32 (...) @GDD_Demo_MoveWindow()
%6 = call i32 (...) @GDD_Demo_Timer()
%7 = call i32 (...) @GDD_Demo_ZigBee()
%8 = call i32 (...) @GDD_Demo_Progressbar()
br label %1
}

LLVM IR (-O2):
define void @gdd_test() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @Hello_Word()
%3 = tail call i32 (...) @GDD_Demo_DrawText()
%4 = tail call i32 (...) @GDD_Demo_Listbox()
%5 = tail call i32 (...) @GDD_Demo_MoveWindow()
%6 = tail call i32 (...) @GDD_Demo_Timer()
%7 = tail call i32 (...) @GDD_Demo_ZigBee()
%8 = tail call i32 (...) @GDD_Demo_Progressbar()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i, j, k;
  if (k == 1) {
    while (i < 10) {
      printf("1\n");
    }
    printf("2\n");
  }
  if (k == 2) {
    do {
      printf("3\n");
    } while (j < 15);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    115c <main+0x4c>
jmp    1135 <main+0x25>
cmpl   $0xa,-0x14(%rbp)
jge    1150 <main+0x40>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1135 <main+0x25>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0x1c(%rbp)
jne    1186 <main+0x76>
jmp    116b <main+0x5b>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xf,-0x18(%rbp)
jl     116b <main+0x5b>
jmp    1186 <main+0x76>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"2\0A\00"
@.str.2 = [3 x i8] c"3\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %2
br label %12
12: ; preds = %15, %11
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %12
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load i32, i32* %8
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %29
22: ; preds = %19
br label %23
23: ; preds = %25, %22
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23
%26 = load i32, i32* %7
%27 = icmp slt i32 %26, 15
br i1 %27, label %23, label %28
28: ; preds = %25
br label %29
29: ; preds = %28, %19
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void sgx_thread_wait_untrusted_event_ocall() {}


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

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

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

LLVM IR (-O2):
define void @sgx_thread_wait_untrusted_event_ocall() {
ret void
}
void endpwent() {}


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

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

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

LLVM IR (-O2):
define void @endpwent() {
ret void
}
void GP_break03(void) {}


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

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

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

LLVM IR (-O2):
define void @GP_break03() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x71() {
  Assert_real((isdigit(113) == 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_isdigit.c",
              570, ("isdigit should be 0 for q"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x71>:
push   %rax
mov    $0x71,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23a,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for q\00"
define void @t_isdigit_0x71() {
%1 = call i64 @isdigit(i32 113)
%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 570, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for q\00"
define void @t_isdigit_0x71() {
%1 = tail call i64 @isdigit(i32 113)
%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 570, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int main(int argc, char **argv) {
  int x = 15;
  int y = x;
  int *a, *b, *c;
  a = (int *)malloc(sizeof(int));
  if (x < 10) {
    b = a;
  }
  *b = x;
  a = c;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1153 <main+0x43>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0xf,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 15, i32* %6
%11 = load i32, i32* %6
store i32 %11, i32* %7
%12 = call i64 @malloc(i32 4)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %8
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i32*, i32** %8
store i32* %17, i32** %9
br label %18
18: ; preds = %16, %2
%19 = load i32, i32* %6
%20 = load i32*, i32** %9
store i32 %19, i32* %20
%21 = load i32*, i32** %10
store i32* %21, i32** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32 15, i32* %4
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t srl_bytes_to_int64(unsigned char *buf, size_t offset) {
  int64_t bd = 0;
  int i;
  for (i = 0; i < 8; i++) {
    int64_t c = buf[i + offset];
    c <<= 56 - i * 8;
    bd |= c;
  }
  return bd;
}


x86 assembly (clang, -O0):
<srl_bytes_to_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    1163 <srl_bytes_to_int64+0x63>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
add    -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x3,%eax
mov    $0x38,%ecx
sub    %eax,%ecx
mov    -0x1c(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <srl_bytes_to_int64+0x1a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @srl_bytes_to_int64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %28, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %31
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = load i64, i64* %4
%16 = add i64 %14, %15
%17 = getelementptr inbounds i8, i8* %12, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
store i32 %19, i32* %7
%20 = load i32, i32* %6
%21 = mul nsw i32 %20, 8
%22 = sub nsw i32 56, %21
%23 = load i32, i32* %7
%24 = shl i32 %23, %22
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = load i32, i32* %5
%27 = or i32 %26, %25
store i32 %27, i32* %5
br label %28
28: ; preds = %11
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %8
31: ; preds = %8
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
define i32 @srl_bytes_to_int64(i8* nocapture %0, i64 %1) {
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int tga_write24(const char *name, uint16_t w, uint16_t h, const uint8_t *r,
                const uint8_t *g, const uint8_t *b) {
  FILE *fp;
  fp = fopen(name, "w+");
  if (fp == NULL) {
    return -1;
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<tga_write24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1169 <tga_write24+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <tga_write24+0x59>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tga_write24>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113e <tga_write24+0x1e>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
define i32 @tga_write24(i8* %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%15 = load i8*, i8** %8
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %16, i32** %14
%17 = load i32*, i32** %14
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 -1, i32* %7
br label %23
20: ; preds = %6
%21 = load i32*, i32** %14
%22 = call i32 @fclose(i32* %21)
store i32 0, i32* %7
br label %23
23: ; preds = %20, %19
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
define i32 @tga_write24(i8* nocapture %0, i32 %1, i32 %2, i32* nocapture readnone %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @fclose(i32* %7)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ 0, %9 ], [ -1, %6 ]
ret i32 %12
}
/* Variables and functions */
long util_rng_next(int);
long util_rng_next_int() { return util_rng_next(32); }


x86 assembly (clang, -O0):
<util_rng_next_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <util_rng_next@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @util_rng_next_int() {
%1 = call i64 @util_rng_next(i32 32)
ret i64 %1
}

LLVM IR (-O2):
define i64 @util_rng_next_int() {
%1 = tail call i64 @util_rng_next(i32 32)
ret i64 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t Ch(uint32_t x, uint32_t y, uint32_t z) { return (x & y) ^ ((~x) & z); }


x86 assembly (clang, -O0):
<Ch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ch>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Ch(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* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @Ch(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
double hms2hour(double h, double m, double s) {
  return (h + m / 60.0 + s / 3600.0);
}


x86 assembly (clang, -O0):
<hms2hour>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xec6(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hms2hour>:
unpcklpd %xmm2,%xmm1
divpd  0xef4(%rip),%xmm1
addsd  %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @hms2hour(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fdiv double %8, 6.000000e+01
%10 = fadd double %7, %9
%11 = load double, double* %6
%12 = fdiv double %11, 3.600000e+03
%13 = fadd double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @hms2hour(double %0, double %1, double %2) {
%4 = insertelement <2 x double> poison, double %1, i64 0
%5 = insertelement <2 x double> %4, double %2, i64 1
%6 = fdiv <2 x double> %5, <double 6.000000e+01, double 3.600000e+03>
%7 = extractelement <2 x double> %6, i64 0
%8 = fadd double %7, %0
%9 = extractelement <2 x double> %6, i64 1
%10 = fadd double %8, %9
ret double %10
}
void RTLockValidatorWriteLockInc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorWriteLockInc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or "
         "MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or "
         "MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
         "MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_FS_IO and/or "
         "MBEDTLS_CTR_DRBG_C not defined.\n");
  return (0);
}


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>
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 = [227 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [226 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([226 x i8], [226 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float sasphere(float a) { return (4 * 3.141592 * a * a); }


x86 assembly (clang, -O0):
<sasphere>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sasphere>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sasphere(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x402921FAFC8B007A, %4
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fmul double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @sasphere(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x402921FAFC8B007A
%4 = fmul double %3, %2
%5 = fptrunc double %4 to float
ret float %5
}
int randomNumber(low, high) { return _rand() % high + low; }


x86 assembly (clang, -O0):
<randomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <_rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @_rand()
%6 = load i32, i32* %4
%7 = srem i32 %5, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @randomNumber(i32 %0, i32 %1) {
%3 = tail call i32 (...) @_rand()
%4 = srem i32 %3, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
zeq() { callrts("cceq"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"cceq\00"
define i32 @zeq() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"cceq\00"
define i32 @zeq() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NOROM_IntUnregister(int);
void stub1(uint32_t);
void CRYPTOIntUnregister(void) {
  ((void (*)(uint32_t ui32Interrupt))(
      (uint32_t *)(((uint32_t *)0x10000180)[12]))[5])(39);
  NOROM_IntUnregister(39);
}


x86 assembly (clang, -O0):
<CRYPTOIntUnregister>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000180,%eax
mov    0x60(%rax),%rax
mov    $0x27,%edi
call   *0x28(%rax)
mov    $0x27,%edi
call   1030 <NOROM_IntUnregister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTOIntUnregister>:
push   %rax
mov    0x100001e0,%rax
10
mov    $0x27,%edi
call   *0x28(%rax)
mov    $0x27,%edi
pop    %rax
jmp    1030 <NOROM_IntUnregister@plt>

LLVM IR (-O0):
define void @CRYPTOIntUnregister() {
%1 = load i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 268435840 to i64*), i64 12)
%2 = inttoptr i64 %1 to i64*
%3 = getelementptr inbounds i64, i64* %2, i64 5
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to void (i64)*
%6 = call i32 @NOROM_IntUnregister(i32 39)
ret void
}

LLVM IR (-O2):
define void @CRYPTOIntUnregister() {
%1 = load i64, i64* inttoptr (i64 268435936 to i64*)
%2 = inttoptr i64 %1 to i64*
%3 = getelementptr inbounds i64, i64* %2, i64 5
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to void (i64)*
tail call void %5(i64 39)
%6 = tail call i32 @NOROM_IntUnregister(i32 39)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ sig_unblock(int /*<<< orphan*/);
extern void sig_int_unblock(void) { sig_unblock(SIGINT); }


x86 assembly (clang, -O0):
<sig_int_unblock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_unblock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_int_unblock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_unblock@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @sig_int_unblock() {
%1 = load i32, i32* @SIGINT
%2 = call i32 @sig_unblock(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @sig_int_unblock() {
%1 = load i32, i32* @SIGINT
%2 = tail call i32 @sig_unblock(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Pid: %d", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Pid: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"Pid: %d\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void UsageFault_Handler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @UsageFault_Handler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @UsageFault_Handler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char result[1024];
  itoa(INT_MIN, result);
  printf("%d\n", INT_MIN);
  printf("%s\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
call   1040 <itoa@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x410(%rbp),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    0x2ea7(%rip),%rbx
mov    (%rbx),%edi
mov    %rsp,%r14
mov    %r14,%rsi
call   1050 <itoa@plt>
mov    (%rbx),%esi
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = load i32, i32* @INT_MIN
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @itoa(i32 %3, i8* %4)
%6 = load i32, i32* @INT_MIN
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @INT_MIN
%4 = call i32 @itoa(i32 %3, i8* %2)
%5 = load i32, i32* @INT_MIN
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @puts(i8* %2)
ret i32 0
}
/* Type definitions */
struct pollfd {
  int fd;
  int /*<<< orphan*/ events;
};

/* Variables and functions */
int /*<<< orphan*/ POLLIN;
int poll(struct pollfd *, int, int);
int wait_for_read(int fd, int tout) {
  struct pollfd fds[1];
  fds[0].fd = fd;
  fds[0].events = POLLIN;
  return poll(fds, 1, tout);
}


x86 assembly (clang, -O0):
<wait_for_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1030 <poll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_read>:
push   %rax
mov    %esi,%edx
mov    %edi,(%rsp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <poll@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
define i32 @wait_for_read(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1 x %struct.pollfd]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %5, i64 0, i64 0
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* @POLLIN
%10 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %5, i64 0, i64 0
%11 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %10, i32 0, i32 1
store i32 %9, i32* %11
%12 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %5, i64 0, i64 0
%13 = load i32, i32* %4
%14 = call i32 @poll(%struct.pollfd* %12, i32 1, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
define i32 @wait_for_read(i32 %0, i32 %1) {
%3 = alloca [1 x %struct.pollfd]
%4 = bitcast [1 x %struct.pollfd]* %3 to i8*
%5 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %3, i64 0, i64 0, i32 0
store i32 %0, i32* %6
%7 = load i32, i32* @POLLIN
%8 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %3, i64 0, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @poll(%struct.pollfd* %5, i32 1, i32 %1)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int /*<<< orphan*/ test();
int main() {
  void *b = malloc(1);
  if (b != 0) {
    free(b);
  }
  test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <main+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1050 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1148 <main+0x18>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 1)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %0
%10 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @free(i8* %1)
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @test()
ret i32 0
}
/* Variables and functions */
int rand();
int shufflecmp(const void *a, const void *b) {
  (void)a;
  (void)b;
  return ((rand() >> 10) % 1023) - 511;
}


x86 assembly (clang, -O0):
<shufflecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
sar    $0xa,%eax
mov    $0x3ff,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
sub    $0x1ff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shufflecmp>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
sar    $0xa,%eax
cltq
imul   $0xffffffff80200803,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x9,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0xa,%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0xfffffe01,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @shufflecmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (...) @rand()
%8 = ashr i32 %7, 10
%9 = srem i32 %8, 1023
%10 = sub nsw i32 %9, 511
ret i32 %10
}

LLVM IR (-O2):
define i32 @shufflecmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = ashr i32 %3, 10
%5 = srem i32 %4, 1023
%6 = add nsw i32 %5, -511
ret i32 %6
}
void ble_rsp_hardware_io_port_config_irq(
    const struct ble_msg_hardware_io_port_config_irq_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_hardware_io_port_config_irq_rsp_t = type opaque
define void @ble_rsp_hardware_io_port_config_irq(%struct.ble_msg_hardware_io_port_config_irq_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char *arg) {
  fprintf(stderr,
          "usage: %s N[dD]"
          "\n",
          arg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"usage: %s N[dD]\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"usage: %s N[dD]\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void cmemcpy_(void *dest, const void *src, int *length) {
  memcpy(dest, src, *length);
}


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

x86 assembly (clang, -O2):
<cmemcpy_>:
mov    (%rdx),%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @cmemcpy_(i8* %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: head [-lines | -n lines] [file ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: head [-lines | -n lines] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: head [-lines | -n lines] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_62uint8_reg(unsigned char val) {
  return ((val) & (0x62 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_62uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x62,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_62uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 98
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}