xunge/DecIR huggingface dataset:
void rop3_159_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

x86 assembly (clang, -O2):
<rop3_159_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
and    %dl,%cl
not    %cl
and    %sil,%cl
not    %sil
and    %dl,%sil
not    %dl
and    %al,%sil
or     %dl,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_159_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, -1
%8 = and i8 %7, %1
%9 = xor i8 %2, -1
%10 = xor i8 %1, -1
%11 = and i8 %10, %2
%12 = and i8 %11, %4
%13 = or i8 %12, %9
%14 = or i8 %13, %8
store i8 %14, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ uint8_t;
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit_bytes(struct jit_state *, int /*<<< orphan*/ *, int);
void emit1(struct jit_state *state, uint8_t x) {
  emit_bytes(state, &x, sizeof(x));
}


x86 assembly (clang, -O0):
<emit1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <emit_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit1>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <emit_bytes@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit1(%struct.jit_state* %0, i32 %1) {
%3 = alloca %struct.jit_state*
%4 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %3
store i32 %1, i32* %4
%5 = load %struct.jit_state*, %struct.jit_state** %3
%6 = call i32 @emit_bytes(%struct.jit_state* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit1(%struct.jit_state* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @emit_bytes(%struct.jit_state* %0, i32* %3, i32 4)
ret void
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
struct dirent *readdir(DIR *dirp) {
  (void)dirp;
  puts("readdir: not implemented");
  return NULL;
}


x86 assembly (clang, -O0):
<readdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [25 x i8] c"readdir: not implemented\00"
define %struct.dirent* @readdir(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret %struct.dirent* null
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [25 x i8] c"readdir: not implemented\00"
define noalias %struct.dirent* @readdir(i32* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret %struct.dirent* null
}
/* Variables and functions */
double dot_product(double const *, double const *, int const);
double norm(double const *, int const);
double cosine(const double *x, const double *y, const int n_dimensions) {
  return 1.0 - (dot_product(x, y, n_dimensions) /
                (norm(x, n_dimensions) * norm(y, n_dimensions)));
}


x86 assembly (clang, -O0):
<cosine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <dot_product@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <norm@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <norm@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe7e(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosine>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <dot_product@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <norm@plt>
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <norm@plt>
mulsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0xe94(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define double @cosine(double* %0, double* %1, i32 %2) {
%4 = tail call double @dot_product(double* %0, double* %1, i32 %2)
%5 = tail call double @norm(double* %0, i32 %2)
%6 = tail call double @norm(double* %1, i32 %2)
%7 = fmul double %5, %6
%8 = fdiv double %4, %7
%9 = fsub double 1.000000e+00, %8
ret double %9
}
int test_imm_6Bint8_mem(signed char *val) {
  return ((*val) & (0x6B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Bint8_mem>:
testb  $0x6b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 107
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int jksengine_bind(int /*<<< orphan*/ *);
scalar_t__ strcmp(char const *, char *);
int jksengine_bind_helper(ENGINE *e, const char *id) {
  ;
  if (id && (strcmp(id, "JKSEngine") != 0))
    return (0);
  return jksengine_bind(e);
}


x86 assembly (clang, -O0):
<jksengine_bind_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <jksengine_bind_helper+0x41>
mov    -0x18(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1161 <jksengine_bind_helper+0x41>
movl   $0x0,-0x4(%rbp)
jmp    116d <jksengine_bind_helper+0x4d>
mov    -0x10(%rbp),%rdi
call   1040 <jksengine_bind@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_bind_helper>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1144 <jksengine_bind_helper+0x24>
lea    0xed0(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1144 <jksengine_bind_helper+0x24>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <jksengine_bind@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"JKSEngine\00"
define i32 @jksengine_bind_helper(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %3
br label %16
13: ; preds = %8, %2
%14 = load i32*, i32** %4
%15 = call i32 @jksengine_bind(i32* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [10 x i8] c"JKSEngine\00"
define i32 @jksengine_bind_helper(i32* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4, %2
%8 = tail call i32 @jksengine_bind(i32* %0)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ 0, %4 ]
ret i32 %10
}
int main(int argc, char const *argv[]) {
  do {
    int a = 1;
    int b = 2;
  } while (1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1112 <main+0x12>
jmp    112f <main+0x2f>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
/* Variables and functions */
long _in_(int);
long microtime() { return (_in_(0x1d)); }


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

x86 assembly (clang, -O2):
<microtime>:
mov    $0x1d,%edi
jmp    1030 <_in_@plt>

LLVM IR (-O0):
define i64 @microtime() {
%1 = call i64 @_in_(i32 29)
ret i64 %1
}

LLVM IR (-O2):
define i64 @microtime() {
%1 = tail call i64 @_in_(i32 29)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ SystemCall(int);
void copyMem(void *source, void *dest, int size) { SystemCall(0xC); }


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

x86 assembly (clang, -O2):
<copyMem>:
mov    $0xc,%edi
jmp    1030 <SystemCall@plt>

LLVM IR (-O0):
define void @copyMem(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @SystemCall(i32 12)
ret void
}

LLVM IR (-O2):
define void @copyMem(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @SystemCall(i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, float *);
double sum_pow(int, float);
int main() {
  int n;
  float x;
  scanf("%d%f", &n, &x);
  printf("%.2f", sum_pow(n, x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
movss  -0xc(%rbp),%xmm0
call   1030 <sum_pow@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%f\00"
@.str.1 = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, float* %2)
%6 = load i32, i32* %1
%7 = load float, float* %2
%8 = call double @sum_pow(i32 %6, float %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int android_atomic_cas(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/ volatile *);
extern int android_atomic_acquire_cas(int32_t old_value, int32_t new_value,
                                      volatile int32_t *ptr) {
  return android_atomic_cas(old_value, new_value, ptr);
}


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

x86 assembly (clang, -O2):
<android_atomic_acquire_cas>:
jmp    1030 <android_atomic_cas@plt>

LLVM IR (-O0):
define i32 @android_atomic_acquire_cas(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 @android_atomic_cas(i32 %7, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @android_atomic_acquire_cas(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @android_atomic_cas(i32 %0, i32 %1, i32* %2)
ret i32 %4
}
int strcount(char *s, int c) {
  int count;
  count = 0;
  while (*s != 0) {
    if (*s == c) {
      count++;
    }
    s++;
  }
  return count;
}


x86 assembly (clang, -O0):
<strcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <strcount+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    113b <strcount+0x3b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <strcount+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <strcount+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
xor    %edx,%edx
cmp    %esi,%ecx
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strcount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcount(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
uint8_t read_uint8(void *buf, ptrdiff_t off) { return *(uint8_t *)(buf + off); }


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

x86 assembly (clang, -O2):
<read_uint8>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @read_uint8(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @read_uint8(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

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


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

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

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

LLVM IR (-O2):
define i32 @hfp_subevent_enhanced_call_status_get_clcc_dir(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test06_head() {
  do {
    printf("test06");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test06_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test06_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test06_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test06\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test06_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test06\00"
define void @test06_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
int ft_init_hex(char *s) {
  *(s++) = '0';
  *(s++) = 'x';
  *(s++) = '1';
  *(s++) = '.';
  return (4);
}


x86 assembly (clang, -O0):
<ft_init_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x30,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x78,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x31,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x2e,(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_init_hex>:
movl   $0x2e317830,(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @ft_init_hex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i32 1
store i8* %4, i8** %2
store i8 48, i8* %3
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
store i8 120, i8* %5
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
store i8 49, i8* %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
store i8 46, i8* %9
ret i32 4
}

LLVM IR (-O2):
define i32 @ft_init_hex(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 48, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 120, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 49, i8* %3
store i8 46, i8* %4
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: spellcheck dictionary infile\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage: spellcheck dictionary infile\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: spellcheck dictionary infile\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("\nProgram %s\n\n", argv[0]);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0AProgram %s\0A\0A\00"
@EXIT_SUCCESS = global i32 0
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AProgram %s\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void I2CRxFIFOConfigSet(uint32_t ui32Base, uint32_t ui32Config) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000F04))) &= 0x0000ffff;
  (*((volatile unsigned long *)(ui32Base + 0x00000F04))) |= ui32Config;
}


x86 assembly (clang, -O0):
<I2CRxFIFOConfigSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf04(%rax),%rcx
and    $0xffff,%rcx
mov    %rcx,0xf04(%rax)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0xf04(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xf04(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CRxFIFOConfigSet>:
mov    %rdi,-0x10(%rsp)
mov    %rsi,-0x8(%rsp)
mov    -0x10(%rsp),%rax
andq   $0xffff,0xf04(%rax)
mov    -0x8(%rsp),%rax
mov    -0x10(%rsp),%rcx
or     %rax,0xf04(%rcx)
ret

LLVM IR (-O0):
define void @I2CRxFIFOConfigSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = add i64 %5, 3844
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, 65535
store volatile i64 %9, i64* %7
%10 = load volatile i64, i64* %4
%11 = load volatile i64, i64* %3
%12 = add i64 %11, 3844
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @I2CRxFIFOConfigSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = add i64 %5, 3844
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, 65535
store volatile i64 %9, i64* %7
%10 = load volatile i64, i64* %4
%11 = load volatile i64, i64* %3
%12 = add i64 %11, 3844
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}
/* Variables and functions */
int GetRegisterValue(int, unsigned char *);
int /*<<< orphan*/ Report(char *, unsigned char);
int BMA222Open() {
  unsigned char ucRegVal;
  {
    int iRetVal = (GetRegisterValue(0x00, &ucRegVal));
    if (0 != iRetVal)
      return iRetVal;
  };
  Report("CHIP ID: 0x%x\n\r", ucRegVal);
  return 0;
}


x86 assembly (clang, -O0):
<BMA222Open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x5(%rbp),%rsi
call   1040 <GetRegisterValue@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
je     114c <BMA222Open+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <BMA222Open+0x43>
lea    0xead(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <Report@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMA222Open>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rsi
xor    %edi,%edi
call   1040 <GetRegisterValue@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1148 <BMA222Open+0x28>
movzbl 0xf(%rsp),%esi
lea    0xebd(%rip),%rdi
call   1030 <Report@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"CHIP ID: 0x%x\0A\0D\00"
define i32 @BMA222Open() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = call i32 @GetRegisterValue(i32 0, i8* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 0, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %3
store i32 %8, i32* %1
br label %12
9: ; preds = %0
%10 = load i8, i8* %2
%11 = call i32 @Report(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
store i32 0, i32* %1
br label %12
12: ; preds = %9, %7
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"CHIP ID: 0x%x\0A\0D\00"
define i32 @BMA222Open() {
%1 = alloca i8
%2 = call i32 @GetRegisterValue(i32 0, i8* %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i8, i8* %1
%6 = call i32 @Report(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
br label %7
7: ; preds = %0, %4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void tg_printi(int i) {
  printf("%d", i);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<tg_printi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tg_printi>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@stdout = global i32 0
define void @tg_printi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stdout = global i32 0
define void @tg_printi(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int **__ctype_toupper_loc();
int /*<<< orphan*/ __softboundmpx_store_return_metadata(void *, void *);
__attribute__((__weak__, __always___)) int const **
softboundmpx___ctype_toupper_loc(void) {
  int const **ret_ptr = __ctype_toupper_loc();
  __softboundmpx_store_return_metadata(
      (void *)ret_ptr, (void *)((char *)ret_ptr + sizeof(int *)));
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx___ctype_toupper_loc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__ctype_toupper_loc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx___ctype_toupper_loc>:
push   %rbx
xor    %eax,%eax
call   1030 <__ctype_toupper_loc@plt>
mov    %rax,%rbx
lea    0x8(%rax),%rsi
mov    %rax,%rdi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i32** @softboundmpx___ctype_toupper_loc() {
%1 = alloca i32**
%2 = call i32** (...) @__ctype_toupper_loc()
store i32** %2, i32*** %1
%3 = load i32**, i32*** %1
%4 = bitcast i32** %3 to i8*
%5 = load i32**, i32*** %1
%6 = bitcast i32** %5 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 8
%8 = call i32 @__softboundmpx_store_return_metadata(i8* %4, i8* %7)
%9 = load i32**, i32*** %1
ret i32** %9
}

LLVM IR (-O2):
define weak i32** @softboundmpx___ctype_toupper_loc() {
%1 = tail call i32** (...) @__ctype_toupper_loc()
%2 = bitcast i32** %1 to i8*
%3 = getelementptr inbounds i32*, i32** %1, i64 1
%4 = bitcast i32** %3 to i8*
%5 = tail call i32 @__softboundmpx_store_return_metadata(i8* %2, i8* %4)
ret i32** %1
}
/* Variables and functions */
float tanh(float);
float tanHFunc(float input) { return tanh(input); }


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

x86 assembly (clang, -O2):
<tanHFunc>:
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define float @tanHFunc(float %0) {
%2 = tail call float @tanh(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, int, int);
void version(char *name) { printf("%s version %d.%d.%d\n", name, 0, 4, 4); }


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
xor    %edx,%edx
mov    $0x4,%r8d
mov    %r8d,%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
mov    $0x4,%ecx
mov    $0x4,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s version %d.%d.%d\0A\00"
define void @version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0, i32 4, i32 4)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s version %d.%d.%d\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 4, i32 4)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int stringComp(const char *a1, const char *a2) { return strcmp(a1, a2); }


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

x86 assembly (clang, -O2):
<stringComp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @stringComp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
void *get_XKeyEvent_display(void *_p) {
  return (void *)((XKeyEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XKeyEvent_display>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @get_XKeyEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x87() {
  Assert_real((isalpha(135) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              680, ("isalpha should be 0 for 0x87"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x87>:
push   %rbp
mov    %rsp,%rbp
mov    $0x87,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2a8,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x87>:
push   %rax
mov    $0x87,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2a8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x87\00"
define void @t_isalpha_0x87() {
%1 = call i64 @isalpha(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x87\00"
define void @t_isalpha_0x87() {
%1 = tail call i64 @isalpha(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_test();
int main(void) {
  run_test();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @run_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_test()
ret i32 0
}
/* Variables and functions */
char *get_acpi_file(char const *);
char *scan_acpi_value(char *, char const *);
char *get_acpi_value(const char *file, const char *key) {
  char *buf = get_acpi_file(file);
  if (!buf)
    return NULL;
  return scan_acpi_value(buf, key);
}


x86 assembly (clang, -O0):
<get_acpi_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_acpi_file@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <get_acpi_value+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1166 <get_acpi_value+0x46>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <scan_acpi_value@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_acpi_value>:
push   %rbx
mov    %rsi,%rbx
call   1030 <get_acpi_file@plt>
test   %rax,%rax
je     113a <get_acpi_value+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scan_acpi_value@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_acpi_value(i8* %0, i8* %1) {
%3 = tail call i8* @get_acpi_file(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @scan_acpi_value(i8* %3, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
int digitSum(int num) {
  int sum = 0;
  int rem;
  while (num) {
    rem = num % 10;
    sum += rem * rem;
    num /= 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<digitSum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <digitSum+0x46>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <digitSum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitSum>:
xor    %eax,%eax
test   %edi,%edi
je     113e <digitSum+0x3e>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   %esi,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <digitSum+0x10>
ret

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

LLVM IR (-O2):
define i32 @digitSum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %6, %6
%8 = add nuw nsw i32 %7, %5
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int find_num_bits_set_in_num(int);
int find_hamming_distance_between_two_nums(int a, int b) {
  int xor_a_b = a ^ b;
  return (find_num_bits_set_in_num(xor_a_b));
}


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

x86 assembly (clang, -O2):
<find_hamming_distance_between_two_nums>:
xor    %esi,%edi
jmp    1030 <find_num_bits_set_in_num@plt>

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

LLVM IR (-O2):
define i32 @find_hamming_distance_between_two_nums(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @find_num_bits_set_in_num(i32 %3)
ret i32 %4
}
int toMinutes(int h1, int m1) {
  int end;
  end = (h1 * 60) + m1;
  return end;
}


x86 assembly (clang, -O0):
<toMinutes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toMinutes>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @toMinutes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 60
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @toMinutes(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 60
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_free(void *ptr, void *user_data) {
  (void)user_data;
  free(ptr);
}


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

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

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

LLVM IR (-O2):
define void @default_free(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}