xunge/DecIR huggingface dataset:
double frexp(double x, int *exp) { return 0; }


x86 assembly (clang, -O0):
<frexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexp>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @frexp(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
store double %0, double* %3
store i32* %1, i32** %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @frexp(double %0, i32* nocapture readnone %1) {
ret double 0.000000e+00
}
/* Variables and functions */
int hDoubleToLongBits(double);
int hIsInd(double d) { return hDoubleToLongBits(d) == 0xfff8000000000000ll; }


x86 assembly (clang, -O0):
<hIsInd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <hDoubleToLongBits@plt>
cltq
movabs $0xfff8000000000000,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hIsInd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @hDoubleToLongBits(double %3)
%5 = sext i32 %4 to i64
%6 = icmp eq i64 %5, -2251799813685248
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @hIsInd(double %0) {
%2 = tail call i32 @hDoubleToLongBits(double %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ asm_putchar(char, char, char);
void putch(char x, char attr, char page) { asm_putchar(x, attr, page); }


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movsbl %cl,%edi
movsbl %al,%esi
movsbl -0x3(%rbp),%edx
call   1030 <asm_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
jmp    1030 <asm_putchar@plt>

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

LLVM IR (-O2):
define void @putch(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @asm_putchar(i8 signext %0, i8 signext %1, i8 signext %2)
ret void
}
/* Variables and functions */
int O_NDELAY;
int O_NOCTTY;
int O_RDWR;
int open(char *, int);
int /*<<< orphan*/ s_configure(int);
int s_open(char *port) {
  int fd;
  fd = open(port, O_RDWR | O_NOCTTY | O_NDELAY);
  if (fd < 0) {
    return fd;
  }
  s_configure(fd);
  return fd;
}


x86 assembly (clang, -O0):
<s_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
or     (%rax),%esi
mov    0x2e87(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1168 <s_open+0x48>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <s_open+0x56>
mov    -0x14(%rbp),%edi
call   1030 <s_configure@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_open>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e96(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     114e <s_open+0x2e>
mov    %ebx,%edi
call   1030 <s_configure@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
define i32 @s_open(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = load i32, i32* @O_NOCTTY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_NDELAY
%10 = or i32 %8, %9
%11 = call i32 @open(i8* %5, i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %20
16: ; preds = %1
%17 = load i32, i32* %4
%18 = call i32 @s_configure(i32 %17)
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %20
20: ; preds = %16, %14
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
define i32 @s_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6)
%8 = icmp slt i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @s_configure(i32 %7)
br label %11
11: ; preds = %1, %9
ret i32 %7
}
void ar2315_plat_mem_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @ar2315_plat_mem_setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Zeropad();
void testZeropad(void) { Zeropad(); }


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

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

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

LLVM IR (-O2):
define void @testZeropad() {
%1 = tail call i32 (...) @Zeropad()
ret void
}
/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
scalar_t__ clock();
double umfpack_timer(void) {
  return (((double)(clock())) / ((double)(CLOCKS_PER_SEC)));
}


x86 assembly (clang, -O0):
<umfpack_timer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<umfpack_timer>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @umfpack_timer() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @umfpack_timer() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
void foo006(int p) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
define void @foo006(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo006(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
char *get_lexeme(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  FILE *i = fopen("tmp.txt", "r");
  printf("%s\n\n", get_lexeme(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <get_lexeme@plt>
mov    %rax,%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
call   1050 <get_lexeme@plt>
lea    0xeb7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"tmp.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [5 x i8] c"%s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i8* @get_lexeme(i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"tmp.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [5 x i8] c"%s\0A\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i8* @get_lexeme(i32* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
void stepLeft() {}


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

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

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

LLVM IR (-O2):
define void @stepLeft() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xselectionclear;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselectionclear_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselectionclear.serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xselectionclear_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xselectionclear_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void loop_forever(void) {}


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

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

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

LLVM IR (-O2):
define void @loop_forever() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void i_want_bar() { foo(); }


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

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

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

LLVM IR (-O2):
define void @i_want_bar() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char z[9];
  printf("Enter a string: ");
  scanf("%[^aeiou]", z);
  printf("The input was \"%s\"\n", z);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x7(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a string: \00"
@.str.1 = [10 x i8] c"%[^aeiou]\00"
@.str.2 = [20 x i8] c"The input was \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a string: \00"
@.str.1 = [10 x i8] c"%[^aeiou]\00"
@.str.2 = [20 x i8] c"The input was \22%s\22\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void deal_with_it() { printf("ello planet earth !"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"ello planet earth !\00"
define void @deal_with_it() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"ello planet earth !\00"
define void @deal_with_it() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hd_region(FILE *f) {
  static int count = 0;
  if (!count++)
    printf("No header has been defined for the region table\n");
  return (0);
}


x86 assembly (clang, -O0):
<hd_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x0,%eax
jne    1142 <hd_region+0x32>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd_region>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
test   %eax,%eax
jne    1130 <hd_region+0x20>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@hd_region.count = internal global i32 0
@.str = [49 x i8] c"No header has been defined for the region table\0A\00"
define i32 @hd_region(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @hd_region.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @hd_region.count
%5 = icmp ne i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 0
}

LLVM IR (-O2):
@hd_region.count = internal unnamed_addr global i32 0
@str = [48 x i8] c"No header has been defined for the region table\00"
define i32 @hd_region(i32* nocapture readnone %0) {
%2 = load i32, i32* @hd_region.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @hd_region.count
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
scalar_t__ ilogb(double);
int ilogbf(float x) { return (int)ilogb((double)x); }


x86 assembly (clang, -O0):
<ilogbf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <ilogb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilogbf>:
cvtss2sd %xmm0,%xmm0
jmp    1030 <ilogb@plt>

LLVM IR (-O0):
define i32 @ilogbf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @ilogb(double %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ilogbf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @ilogb(double %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
void mod_tcp_is_dlclose_safe() {}


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

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

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

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

/* Variables and functions */
void I2CSlaveIntDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000080C))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80c,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntDisable>:
movslq %edi,%rax
andl   $0xfffffffe,0x80c(%rax)
ret

LLVM IR (-O0):
define void @I2CSlaveIntDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2060
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntDisable(i32 %0) {
%2 = add nsw i32 %0, 2060
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -2
store volatile i32 %6, i32* %4
ret void
}
int test_imm_AEint16_mem(short *val) {
  return ((*val) & (0xAE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AEint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xae,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AEint16_mem>:
testb  $0xae,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AEint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 174
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test1(int);
int main() {
  test1(15);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test1(i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int first, second;
  printf("Enter two integers: ");
  scanf("%d %d", &first, &second);
  printf("The user entered %d and %d", first, second);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter two integers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [27 x i8] c"The user entered %d and %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter two integers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [27 x i8] c"The user entered %d and %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int test(int);
int main() { return test(1) + test(2) + test(3) + test(4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <test@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%edi
call   1030 <test@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <test@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x3,%edi
call   1030 <test@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x4,%edi
call   1030 <test@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 1)
%3 = call i32 @test(i32 2)
%4 = add nsw i32 %2, %3
%5 = call i32 @test(i32 3)
%6 = add nsw i32 %4, %5
%7 = call i32 @test(i32 4)
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 1)
%2 = tail call i32 @test(i32 2)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @test(i32 3)
%5 = add nsw i32 %3, %4
%6 = tail call i32 @test(i32 4)
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int func3b(int);
__attribute__((always_)) int func3a(int x) { return func3b(x * 23); }


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

x86 assembly (clang, -O2):
<func3a>:
lea    (%rdi,%rdi,2),%eax
shl    $0x3,%eax
sub    %edi,%eax
mov    %eax,%edi
jmp    1030 <func3b@plt>

LLVM IR (-O0):
define i32 @func3a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 23
%5 = call i32 @func3b(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @func3a(i32 %0) {
%2 = mul nsw i32 %0, 23
%3 = tail call i32 @func3b(i32 %2)
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn29() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn29");
  return result;
}


x86 assembly (clang, -O0):
<fn29>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn29>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn29\00"
define i8* @fn29() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn29\00"
define i8* @fn29() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
scalar_t__ isdigit(char);
int allDigits(char *str) {
  while (*str != '\0' && isdigit(*str)) {
    str++;
  }
  return (*str == '\0');
}


x86 assembly (clang, -O0):
<allDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <allDigits+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <allDigits+0x47>
jmp    1168 <allDigits+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <allDigits+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allDigits>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     1154 <allDigits+0x44>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     114a <allDigits+0x3a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <allDigits+0x20>
jmp    1154 <allDigits+0x44>
xor    %ebp,%ebp
cmpb   $0x0,-0x1(%rbx)
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @allDigits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = tail call i64 @isdigit(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i8, i8* %6
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %17
13: ; preds = %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %9, %1
%18 = phi i32 [ 1, %1 ], [ %12, %9 ], [ 1, %13 ]
ret i32 %18
}
int main(void) {
  asm("main_label: .globl main_label");
  int sum, a, b;
  sum = a + b;
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "main_label: .globl main_label", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Variables and functions */
scalar_t__ random();
unsigned int getuint(unsigned int limit) {
  return (((unsigned long)random()) % limit);
}


x86 assembly (clang, -O0):
<getuint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x4(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuint>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
mov    %ebx,%ecx
mov    %rax,%rdx
shr    $0x20,%rdx
je     112f <getuint+0x1f>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getuint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @random()
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = urem i64 %3, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @getuint(i32 %0) {
%2 = tail call i64 (...) @random()
%3 = zext i32 %0 to i64
%4 = urem i64 %2, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ ceil(double);
long double ceill(long double x) { return (long double)ceil((double)x); }


x86 assembly (clang, -O0):
<ceill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceill>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <ceil@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @ceill(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @ceil(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @ceill(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @ceil(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
int uade_main(int, char **);
int main(int argc, char **argv) { return uade_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <uade_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <uade_main@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @uade_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @uade_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
size_t fread(void *, int, size_t, void *);
size_t file_read(void *file, void *data, size_t size) {
  return fread(data, 1, size, file);
}


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

x86 assembly (clang, -O2):
<file_read>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @file_read(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i64 %2, i8* %0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int exitCommand(char **args) { exit(0); }


x86 assembly (clang, -O0):
<exitCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exitCommand>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @exitCommand(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @exitCommand(i8** nocapture readnone %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
int add10(int arg2) { return 10 + arg2; }


x86 assembly (clang, -O0):
<add10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add10>:
lea    0xa(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @add10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 10, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @add10(i32 %0) {
%2 = add nsw i32 %0, 10
ret i32 %2
}
int seg_crash(int n, double x, float y) {
  int *a = 0;
  if (n > 0)
    seg_crash(n - 1, x, y);
  *a = 3;
  return 1;
}


x86 assembly (clang, -O0):
<seg_crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114c <seg_crash+0x3c>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
movsd  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <seg_crash@plt>
mov    -0x20(%rbp),%rax
movl   $0x3,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seg_crash>:
push   %rax
add    $0xffffffff,%edi
call   1030 <seg_crash@plt>

LLVM IR (-O0):
define i32 @seg_crash(i32 %0, double %1, float %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca float
%7 = alloca i32*
store i32 %0, i32* %4
store double %1, double* %5
store float %2, float* %6
store i32* null, i32** %7
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = load double, double* %5
%14 = load float, float* %6
%15 = call i32 @seg_crash(i32 %12, double %13, float %14)
br label %16
16: ; preds = %10, %3
%17 = load i32*, i32** %7
store i32 3, i32* %17
ret i32 1
}

LLVM IR (-O2):
define i32 @seg_crash(i32 %0, double %1, float %2) {
%4 = icmp sgt i32 %0, 0
tail call void @llvm.assume(i1 %4)
%5 = add nsw i32 %0, -1
%6 = tail call i32 @seg_crash(i32 %5, double %1, float %2)
unreachable
}
short f0_wh(short x) {
  while (x--)
    if (x <= 0)
      return 100;
  return 200;
}


x86 assembly (clang, -O0):
<f0_wh>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0x4(%rbp)
cmp    $0x0,%ax
je     1141 <f0_wh+0x41>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jg     113c <f0_wh+0x3c>
movw   $0x64,-0x2(%rbp)
jmp    1147 <f0_wh+0x47>
jmp    110b <f0_wh+0xb>
movw   $0xc8,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0_wh>:
lea    -0x1(%rdi),%eax
xor    %ecx,%ecx
test   %ax,%ax
cmovs  %eax,%ecx
neg    %ecx
lea    (%rdi,%rcx,1),%eax
add    $0xffffffff,%eax
cmp    %ax,%di
cmovb  %edi,%eax
cmp    $0x20,%ax
jb     1150 <f0_wh+0x50>
movzwl %ax,%eax
lea    0x1(%rax),%ecx
mov    %ecx,%edx
and    $0x1f,%edx
mov    $0x20,%esi
cmovne %edx,%esi
not    %eax
add    %esi,%eax
sub    %ecx,%esi
add    %edi,%esi
mov    %esi,%edi
nopl   0x0(%rax)
add    $0x20,%eax
jne    1140 <f0_wh+0x40>
cs nopw 0x0(%rax,%rax,1)
nop
sub    $0x1,%di
jb     1160 <f0_wh+0x60>
test   %di,%di
jg     1150 <f0_wh+0x50>
mov    $0x64,%ax
ret
mov    $0xc8,%ax
ret

LLVM IR (-O0):
define signext i16 @f0_wh(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
br label %4
4: ; preds = %13, %1
%5 = load i16, i16* %3
%6 = add i16 %5, -1
store i16 %6, i16* %3
%7 = icmp ne i16 %5, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i16 100, i16* %2
br label %15
13: ; preds = %8
br label %4
14: ; preds = %4
store i16 200, i16* %2
br label %15
15: ; preds = %14, %12
%16 = load i16, i16* %2
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @f0_wh(i16 signext %0) {
%2 = add i16 %0, -1
%3 = call i16 @llvm.smin.i16(i16 %2, i16 0)
%4 = sub i16 %2, %3
%5 = call i16 @llvm.umin.i16(i16 %0, i16 %4)
%6 = zext i16 %5 to i32
%7 = add nuw nsw i32 %6, 1
%8 = icmp ult i16 %5, 32
br i1 %8, label %20, label %9
9: ; preds = %1
%10 = and i32 %7, 31
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 32, i32 %10
%13 = sub nsw i32 %7, %12
%14 = trunc i32 %13 to i16
%15 = sub i16 %0, %14
br label %16
16: ; preds = %16, %9
%17 = phi i32 [ 0, %9 ], [ %18, %16 ]
%18 = add nuw i32 %17, 32
%19 = icmp eq i32 %18, %13
br i1 %19, label %20, label %16
20: ; preds = %16, %1
%21 = phi i16 [ %0, %1 ], [ %15, %16 ]
br label %22
22: ; preds = %20, %26
%23 = phi i16 [ %24, %26 ], [ %21, %20 ]
%24 = add i16 %23, -1
%25 = icmp eq i16 %23, 0
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = icmp slt i16 %24, 1
br i1 %27, label %28, label %22
28: ; preds = %22, %26
%29 = phi i16 [ 100, %26 ], [ 200, %22 ]
ret i16 %29
}
/* Variables and functions */
int /*<<< orphan*/ context_test();
int main() {
  context_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @context_test()
ret i32 0
}
float max(float lhs, float rhs) { return (lhs > rhs) ? lhs : rhs; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max(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 ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
struct cpu_topology {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ outfile_topo_info(int /*<<< orphan*/ *,
                                     struct cpu_topology *);
int output_cpu_topo_info(struct cpu_topology *topo, FILE *f) {
  outfile_topo_info(f, topo);
  return 0;
}


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

x86 assembly (clang, -O2):
<output_cpu_topo_info>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <outfile_topo_info@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cpu_topology = type { i32 }
define i32 @output_cpu_topo_info(%struct.cpu_topology* %0, i32* %1) {
%3 = alloca %struct.cpu_topology*
%4 = alloca i32*
store %struct.cpu_topology* %0, %struct.cpu_topology** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load %struct.cpu_topology*, %struct.cpu_topology** %3
%7 = call i32 @outfile_topo_info(i32* %5, %struct.cpu_topology* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.cpu_topology = type { i32 }
define i32 @output_cpu_topo_info(%struct.cpu_topology* %0, i32* %1) {
%3 = tail call i32 @outfile_topo_info(i32* %1, %struct.cpu_topology* %0)
ret i32 0
}
/* Type definitions */
struct Expressions {
  int dummy;
};

/* Variables and functions */
int _compile(struct Expressions *, char const *, char **);
int exp_push(struct Expressions *exps, const char *exp, char **err) {
  return _compile(exps, exp, err);
}


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

x86 assembly (clang, -O2):
<exp_push>:
jmp    1030 <_compile@plt>

LLVM IR (-O0):
%struct.Expressions = type { i32 }
define i32 @exp_push(%struct.Expressions* %0, i8* %1, i8** %2) {
%4 = alloca %struct.Expressions*
%5 = alloca i8*
%6 = alloca i8**
store %struct.Expressions* %0, %struct.Expressions** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load %struct.Expressions*, %struct.Expressions** %4
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
%10 = call i32 @_compile(%struct.Expressions* %7, i8* %8, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.Expressions = type { i32 }
define i32 @exp_push(%struct.Expressions* %0, i8* %1, i8** %2) {
%4 = tail call i32 @_compile(%struct.Expressions* %0, i8* %1, i8** %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *);
void print_error_input_file(void) {
  print_error("Cannot read input file");
  return;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Cannot read input file\00"
define void @print_error_input_file() {
%1 = call i32 @print_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Cannot read input file\00"
define void @print_error_input_file() {
%1 = tail call i32 @print_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct bitree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bitree_init(struct bitree *, int (*)(void *, void *));
void bi_search_tree_init(struct bitree *b, int (*compare)(void *d1, void *d2)) {
  bitree_init(b, compare);
}


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

x86 assembly (clang, -O2):
<bi_search_tree_init>:
jmp    1030 <bitree_init@plt>

LLVM IR (-O0):
%struct.bitree = type { i32 }
define void @bi_search_tree_init(%struct.bitree* %0, i32 (i8*, i8*)* %1) {
%3 = alloca %struct.bitree*
%4 = alloca i32 (i8*, i8*)*
store %struct.bitree* %0, %struct.bitree** %3
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %4
%5 = load %struct.bitree*, %struct.bitree** %3
%6 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %4
%7 = call i32 @bitree_init(%struct.bitree* %5, i32 (i8*, i8*)* %6)
ret void
}

LLVM IR (-O2):
%struct.bitree = type { i32 }
define void @bi_search_tree_init(%struct.bitree* %0, i32 (i8*, i8*)* %1) {
%3 = tail call i32 @bitree_init(%struct.bitree* %0, i32 (i8*, i8*)* %1)
ret void
}
void Reload_E_In_Register(void) {}


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

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

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

LLVM IR (-O2):
define void @Reload_E_In_Register() {
ret void
}
/* Variables and functions */
char get_bit_val(unsigned int, int);
unsigned shift_transform(unsigned val, int i, char *start_bit) {
  val ^= (unsigned)*start_bit << i;
  *start_bit ^= get_bit_val(val, i);
  return val;
}


x86 assembly (clang, -O0):
<shift_transform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <get_bit_val@plt>
movsbl %al,%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_transform>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
movsbl (%rdx),%ebp
mov    %esi,%ecx
shl    %cl,%ebp
xor    %edi,%ebp
mov    %ebp,%edi
call   1030 <get_bit_val@plt>
xor    %al,(%rbx)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @shift_transform(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i32, i32* %5
%11 = shl i32 %9, %10
%12 = load i32, i32* %4
%13 = xor i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call signext i8 @get_bit_val(i32 %14, i32 %15)
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %6
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = xor i32 %20, %17
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @shift_transform(i32 %0, i32 %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = shl i32 %5, %1
%7 = xor i32 %6, %0
%8 = tail call signext i8 @get_bit_val(i32 %7, i32 %1)
%9 = load i8, i8* %2
%10 = xor i8 %9, %8
store i8 %10, i8* %2
ret i32 %7
}