xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "Usage: mount [-a] [-r] [-e] [-t type] [-o options] special name\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: mount [-a] [-r] [-e] [-t type] [-o options] special name\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: mount [-a] [-r] [-e] [-t type] [-o options] special name\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mcal_cpu_nop();
void __vector_unused_irq() {
  for (;;) {
    mcal_cpu_nop();
  }
}


x86 assembly (clang, -O0):
<__vector_unused_irq>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <__vector_unused_irq+0x9>
mov    $0x0,%al
call   1030 <mcal_cpu_nop@plt>
jmp    1119 <__vector_unused_irq+0x9>

x86 assembly (clang, -O2):
<__vector_unused_irq>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mcal_cpu_nop@plt>
jmp    1120 <__vector_unused_irq+0x10>

LLVM IR (-O0):
define void @__vector_unused_irq() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @mcal_cpu_nop()
br label %1
}

LLVM IR (-O2):
define void @__vector_unused_irq() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @mcal_cpu_nop()
br label %1
}
/* Variables and functions */
scalar_t__ smrand_do();
float smrand_uniform_do() {
  return 2 * (float)smrand_do() / (float)(0xffffffffUL) - 1;
}


x86 assembly (clang, -O0):
<smrand_uniform_do>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <smrand_do@plt>
cvtsi2ss %rax,%xmm1
movss  0xee0(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  0xed0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xec0(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<smrand_uniform_do>:
push   %rax
xor    %eax,%eax
call   1030 <smrand_do@plt>
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
mulss  0xed7(%rip),%xmm0
addss  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @smrand_uniform_do() {
%1 = call i64 (...) @smrand_do()
%2 = sitofp i64 %1 to float
%3 = fmul float 2.000000e+00, %2
%4 = fdiv float %3, 0x41F0000000000000
%5 = fsub float %4, 1.000000e+00
ret float %5
}

LLVM IR (-O2):
define float @smrand_uniform_do() {
%1 = tail call i64 (...) @smrand_do()
%2 = sitofp i64 %1 to float
%3 = fmul float %2, 2.000000e+00
%4 = fmul float %3, 0x3DF0000000000000
%5 = fadd float %4, -1.000000e+00
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ getyx(int /*<<< orphan*/ *, int, int);
void ncurses_getyx(WINDOW *win, int *y, int *x) { getyx(win, *y, *x); }


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

x86 assembly (clang, -O2):
<ncurses_getyx>:
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <getyx@plt>

LLVM IR (-O0):
define void @ncurses_getyx(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* %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 @getyx(i32* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @ncurses_getyx(i32* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 @getyx(i32* %0, i32 %4, i32 %5)
ret void
}
int getlen(const char *s) { return s[6]; }


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

x86 assembly (clang, -O2):
<getlen>:
movsbl 0x6(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 6
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @getlen(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _merge_sort(int *, int /*<<< orphan*/, int);
void merge_sort(int array[], int size) { _merge_sort(array, 0, size - 1); }


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

x86 assembly (clang, -O2):
<merge_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <_merge_sort@plt>

LLVM IR (-O0):
define void @merge_sort(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 = sub nsw i32 %6, 1
%8 = call i32 @_merge_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @_merge_sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int Scl_ConHasInArrs_(int /*<<< orphan*/);
int /*<<< orphan*/ Scl_ConReadMan();
int Scl_ConHasInArrs() { return Scl_ConHasInArrs_(Scl_ConReadMan()); }


x86 assembly (clang, -O0):
<Scl_ConHasInArrs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
call   1030 <Scl_ConHasInArrs_@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Scl_ConHasInArrs() {
%1 = call i32 (...) @Scl_ConReadMan()
%2 = call i32 @Scl_ConHasInArrs_(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @Scl_ConHasInArrs() {
%1 = tail call i32 (...) @Scl_ConReadMan()
%2 = tail call i32 @Scl_ConHasInArrs_(i32 %1)
ret i32 %2
}
__attribute__((aarch64_vector_pcs)) void f_def_vpcs(void) {}


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

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

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

LLVM IR (-O2):
define void @f_def_vpcs() {
ret void
}
/* Variables and functions */
char *path_basename(char *);
int /*<<< orphan*/ sscanf(char const *, char *, char *);
char *xxstrdup(char *);
char *get_rule_number(char *filename) {
  char name[1024];
  const char *base = path_basename(filename);
  sscanf(base,
         "resource-rule-"
         "%6c"
         ".summary",
         name);
  return xxstrdup(name);
}


x86 assembly (clang, -O0):
<get_rule_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <path_basename@plt>
mov    %rax,-0x418(%rbp)
mov    -0x418(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1040 <sscanf@plt>
lea    -0x410(%rbp),%rdi
call   1050 <xxstrdup@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rule_number>:
push   %rbx
sub    $0x400,%rsp
call   1030 <path_basename@plt>
lea    0xebc(%rip),%rsi
mov    %rsp,%rbx
mov    %rax,%rdi
mov    %rbx,%rdx
call   1040 <sscanf@plt>
mov    %rbx,%rdi
call   1050 <xxstrdup@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"resource-rule-%6c.summary\00"
define i8* @get_rule_number(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @path_basename(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%11 = call i8* @xxstrdup(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"resource-rule-%6c.summary\00"
define i8* @get_rule_number(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @path_basename(i8* %0)
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i8* @xxstrdup(i8* %3)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void clean_stdin(void) { fflush(stdin); }


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

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

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

LLVM IR (-O2):
@stdin = global i32 0
define void @clean_stdin() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Variables and functions */
int abs(float);
float sigmoidFast(float x) { return x / (1 + abs(x)); }


x86 assembly (clang, -O0):
<sigmoidFast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <abs@plt>
movss  -0x8(%rbp),%xmm0
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoidFast>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <abs@plt>
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sigmoidFast(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call i32 @abs(float %4)
%6 = add nsw i32 1, %5
%7 = sitofp i32 %6 to float
%8 = fdiv float %3, %7
ret float %8
}

LLVM IR (-O2):
define float @sigmoidFast(float %0) {
%2 = tail call i32 @abs(float %0)
%3 = add nsw i32 %2, 1
%4 = sitofp i32 %3 to float
%5 = fdiv float %0, %4
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ I2C_Recv2(int /*<<< orphan*/);
int /*<<< orphan*/ I2C_Send3(int /*<<< orphan*/, int, int, int);
void lightsensorstart(uint8_t slaveAddress) {
  I2C_Send3(slaveAddress, 0x02, 0xC0, 0x00);
  I2C_Send3(slaveAddress, 0x01, 0xCA, 0x10);
  I2C_Recv2(slaveAddress);
}


x86 assembly (clang, -O0):
<lightsensorstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
mov    $0xc0,%edx
xor    %ecx,%ecx
call   1040 <I2C_Send3@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0xca,%edx
mov    $0x10,%ecx
call   1040 <I2C_Send3@plt>
mov    -0x4(%rbp),%edi
call   1030 <I2C_Recv2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lightsensorstart>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
mov    $0xc0,%edx
xor    %ecx,%ecx
call   1040 <I2C_Send3@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0xca,%edx
mov    $0x10,%ecx
call   1040 <I2C_Send3@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <I2C_Recv2@plt>

LLVM IR (-O0):
define void @lightsensorstart(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @I2C_Send3(i32 %3, i32 2, i32 192, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @I2C_Send3(i32 %5, i32 1, i32 202, i32 16)
%7 = load i32, i32* %2
%8 = call i32 @I2C_Recv2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @lightsensorstart(i32 %0) {
%2 = tail call i32 @I2C_Send3(i32 %0, i32 2, i32 192, i32 0)
%3 = tail call i32 @I2C_Send3(i32 %0, i32 1, i32 202, i32 16)
%4 = tail call i32 @I2C_Recv2(i32 %0)
ret void
}
/* Variables and functions */
float __ocml_erfcx_f32(float);
float erfcxf(float x) { return __ocml_erfcx_f32(x); }


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

x86 assembly (clang, -O2):
<erfcxf>:
jmp    1030 <__ocml_erfcx_f32@plt>

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

LLVM IR (-O2):
define float @erfcxf(float %0) {
%2 = tail call float @__ocml_erfcx_f32(float %0)
ret float %2
}
/* Variables and functions */
int gui_getk();
int /*<<< orphan*/ *strchr(char *, int);
int /*<<< orphan*/ usleep(int);
int gui_wait_for_key(char *s) {
  int c;
  while (1) {
    while ((c = gui_getk()) != 0) {
      if (strchr(s, c) != NULL)
        return c;
    }
    usleep(10000);
  }
}


x86 assembly (clang, -O0):
<gui_wait_for_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1141 <gui_wait_for_key+0x11>
mov    $0x0,%al
call   1030 <gui_getk@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1178 <gui_wait_for_key+0x48>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1173 <gui_wait_for_key+0x43>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1141 <gui_wait_for_key+0x11>
mov    $0x2710,%edi
call   1050 <usleep@plt>
jmp    113c <gui_wait_for_key+0xc>

x86 assembly (clang, -O2):
<gui_wait_for_key>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
jmp    114a <gui_wait_for_key+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x2710,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
call   1030 <gui_getk@plt>
test   %eax,%eax
je     1140 <gui_wait_for_key+0x10>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     114a <gui_wait_for_key+0x1a>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @gui_wait_for_key(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %16
br label %5
5: ; preds = %15, %4
%6 = call i32 (...) @gui_getk()
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = call i32* @strchr(i8* %9, i32 %10)
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i32, i32* %3
ret i32 %14
15: ; preds = %8
br label %5
16: ; preds = %5
%17 = call i32 @usleep(i32 10000)
br label %4
}

LLVM IR (-O2):
define i32 @gui_wait_for_key(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = tail call i32 (...) @gui_getk()
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32* @strchr(i8* %0, i32 %3)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %5, %10
br label %2
9: ; preds = %5
ret i32 %3
10: ; preds = %2
%11 = tail call i32 @usleep(i32 10000)
br label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putch(char);
main() {
  int x = 2;
  printf(" %d \n", x);
  printf("a = %d\t", (int)(x * 2 + 3.14));
  ;
  putch('\n');
  ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <putch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <putch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %d \0A\00"
@.str.1 = [8 x i8] c"a = %d\09\00"
define i32 @main() {
%1 = alloca i32
store i32 2, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, 2
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 3.140000e+00
%8 = fptosi double %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @putch(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c" %d \0A\00"
@.str.1 = [8 x i8] c"a = %d\09\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%3 = tail call i32 @putch(i8 signext 10)
ret i32 0
}
void genaddu() {}


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

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

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

LLVM IR (-O2):
define void @genaddu() {
ret void
}
unsigned bitCount_fun_ushort(unsigned short x) {
  unsigned r = x & 1;
  while (x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
cmp    $0x0,%ax
je     113c <bitCount_fun_ushort+0x3c>
movzwl -0x2(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <bitCount_fun_ushort+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_ushort>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x2,%di
jb     1124 <bitCount_fun_ushort+0x24>
nopl   0x0(%rax,%rax,1)
movzwl %di,%ecx
mov    %ecx,%edi
shr    %edi
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
cmp    $0x3,%cx
ja     1110 <bitCount_fun_ushort+0x10>
ret

LLVM IR (-O0):
define i32 @bitCount_fun_ushort(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = and i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %13, %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 1
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
%12 = icmp ne i16 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %7
%14 = load i16, i16* %2
%15 = zext i16 %14 to i32
%16 = and i32 %15, 1
%17 = load i32, i32* %3
%18 = add i32 %17, %16
store i32 %18, i32* %3
br label %7
19: ; preds = %7
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @bitCount_fun_ushort(i16 zeroext %0) {
%2 = and i16 %0, 1
%3 = zext i16 %2 to i32
%4 = icmp ult i16 %0, 2
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i16 [ %8, %5 ], [ %0, %1 ]
%7 = phi i32 [ %11, %5 ], [ %3, %1 ]
%8 = lshr i16 %6, 1
%9 = and i16 %8, 1
%10 = zext i16 %9 to i32
%11 = add i32 %7, %10
%12 = icmp ult i16 %6, 4
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ %3, %1 ], [ %11, %5 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
void set_XCirculateEvent_window(void *_p, unsigned long _v) {
  ((XCirculateEvent *)_p)->window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XCirculateEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int SpeedGet(int d) {
  int i;
  for (i = 8; i > 0; i--) {
    if (d > 0x100 << i)
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<SpeedGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1147 <SpeedGet+0x47>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x100,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jle    1134 <SpeedGet+0x34>
jmp    1147 <SpeedGet+0x47>
jmp    1139 <SpeedGet+0x39>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <SpeedGet+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SpeedGet>:
mov    $0x8,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x100,%eax
shl    %cl,%eax
sub    $0x1,%ecx
jb     1120 <SpeedGet+0x20>
cmp    %edi,%eax
jge    1110 <SpeedGet+0x10>
add    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @SpeedGet(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 8, %1 ], [ %8, %2 ]
%4 = icmp eq i32 %3, 0
%5 = shl i32 256, %3
%6 = icmp slt i32 %5, %0
%7 = select i1 %4, i1 true, i1 %6
%8 = add nsw i32 %3, -1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ spi_arch_select(int);
void spi_arch_deselect_all(void) { spi_arch_select(~(0x01 | 0x02 | 0x04)); }


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

x86 assembly (clang, -O2):
<spi_arch_deselect_all>:
mov    $0xfffffff8,%edi
jmp    1030 <spi_arch_select@plt>

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

LLVM IR (-O2):
define void @spi_arch_deselect_all() {
%1 = tail call i32 @spi_arch_select(i32 -8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sound_Play(double, int);
void Tone4() { Sound_Play(27.5, 250); }


x86 assembly (clang, -O0):
<Tone4>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
mov    $0xfa,%edi
call   1030 <Sound_Play@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tone4>:
movsd  0xee8(%rip),%xmm0
mov    $0xfa,%edi
jmp    1030 <Sound_Play@plt>

LLVM IR (-O0):
define void @Tone4() {
%1 = call i32 @Sound_Play(double 2.750000e+01, i32 250)
ret void
}

LLVM IR (-O2):
define void @Tone4() {
%1 = tail call i32 @Sound_Play(double 2.750000e+01, i32 250)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
scalar_t__ xmalloc(int);
char *pstrdup(char *src) {
  int len = src[0];
  char *obuf = (char *)xmalloc(len + 1);
  memcpy(obuf, src + 1, len);
  obuf[len] = 0;
  return obuf;
}


x86 assembly (clang, -O0):
<pstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
movsbq (%rdi),%r14
lea    0x1(%r14),%edi
call   1030 <xmalloc@plt>
mov    %rax,%r15
add    $0x1,%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <memcpy@plt>
movb   $0x0,(%r15,%r14,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @pstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = call i64 @xmalloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i32, i32* %3
%17 = call i32 @memcpy(i8* %13, i8* %15, i32 %16)
%18 = load i8*, i8** %4
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 0, i8* %21
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @pstrdup(i8* %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, 1
%5 = tail call i64 @xmalloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i32 @memcpy(i8* %6, i8* %7, i32 %3)
%9 = sext i8 %2 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8 0, i8* %10
ret i8* %6
}
int metres_to_feet(int metres) { return (metres * 840) / 256; }


x86 assembly (clang, -O0):
<metres_to_feet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x348,-0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<metres_to_feet>:
imul   $0x348,%edi,%ecx
lea    0xff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @metres_to_feet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 840
%5 = sdiv i32 %4, 256
ret i32 %5
}

LLVM IR (-O2):
define i32 @metres_to_feet(i32 %0) {
%2 = mul nsw i32 %0, 840
%3 = sdiv i32 %2, 256
ret i32 %3
}
/* Type definitions */
struct PMC {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void never_ever(int interp, struct PMC *pmc) { abort(); }


x86 assembly (clang, -O0):
<never_ever>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<never_ever>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.PMC = type { i32 }
define void @never_ever(i32 %0, %struct.PMC* %1) {
%3 = alloca i32
%4 = alloca %struct.PMC*
store i32 %0, i32* %3
store %struct.PMC* %1, %struct.PMC** %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.PMC = type { i32 }
define void @never_ever(i32 %0, %struct.PMC* nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
void troca(int *a, int *b) {
  int aux;
  aux = *a;
  *a = *b;
  *b = aux;
}


x86 assembly (clang, -O0):
<troca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<troca>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @troca(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int CHAR_BIT;
int /*<<< orphan*/ assert(int);
void get_bit(volatile uint32_t *current, uint8_t shift, bool *value) {
  assert(shift <= (sizeof((*current)) * CHAR_BIT - 1));
  *value = *current & (1 << shift);
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0xc(%rbp),%rax
mov    0x2eb2(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x1c(%rbp),%ecx
and    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
movslq %esi,%rbx
mov    0x2ebb(%rip),%rax
movslq (%rax),%rax
lea    -0x1(,%rax,4),%rax
ff
xor    %edi,%edi
cmp    %rbx,%rax
setae  %dil
call   1030 <assert@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
and    (%r15),%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define void @get_bit(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 = sext i32 %7 to i64
%9 = load i32, i32* @CHAR_BIT
%10 = sext i32 %9 to i64
%11 = mul i64 4, %10
%12 = sub i64 %11, 1
%13 = icmp ule i64 %8, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32*, i32** %4
%17 = load volatile i32, i32* %16
%18 = load i32, i32* %5
%19 = shl i32 1, %18
%20 = and i32 %17, %19
%21 = load i32*, i32** %6
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define void @get_bit(i32* %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sext i32 %1 to i64
%5 = load i32, i32* @CHAR_BIT
%6 = sext i32 %5 to i64
%7 = shl nsw i64 %6, 2
%8 = add nsw i64 %7, -1
%9 = icmp uge i64 %8, %4
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = load volatile i32, i32* %0
%13 = shl nuw i32 1, %1
%14 = and i32 %12, %13
store i32 %14, i32* %2
ret void
}
OP(fd, cc) {
  illegal_1();
  op_cc();
}


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 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_cc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_cc@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 (...) @illegal_1()
%7 = call i32 (...) @op_cc()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_cc()
ret i32 undef
}
void ptrace_sandbox_permit_sigreturn(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_sigreturn(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeString(char *);
void reset_hdmi_chip(void) {
  (*(volatile unsigned char *)((0x900000007F00B080ULL)) = 0);
  writeString("Reset HDMI chip");
  (*(volatile unsigned char *)((0x900000007F00B080ULL)) = 1);
}


x86 assembly (clang, -O0):
<reset_hdmi_chip>:
push   %rbp
mov    %rsp,%rbp
movabs $0x900000007f00b080,%rax
movb   $0x0,(%rax)
lea    0xed8(%rip),%rdi
call   1030 <writeString@plt>
movabs $0x900000007f00b080,%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_hdmi_chip>:
push   %rbx
movabs $0x900000007f00b080,%rbx
movb   $0x0,(%rbx)
lea    0xedb(%rip),%rdi
call   1030 <writeString@plt>
movb   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Reset HDMI chip\00"
define void @reset_hdmi_chip() {
store volatile i8 0, i8* inttoptr (i64 -8070450530117177216 to i8*)
%1 = call i32 @writeString(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store volatile i8 1, i8* inttoptr (i64 -8070450530117177216 to i8*)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Reset HDMI chip\00"
define void @reset_hdmi_chip() {
store volatile i8 0, i8* inttoptr (i64 -8070450530117177216 to i8*)
%1 = tail call i32 @writeString(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store volatile i8 1, i8* inttoptr (i64 -8070450530117177216 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void anp_sys_free(void *addr, int type) { free(addr); }


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

x86 assembly (clang, -O2):
<anp_sys_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @anp_sys_free(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_track_new(void *bus, void **track, void *handler, void *userdata) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_track_new>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_track_new>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_track_new(i8* %0, i8** %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_track_new(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
void vlan_gvrp_request_leave(const struct net_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define void @vlan_gvrp_request_leave(%struct.net_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_fail(char const *, int, char *, int);
void assert_true_(const char *file, int line, int cond) {
  if (!cond) {
    assert_fail(file, line, "Expected <true> but was <%d>", cond);
  }
}


x86 assembly (clang, -O0):
<assert_true_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1142 <assert_true_+0x32>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xec3(%rip),%rdx
call   1030 <assert_fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_true_>:
test   %edx,%edx
je     1115 <assert_true_+0x5>
ret
lea    0xee4(%rip),%rdx
xor    %ecx,%ecx
jmp    1030 <assert_fail@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Expected <true> but was <%d>\00"
define void @assert_true_(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
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @assert_fail(i8* %10, i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Expected <true> but was <%d>\00"
define void @assert_true_(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @assert_fail(i8* %0, i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 0)
br label %7
7: ; preds = %5, %3
ret void
}
void *drop(void *_set, const void *_element) {
  int *element = find(_set, _element);
  if (element)
    *element = 10;
  return element;
}


x86 assembly (clang, -O0):
<drop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <find@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <drop+0x3a>
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop>:
push   %rax
xor    %eax,%eax
call   1030 <find@plt>
cltq
test   %eax,%eax
je     1124 <drop+0x14>
movl   $0xa,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @drop(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @find to i32 (i8*, i8*, ...)*)(i8* %6, i8* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32*, i32** %5
store i32 10, i32* %14
br label %15
15: ; preds = %13, %2
%16 = load i32*, i32** %5
%17 = bitcast i32* %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
define i8* @drop(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @find to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = inttoptr i64 %4 to i32*
store i32 10, i32* %7
br label %8
8: ; preds = %6, %2
%9 = inttoptr i64 %4 to i8*
ret i8* %9
}
/* Variables and functions */
int countwithin(int /*<<< orphan*/, int /*<<< orphan*/, char);
int /*<<< orphan*/ winend();
int /*<<< orphan*/ winstart();
int count(char c) { return countwithin(winstart(), winend(), c); }


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <winstart@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <winend@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
movsbl -0x1(%rbp),%edx
call   1040 <countwithin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <winstart@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <winend@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <countwithin@plt>

LLVM IR (-O0):
define i32 @count(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @winstart()
%4 = call i32 (...) @winend()
%5 = load i8, i8* %2
%6 = call i32 @countwithin(i32 %3, i32 %4, i8 signext %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @count(i8 signext %0) {
%2 = tail call i32 (...) @winstart()
%3 = tail call i32 (...) @winend()
%4 = tail call i32 @countwithin(i32 %2, i32 %3, i8 signext %0)
ret i32 %4
}
void sb800_prefetch(struct device *dev, int on) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.device = type opaque
define void @sb800_prefetch(%struct.device* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cumbet(double *, double *, double *, double *, double *,
                          double *);
double betadf(double x, double p, double q) {
  double xx = x, yy = 1.0 - x, aa = p, bb = q, pp, qq;
  cumbet(&xx, &yy, &aa, &bb, &pp, &qq);
  return pp;
}


x86 assembly (clang, -O0):
<betadf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
lea    -0x40(%rbp),%r8
lea    -0x48(%rbp),%r9
call   1030 <cumbet@plt>
movsd  -0x40(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<betadf>:
sub    $0x38,%rsp
movsd  %xmm0,0x28(%rsp)
movsd  0xede(%rip),%xmm3
subsd  %xmm0,%xmm3
movsd  %xmm3,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
lea    0x28(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x30(%rsp),%r9
call   1030 <cumbet@plt>
movsd  0x8(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @betadf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%13 = load double, double* %4
store double %13, double* %7
%14 = load double, double* %4
%15 = fsub double 1.000000e+00, %14
store double %15, double* %8
%16 = load double, double* %5
store double %16, double* %9
%17 = load double, double* %6
store double %17, double* %10
%18 = call i32 @cumbet(double* %7, double* %8, double* %9, double* %10, double* %11, double* %12)
%19 = load double, double* %11
ret double %19
}

LLVM IR (-O2):
define double @betadf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = bitcast double* %4 to i8*
store double %0, double* %4
%11 = bitcast double* %5 to i8*
%12 = fsub double 1.000000e+00, %0
store double %12, double* %5
%13 = bitcast double* %6 to i8*
store double %1, double* %6
%14 = bitcast double* %7 to i8*
store double %2, double* %7
%15 = bitcast double* %8 to i8*
%16 = bitcast double* %9 to i8*
%17 = call i32 @cumbet(double* %4, double* %5, double* %6, double* %7, double* %8, double* %9)
%18 = load double, double* %8
ret double %18
}
/* Variables and functions */
int(Memento_setParanoia)(int i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Memento_setParanoia(i32 %0) {
ret i32 0
}
/* Variables and functions */
char *concat(char *, char *);
char *gpioPath(char *gpio_number) {
  return concat("/sys/class/gpio/gpio", gpio_number);
}


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

x86 assembly (clang, -O2):
<gpioPath>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <concat@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"/sys/class/gpio/gpio\00"
define i8* @gpioPath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @concat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"/sys/class/gpio/gpio\00"
define i8* @gpioPath(i8* %0) {
%2 = tail call i8* @concat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
void EC_POINT_add(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_add() {
ret void
}
__attribute__((always_)) void set_64bit(volatile unsigned long *ptr,
                                        unsigned long val) {
  *ptr = val;
}


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

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

LLVM IR (-O0):
define void @set_64bit(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64*, i64** %3
store volatile i64 %5, i64* %6
ret void
}

LLVM IR (-O2):
define void @set_64bit(i64* %0, i64 %1) {
store volatile i64 %1, i64* %0
ret void
}
int searchMapsLine() { return 1; }


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

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

LLVM IR (-O0):
define i32 @searchMapsLine() {
ret i32 1
}

LLVM IR (-O2):
define i32 @searchMapsLine() {
ret i32 1
}
/* Variables and functions */
long add1(int);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  long result;
  scanf("%d", &n);
  result = add1(n);
  printf("Sum = %ld\n", result);
  return 0;
}


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   1040 <add1@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Sum = %ld\0A\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 i64 @add1(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i64 %5)
ret i32 0
}