xunge/DecIR huggingface dataset:
/* Type definitions */
typedef enum xprt_stat { ____Placeholder_xprt_stat } xprt_stat;
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int XPRT_IDLE;
enum xprt_stat svcraw_stat(SVCXPRT *xprt) { return (XPRT_IDLE); }


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

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

LLVM IR (-O0):
@XPRT_IDLE = global i32 0
define i32 @svcraw_stat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @XPRT_IDLE
ret i32 %3
}

LLVM IR (-O2):
@XPRT_IDLE = global i32 0
define i32 @svcraw_stat(i32* nocapture readnone %0) {
%2 = load i32, i32* @XPRT_IDLE
ret i32 %2
}
void I_StopCD(void) {}


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

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

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

LLVM IR (-O2):
define void @I_StopCD() {
ret void
}
int to_hex(int c) { return c + (c < 10 ? '0' : ('a' - 10)); }


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%esi
mov    $0x57,%ecx
mov    $0x30,%edx
cmp    $0xa,%esi
cmovl  %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
lea    0x57(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @to_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 48, i32 87
%8 = add nsw i32 %3, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @to_hex(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 48, i32 87
%4 = add nsw i32 %3, %0
ret i32 %4
}
void __DELETE_java_util_HashMap_Entry(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_util_HashMap_Entry(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_util_HashMap_Entry(i8* nocapture %0, i8* nocapture %1) {
ret void
}
unsigned long get_eflags(void) {
  unsigned long eflags;
  asm volatile("pushf"
               "q"
               "\n\tpop"
               "q"
               " %0"
               : "=rm"(eflags));
  return eflags;
}


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

x86 assembly (clang, -O2):
<get_eflags>:
pushf
pop    -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @get_eflags() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
ret i64 %3
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
size_t node_fun_all_args_count(struct node const *);
size_t c_fun_args_count(const struct node *node) {
  return node_fun_all_args_count(node);
}


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

x86 assembly (clang, -O2):
<c_fun_args_count>:
jmp    1030 <node_fun_all_args_count@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define i64 @c_fun_args_count(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call i64 @node_fun_all_args_count(%struct.node* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i64 @c_fun_args_count(%struct.node* %0) {
%2 = tail call i64 @node_fun_all_args_count(%struct.node* %0)
ret i64 %2
}
void msi_init(void) {}


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

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

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

LLVM IR (-O2):
define void @msi_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEirem(int /*<<< orphan*/ *);
void code_irem() { appendCODE(makeCODEirem(NULL)); }


x86 assembly (clang, -O0):
<code_irem>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <makeCODEirem@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @code_irem() {
%1 = call i32 @makeCODEirem(i32* null)
%2 = call i32 @appendCODE(i32 %1)
ret void
}

LLVM IR (-O2):
define void @code_irem() {
%1 = tail call i32 @makeCODEirem(i32* null)
%2 = tail call i32 @appendCODE(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_bzfree(void *opaque, void *addr) {
  if (addr != 0)
    free(addr);
}


x86 assembly (clang, -O0):
<default_bzfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <default_bzfree+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_bzfree>:
test   %rsi,%rsi
je     111d <default_bzfree+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @default_bzfree(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
int syscall4(int eax, int ebx, int ecx, int edx) {
  int result;
  asm("int $0x80" : "=a"(result) : "a"(eax), "b"(ebx), "c"(ecx), "d"(edx));
  return result;
}


x86 assembly (clang, -O0):
<syscall4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
int    $0x80
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall4>:
push   %rbx
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%ebx
mov    %edi,%eax
mov    %r8d,%edx
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @syscall4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 asm "int $$0x80", "={ax},{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %10, i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @syscall4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 asm "int $$0x80", "={ax},{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *stripper(char *);
int main(void) {
  char input[] = "this is some <a href=\"foo\">links</a> and stuff <br/>. "
                 "<h1>Hello</h1> world";
  printf("input:  [%s]\n", input);
  printf("output: [%s]\n", stripper(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x4b,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xeec(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <stripper@plt>
mov    %rax,%rsi
lea    0xee2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movups 0xf0f(%rip),%xmm0
movups %xmm0,0x3b(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <stripper@plt>
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.input = [75 x i8] c"this is some <a href=\22foo\22>links</a> and stuff <br/>. <h1>Hello</h1> world\00"
@.str = [14 x i8] c"input: [%s]\0A\00"
@.str.1 = [14 x i8] c"output: [%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [75 x i8]
store i32 0, i32* %1
%3 = bitcast [75 x i8]* %2 to i8*
%4 = getelementptr inbounds [75 x i8], [75 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [75 x i8], [75 x i8]* %2, i64 0, i64 0
%7 = call i8* @stripper(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.input = [75 x i8] c"this is some <a href=\22foo\22>links</a> and stuff <br/>. <h1>Hello</h1> world\00"
@.str = [14 x i8] c"input: [%s]\0A\00"
@.str.1 = [14 x i8] c"output: [%s]\0A\00"
define i32 @main() {
%1 = alloca [75 x i8]
%2 = getelementptr inbounds [75 x i8], [75 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @stripper(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
void VIDDummyVdp2SetPriorityRBG0(__attribute((unused)) int priority) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp2SetPriorityRBG0(i32 %0) {
ret void
}
int EsLetra(char caracter) {
  if ((caracter >= 'a' && caracter <= 'z') ||
      (caracter >= 'A' && caracter <= 'Z')) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<EsLetra>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <EsLetra+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    113e <EsLetra+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     114a <EsLetra+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <EsLetra+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <EsLetra+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EsLetra>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @EsLetra(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 1, i32* %2
br label %21
20: ; preds = %15, %11
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @EsLetra(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_compile();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ lua_closefile();
scalar_t__ lua_openfile(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void compile(char *filename) {
  if (lua_openfile(filename) == 0) {
    fprintf(stderr, "luac: cannot open ");
    perror(filename);
    exit(1);
  }
  do_compile();
  lua_closefile();
}


x86 assembly (clang, -O0):
<compile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lua_openfile@plt>
cmp    $0x0,%rax
jne    11a7 <compile+0x47>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xe71(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    $0x0,%al
call   1050 <do_compile@plt>
mov    $0x0,%al
call   1070 <lua_closefile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compile>:
push   %rbx
mov    %rdi,%rbx
call   1030 <lua_openfile@plt>
test   %rax,%rax
je     117d <compile+0x1d>
xor    %eax,%eax
call   1050 <do_compile@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <lua_closefile@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"luac: cannot open \00"
define void @compile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @lua_openfile(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i32 @perror(i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = call i32 (...) @do_compile()
%14 = call i32 (...) @lua_closefile()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"luac: cannot open \00"
define void @compile(i8* %0) {
%2 = tail call i64 @lua_openfile(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = tail call i32 (...) @do_compile()
%11 = tail call i32 (...) @lua_closefile()
ret void
}
int rawStringCharPredicate(char c) { return c != '`'; }


x86 assembly (clang, -O0):
<rawStringCharPredicate>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x60,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rawStringCharPredicate>:
xor    %eax,%eax
cmp    $0x60,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @rawStringCharPredicate(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 96
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @rawStringCharPredicate(i8 signext %0) {
%2 = icmp ne i8 %0, 96
%3 = zext i1 %2 to i32
ret i32 %3
}
OP(dd, db) { op_db(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_db()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ one;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int net_reuse_addr(int fd) {
  int one = 1;
  return setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
}


x86 assembly (clang, -O0):
<net_reuse_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_reuse_addr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @net_reuse_addr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @net_reuse_addr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
int geo_has_children(double prob_node_has_children) {
  double rn = (double)rand() / RAND_MAX;
  if (rn <= prob_node_has_children)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<geo_has_children>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb8(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1159 <geo_has_children+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1160 <geo_has_children+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geo_has_children>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2ebc(%rip),%rax
divsd  (%rax),%xmm0
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @geo_has_children(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fcmp ole double %9, %10
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @geo_has_children(double %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load double, double* @RAND_MAX
%5 = fdiv double %3, %4
%6 = fcmp ole double %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
void A() {}


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

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

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

LLVM IR (-O2):
define void @A() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ act_exit();
int /*<<< orphan*/ act_save();
int /*<<< orphan*/ draw_scr();
void act_exitsave(void) {
  act_save();
  draw_scr();
  act_exit();
}


x86 assembly (clang, -O0):
<act_exitsave>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <act_save@plt>
mov    $0x0,%al
call   1040 <draw_scr@plt>
mov    $0x0,%al
call   1030 <act_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<act_exitsave>:
push   %rax
xor    %eax,%eax
call   1050 <act_save@plt>
xor    %eax,%eax
call   1040 <draw_scr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <act_exit@plt>

LLVM IR (-O0):
define void @act_exitsave() {
%1 = call i32 (...) @act_save()
%2 = call i32 (...) @draw_scr()
%3 = call i32 (...) @act_exit()
ret void
}

LLVM IR (-O2):
define void @act_exitsave() {
%1 = tail call i32 (...) @act_save()
%2 = tail call i32 (...) @draw_scr()
%3 = tail call i32 (...) @act_exit()
ret void
}
/* Variables and functions */
int fac(int);
int main(int ac, char **av) { return fac(3); }


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    $0x3,%edi
call   1030 <fac@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fac(i32 3)
ret i32 %3
}
unsigned int rand_num(unsigned int max, unsigned int state) {
  state = state * 1103515245 + 12345;
  return ((state / 65536) % max);
}


x86 assembly (clang, -O0):
<rand_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x41c64e6d,-0x8(%rbp),%eax
add    $0x3039,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_num>:
imul   $0x41c64e6d,%esi,%eax
add    $0x3039,%eax
shr    $0x10,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @rand_num(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul i32 %5, 1103515245
%7 = add i32 %6, 12345
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = udiv i32 %8, 65536
%10 = load i32, i32* %3
%11 = urem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rand_num(i32 %0, i32 %1) {
%3 = mul i32 %1, 1103515245
%4 = add i32 %3, 12345
%5 = lshr i32 %4, 16
%6 = urem i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gcom() { ol("not\t%d0"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"not\09%d0\00"
define i32 @gcom() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"not\09%d0\00"
define i32 @gcom() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
struct Tim {
  int i, j;
} * p() {
  __typeof(*p()) *r = malloc(sizeof *r);
  r->i = 5;
  r->j = 2;
  return r;
}


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

x86 assembly (clang, -O2):
<p>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movabs $0x200000005,%rcx
mov    %rcx,(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.Tim = type { i32, i32 }
define noalias %struct.Tim* @p() {
%1 = tail call dereferenceable_or_null(8) i8* @malloc(i64 8)
%2 = bitcast i8* %1 to %struct.Tim*
%3 = getelementptr inbounds %struct.Tim, %struct.Tim* %2, i64 0, i32 0
store i32 5, i32* %3
%4 = getelementptr inbounds %struct.Tim, %struct.Tim* %2, i64 0, i32 1
store i32 2, i32* %4
ret %struct.Tim* %2
}
/* Variables and functions */
int S_IREAD;
int S_IWRITE;
unsigned long creat(char const *, int);
int OS_file_create(unsigned long *p_file_handle, const char *p_filename) {
  *p_file_handle = creat(p_filename, S_IWRITE | S_IREAD);
  if (-1 == *p_file_handle)
    return 0x1004;
  return 0;
}


x86 assembly (clang, -O0):
<OS_file_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
or     (%rax),%esi
call   1030 <creat@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0xffffffffffffffff,%rax
cmp    (%rcx),%rax
jne    1165 <OS_file_create+0x55>
movl   $0x1004,-0x4(%rbp)
jmp    116c <OS_file_create+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_file_create>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%rcx
mov    0x2eb3(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    %rax,%rdi
call   1030 <creat@plt>
mov    %rax,(%rbx)
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
mov    $0x1004,%eax
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@S_IWRITE = global i32 0
@S_IREAD = global i32 0
define i32 @OS_file_create(i64* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i8*
store i64* %0, i64** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i32, i32* @S_IWRITE
%8 = load i32, i32* @S_IREAD
%9 = or i32 %7, %8
%10 = call i64 @creat(i8* %6, i32 %9)
%11 = load i64*, i64** %4
store i64 %10, i64* %11
%12 = load i64*, i64** %4
%13 = load i64, i64* %12
%14 = icmp eq i64 -1, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 4100, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@S_IWRITE = global i32 0
@S_IREAD = global i32 0
define i32 @OS_file_create(i64* nocapture writeonly %0, i8* %1) {
%3 = load i32, i32* @S_IWRITE
%4 = load i32, i32* @S_IREAD
%5 = or i32 %4, %3
%6 = tail call i64 @creat(i8* %1, i32 %5)
store i64 %6, i64* %0
%7 = icmp eq i64 %6, -1
%8 = select i1 %7, i32 4100, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute__((visibility("default"))) void bench_ffi_trace(void) {}


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

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

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

LLVM IR (-O2):
define void @bench_ffi_trace() {
ret void
}
void wifi_rsp_dfu_flash_upload(
    const struct wifi_msg_dfu_flash_upload_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_dfu_flash_upload_rsp_t = type opaque
define void @wifi_rsp_dfu_flash_upload(%struct.wifi_msg_dfu_flash_upload_rsp_t* nocapture %0) {
ret void
}
float _marshall_getfloat(const void *pBuf) {
  float f;
  ((char *)(&f))[0] = ((char *)(pBuf))[3],
         ((char *)(&f))[1] = ((char *)(pBuf))[2],
         ((char *)(&f))[2] = ((char *)(pBuf))[1],
         ((char *)(&f))[3] = ((char *)(pBuf))[0];
  return f;
}


x86 assembly (clang, -O0):
<_marshall_getfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_marshall_getfloat>:
mov    (%rdi),%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @_marshall_getfloat(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = bitcast float* %3 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = bitcast float* %3 to i8*
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = bitcast float* %3 to i8*
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = bitcast float* %3 to i8*
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
%24 = load float, float* %3
ret float %24
}

LLVM IR (-O2):
define float @_marshall_getfloat(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %14, %17
%19 = bitcast i32 %18 to float
ret float %19
}
/* Variables and functions */
int flower(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a;
  scanf("%d", &a);
  if (flower(a) == 1)
    printf("YES");
  else
    printf("NO");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <flower@plt>
cmp    $0x1,%eax
jne    1171 <main+0x41>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
jmp    117d <main+0x4d>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <flower@plt>
cmp    $0x1,%eax
lea    0xeae(%rip),%rax
lea    0xeab(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @flower(i32 %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @flower(i32 %4)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
int minstrel_ewma(int old, int new, int weight) {
  return (new *(128 - weight) + old *weight) / 128;
}


x86 assembly (clang, -O0):
<minstrel_ewma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x80,%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<minstrel_ewma>:
mov    $0x80,%ecx
sub    %edx,%ecx
imul   %esi,%ecx
imul   %edx,%edi
lea    (%rcx,%rdi,1),%eax
add    $0x7f,%eax
add    %edi,%ecx
cmovns %ecx,%eax
sar    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @minstrel_ewma(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* %5
%8 = load i32, i32* %6
%9 = sub nsw i32 128, %8
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %10, %13
%15 = sdiv i32 %14, 128
ret i32 %15
}

LLVM IR (-O2):
define i32 @minstrel_ewma(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 128, %2
%5 = mul nsw i32 %4, %1
%6 = mul nsw i32 %2, %0
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %7, 128
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strstr(char *, char *);
void find_ext(char *file_name, char *ext) {
  char *ret;
  ret = strstr(file_name, ext);
  printf("%s", ret);
}


x86 assembly (clang, -O0):
<find_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_ext>:
push   %rax
call   1040 <strstr@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @find_ext(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 = load i8*, i8** %4
%8 = call i8* @strstr(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @find_ext(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int strcmp(const char *s1, const char *s2) {
  for (; *s1 == *s2; s1++, s2++)
    if (*s1 == '\0')
      return 0;
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <strcmp+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <strcmp+0x73>
jmp    1143 <strcmp+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ assert(int);
int mean(int *, int, int *);
void test_too_small_sum(void) {
  int res;
  int arr[] = {INT_MAX, INT_MAX};
  assert((mean(arr, 2, &res) == 3));
}


x86 assembly (clang, -O0):
<test_too_small_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
lea    -0x4(%rbp),%rdx
call   1040 <mean@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_too_small_sum>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    %eax,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x14(%rsp),%rdx
mov    $0x2,%esi
call   1040 <mean@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @test_too_small_sum() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = load i32, i32* @INT_MAX
store i32 %4, i32* %3
%5 = getelementptr inbounds i32, i32* %3, i64 1
%6 = load i32, i32* @INT_MAX
store i32 %6, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = call i32 @mean(i32* %7, i32 2, i32* %1)
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @test_too_small_sum() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* @INT_MAX
store i32 %6, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 %6, i32* %7
%8 = call i32 @mean(i32* %5, i32 2, i32* %1)
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}
double k_sin(double x) {
  double retval;
  __asm__ __volatile__("fldl %0\n" : : "m"(x));
  __asm__ __volatile__("fsin\n");
  __asm__ __volatile__("fstpl %0\n"
                       "fwait\n"
                       : "=m"(retval));
  return retval;
}


x86 assembly (clang, -O0):
<k_sin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
fsin
fstpl  -0x10(%rbp)
fwait
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_sin>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fsin
fstpl  -0x10(%rsp)
fwait
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @k_sin(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @k_sin(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = bitcast double* %3 to i8*
%5 = load double, double* %3
ret double %5
}
void rop3_198_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_198_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_198_1_0>:
not    %dl
or     %sil,%dl
and    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_198_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_198_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %2, -1
%6 = or i8 %5, %1
%7 = and i8 %4, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
unsigned char VIM_HIF_GetReg8(int);
unsigned char VIM_JPEG_GetStatus(void) {
  return VIM_HIF_GetReg8((0x0000 + 0x002));
}


x86 assembly (clang, -O0):
<VIM_JPEG_GetStatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <VIM_HIF_GetReg8@plt>
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @VIM_JPEG_GetStatus() {
%1 = call zeroext i8 @VIM_HIF_GetReg8(i32 2)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @VIM_JPEG_GetStatus() {
%1 = tail call zeroext i8 @VIM_HIF_GetReg8(i32 2)
ret i8 %1
}
/* Variables and functions */
double exp(double);
double myexp(double x) {
  if (x < -70)
    return 0.0;
  else
    return exp(x);
}


x86 assembly (clang, -O0):
<myexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <myexp+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <myexp+0x3c>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myexp>:
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1123 <myexp+0x13>
xorpd  %xmm0,%xmm0
ret
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @myexp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, -7.000000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @exp(double %8)
store double %9, double* %2
br label %10
10: ; preds = %7, %6
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @myexp(double %0) {
%2 = fcmp olt double %0, -7.000000e+01
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @exp(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, void *);
char *xmalloc(int);
char *ptoa(void *pointer) {
  char *string;
  string = xmalloc(sizeof(long) * sizeof(char));
  sprintf(string, "%p", pointer);
  return string;
}


x86 assembly (clang, -O0):
<ptoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptoa>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x8,%edi
call   1030 <xmalloc@plt>
mov    %rax,%rbx
lea    0xec5(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%p\00"
define i8* @ptoa(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @xmalloc(i32 8)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i8* @ptoa(i8* %0) {
%2 = tail call i8* @xmalloc(i32 8)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}