xunge/DecIR huggingface dataset:
void strswap(char *a, char *b) {
  char tmp = a[0];
  a[0] = b[0];
  b[0] = tmp;
}


x86 assembly (clang, -O0):
<strswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strswap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @strswap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8, i8* %5
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @strswap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
void shineOnMe() {
  unsigned int *data = ((unsigned int *)0x50023FFC);
  *data = ~0xFFF;
}


x86 assembly (clang, -O0):
<shineOnMe>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50023ffc,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xfffff000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shineOnMe>:
movl   $0xfffff000,0x50023ffc
ret

LLVM IR (-O0):
define void @shineOnMe() {
%1 = alloca i32*
store i32* inttoptr (i64 1342324732 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 -4096, i32* %2
ret void
}

LLVM IR (-O2):
define void @shineOnMe() {
store i32 -4096, i32* inttoptr (i64 1342324732 to i32*)
ret void
}
/* Variables and functions */
int gOr(int, int);
int gOr4Way(int a, int b, int c, int d) { return gOr(gOr(a, b), gOr(c, d)); }


x86 assembly (clang, -O0):
<gOr4Way>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gOr@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <gOr@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <gOr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gOr4Way>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <gOr@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <gOr@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <gOr@plt>

LLVM IR (-O0):
define i32 @gOr4Way(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @gOr(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @gOr(i32 %12, i32 %13)
%15 = call i32 @gOr(i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @gOr4Way(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @gOr(i32 %0, i32 %1)
%6 = tail call i32 @gOr(i32 %2, i32 %3)
%7 = tail call i32 @gOr(i32 %5, i32 %6)
ret i32 %7
}
void gtk_cell_renderer_text_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_text_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isgreaterequal(long double, long double);
void uninitvar_isgreaterequal(void) {
  float f1, f2;
  (void)isgreaterequal(f1, f2);
  double d1, d2;
  (void)isgreaterequal(d1, d2);
  long double ld1, ld2;
  (void)isgreaterequal(ld1, ld2);
}


x86 assembly (clang, -O0):
<uninitvar_isgreaterequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
flds   -0x4(%rbp)
flds   -0x8(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <isgreaterequal@plt>
fldl   -0x10(%rbp)
fldl   -0x18(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <isgreaterequal@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <isgreaterequal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_isgreaterequal>:
sub    $0x28,%rsp
call   1030 <isgreaterequal@plt>
call   1030 <isgreaterequal@plt>
call   1030 <isgreaterequal@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_isgreaterequal() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = load float, float* %1
%8 = fpext float %7 to x86_fp80
%9 = load float, float* %2
%10 = fpext float %9 to x86_fp80
%11 = call i32 @isgreaterequal(x86_fp80 %8, x86_fp80 %10)
%12 = load double, double* %3
%13 = fpext double %12 to x86_fp80
%14 = load double, double* %4
%15 = fpext double %14 to x86_fp80
%16 = call i32 @isgreaterequal(x86_fp80 %13, x86_fp80 %15)
%17 = load x86_fp80, x86_fp80* %5
%18 = load x86_fp80, x86_fp80* %6
%19 = call i32 @isgreaterequal(x86_fp80 %17, x86_fp80 %18)
ret void
}

LLVM IR (-O2):
define void @uninitvar_isgreaterequal() {
%1 = tail call i32 @isgreaterequal(x86_fp80 undef, x86_fp80 undef)
%2 = tail call i32 @isgreaterequal(x86_fp80 undef, x86_fp80 undef)
%3 = tail call i32 @isgreaterequal(x86_fp80 undef, x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  bar();
  printf("OK\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @bar()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @bar()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_constant_and_var_0() {
  char *x = "abc";
  if (strcasecmp(x, "Abc") != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcasecmp_constant_and_var_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     113d <strcasecmp_constant_and_var_0+0x2d>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strcasecmp_constant_and_var_0() {
%1 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i64 @strcasecmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8, i8* null
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @strcasecmp_constant_and_var_0() {
ret void
}
int test_imm_77int8_reg(signed char val) {
  return ((val) & (0x77 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_77int8_reg(i8 signext %0) {
%2 = and i8 %0, 119
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int rand();
int val(int max) { return rand() % max; }


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

x86 assembly (clang, -O2):
<val>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @val(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @val(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
extern long long_to_long(long x, int k) { return x + k; }


x86 assembly (clang, -O0):
<long_to_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_to_long>:
movslq %esi,%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @long_to_long(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add nsw i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ inmidi_realtimein(int, int);
int libpd_sysrealtime(int port, int byte) {
  if (port < 0 || port > 0x0fff)
    return -1;
  if (byte < 0 || byte > 0xff)
    return -1;
  inmidi_realtimein(port, byte);
  return 0;
}


x86 assembly (clang, -O0):
<libpd_sysrealtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1135 <libpd_sysrealtime+0x25>
cmpl   $0xfff,-0x8(%rbp)
jle    1141 <libpd_sysrealtime+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <libpd_sysrealtime+0x66>
cmpl   $0x0,-0xc(%rbp)
jl     1158 <libpd_sysrealtime+0x48>
cmpl   $0xff,-0xc(%rbp)
jle    1164 <libpd_sysrealtime+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <libpd_sysrealtime+0x66>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <inmidi_realtimein@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libpd_sysrealtime>:
mov    $0xffffffff,%eax
cmp    $0xfff,%edi
ja     1131 <libpd_sysrealtime+0x21>
cmp    $0xff,%esi
ja     1131 <libpd_sysrealtime+0x21>
push   %rax
call   1030 <inmidi_realtimein@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @libpd_sysrealtime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 4095
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %23
12: ; preds = %8
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, 255
br i1 %17, label %18, label %19
18: ; preds = %15, %12
store i32 -1, i32* %3
br label %23
19: ; preds = %15
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 @inmidi_realtimein(i32 %20, i32 %21)
store i32 0, i32* %3
br label %23
23: ; preds = %19, %18, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @libpd_sysrealtime(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, 4095
%4 = icmp ugt i32 %1, 255
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @inmidi_realtimein(i32 %0, i32 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %9
}
int ext_codec_ak4642_i2c_command(struct i2c_client *device, unsigned int cmd,
                                 void *arg) {
  (void)device;
  (void)cmd;
  (void)arg;
  return -1;
}


x86 assembly (clang, -O0):
<ext_codec_ak4642_i2c_command>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.i2c_client = type opaque
define i32 @ext_codec_ak4642_i2c_command(%struct.i2c_client* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -1
}
void foo493(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo493(i32 %0) {
ret void
}
/* Variables and functions */
int binary_search_rec_helper(int *, int /*<<< orphan*/, int, int);
int binary_search_rec(int *arr, int n, int value) {
  return binary_search_rec_helper(arr, 0, n, value);
}


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

x86 assembly (clang, -O2):
<binary_search_rec>:
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <binary_search_rec_helper@plt>

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

LLVM IR (-O2):
define i32 @binary_search_rec(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @binary_search_rec_helper(i32* %0, i32 0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long __async_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<__async_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__async_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @__async_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @__async_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_wday;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int weekday(time_t *time) {
  struct tm *ptm = localtime(time);
  int retval = ptm->tm_wday;
  return retval;
}


x86 assembly (clang, -O0):
<weekday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<weekday>:
push   %rax
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @weekday(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.tm*
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %6, %struct.tm** %3
%7 = load %struct.tm*, %struct.tm** %3
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @weekday(i32* %0) {
%2 = tail call %struct.tm* @localtime(i32* %0)
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
scalar_t__ log2f(float);
size_t clgpMaxlevel(size_t width, size_t height) {
  return (size_t)log2f((float)((width > height) ? width : height)) + 1;
}


x86 assembly (clang, -O0):
<clgpMaxlevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    113b <clgpMaxlevel+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1143 <clgpMaxlevel+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x20(%rbp)
test   %rax,%rax
movss  %xmm0,-0x1c(%rbp)
js     1180 <clgpMaxlevel+0x70>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <log2f@plt>
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clgpMaxlevel>:
cmp    %rsi,%rdi
cmova  %rdi,%rsi
test   %rsi,%rsi
js     1123 <clgpMaxlevel+0x13>
cvtsi2ss %rsi,%xmm0
jmp    1138 <clgpMaxlevel+0x28>
mov    %rsi,%rax
shr    %rax
and    $0x1,%esi
or     %rax,%rsi
cvtsi2ss %rsi,%xmm0
addss  %xmm0,%xmm0
push   %rax
call   1030 <log2f@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @clgpMaxlevel(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
%14 = uitofp i64 %13 to float
%15 = call i64 @log2f(float %14)
%16 = add i64 %15, 1
ret i64 %16
}

LLVM IR (-O2):
define i64 @clgpMaxlevel(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
%5 = uitofp i64 %4 to float
%6 = tail call i64 @log2f(float %5)
%7 = add i64 %6, 1
ret i64 %7
}
void b_smp_wait(void) { asm volatile("call 0x00100150"); }


x86 assembly (clang, -O0):
<b_smp_wait>:
push   %rbp
mov    %rsp,%rbp
call   100150 <completed.0+0xfc130>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_smp_wait>:
call   100150 <completed.0+0xfc130>
ret

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

LLVM IR (-O2):
define void @b_smp_wait() {
tail call void asm sideeffect "call 0x00100150", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void sd_check_item(struct item_head *ih, char *item) {}


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

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

LLVM IR (-O0):
%struct.item_head = type opaque
define void @sd_check_item(%struct.item_head* %0, i8* %1) {
%3 = alloca %struct.item_head*
%4 = alloca i8*
store %struct.item_head* %0, %struct.item_head** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.item_head = type opaque
define void @sd_check_item(%struct.item_head* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
long double rint(long double);
long double rintl(long double a1) { return rint(a1); }


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <rint@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <rintl@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.rint.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ close_nointr_nofail(int);
void closep(int *fd) {
  if (*fd >= 0)
    close_nointr_nofail(*fd);
}


x86 assembly (clang, -O0):
<closep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1134 <closep+0x24>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close_nointr_nofail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closep>:
mov    (%rdi),%edi
test   %edi,%edi
js     111b <closep+0xb>
jmp    1030 <close_nointr_nofail@plt>
ret

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

LLVM IR (-O2):
define void @closep(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close_nointr_nofail(i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
void CliMonitorInit(void) {}


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

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

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

LLVM IR (-O2):
define void @CliMonitorInit() {
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_recvmsg(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


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

x86 assembly (clang, -O2):
<sys_recvmsg>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_recvmsg(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_recvmsg(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
__register_frame_info() {}


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

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

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

LLVM IR (-O2):
define i32 @__register_frame_info() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ refresh();
void Led8x8driver_SetupDisplay(void) {
  initscr();
  refresh();
}


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

x86 assembly (clang, -O2):
<Led8x8driver_SetupDisplay>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
define void @Led8x8driver_SetupDisplay() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @Led8x8driver_SetupDisplay() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @refresh()
ret void
}
int test_imm_11uint16_mem(unsigned short *val) {
  return ((*val) & (-0x11 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_11uint16_mem>:
movzwl (%rdi),%eax
test   $0xffef,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_11uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -17
%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_11uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -17
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ _byteswap64bit(int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
scalar_t__ be64toh(int /*<<< orphan*/);
scalar_t__ htobe64(int /*<<< orphan*/);
void cmp(uint64_t vali) {
  assert((_byteswap64bit(vali)) == be64toh(vali));
  assert((_byteswap64bit(vali)) == htobe64(vali));
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <_byteswap64bit@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <be64toh@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
call   1050 <_byteswap64bit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <htobe64@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1050 <_byteswap64bit@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1040 <be64toh@plt>
xor    %edi,%edi
cmp    %rax,%r14
sete   %dil
call   1030 <assert@plt>
mov    %ebx,%edi
call   1050 <_byteswap64bit@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1060 <htobe64@plt>
xor    %edi,%edi
cmp    %rax,%r14
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @cmp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @_byteswap64bit(i32 %3)
%5 = load i32, i32* %2
%6 = call i64 @be64toh(i32 %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %2
%11 = call i64 @_byteswap64bit(i32 %10)
%12 = load i32, i32* %2
%13 = call i64 @htobe64(i32 %12)
%14 = icmp eq i64 %11, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @cmp(i32 %0) {
%2 = tail call i64 @_byteswap64bit(i32 %0)
%3 = tail call i64 @be64toh(i32 %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i64 @_byteswap64bit(i32 %0)
%8 = tail call i64 @htobe64(i32 %0)
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
ret void
}
/* Variables and functions */
scalar_t__ __eqsf2(float, float);
int _COM_CMPEQf(float a, float b) { return __eqsf2(a, b) == 0; }


x86 assembly (clang, -O0):
<_COM_CMPEQf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__eqsf2@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_COM_CMPEQf(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 = call i64 @__eqsf2(float %5, float %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_COM_CMPEQf(float %0, float %1) {
%3 = tail call i64 @__eqsf2(float %0, float %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *memdup(void *src, size_t len) {
  void *dst = malloc(len);
  memcpy(dst, src, len);
  return dst;
}


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

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void my_malloc3(int n) { malloc(n); }


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

x86 assembly (clang, -O2):
<my_malloc3>:
jmp    1030 <malloc@plt>

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

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

/* Variables and functions */
scalar_t__ calc_tree(struct tree *);
double op_equal(struct tree *left, struct tree *right) {
  return calc_tree(left) == calc_tree(right);
}


x86 assembly (clang, -O0):
<op_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calc_tree@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <calc_tree@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <calc_tree@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <calc_tree@plt>
cmp    %rax,%rbx
je     1131 <op_equal+0x21>
xorps  %xmm0,%xmm0
jmp    1139 <op_equal+0x29>
movsd  0xec7(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @op_equal(%struct.tree* %0, %struct.tree* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = call i64 @calc_tree(%struct.tree* %5)
%7 = load %struct.tree*, %struct.tree** %4
%8 = call i64 @calc_tree(%struct.tree* %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @op_equal(%struct.tree* %0, %struct.tree* %1) {
%3 = tail call i64 @calc_tree(%struct.tree* %0)
%4 = tail call i64 @calc_tree(%struct.tree* %1)
%5 = icmp eq i64 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
/* Type definitions */
struct xenDevice {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int compareDevice(struct device *, struct device *);
int xenCompareDevice(struct xenDevice *dev1, struct xenDevice *dev2) {
  return compareDevice((struct device *)dev1, (struct device *)dev2);
}


x86 assembly (clang, -O0):
<xenCompareDevice>:
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 <compareDevice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xenCompareDevice>:
jmp    1030 <compareDevice@plt>

LLVM IR (-O0):
%struct.xenDevice = type { i32 }
%struct.device = type { i32 }
define i32 @xenCompareDevice(%struct.xenDevice* %0, %struct.xenDevice* %1) {
%3 = alloca %struct.xenDevice*
%4 = alloca %struct.xenDevice*
store %struct.xenDevice* %0, %struct.xenDevice** %3
store %struct.xenDevice* %1, %struct.xenDevice** %4
%5 = load %struct.xenDevice*, %struct.xenDevice** %3
%6 = bitcast %struct.xenDevice* %5 to %struct.device*
%7 = load %struct.xenDevice*, %struct.xenDevice** %4
%8 = bitcast %struct.xenDevice* %7 to %struct.device*
%9 = call i32 @compareDevice(%struct.device* %6, %struct.device* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.xenDevice = type { i32 }
%struct.device = type { i32 }
define i32 @xenCompareDevice(%struct.xenDevice* %0, %struct.xenDevice* %1) {
%3 = bitcast %struct.xenDevice* %0 to %struct.device*
%4 = bitcast %struct.xenDevice* %1 to %struct.device*
%5 = tail call i32 @compareDevice(%struct.device* %3, %struct.device* %4)
ret i32 %5
}
int mt_cpu_dormant(unsigned long flags) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mt_cpu_dormant(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_prime_sum(int /*<<< orphan*/);
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnum(char *);
int main(int ac, char **av) {
  if (ac == 2) {
    add_prime_sum(ft_putnum(av[1]));
  }
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1164 <main+0x34>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ft_putnum@plt>
mov    %eax,%edi
call   1050 <add_prime_sum@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1146 <main+0x16>
mov    0x8(%rsi),%rdi
call   1030 <ft_putnum@plt>
mov    %eax,%edi
call   1050 <add_prime_sum@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_putnum(i8* %6)
%8 = tail call i32 @add_prime_sum(i32 %7)
br label %9
9: ; preds = %4, %2
%10 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ desmontaHeap(int *, int);
int /*<<< orphan*/ montaHeap(int *, int);
void heapSort(int *v, int n) {
  montaHeap(v, n);
  desmontaHeap(v, n);
}


x86 assembly (clang, -O0):
<heapSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <montaHeap@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <desmontaHeap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapSort>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <montaHeap@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <desmontaHeap@plt>

LLVM IR (-O0):
define void @heapSort(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 = call i32 @montaHeap(i32* %5, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = call i32 @desmontaHeap(i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @heapSort(i32* %0, i32 %1) {
%3 = tail call i32 @montaHeap(i32* %0, i32 %1)
%4 = tail call i32 @desmontaHeap(i32* %0, i32 %1)
ret void
}
int openconnect_has_tss_blob_support(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @openconnect_has_tss_blob_support() {
ret i32 0
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int nombreAleatoire(int nombreMax) {
  srand(time(NULL));
  return (rand() % nombreMax);
}


x86 assembly (clang, -O0):
<nombreAleatoire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nombreAleatoire>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nombreAleatoire(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @nombreAleatoire(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ use_buffer(char *);
void down(int i) {
  char buf[10000];
  if (i > 0) {
    use_buffer(buf);
    down(i - 1);
  }
}


x86 assembly (clang, -O0):
<down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114f <down+0x2f>
lea    -0x2720(%rbp),%rdi
call   1040 <use_buffer@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <down@plt>
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<down>:
test   %edi,%edi
jle    1148 <down+0x28>
push   %rbx
sub    $0x2710,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
call   1040 <use_buffer@plt>
add    $0xffffffff,%ebx
mov    %ebx,%edi
call   1030 <down@plt>
add    $0x2710,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @down(i32 %0) {
%2 = alloca i32
%3 = alloca [10000 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%8 = call i32 @use_buffer(i8* %7)
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @down(i32 %0) {
%2 = alloca [10000 x i8]
%3 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @use_buffer(i8* %3)
%7 = add nsw i32 %0, -1
br label %8
8: ; preds = %5, %1
ret void
}
void signed_char_div_unsigned_char(signed char *LHS, unsigned char RHS) {
  (*LHS) /= RHS;
}


x86 assembly (clang, -O0):
<signed_char_div_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_div_unsigned_char>:
movsbl (%rdi),%eax
cwtd
idiv   %si
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_div_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = sdiv i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_div_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i16
%5 = zext i8 %1 to i16
%6 = sdiv i16 %4, %5
%7 = trunc i16 %6 to i8
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:\n");
  printf("sssetchannel interface channel [para1] [para2]\n");
  printf("		para1: channel number\n");
  printf("		para2: 1 means frequency hopping\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [48 x i8] c"sssetchannel interface channel [para1] [para2]\0A\00"
@.str.2 = [25 x i8] c"\09\09para1: channel number\0A\00"
@.str.3 = [36 x i8] c"\09\09para2: 1 means frequency hopping\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.4 = [47 x i8] c"sssetchannel interface channel [para1] [para2]\00"
@str.5 = [24 x i8] c"\09\09para1: channel number\00"
@str.6 = [35 x i8] c"\09\09para2: 1 means frequency hopping\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char append_image(char *data, unsigned int len, FILE *output) {
  return 0;
}


x86 assembly (clang, -O0):
<append_image>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @append_image(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @append_image(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i8 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int8_t;

/* Variables and functions */
int8_t complementBit_fun_int8_t(int8_t x, uint32_t i) { return x ^ 1 << i; }


x86 assembly (clang, -O0):
<complementBit_fun_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complementBit_fun_int8_t>:
mov    %edi,%eax
btc    %esi,%eax
ret

LLVM IR (-O0):
define i32 @complementBit_fun_int8_t(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 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @complementBit_fun_int8_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}