xunge/DecIR huggingface dataset:
void mdp4_dsi_video_pipe_queue(int cndx, struct mdp4_overlay_pipe *pipe) {}


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

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

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

LLVM IR (-O2):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_dsi_video_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char const *);
void die(const char *error) {
  puts(error);
  exit(1);
}


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

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int pr_getchan(int, int *, int *);
int ProcessGetChan(int pid, int *inchan, int *outchan) {
  return pr_getchan(pid, inchan, outchan);
}


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

x86 assembly (clang, -O2):
<ProcessGetChan>:
jmp    1030 <pr_getchan@plt>

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

LLVM IR (-O2):
define i32 @ProcessGetChan(i32 %0, i32* %1, i32* %2) {
%4 = tail call i32 @pr_getchan(i32 %0, i32* %1, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u64_t1ha64s_data64(int /*<<< orphan*/ const *, size_t,
                                           uintptr_t);
uint64_t rgph_u64_t1ha64s_u64a(const uint64_t *key, size_t len,
                               uintptr_t seed) {
  return rgph_u64_t1ha64s_data64(key, len, seed);
}


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

x86 assembly (clang, -O2):
<rgph_u64_t1ha64s_u64a>:
jmp    1030 <rgph_u64_t1ha64s_data64@plt>

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

LLVM IR (-O2):
define i32 @rgph_u64_t1ha64s_u64a(i32* %0, i64 %1, i64 %2) {
%4 = tail call i32 @rgph_u64_t1ha64s_data64(i32* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
double the_middle_of2(double, double);
double the_middle_of(double a, double b) {
  double r = 0;
  double s = a + b;
  return the_middle_of2(r - 1.0, s - (s / 2.F - 1.0));
}


x86 assembly (clang, -O0):
<the_middle_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  0xeac(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  0xe98(%rip),%xmm3
subsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
call   1030 <the_middle_of2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<the_middle_of>:
addsd  %xmm0,%xmm1
movsd  0xee4(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  0xee0(%rip),%xmm0
addsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
jmp    1030 <the_middle_of2@plt>

LLVM IR (-O0):
define double @the_middle_of(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fadd double %7, %8
store double %9, double* %6
%10 = load double, double* %5
%11 = fsub double %10, 1.000000e+00
%12 = load double, double* %6
%13 = load double, double* %6
%14 = fdiv double %13, 2.000000e+00
%15 = fsub double %14, 1.000000e+00
%16 = fsub double %12, %15
%17 = call double @the_middle_of2(double %11, double %16)
ret double %17
}

LLVM IR (-O2):
define double @the_middle_of(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, 5.000000e-01
%5 = fadd double %4, -1.000000e+00
%6 = fsub double %3, %5
%7 = tail call double @the_middle_of2(double -1.000000e+00, double %6)
ret double %7
}
double c2f(double c) { return 9.0 * c / 5.0 + 32.0; }


x86 assembly (clang, -O0):
<c2f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2f>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @c2f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 9.000000e+00, %3
%5 = fdiv double %4, 5.000000e+00
%6 = fadd double %5, 3.200000e+01
ret double %6
}

LLVM IR (-O2):
define double @c2f(double %0) {
%2 = fmul double %0, 9.000000e+00
%3 = fdiv double %2, 5.000000e+00
%4 = fadd double %3, 3.200000e+01
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a = 0;
  int b = 0;
  scanf("%d %d", &a, &b);
  double average = (a + b) / 2.0;
  printf("%d和%d的平均值 = %f\n", a, b, average);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe9d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    (%rdx,%rsi,1),%eax
cvtsi2sd %eax,%xmm0
mulsd  0xea6(%rip),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [26 x i8] c"%d\E5\92\8C%d\E7\9A\84\E5\B9\B3\E5\9D\87\E5\80\BC = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 2.000000e+00
store double %10, double* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load double, double* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12, double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [26 x i8] c"%d\E5\92\8C%d\E7\9A\84\E5\B9\B3\E5\9D\87\E5\80\BC = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 5.000000e-01
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, double %10)
ret i32 0
}
double berechne_durchschnittsverbrauch_us_mi_pro_gal(double strecke,
                                                     double verbrauch) {
  double durchschnittsverbrauch = strecke / verbrauch;
  return durchschnittsverbrauch;
}


x86 assembly (clang, -O0):
<berechne_durchschnittsverbrauch_us_mi_pro_gal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_durchschnittsverbrauch_us_mi_pro_gal>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @berechne_durchschnittsverbrauch_us_mi_pro_gal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @berechne_durchschnittsverbrauch_us_mi_pro_gal(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
void outl(unsigned int value, unsigned short port) {
  asm volatile("out"
               "l"
               " %"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outl(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy_bug();
int main(int argc, char *argv[]) {
  memcpy_bug();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @memcpy_bug()
ret i32 0
}
/* Variables and functions */
unsigned int SYS32_SetBit(unsigned short, unsigned int);
scalar_t__ pow(double, double);
unsigned int SYS32_ClrBit(unsigned short bit, unsigned int value) {
  value = SYS32_SetBit(bit, value);
  return (value ^ (unsigned int)(pow(2.0, (double)bit)));
}


x86 assembly (clang, -O0):
<SYS32_ClrBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <SYS32_SetBit@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xea9(%rip),%xmm0
call   1040 <pow@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYS32_ClrBit>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <SYS32_SetBit@plt>
mov    %eax,%ebp
cvtsi2sd %ebx,%xmm1
movsd  0xec8(%rip),%xmm0
call   1040 <pow@plt>
xor    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SYS32_ClrBit(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = load i32, i32* %4
%7 = call i32 @SYS32_SetBit(i16 zeroext %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i16, i16* %3
%10 = uitofp i16 %9 to double
%11 = call i64 @pow(double 2.000000e+00, double %10)
%12 = trunc i64 %11 to i32
%13 = xor i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @SYS32_ClrBit(i16 zeroext %0, i32 %1) {
%3 = tail call i32 @SYS32_SetBit(i16 zeroext %0, i32 %1)
%4 = uitofp i16 %0 to double
%5 = tail call i64 @pow(double 2.000000e+00, double %4)
%6 = trunc i64 %5 to i32
%7 = xor i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *utf8_filter(char *);
int main() {
  char test[] =
      "&aring;r fastsettes som en videref&oslash;ring av dagens "
      "leieniv&aring;. Med vennlig hilsen for <b>Forskningsparken</b> AS "
      "Svenning Torp <b>FORSKNINGSPARKEN</b> AS Oslo ...";
  char *ny = utf8_filter(test);
  printf("%s\n", ny);
  free(ny);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    -0xb0(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0xad,%edx
call   1050 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
call   1060 <utf8_filter@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rsi
lea    0xf29(%rip),%rdi
call   1040 <printf@plt>
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xb0,%rsp
lea    0xeb1(%rip),%rsi
mov    %rsp,%rbx
mov    $0xad,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
mov    %rbx,%rdi
call   1060 <utf8_filter@plt>
mov    %rax,%rbx
lea    0xf3c(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.test = [173 x i8] c"&aring;r fastsettes som en videref&oslash;ring av dagens leieniv&aring;. Med vennlig hilsen for <b>Forskningsparken</b> AS Svenning Torp <b>FORSKNINGSPARKEN</b> AS Oslo ...\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [173 x i8]
%2 = alloca i8*
%3 = bitcast [173 x i8]* %1 to i8*
%4 = getelementptr inbounds [173 x i8], [173 x i8]* %1, i64 0, i64 0
%5 = call i8* @utf8_filter(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [173 x i8] c"&aring;r fastsettes som en videref&oslash;ring av dagens leieniv&aring;. Med vennlig hilsen for <b>Forskningsparken</b> AS Svenning Torp <b>FORSKNINGSPARKEN</b> AS Oslo ...\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [173 x i8]
%2 = getelementptr inbounds [173 x i8], [173 x i8]* %1, i64 0, i64 0
%3 = call i8* @utf8_filter(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @free(i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_role_change_get_role(const uint8_t *event) {
  return event[9];
}


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

x86 assembly (clang, -O2):
<hci_event_role_change_get_role>:
mov    0x24(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hci_event_role_change_get_role(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int rom_present(char *);
int xtide_available() { return rom_present("ide_xt.bin"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"ide_xt.bin\00"
define i32 @xtide_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"ide_xt.bin\00"
define i32 @xtide_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sink(int *, int *, void *);
__attribute__((noipa)) void *return_array_or_array(int i) {
  int a[5];
  int b[7];
  void *p = i ? a : b;
  sink(a, b, p);
  return p;
}


x86 assembly (clang, -O0):
<return_array_or_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <return_array_or_array+0x22>
lea    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
jmp    113a <return_array_or_array+0x2a>
lea    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
call   1030 <sink@plt>
mov    -0x48(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_array_or_array>:
push   %rbx
sub    $0x40,%rsp
test   %edi,%edi
lea    0x20(%rsp),%rsi
mov    %rsp,%rdi
mov    %rdi,%rbx
cmove  %rsi,%rbx
mov    %rbx,%rdx
call   1030 <sink@plt>
mov    %rbx,%rax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @return_array_or_array(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca [7 x i32]
%5 = alloca i8*
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
br label %12
10: ; preds = %1
%11 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
br label %12
12: ; preds = %10, %8
%13 = phi i32* [ %9, %8 ], [ %11, %10 ]
%14 = bitcast i32* %13 to i8*
store i8* %14, i8** %5
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%16 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
%17 = load i8*, i8** %5
%18 = call i32 @sink(i32* %15, i32* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @return_array_or_array(i32 %0) {
%2 = alloca [5 x i32]
%3 = alloca [7 x i32]
%4 = bitcast [5 x i32]* %2 to i8*
%5 = bitcast [7 x i32]* %3 to i8*
%6 = icmp eq i32 %0, 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%9 = select i1 %6, i32* %8, i32* %7
%10 = bitcast i32* %9 to i8*
%11 = call i32 @sink(i32* %7, i32* %8, i8* %10)
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void __create_alter_2(void *cc, void *k, void *v, bool n) {
  if (!n) {
    (*(uint32_t *)v)++;
  }
}


x86 assembly (clang, -O0):
<__create_alter_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1128 <__create_alter_2+0x28>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__create_alter_2>:
test   %ecx,%ecx
je     1105 <__create_alter_2+0x5>
ret
addl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @__create_alter_2(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = bitcast i8* %2 to i32*
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
br label %10
10: ; preds = %6, %4
ret void
}
/* Variables and functions */
int _removeElement(int *, int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int removeElement(int *nums, int numsSize, int val) {
  return _removeElement(nums, numsSize, val, 0, 0);
}


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

x86 assembly (clang, -O2):
<removeElement>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <_removeElement@plt>

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

LLVM IR (-O2):
define i32 @removeElement(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @_removeElement(i32* %0, i32 %1, i32 %2, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
char getc();
int /*<<< orphan*/ putc(char);
int /*<<< orphan*/ screen_clear();
void free_write() {
  screen_clear();
  char c;
  int i;
  while (1) {
    c = getc();
    putc(c);
    while (i++ < 100000)
      ;
    i = 0;
  }
}


x86 assembly (clang, -O0):
<free_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <screen_clear@plt>
mov    $0x0,%al
call   1050 <getc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x186a0,%eax
jge    116d <free_write+0x3d>
jmp    1152 <free_write+0x22>
movl   $0x0,-0x8(%rbp)
jmp    113f <free_write+0xf>

x86 assembly (clang, -O2):
<free_write>:
push   %rax
xor    %eax,%eax
call   1040 <screen_clear@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getc@plt>
movsbl %al,%edi
call   1030 <putc@plt>
jmp    1140 <free_write+0x10>

LLVM IR (-O0):
define void @free_write() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 (...) @screen_clear()
br label %4
4: ; preds = %0, %13
%5 = call signext i8 (...) @getc()
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = call i32 @putc(i8 signext %6)
br label %8
8: ; preds = %12, %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
%11 = icmp slt i32 %9, 100000
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
store i32 0, i32* %2
br label %4
}

LLVM IR (-O2):
define void @free_write() {
%1 = tail call i32 (...) @screen_clear()
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getc()
%4 = tail call i32 @putc(i8 signext %3)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_47(int /*<<< orphan*/);
int gen_47() {
  handle_47(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_47() {
%1 = call i32 @handle_47(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_47() {
%1 = tail call i32 @handle_47(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *);
void *malloc(size_t);
void *xmalloc(size_t bytes) {
  void *new;
  new = malloc(bytes);
  if (!new)
    fatal_error("memory allocation error");
  return new;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <fatal_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"memory allocation error\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @fatal_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"memory allocation error\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double rand0_1(void) {
  double v;
  double r = rand();
  v = r / ((double)RAND_MAX + 1);
  ((void *)0);
  return v;
}


x86 assembly (clang, -O0):
<rand0_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2eb8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec3(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand0_1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand0_1() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @rand()
store double %3, double* %2
%4 = load double, double* %2
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %4, %7
store double %8, double* %1
%9 = load double, double* %1
ret double %9
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand0_1() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %1, %4
ret double %5
}
int main() {
  int i;
  i = 0;
error:
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ bytes2ushort(char *);
scalar_t__ checksum(unsigned char *, unsigned short);
int testCheckSum(char *packet, unsigned short len) {
  return checksum((unsigned char *)&packet[2], len - 2) == bytes2ushort(packet);
}


x86 assembly (clang, -O0):
<testCheckSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
movzwl -0xa(%rbp),%eax
sub    $0x2,%eax
movzwl %ax,%esi
call   1040 <checksum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bytes2ushort@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCheckSum>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x2,%rdi
add    $0xfffffffe,%esi
movzwl %si,%esi
call   1040 <checksum@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <bytes2ushort@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @testCheckSum(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = sub nsw i32 %8, 2
%10 = trunc i32 %9 to i16
%11 = call i64 @checksum(i8* %6, i16 zeroext %10)
%12 = load i8*, i8** %3
%13 = call i64 @bytes2ushort(i8* %12)
%14 = icmp eq i64 %11, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @testCheckSum(i8* %0, i16 zeroext %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = add i16 %1, -2
%5 = tail call i64 @checksum(i8* %3, i16 zeroext %4)
%6 = tail call i64 @bytes2ushort(i8* %0)
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ print_error_ce(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char msg[512];
  char in[512];
  strcpy(msg, argv[1]);
  strcpy(in, argv[2]);
  print_error_ce(msg, in);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1040 <print_error_ce@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0x200(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbx),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <print_error_ce@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcpy(i8* %8, i8* %11)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %13, i8* %16)
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%20 = call i32 @print_error_ce(i8* %18, i8* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %5, i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = call i32 @strcpy(i8* %6, i8* %11)
%13 = call i32 @print_error_ce(i8* %5, i8* %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _OSSwapInt64(int /*<<< orphan*/);
void OSWriteSwapInt64(volatile void *base, uintptr_t byteOffset,
                      uint64_t data) {
  *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data);
}


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

x86 assembly (clang, -O2):
<OSWriteSwapInt64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <_OSSwapInt64@plt>
mov    %eax,(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @OSWriteSwapInt64(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @_OSSwapInt64(i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = load i64, i64* %5
%12 = add i64 %10, %11
%13 = inttoptr i64 %12 to i32*
store volatile i32 %8, i32* %13
ret void
}

LLVM IR (-O2):
define void @OSWriteSwapInt64(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @_OSSwapInt64(i32 %2)
%5 = ptrtoint i8* %0 to i64
%6 = add i64 %5, %1
%7 = inttoptr i64 %6 to i32*
store volatile i32 %4, i32* %7
ret void
}
int in_def_update_keycode(void *drv_data, int *is_down) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @in_def_update_keycode(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1;
  if (a == 1) {
    a = 2;
  } else {
    if (a == 2) {
      a = 3;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1121 <main+0x21>
movl   $0x2,-0x4(%rbp)
jmp    1137 <main+0x37>
cmpl   $0x2,-0x4(%rbp)
jne    1132 <main+0x32>
movl   $0x3,-0x4(%rbp)
jmp    1137 <main+0x37>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int libcall(int, int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(int argc, char *argv[]) {
  int r1 = libcall(1, 2);
  int r2 = libcall(3, 4);
  int r3 = libcall(5, 6);
  int r4 = libcall(7, 8);
  printf("%d %d %d %d\n", r1, r2, r3, r4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <libcall@plt>
mov    %eax,-0x14(%rbp)
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <libcall@plt>
mov    %eax,-0x18(%rbp)
mov    $0x5,%edi
mov    $0x6,%esi
call   1040 <libcall@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x7,%edi
mov    $0x8,%esi
call   1040 <libcall@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <libcall@plt>
mov    %eax,%r14d
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <libcall@plt>
mov    %eax,%ebp
mov    $0x5,%edi
mov    $0x6,%esi
call   1040 <libcall@plt>
mov    %eax,%ebx
mov    $0x7,%edi
mov    $0x8,%esi
call   1040 <libcall@plt>
lea    0xe92(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @libcall(i32 1, i32 2)
store i32 %10, i32* %6
%11 = call i32 @libcall(i32 3, i32 4)
store i32 %11, i32* %7
%12 = call i32 @libcall(i32 5, i32 6)
store i32 %12, i32* %8
%13 = call i32 @libcall(i32 7, i32 8)
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @libcall(i32 1, i32 2)
%4 = tail call i32 @libcall(i32 3, i32 4)
%5 = tail call i32 @libcall(i32 5, i32 6)
%6 = tail call i32 @libcall(i32 7, i32 8)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_notify(int unset_environment,
                                                     const char *state) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_notify>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_notify(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
unsigned long max_ulong(int wsize) {
  if (wsize == 0)
    return 0;
  return ((1 << (wsize - 1)) << 1) - 1;
}


x86 assembly (clang, -O0):
<max_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111e <max_ulong+0x1e>
movq   $0x0,-0x8(%rbp)
jmp    1137 <max_ulong+0x37>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x1,%eax
sub    $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_ulong>:
lea    -0x1(%rdi),%ecx
mov    $0x2,%eax
shl    %cl,%eax
add    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x1,%edi
cmovae %eax,%ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @max_ulong(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = shl i32 1, %9
%11 = shl i32 %10, 1
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
store i64 %13, i64* %2
br label %14
14: ; preds = %7, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @max_ulong(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = shl i32 2, %3
%5 = add nsw i32 %4, -1
%6 = select i1 %2, i32 0, i32 %5
%7 = sext i32 %6 to i64
ret i64 %7
}
char *get_filename(int num, unsigned char *buf) {
  return (char *)(buf + (0x110 + num * 32));
}


x86 assembly (clang, -O0):
<get_filename>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x5,%ecx
add    $0x110,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename>:
shl    $0x5,%edi
movslq %edi,%rax
add    %rsi,%rax
add    $0x110,%rax
ret

LLVM IR (-O0):
define i8* @get_filename(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 32
%8 = add nsw i32 272, %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
ret i8* %10
}

LLVM IR (-O2):
define i8* @get_filename(i32 %0, i8* readnone %1) {
%3 = shl nsw i32 %0, 5
%4 = add nsw i32 %3, 272
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
char *zerobuf(void) {
  char *b;
  char *tmpbuf();
  b = tmpbuf();
  bzero(b, 512);
  return (b);
}


x86 assembly (clang, -O0):
<zerobuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <tmpbuf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x200,%esi
call   1040 <bzero@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zerobuf>:
push   %rbx
xor    %eax,%eax
call   1030 <tmpbuf@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x200,%esi
call   1040 <bzero@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @zerobuf() {
%1 = alloca i8*
%2 = call i8* (...) @tmpbuf()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @bzero(i8* %3, i32 512)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @zerobuf() {
%1 = tail call i8* (...) @tmpbuf()
%2 = tail call i32 @bzero(i8* %1, i32 512)
ret i8* %1
}
double __adddf3(double a1, double a2) { return ((float)a1 + (float)a2); }


x86 assembly (clang, -O0):
<__adddf3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__adddf3>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__adddf3(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptrunc double %5 to float
%7 = load double, double* %4
%8 = fptrunc double %7 to float
%9 = fadd float %6, %8
%10 = fpext float %9 to double
ret double %10
}

LLVM IR (-O2):
define double @__adddf3(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = fadd float %3, %4
%6 = fpext float %5 to double
ret double %6
}
void ubi_dbg_dump_vol_info(const struct ubi_volume *vol) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubi_volume = type opaque
define void @ubi_dbg_dump_vol_info(%struct.ubi_volume* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ leq2(int, int, int, int);
int leq3(int a1, int a2, int a3, int b1, int b2, int b3) {
  return a1 < b1 || a1 == b1 && leq2(a2, a3, b2, b3);
}


x86 assembly (clang, -O0):
<leq3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0x10(%rbp),%ecx
mov    %al,-0x19(%rbp)
jl     116f <leq3+0x5f>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x1a(%rbp)
jne    1169 <leq3+0x59>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <leq2@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leq3>:
mov    $0x1,%eax
cmp    %ecx,%edi
jl     113e <leq3+0x2e>
xor    %eax,%eax
cmp    %ecx,%edi
jne    113e <leq3+0x2e>
push   %rax
mov    %esi,%edi
mov    %edx,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
call   1030 <leq2@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @leq3(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %10
%15 = icmp slt i32 %13, %14
br i1 %15, label %29, label %16
16: ; preds = %6
%17 = load i32, i32* %7
%18 = load i32, i32* %10
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = load i32, i32* %11
%24 = load i32, i32* %12
%25 = call i64 @leq2(i32 %21, i32 %22, i32 %23, i32 %24)
%26 = icmp ne i64 %25, 0
br label %27
27: ; preds = %20, %16
%28 = phi i1 [ false, %16 ], [ %26, %20 ]
br label %29
29: ; preds = %27, %6
%30 = phi i1 [ true, %6 ], [ %28, %27 ]
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @leq3(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp slt i32 %0, %3
br i1 %7, label %14, label %8
8: ; preds = %6
%9 = icmp eq i32 %0, %3
br i1 %9, label %10, label %14
10: ; preds = %8
%11 = tail call i64 @leq2(i32 %1, i32 %2, i32 %4, i32 %5)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %10, %6
%15 = phi i32 [ 1, %6 ], [ 0, %8 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ log10(int);
int integerLength(int num) { return ((int)log10(num)) + 1; }


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

x86 assembly (clang, -O2):
<integerLength>:
push   %rax
call   1030 <log10@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @integerLength(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @log10(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @integerLength(i32 %0) {
%2 = tail call i64 @log10(i32 %0)
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
ret i32 %4
}