xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __NR_membarrier;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  syscall(__NR_membarrier, 0);
  fprintf(stderr, "Done.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <syscall@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <syscall@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__NR_membarrier = global i32 0
@stderr = global i32 0
@.str = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @__NR_membarrier
%7 = call i32 @syscall(i32 %6, i32 0)
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__NR_membarrier = global i32 0
@stderr = global i32 0
@.str = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @__NR_membarrier
%4 = tail call i32 @syscall(i32 %3, i32 0)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fc8300b_tuner_deinit(void *handle, unsigned short devid) { return 0; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fc8300b_tuner_deinit(i8* nocapture readnone %0, i16 zeroext %1) {
ret i32 0
}
void stl_rotate(float *x, float *y, const double c, const double s) {
  double xold = *x;
  double yold = *y;
  *x = c * xold - s * yold;
  *y = s * xold + c * yold;
}


x86 assembly (clang, -O0):
<stl_rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stl_rotate>:
movss  (%rdi),%xmm2
cvtss2sd %xmm2,%xmm2
movss  (%rsi),%xmm3
cvtss2sd %xmm3,%xmm3
movaps %xmm3,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm0
subsd  %xmm4,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rdi)
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @stl_rotate(float* %0, float* %1, double %2, double %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store float* %0, float** %5
store float* %1, float** %6
store double %2, double* %7
store double %3, double* %8
%11 = load float*, float** %5
%12 = load float, float* %11
%13 = fpext float %12 to double
store double %13, double* %9
%14 = load float*, float** %6
%15 = load float, float* %14
%16 = fpext float %15 to double
store double %16, double* %10
%17 = load double, double* %7
%18 = load double, double* %9
%19 = load double, double* %8
%20 = load double, double* %10
%21 = fmul double %19, %20
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double %17, double %18, double %22)
%24 = fptrunc double %23 to float
%25 = load float*, float** %5
store float %24, float* %25
%26 = load double, double* %8
%27 = load double, double* %9
%28 = load double, double* %7
%29 = load double, double* %10
%30 = fmul double %28, %29
%31 = call double @llvm.fmuladd.f64(double %26, double %27, double %30)
%32 = fptrunc double %31 to float
%33 = load float*, float** %6
store float %32, float* %33
ret void
}

LLVM IR (-O2):
define void @stl_rotate(float* nocapture %0, float* nocapture %1, double %2, double %3) {
%5 = load float, float* %0
%6 = fpext float %5 to double
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = fneg double %8
%10 = fmul double %9, %3
%11 = tail call double @llvm.fmuladd.f64(double %2, double %6, double %10)
%12 = fptrunc double %11 to float
store float %12, float* %0
%13 = fmul double %8, %2
%14 = tail call double @llvm.fmuladd.f64(double %3, double %6, double %13)
%15 = fptrunc double %14 to float
store float %15, float* %1
ret void
}
/* Variables and functions */
size_t strlen(char *);
char *strncat(char *, char const *, size_t);
char *ethash_strncat(char *dest, size_t dest_size, char const *src,
                     size_t count) {
  return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count)
                                               : NULL;
}


x86 assembly (clang, -O0):
<ethash_strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x20(%rbp),%rax
add    $0x1,%rax
cmp    -0x10(%rbp),%rax
ja     116d <ethash_strncat+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <strncat@plt>
mov    %rax,-0x28(%rbp)
jmp    1178 <ethash_strncat+0x58>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1178 <ethash_strncat+0x58>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethash_strncat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %r14,%rax
add    $0x1,%rax
cmp    %r12,%rax
jbe    1149 <ethash_strncat+0x29>
xor    %ebx,%ebx
jmp    1157 <ethash_strncat+0x37>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <strncat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ethash_strncat(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = load i64, i64* %8
%12 = add i64 %10, %11
%13 = add i64 %12, 1
%14 = load i64, i64* %6
%15 = icmp ule i64 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %7
%19 = load i64, i64* %8
%20 = call i8* @strncat(i8* %17, i8* %18, i64 %19)
br label %22
21: ; preds = %4
br label %22
22: ; preds = %21, %16
%23 = phi i8* [ %20, %16 ], [ null, %21 ]
ret i8* %23
}

