xunge/DecIR huggingface dataset:
int str_comp(char *str1, char *str2, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (str1[i] != str2[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<str_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1161 <str_comp+0x61>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114e <str_comp+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1168 <str_comp+0x68>
jmp    1153 <str_comp+0x53>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <str_comp+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_comp>:
mov    $0x1,%eax
test   %edx,%edx
jle    1122 <str_comp+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <str_comp+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <str_comp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_comp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printPrivate(char *);
int executeQuit(void) {
  printPrivate("To leave the game, press Ctrl and ], then enter quit.\n");
  return -1;
}


x86 assembly (clang, -O0):
<executeQuit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printPrivate@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [55 x i8] c"To leave the game, press Ctrl and ], then enter quit.\0A\00"
define i32 @executeQuit() {
%1 = call i32 @printPrivate(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [55 x i8] c"To leave the game, press Ctrl and ], then enter quit.\0A\00"
define i32 @executeQuit() {
%1 = tail call i32 @printPrivate(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
long long gu_time_thread_cputime() { return -1; }


x86 assembly (clang, -O0):
<gu_time_thread_cputime>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu_time_thread_cputime>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @gu_time_thread_cputime() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @gu_time_thread_cputime() {
ret i64 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int32_t;

/* Variables and functions */
scalar_t__ memcmp(int /*<<< orphan*/ const *, char *, size_t);
bool IsStop(int32_t length, const uint8_t *data) {
  return length == 5 && memcmp(data, "STOP>", (size_t)length) == 0;
}


x86 assembly (clang, -O0):
<IsStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x5,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jne    114c <IsStop+0x3c>
mov    -0x10(%rbp),%rdi
movslq -0x4(%rbp),%rdx
lea    0xec3(%rip),%rsi
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsStop>:
xor    %eax,%eax
cmp    $0x5,%edi
jne    113e <IsStop+0x2e>
push   %rax
lea    0xee1(%rip),%rax
mov    $0x5,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"STOP>\00"
define i32 @IsStop(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 = icmp eq i32 %5, 5
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = call i64 @memcmp(i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = icmp eq i64 %11, 0
br label %13
13: ; preds = %7, %2
%14 = phi i1 [ false, %2 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"STOP>\00"
define i32 @IsStop(i32 %0, i32* %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i64 @memcmp(i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ systemReset();
void systemResetToBootloader(void) {
  *((uint32_t *)0x20004FF0) = 0xDEADBEEF;
  systemReset();
}


x86 assembly (clang, -O0):
<systemResetToBootloader>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20004ff0,%eax
movl   $0xdeadbeef,(%rax)
mov    $0x0,%al
call   1030 <systemReset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<systemResetToBootloader>:
movl   $0xdeadbeef,0x20004ff0
ef be ad de
xor    %eax,%eax
jmp    1030 <systemReset@plt>

LLVM IR (-O0):
define void @systemResetToBootloader() {
store i32 -559038737, i32* inttoptr (i64 536891376 to i32*)
%1 = call i32 (...) @systemReset()
ret void
}

LLVM IR (-O2):
define void @systemResetToBootloader() {
store i32 -559038737, i32* inttoptr (i64 536891376 to i32*)
%1 = tail call i32 (...) @systemReset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int /*<<< orphan*/);
int /*<<< orphan*/ isblank(char);
void test_isblank() {
  clang_analyzer_eval(isblank('\t'));
  clang_analyzer_eval(isblank(' '));
  clang_analyzer_eval(isblank('\n'));
}


x86 assembly (clang, -O0):
<test_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1030 <isblank@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
mov    $0x20,%edi
call   1030 <isblank@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
mov    $0xa,%edi
call   1030 <isblank@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isblank>:
push   %rax
mov    $0x9,%edi
call   1030 <isblank@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
mov    $0x20,%edi
call   1030 <isblank@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
mov    $0xa,%edi
call   1030 <isblank@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @test_isblank() {
%1 = call i32 @isblank(i8 signext 9)
%2 = call i32 @clang_analyzer_eval(i32 %1)
%3 = call i32 @isblank(i8 signext 32)
%4 = call i32 @clang_analyzer_eval(i32 %3)
%5 = call i32 @isblank(i8 signext 10)
%6 = call i32 @clang_analyzer_eval(i32 %5)
ret void
}

LLVM IR (-O2):
define void @test_isblank() {
%1 = tail call i32 @isblank(i8 signext 9)
%2 = tail call i32 @clang_analyzer_eval(i32 %1)
%3 = tail call i32 @isblank(i8 signext 32)
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
%5 = tail call i32 @isblank(i8 signext 10)
%6 = tail call i32 @clang_analyzer_eval(i32 %5)
ret void
}
ibmhello() {}


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

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

LLVM IR (-O0):
define i32 @ibmhello() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @ibmhello() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ soc_is_qca9556();
scalar_t__ soc_is_qca9558();
int soc_is_qca955x(void) { return soc_is_qca9556() || soc_is_qca9558(); }


x86 assembly (clang, -O0):
<soc_is_qca955x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <soc_is_qca9556@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1152 <soc_is_qca955x+0x32>
mov    $0x0,%al
call   1030 <soc_is_qca9558@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_is_qca955x>:
push   %rax
xor    %eax,%eax
call   1040 <soc_is_qca9556@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <soc_is_qca955x+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <soc_is_qca9558@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @soc_is_qca955x() {
%1 = call i64 (...) @soc_is_qca9556()
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @soc_is_qca9558()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @soc_is_qca955x() {
%1 = tail call i64 (...) @soc_is_qca9556()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @soc_is_qca9558()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
int cairo_code_draw_silverDial_get_width() { return 77; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_silverDial_get_width() {
ret i32 77
}

LLVM IR (-O2):
define i32 @cairo_code_draw_silverDial_get_width() {
ret i32 77
}
/* Variables and functions */
int dup2(int, int);
int /*<<< orphan*/ unix_error(char *);
void Dup2(int newFd, int oldFd) {
  int rc;
  if ((rc = dup2(newFd, oldFd)) < 0)
    unix_error("Dup error");
}


x86 assembly (clang, -O0):
<Dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1151 <Dup2+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dup2>:
push   %rax
call   1030 <dup2@plt>
test   %eax,%eax
js     112c <Dup2+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Dup error\00"
define void @Dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @dup2(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @unix_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Dup error\00"
define void @Dup2(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_init();
void coreInitGPIO(void) { gpio_init(); }


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

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

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

LLVM IR (-O2):
define void @coreInitGPIO() {
%1 = tail call i32 (...) @gpio_init()
ret void
}
float fahrenheitToCelcius(float Tf) {
  float Tc = (Tf - 32.0) * ((float)9.0 / 5.0);
  return Tc;
}


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

x86 assembly (clang, -O2):
<fahrenheitToCelcius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahrenheitToCelcius(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fsub double %5, 3.200000e+01
%7 = fmul double %6, 1.800000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @fahrenheitToCelcius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 1.800000e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ _test_free(char *const, char *, int);
scalar_t__ _test_malloc(int, char *, int);
void buffer_overflow() {
  char *const memory = (char *)_test_malloc(
      sizeof(int),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fsaintjacques/cmockery/refs/heads/master/"
      "examples/allocate_module.c",
      33);
  memory[sizeof(int)] = '!';
  _test_free(memory,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/fsaintjacques/cmockery/refs/heads/"
             "master/examples/allocate_module.c",
             35);
}


x86 assembly (clang, -O0):
<buffer_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
lea    0xecc(%rip),%rsi
mov    $0x21,%edx
call   1040 <_test_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x21,0x4(%rax)
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
mov    $0x23,%edx
call   1030 <_test_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_overflow>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x21,%edx
call   1040 <_test_malloc@plt>
movb   $0x21,0x4(%rax)
mov    %rax,%rdi
mov    %rbx,%rsi
mov    $0x23,%edx
pop    %rbx
jmp    1030 <_test_free@plt>

LLVM IR (-O0):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fsaintjacques/cmockery/refs/heads/master/examples/allocate_module.c\00"
define void @buffer_overflow() {
%1 = alloca i8*
%2 = call i64 @_test_malloc(i32 4, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 33)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 4
store i8 33, i8* %5
%6 = load i8*, i8** %1
%7 = call i32 @_test_free(i8* %6, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 35)
ret void
}

LLVM IR (-O2):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fsaintjacques/cmockery/refs/heads/master/examples/allocate_module.c\00"
define void @buffer_overflow() {
%1 = tail call i64 @_test_malloc(i32 4, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 33)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 4
store i8 33, i8* %3
%4 = tail call i32 @_test_free(i8* %2, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 35)
ret void
}
/* Variables and functions */
int mus_read_any_1(int, int, int, int, int **, int /*<<< orphan*/ *, char *);
int mus_file_read_buffer(int charbuf_data_format, int beg, int chans, int nints,
                         int **bufs, char *charbuf) {
  return (mus_read_any_1(charbuf_data_format, beg, chans, nints, bufs, NULL,
                         charbuf));
}


x86 assembly (clang, -O0):
<mus_file_read_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rax
xor    %r9d,%r9d
mov    %rax,(%rsp)
call   1030 <mus_read_any_1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_file_read_buffer>:
push   %rax
mov    %r9,(%rsp)
xor    %r9d,%r9d
call   1030 <mus_read_any_1@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mus_file_read_buffer(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32**
%12 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32** %4, i32*** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32**, i32*** %11
%18 = load i8*, i8** %12
%19 = call i32 @mus_read_any_1(i32 %13, i32 %14, i32 %15, i32 %16, i32** %17, i32* null, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @mus_file_read_buffer(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i8* %5) {
%7 = tail call i32 @mus_read_any_1(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i32* null, i8* %5)
ret i32 %7
}
/* Variables and functions */
int EINVAL;
int pthread_setcanceltype(int type, int *oldtype) {
  (void)type;
  (void)oldtype;
  return EINVAL;
}


x86 assembly (clang, -O0):
<pthread_setcanceltype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_setcanceltype>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pthread_setcanceltype(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32*, i32** %4
%7 = load i32, i32* @EINVAL
ret i32 %7
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_setcanceltype(i32 %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
ret i32 %3
}
int thrackle_size_upper_bound(int n) {
  if (n % 2 == 0) {
    return (n * n - 2 * n) / 6;
  } else {
    return (n * n - n) / 6;
  }
}


x86 assembly (clang, -O0):
<thrackle_size_upper_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113a <thrackle_size_upper_bound+0x3a>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    114f <thrackle_size_upper_bound+0x4f>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrackle_size_upper_bound>:
lea    -0x2(%rdi),%eax
imul   %edi,%eax
mov    %edi,%ecx
imul   %edi,%ecx
sub    %edi,%ecx
test   $0x1,%dil
cmove  %eax,%ecx
movslq %ecx,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @thrackle_size_upper_bound(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = add i32 %0, -2
%5 = mul i32 %4, %0
%6 = mul nsw i32 %0, %0
%7 = sub nsw i32 %6, %0
%8 = select i1 %3, i32 %5, i32 %7
%9 = sdiv i32 %8, 6
ret i32 %9
}
/* Type definitions */
struct point_light_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ light_set_attenuation(struct point_light_t *, double, double,
                                         double);
void rt_light_attenuation(void *vli, double Kc, double Kl, double Kq) {
  light_set_attenuation((struct point_light_t *)vli, Kc, Kl, Kq);
}


x86 assembly (clang, -O0):
<rt_light_attenuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <light_set_attenuation@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_light_attenuation>:
jmp    1030 <light_set_attenuation@plt>

LLVM IR (-O0):
%struct.point_light_t = type { i32 }
define void @rt_light_attenuation(i8* %0, double %1, double %2, double %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i8* %0, i8** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to %struct.point_light_t*
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = call i32 @light_set_attenuation(%struct.point_light_t* %10, double %11, double %12, double %13)
ret void
}

LLVM IR (-O2):
%struct.point_light_t = type { i32 }
define void @rt_light_attenuation(i8* %0, double %1, double %2, double %3) {
%5 = bitcast i8* %0 to %struct.point_light_t*
%6 = tail call i32 @light_set_attenuation(%struct.point_light_t* %5, double %1, double %2, double %3)
ret void
}
void gtk_ui_manager_add_ui() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ui_manager_add_ui() {
ret void
}
int test_imm_B9uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xb9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B9uint64_highword_reg>:
movabs $0xb900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B9uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 185
%6 = icmp ne i64 %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_B9uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 794568949760
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double exp(double x) { return 1; }


x86 assembly (clang, -O0):
<exp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @exp(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @exp(double %0) {
ret double 1.000000e+00
}
/* Type definitions */
struct frag_fh {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct frag_fh *);
int frag_fh_cleanup(struct frag_fh *fh) {
  if (fh == NULL)
    return 0;
  free(fh);
  return 0;
}


x86 assembly (clang, -O0):
<frag_fh_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <frag_fh_cleanup+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1143 <frag_fh_cleanup+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frag_fh_cleanup>:
test   %rdi,%rdi
je     111f <frag_fh_cleanup+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.frag_fh = type { i32 }
define i32 @frag_fh_cleanup(%struct.frag_fh* %0) {
%2 = icmp eq %struct.frag_fh* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.frag_fh* %0)
br label %5
5: ; preds = %1, %3
ret i32 0
}
void silly(void) {}


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

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

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

LLVM IR (-O2):
define void @silly() {
ret void
}
/* Variables and functions */
char *legible_1(char *);
int /*<<< orphan*/ long_to_string(char *, long);
char *legible(long l) {
  char inbuf[24];
  long_to_string(inbuf, l);
  return legible_1(inbuf);
}


x86 assembly (clang, -O0):
<legible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <long_to_string@plt>
lea    -0x20(%rbp),%rdi
call   1030 <legible_1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<legible>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <long_to_string@plt>
mov    %rbx,%rdi
call   1030 <legible_1@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @legible(i64 %0) {
%2 = alloca i64
%3 = alloca [24 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i32 @long_to_string(i8* %4, i64 %5)
%7 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%8 = call i8* @legible_1(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @legible(i64 %0) {
%2 = alloca [24 x i8]
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%4 = call i32 @long_to_string(i8* %3, i64 %0)
%5 = call i8* @legible_1(i8* %3)
ret i8* %5
}
/* Variables and functions */
int strlen(const char *s) {
  int n = 0;
  while (*s++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("Hello, World!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%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 = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = 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, int, int);
testLesEqual() { printf("%d <= %d = %d\n", 10, 4, 10 <= 4); }


x86 assembly (clang, -O0):
<testLesEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLesEqual>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"%d <= %d = %d\0A\00"
define i32 @testLesEqual() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 0)
ret i32 undef
}
char *hash_plugin_detailed(void) {
  return ("dmg - A FileVault (v1) passwords plugin\n"
          "------------------------------------------------\n"
          "Use this module to crack Apple DMG images passwords\n"
          "Input should be a dmg file specified with -f\n"
          "Supports FileVault v1 images only \n"
          "Known software that uses this password hashing method:\n"
          "Apple MacOSX\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [335 x i8] c"dmg - A FileVault (v1) passwords plugin\0A------------------------------------------------\0AUse this module to crack Apple DMG images passwords\0AInput should be a dmg file specified with -f\0ASupports FileVault v1 images only \0AKnown software that uses this password hashing method:\0AApple MacOSX\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([335 x i8], [335 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [335 x i8] c"dmg - A FileVault (v1) passwords plugin\0A------------------------------------------------\0AUse this module to crack Apple DMG images passwords\0AInput should be a dmg file specified with -f\0ASupports FileVault v1 images only \0AKnown software that uses this password hashing method:\0AApple MacOSX\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([335 x i8], [335 x i8]* @.str, i64 0, i64 0)
}
int intLoc(int inp, long long int arr[]) {
  int loc = 0;
  while (1) {
    if (*(arr + loc) == inp) {
      break;
    } else {
      loc++;
    }
  }
  return loc;
}


x86 assembly (clang, -O0):
<intLoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jne    1130 <intLoc+0x30>
jmp    113e <intLoc+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <intLoc+0x12>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intLoc>:
movslq %edi,%rcx
mov    $0xffffffff,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
lea    0x8(%rsi),%rdx
cmp    %rcx,(%rsi)
mov    %rdx,%rsi
jne    1110 <intLoc+0x10>
ret

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

LLVM IR (-O2):
define i32 @intLoc(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i64, i64* %1, i64 %5
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, %3
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
scalar_t__ pthread_self();
void *PrintID() {
  pthread_t tid = pthread_self();
  printf("TID =  %u.\n", (unsigned int)tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintID>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"TID = %u.\0A\00"
define i8* @PrintID() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 (...) @pthread_self()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @pthread_exit(i32* null)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [12 x i8] c"TID = %u.\0A\00"
define noalias i8* @PrintID() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int);
int atoi(const char *nptr) { return (int)strtol(nptr, NULL, 10); }


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i32* null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void g_string_append_unichar() {}


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

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

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

LLVM IR (-O2):
define void @g_string_append_unichar() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void sg_put_unaligned_le16(uint16_t val, void *p) {
  ((uint8_t *)p)[0] = val & 0xff;
  ((uint8_t *)p)[1] = val >> 8;
}


x86 assembly (clang, -O0):
<sg_put_unaligned_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_put_unaligned_le16>:
movzbl %dil,%eax
mov    %eax,(%rsi)
sar    $0x8,%edi
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @sg_put_unaligned_le16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %6, i32* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %11, i32* %14
ret void
}

LLVM IR (-O2):
define void @sg_put_unaligned_le16(i32 %0, i8* nocapture writeonly %1) {
%3 = and i32 %0, 255
%4 = bitcast i8* %1 to i32*
store i32 %3, i32* %4
%5 = ashr i32 %0, 8
%6 = getelementptr inbounds i8, i8* %1, i64 4
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}
int test_fun(int x, int y, int z) {
  if (y <= 0) {
    return z;
  }
  while (x >= z) {
    if (y <= 0) {
      return z;
    }
    z = z + y;
  }
  return z;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1122 <test_fun+0x22>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <test_fun+0x5c>
jmp    1127 <test_fun+0x27>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1156 <test_fun+0x56>
cmpl   $0x0,-0xc(%rbp)
jg     1148 <test_fun+0x48>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <test_fun+0x5c>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <test_fun+0x27>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
mov    %edx,%eax
test   %esi,%esi
jle    1116 <test_fun+0x16>
sub    %esi,%eax
nopl   0x0(%rax,%rax,1)
add    %esi,%eax
cmp    %edi,%eax
jle    1110 <test_fun+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %9, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = icmp sgt i32 %6, %0
%8 = add nsw i32 %6, %1
br i1 %7, label %9, label %5
9: ; preds = %5, %3
%10 = phi i32 [ %2, %3 ], [ %6, %5 ]
ret i32 %10
}
int fct1(a, b) {}


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

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

LLVM IR (-O0):
define i32 @fct1(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @fct1(i32 %0, i32 %1) {
ret i32 undef
}
int __attribute__((no, noclone)) f1(float a, float b) {
  return __builtin_isless(a, b) || __builtin_isgreater(a, b);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
ja     1135 <f1+0x35>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setne  %al
ret

LLVM IR (-O0):
define i32 @f1(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fcmp ogt float %9, %10
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ true, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @f1(float %0, float %1) {
%3 = fcmp one float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_73int64_midword_reg(long long val) {
  return ((val >> 16) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x73,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_73int64_midword_reg>:
test   $0x730000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_73int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 115
%6 = icmp ne i64 %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_73int64_midword_reg(i64 %0) {
%2 = and i64 %0, 7536640
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glk_put_string(char *);
void trm_str(char *str) { glk_put_string(str); }


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

x86 assembly (clang, -O2):
<trm_str>:
jmp    1030 <glk_put_string@plt>

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

LLVM IR (-O2):
define void @trm_str(i8* %0) {
%2 = tail call i32 @glk_put_string(i8* %0)
ret void
}
void mmc_lock_remove_sysfs(struct mmc_card *card) {}


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

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

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

LLVM IR (-O2):
%struct.mmc_card = type opaque
define void @mmc_lock_remove_sysfs(%struct.mmc_card* nocapture %0) {
ret void
}
void av_add_i() {}


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

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

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

LLVM IR (-O2):
define void @av_add_i() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _m_from_int64(long long);
__m64 test_m_from_int64(long long a) { return _m_from_int64(a); }


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

x86 assembly (clang, -O2):
<test_m_from_int64>:
jmp    1030 <_m_from_int64@plt>

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

LLVM IR (-O2):
define i32 @test_m_from_int64(i64 %0) {
%2 = tail call i32 @_m_from_int64(i64 %0)
ret i32 %2
}