LLVM IR (-O2):
define i8* @ethash_strncat(i8* %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add i64 %3, 1
%7 = add i64 %6, %5
%8 = icmp ugt i64 %7, %1
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i8* @strncat(i8* dereferenceable(1) %0, i8* %2, i64 %3)
br label %11
11: ; preds = %4, %9
%12 = phi i8* [ %0, %9 ], [ null, %4 ]
ret i8* %12
}
void OnAPPLICATION_Hide() {}


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

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

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

LLVM IR (-O2):
define void @OnAPPLICATION_Hide() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int valid_id(char *);
int main() {
  char input[20];
  scanf("%[^\n]s", input);
  printf("%d", valid_id(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <valid_id@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <valid_id@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @valid_id(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
unsigned long l2l(unsigned long);
__attribute__((__visibility__("default"))) __attribute__((used)) unsigned long
rl2l(unsigned long *x) {
  return l2l(*x);
}


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

x86 assembly (clang, -O2):
<rl2l>:
mov    (%rdi),%rdi
jmp    1030 <l2l@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i64 (i64*)* @rl2l to i8*)], section "llvm.metadata"
define i64 @rl2l(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i64 @l2l(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i64 (i64*)* @rl2l to i8*)], section "llvm.metadata"
define i64 @rl2l(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @l2l(i64 %2)
ret i64 %3
}
/* Variables and functions */
unsigned int hasard(unsigned int const, unsigned int const);
unsigned int tirerDegatAleatoireNouveauEnnemi(const unsigned int niveauIA) {
  static const unsigned int baseDegatEnnemi[3][2] = {{3, 8}, {8, 15}, {15, 22}};
  return hasard(baseDegatEnnemi[niveauIA][0], baseDegatEnnemi[niveauIA][1]);
}


x86 assembly (clang, -O0):
<tirerDegatAleatoireNouveauEnnemi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0xed9(%rip),%rax
mov    (%rax,%rcx,8),%edi
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0xeca(%rip),%rax
mov    0x4(%rax,%rcx,8),%esi
call   1030 <hasard@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tirerDegatAleatoireNouveauEnnemi>:
mov    %edi,%eax
lea    0xee7(%rip),%rcx
mov    (%rcx,%rax,8),%edi
mov    0x4(%rcx,%rax,8),%esi
jmp    1030 <hasard@plt>

LLVM IR (-O0):
@tirerDegatAleatoireNouveauEnnemi.baseDegatEnnemi = internal constant [3 x [2 x i32]] [[2 x i32] [i32 3, i32 8], [2 x i32] [i32 8, i32 15], [2 x i32] [i32 15, i32 22]]
define i32 @tirerDegatAleatoireNouveauEnnemi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @tirerDegatAleatoireNouveauEnnemi.baseDegatEnnemi, i64 0, i64 %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%7 = load i32, i32* %6
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @tirerDegatAleatoireNouveauEnnemi.baseDegatEnnemi, i64 0, i64 %9
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%12 = load i32, i32* %11
%13 = call i32 @hasard(i32 %7, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@tirerDegatAleatoireNouveauEnnemi.baseDegatEnnemi = internal unnamed_addr constant [3 x [2 x i32]] [[2 x i32] [i32 3, i32 8], [2 x i32] [i32 8, i32 15], [2 x i32] [i32 15, i32 22]]
define i32 @tirerDegatAleatoireNouveauEnnemi(i32 %0) {
%2 = zext i32 %0 to i64
%3 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @tirerDegatAleatoireNouveauEnnemi.baseDegatEnnemi, i64 0, i64 %2, i64 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @tirerDegatAleatoireNouveauEnnemi.baseDegatEnnemi, i64 0, i64 %2, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @hasard(i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ f1(int, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("And now we will se a work of f1!!!;\n");
  f1(argc, argv);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <f1@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"And now we will se a work of f1!!!;\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @f1(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"And now we will se a work of f1!!!;\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @f1(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AtmegaCompareP__1__Alarm__fired();
int /*<<< orphan*/ AtmegaCompareP__1__AtmegaCompare__stop();
void AtmegaCompareP__1__AtmegaCompare__fired(void) {
  AtmegaCompareP__1__AtmegaCompare__stop();
  AtmegaCompareP__1__Alarm__fired();
}


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

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

LLVM IR (-O0):
define void @AtmegaCompareP__1__AtmegaCompare__fired() {
%1 = call i32 (...) @AtmegaCompareP__1__AtmegaCompare__stop()
%2 = call i32 (...) @AtmegaCompareP__1__Alarm__fired()
ret void
}

LLVM IR (-O2):
define void @AtmegaCompareP__1__AtmegaCompare__fired() {
%1 = tail call i32 (...) @AtmegaCompareP__1__AtmegaCompare__stop()
%2 = tail call i32 (...) @AtmegaCompareP__1__Alarm__fired()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
FILE *out_init(char *path) {
  FILE *fp = fopen(path, "w+");
  if (fp == NULL)
    return fp;
  fprintf(fp,
          "\t.section .bss\n"
          "\t.comm mem, %d\n"
          "\t.section .text\n"
          "\t.globl _start\n"
          "_start:\n"
          "\tmovq $mem, %%rsi\n"
          "\tmovq $0x01, %%rdx\n",
          30000);
  return fp;
}


x86 assembly (clang, -O0):
<out_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <out_init+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <out_init+0x55>
mov    -0x18(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x7530,%edx
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_init>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <out_init+0x29>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7530,%edx
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
@.str.1 = [107 x i8] c"\09.section .bss\0A\09.comm mem, %d\0A\09.section .text\0A\09.globl _start\0A_start:\0A\09movq $mem, %%rsi\0A\09movq $0x01, %%rdx\0A\00"
define i32* @out_init(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32*, i32** %4
store i32* %10, i32** %2
br label %15
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.1, i64 0, i64 0), i32 30000)
%14 = load i32*, i32** %4
store i32* %14, i32** %2
br label %15
15: ; preds = %11, %9
%16 = load i32*, i32** %2
ret i32* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
@.str.1 = [107 x i8] c"\09.section .bss\0A\09.comm mem, %d\0A\09.section .text\0A\09.globl _start\0A_start:\0A\09movq $mem, %%rsi\0A\09movq $0x01, %%rdx\0A\00"
define noalias i32* @out_init(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.1, i64 0, i64 0), i32 30000)
br label %6
6: ; preds = %1, %4
ret i32* %2
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_UART_RXD0_PIN() { return 0x01 & (inp_emulate(0x71) >> 0); }


x86 assembly (clang, -O0):
<TOSH_READ_UART_RXD0_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x71,%edi
call   1030 <inp_emulate@plt>
sar    $0x0,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_UART_RXD0_PIN>:
push   %rax
mov    $0x71,%edi
call   1030 <inp_emulate@plt>
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_UART_RXD0_PIN() {
%1 = call i32 @inp_emulate(i32 113)
%2 = ashr i32 %1, 0
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_UART_RXD0_PIN() {
%1 = tail call i32 @inp_emulate(i32 113)
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 1
ret i8 %3
}
/* Type definitions */
typedef unsigned char const uint32_t;

/* Variables and functions */
uint32_t read_uint32(const unsigned char *buffer) {
  return buffer[0] | buffer[1] << 8 | buffer[2] << 16 | buffer[3] << 24;
}


x86 assembly (clang, -O0):
<read_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @read_uint32(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_eq(uint32_t a, uint32_t b) { return a == b; }


x86 assembly (clang, -O0):
<op_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_eq>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @op_eq(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @op_eq(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *HUFv06_getErrorName(size_t code) { return ERR_getErrorName(code); }


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

x86 assembly (clang, -O2):
<HUFv06_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

LLVM IR (-O0):
define i8* @HUFv06_getErrorName(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @ERR_getErrorName(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @HUFv06_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
int find_index(char a[], int num_elements, char value) {
  int i;
  for (i = 0; i < num_elements; i++) {
    if (a[i] == value) {
      return (i);
    }
  }
  return (-1);
}


x86 assembly (clang, -O0):
<find_index>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <find_index+0x59>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <find_index+0x46>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <find_index+0x60>
jmp    114b <find_index+0x4b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <find_index+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_index>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <find_index+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dl,(%rdi,%rcx,1)
je     111f <find_index+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <find_index+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find_index(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ link_error();
void foo(int x) {
  switch (x) {
  case 0:
    if (0) {
      link_error();
    case 1:
      bar();
    }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     114f <foo+0x2f>
jmp    113e <foo+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1165 <foo+0x45>
jmp    1171 <foo+0x51>
xor    %eax,%eax
test   $0x1,%al
jne    115e <foo+0x3e>
jmp    116c <foo+0x4c>
mov    $0x0,%al
call   1040 <link_error@plt>
mov    $0x0,%al
call   1030 <bar@plt>
jmp    1171 <foo+0x51>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%edi
jne    111c <foo+0xc>
xor    %eax,%eax
jmp    1030 <bar@plt>
ret

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 0, label %4
i32 1, label %7
]
4: ; preds = %1
br i1 false, label %5, label %9
5: ; preds = %4
%6 = call i32 (...) @link_error()
br label %7
7: ; preds = %1, %5
%8 = call i32 (...) @bar()
br label %9
9: ; preds = %7, %4
br label %10
10: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %1, %3
ret void
}
char NMI320_NULL(void) { return 1; }


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

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

LLVM IR (-O0):
define signext i8 @NMI320_NULL() {
ret i8 1
}

LLVM IR (-O2):
define signext i8 @NMI320_NULL() {
ret i8 1
}
/* Type definitions */
typedef int /*<<< orphan*/ bio_info_cb;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
long BIO_callback_ctrl(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_next(int /*<<< orphan*/ *);
long ok_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) {
  long ret = 1;
  BIO *next;
  next = BIO_next(b);
  if (next == NULL)
    return 0;
  switch (cmd) {
  default:
    ret = BIO_callback_ctrl(next, cmd, fp);
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<ok_callback_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <BIO_next@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1160 <ok_callback_ctrl+0x40>
movq   $0x0,-0x8(%rbp)
jmp    117c <ok_callback_ctrl+0x5c>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <BIO_callback_ctrl@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok_callback_ctrl>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <BIO_next@plt>
test   %rax,%rax
je     1145 <ok_callback_ctrl+0x25>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <BIO_callback_ctrl@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @ok_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i64 1, i64* %8
%10 = load i32*, i32** %5
%11 = call i32* @BIO_next(i32* %10)
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i64 0, i64* %4
br label %24
15: ; preds = %3
%16 = load i32, i32* %6
switch i32 %16, label %17 [
]
17: ; preds = %15
%18 = load i32*, i32** %9
%19 = load i32, i32* %6
%20 = load i32*, i32** %7
%21 = call i64 @BIO_callback_ctrl(i32* %18, i32 %19, i32* %20)
store i64 %21, i64* %8
br label %22
22: ; preds = %17
%23 = load i64, i64* %8
store i64 %23, i64* %4
br label %24
24: ; preds = %22, %14
%25 = load i64, i64* %4
ret i64 %25
}

LLVM IR (-O2):
define i64 @ok_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32* @BIO_next(i32* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i64 @BIO_callback_ctrl(i32* %4, i32 %1, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i64 [ %7, %6 ], [ 0, %3 ]
ret i64 %9
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t nn_getl(const uint8_t *buf) {
  return (((uint32_t)buf[0]) << 24) | (((uint32_t)buf[1]) << 16) |
         (((uint32_t)buf[2]) << 8) | ((uint32_t)buf[3]);
}


x86 assembly (clang, -O0):
<nn_getl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_getl>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @nn_getl(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int test_rightmost_one(unsigned x) {
  int mask;
  for (mask = 1; mask; mask <<= 1)
    if (x & mask)
      return mask;
  return 0;
}


x86 assembly (clang, -O0):
<test_rightmost_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1145 <test_rightmost_one+0x45>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1132 <test_rightmost_one+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <test_rightmost_one+0x4c>
jmp    1137 <test_rightmost_one+0x37>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test_rightmost_one+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rightmost_one>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
test   %ecx,%ecx
je     1121 <test_rightmost_one+0x21>
mov    %eax,%edx
and    %edi,%edx
lea    (%rax,%rax,1),%ecx
test   %edx,%edx
je     1110 <test_rightmost_one+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_rightmost_one(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = icmp ne i32 %3, 0
%5 = and i32 %3, %0
%6 = icmp eq i32 %5, 0
%7 = and i1 %4, %6
%8 = shl i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i32 %3
}
int fun432() { return 432; }


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

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

LLVM IR (-O0):
define i32 @fun432() {
ret i32 432
}

LLVM IR (-O2):
define i32 @fun432() {
ret i32 432
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ makePalindrome(char *, int, int /*<<< orphan*/);
int strlen(char *);
int main() {
  char str[100];
  gets(str);
  int len = strlen(str), padding = 0;
  while (!makePalindrome(str, len, padding++))
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    -0x78(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
call   1030 <makePalindrome@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    118a <main+0x5a>
jmp    118f <main+0x5f>
jmp    115e <main+0x2e>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <gets@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
xor    %edx,%edx
nop
lea    0x1(%rdx),%ebx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <makePalindrome@plt>
mov    %ebx,%edx
test   %eax,%eax
je     1150 <main+0x20>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
store i32 0, i32* %4
br label %9
9: ; preds = %17, %0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
%14 = call i32 @makePalindrome(i8* %10, i32 %11, i32 %12)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @strlen(i8* %2)
br label %5
5: ; preds = %5, %0
%6 = phi i32 [ 0, %0 ], [ %7, %5 ]
%7 = add nuw nsw i32 %6, 1
%8 = call i32 @makePalindrome(i8* %2, i32 %4, i32 %6)
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

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


x86 assembly (clang, -O0):
<macro_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):
<macro_getyx>:
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <getyx@plt>

LLVM IR (-O0):
define void @macro_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 @macro_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
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_uhr(scalar_t__);
uint32_t __stdfix_sadd_uhr(uint32_t x, uint32_t y) {
  return (__stdfix_sat_uhr((uint32_t)x + (uint32_t)y));
}


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

x86 assembly (clang, -O2):
<__stdfix_sadd_uhr>:
add    %rsi,%rdi
jmp    1030 <__stdfix_sat_uhr@plt>

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

LLVM IR (-O2):
define i64 @__stdfix_sadd_uhr(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = tail call i64 @__stdfix_sat_uhr(i64 %3)
ret i64 %4
}
int main() {
  int a = 0;
  switch (0) {
  case 0:
  case 1:
  case 2:
  default:
    a = 5;
  }
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
int amf_decode_boolean(char *data) {
  int b = *data;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @amf_decode_boolean(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
void SPIM_1_EnableTxInt(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ putbuf(int /*<<< orphan*/ *, int);
void putbuf4(uint32_t i) { putbuf(&i, 4); }


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

x86 assembly (clang, -O2):
<putbuf4>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <putbuf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @putbuf4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @putbuf(i32* %2, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int /*<<< orphan*/ add_allocated_node(void *, int);
void *malloc(int);
void *wrapper_malloc(int size) {
  void *ptr = malloc(sizeof(size));
  add_allocated_node(ptr, size);
  return ptr;
}


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

x86 assembly (clang, -O2):
<wrapper_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <add_allocated_node@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @wrapper_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @add_allocated_node(i8* %5, i32 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @wrapper_malloc(i32 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = tail call i32 @add_allocated_node(i8* %2, i32 %0)
ret i8* %2
}
void op_code_normal_case0x52(void) {}


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

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

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

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

/* Variables and functions */
void mmiof_write(void *iomem, unsigned long offset, unsigned long value) {
  void *addr;
  addr = iomem + offset;
  uint32_t *data = addr;
  *data = value;
}


x86 assembly (clang, -O0):
<mmiof_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mmiof_write(i8* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = getelementptr i8, i8* %0, i64 %1
%5 = bitcast i8* %4 to i64*
store i64 %2, i64* %5
ret void
}
/* Type definitions */
struct sockaddr_un {
  int /*<<< orphan*/ sun_path;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ipc_sockname(int, int /*<<< orphan*/, int);
scalar_t__ strlen(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(int /*<<< orphan*/);
void ipc_close(int fd) {
  struct sockaddr_un addr = {};
  ipc_sockname(fd, addr.sun_path, sizeof(addr.sun_path));
  close(fd);
  if (strlen(addr.sun_path) > 0)
    unlink(addr.sun_path);
}


x86 assembly (clang, -O0):
<ipc_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
call   1070 <ipc_sockname@plt>
mov    -0x4(%rbp),%edi
call   1060 <close@plt>
mov    -0x8(%rbp),%edi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    119d <ipc_close+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_close>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <ipc_sockname@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %edi,%edi
call   1040 <strlen@plt>
test   %rax,%rax
jle    116a <ipc_close+0x2a>
xor    %edi,%edi
pop    %rbx
jmp    1030 <unlink@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32 }
define void @ipc_close(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_un
store i32 %0, i32* %2
%4 = bitcast %struct.sockaddr_un* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @ipc_sockname(i32 %5, i32 %7, i32 4)
%9 = load i32, i32* %2
%10 = call i32 @close(i32 %9)
%11 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i64 @strlen(i32 %12)
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %1
%16 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @unlink(i32 %17)
br label %19
19: ; preds = %15, %1
ret void
}

LLVM IR (-O2):
define void @ipc_close(i32 %0) {
%2 = tail call i32 @ipc_sockname(i32 %0, i32 0, i32 4)
%3 = tail call i32 @close(i32 %0)
%4 = tail call i64 @strlen(i32 0)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @unlink(i32 0)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kdAssert(int, char const *);
void kdAssertShortEquals(const short expected, const short actual,
                         const char *message) {
  kdAssert(expected == actual, message);
}


x86 assembly (clang, -O0):
<kdAssertShortEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rsi
call   1030 <kdAssert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kdAssertShortEquals>:
xor    %eax,%eax
cmp    %si,%di
sete   %al
mov    %eax,%edi
mov    %rdx,%rsi
jmp    1030 <kdAssert@plt>

LLVM IR (-O0):
define void @kdAssertShortEquals(i16 signext %0, i16 signext %1, i8* %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i8*
store i16 %0, i16* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = icmp eq i32 %8, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %6
%14 = call i32 @kdAssert(i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @kdAssertShortEquals(i16 signext %0, i16 signext %1, i8* %2) {
%4 = icmp eq i16 %0, %1
%5 = zext i1 %4 to i32
%6 = tail call i32 @kdAssert(i32 %5, i8* %2)
ret void
}