xunge/DecIR huggingface dataset:
void destroyServiceHashEntry(void *arg, char *key, char *value) {
  do {
    (void)(arg);
  } while (0);
  do {
    (void)(key);
  } while (0);
  do {
    (void)(value);
  } while (0);
}


x86 assembly (clang, -O0):
<destroyServiceHashEntry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    1115 <destroyServiceHashEntry+0x15>
jmp    111a <destroyServiceHashEntry+0x1a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @destroyServiceHashEntry(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %3
%8 = load i8*, i8** %4
br label %9
9: ; preds = %7
br label %10
10: ; preds = %9
%11 = load i8*, i8** %5
br label %12
12: ; preds = %10
br label %13
13: ; preds = %12
%14 = load i8*, i8** %6
br label %15
15: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @destroyServiceHashEntry(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int add(int, int);
int fibonacci(int);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int main(int argc, char *argv[]) {
  int a = 1, b = 2, sum, fib;
  sum = add(a, b);
  fib = fibonacci(3);
  printf("%d + %d = %d, fibonacci(%d) = %d\n", a, b, sum, 3, fib);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1050 <fibonacci@plt>
lea    0xead(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ebx,%ecx
mov    $0x3,%r8d
mov    %eax,%r9d
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"%d + %d = %d, fibonacci(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 1, i32 2)
%4 = tail call i32 @fibonacci(i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 %3, i32 3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int dpgetprime(int);
int dpprimenum(int num) {
  assert(num > 0);
  return dpgetprime(num);
}


x86 assembly (clang, -O0):
<dpprimenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
call   1030 <dpgetprime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpprimenum>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1040 <assert@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <dpgetprime@plt>

LLVM IR (-O0):
define i32 @dpprimenum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @dpgetprime(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @dpprimenum(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @dpgetprime(i32 %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void mixedComparisons1(signed char a) {
  int min = (-((~0U) & ((~0U) >> 1)) - 1);
  clang_analyzer_eval((a - 2) >= (min + 5LL));
  clang_analyzer_eval(a == 0);
  clang_analyzer_eval(a == 0x7F);
  clang_analyzer_eval(a == -0x80);
}


x86 assembly (clang, -O0):
<mixedComparisons1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x80000000,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x2,%eax
cltq
movslq -0x8(%rbp),%rcx
add    $0x5,%rcx
cmp    %rcx,%rax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xffffff80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixedComparisons1>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
test   %bl,%bl
sete   %dil
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    $0x7f,%bl
sete   %dil
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    $0x80,%bl
sete   %dil
pop    %rbx
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @mixedComparisons1(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 -2147483648, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 2
%7 = sext i32 %6 to i64
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, 5
%11 = icmp sge i64 %7, %10
%12 = zext i1 %11 to i32
%13 = call i32 @clang_analyzer_eval(i32 %12)
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @clang_analyzer_eval(i32 %17)
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 127
%22 = zext i1 %21 to i32
%23 = call i32 @clang_analyzer_eval(i32 %22)
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, -128
%27 = zext i1 %26 to i32
%28 = call i32 @clang_analyzer_eval(i32 %27)
ret void
}

LLVM IR (-O2):
define void @mixedComparisons1(i8 signext %0) {
%2 = tail call i32 @clang_analyzer_eval(i32 1)
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
%6 = icmp eq i8 %0, 127
%7 = zext i1 %6 to i32
%8 = tail call i32 @clang_analyzer_eval(i32 %7)
%9 = icmp eq i8 %0, -128
%10 = zext i1 %9 to i32
%11 = tail call i32 @clang_analyzer_eval(i32 %10)
ret void
}
/* Variables and functions */
long double tanh(long double);
long double tanhl(long double a1) { return tanh(a1); }


x86 assembly (clang, -O0):
<tanhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tanh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define x86_fp80 @tanhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @tanh(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
int /*<<< orphan*/ pmu_setting_temp_based();
void pmu_set_clk_init() {
  pmu_setting_temp_based();
  pmu_reg_write(0x05, ((0 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                       (0 << 9) | (0 << 8) | (0 << 7) | (47)));
  pmu_reg_write(0x05, ((1 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                       (1 << 9) | (0 << 8) | (1 << 7) | (47)));
}


x86 assembly (clang, -O0):
<pmu_set_clk_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pmu_setting_temp_based@plt>
mov    $0x5,%edi
mov    $0x82f,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x5,%edi
mov    $0x2aaf,%esi
call   1040 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_clk_init>:
push   %rax
xor    %eax,%eax
call   1030 <pmu_setting_temp_based@plt>
mov    $0x5,%edi
mov    $0x82f,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x5,%edi
mov    $0x2aaf,%esi
pop    %rax
jmp    1040 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_set_clk_init() {
%1 = call i32 (...) @pmu_setting_temp_based()
%2 = call i32 @pmu_reg_write(i32 5, i32 2095)
%3 = call i32 @pmu_reg_write(i32 5, i32 10927)
ret void
}

LLVM IR (-O2):
define void @pmu_set_clk_init() {
%1 = tail call i32 (...) @pmu_setting_temp_based()
%2 = tail call i32 @pmu_reg_write(i32 5, i32 2095)
%3 = tail call i32 @pmu_reg_write(i32 5, i32 10927)
ret void
}
zz_bind_call_exe_no_tag(proc) int (*proc)();
{
  setaction_exeproc(proc, 0);
  return 1;
}


x86 assembly (clang, -O0):
<zz_bind_call_exe_no_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <setaction_exeproc@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zz_bind_call_exe_no_tag>:
push   %rax
xor    %esi,%esi
xor    %eax,%eax
call   1030 <setaction_exeproc@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @zz_bind_call_exe_no_tag(i32 (...)* %0) {
%2 = alloca i32 (...)*
store i32 (...)* %0, i32 (...)** %2
%3 = load i32 (...)*, i32 (...)** %2
%4 = call i32 (i32 (...)*, i32, ...) bitcast (i32 (...)* @setaction_exeproc to i32 (i32 (...)*, i32, ...)*)(i32 (...)* %3, i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @zz_bind_call_exe_no_tag(i32 (...)* %0) {
%2 = tail call i32 (i32 (...)*, i32, ...) bitcast (i32 (...)* @setaction_exeproc to i32 (i32 (...)*, i32, ...)*)(i32 (...)* %0, i32 0)
ret i32 1
}
/* Type definitions */
typedef void (*routine)(void *);
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_cleanup_pop(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_cleanup_push(void (*)(void *), void *);
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ pthread_mutex_unlock;
int cond_wait_and_unlock_if_cancelled(pthread_cond_t *cond,
                                      pthread_mutex_t *mutex) {
  int err;
  typedef void (*routine)(void *);
  routine r = (routine)pthread_mutex_unlock;
  pthread_cleanup_push(r, (void *)mutex);
  err = pthread_cond_wait(cond, mutex);
  pthread_cleanup_pop(0);
  return err;
}


x86 assembly (clang, -O0):
<cond_wait_and_unlock_if_cancelled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_cleanup_push@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_cond_wait@plt>
mov    %eax,-0x14(%rbp)
xor    %edi,%edi
call   1040 <pthread_cleanup_pop@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_wait_and_unlock_if_cancelled>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
call   1050 <pthread_cleanup_push@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <pthread_cond_wait@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <pthread_cleanup_pop@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@pthread_mutex_unlock = global i64 0
define i32 @cond_wait_and_unlock_if_cancelled(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca void (i8*)*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i64, i64* @pthread_mutex_unlock
%8 = inttoptr i64 %7 to void (i8*)*
store void (i8*)* %8, void (i8*)** %6
%9 = load void (i8*)*, void (i8*)** %6
%10 = load i32*, i32** %4
%11 = bitcast i32* %10 to i8*
%12 = call i32 @pthread_cleanup_push(void (i8*)* %9, i8* %11)
%13 = load i32*, i32** %3
%14 = load i32*, i32** %4
%15 = call i32 @pthread_cond_wait(i32* %13, i32* %14)
store i32 %15, i32* %5
%16 = call i32 @pthread_cleanup_pop(i32 0)
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@pthread_mutex_unlock = global i64 0
define i32 @cond_wait_and_unlock_if_cancelled(i32* %0, i32* %1) {
%3 = load i64, i64* @pthread_mutex_unlock
%4 = inttoptr i64 %3 to void (i8*)*
%5 = bitcast i32* %1 to i8*
%6 = tail call i32 @pthread_cleanup_push(void (i8*)* %4, i8* %5)
%7 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
%8 = tail call i32 @pthread_cleanup_pop(i32 0)
ret i32 %7
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 690137161UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1156 <RandomFunc+0x56>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1129 <RandomFunc+0x29>
mov    -0x18(%rbp),%rcx
and    $0x2922a849,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x7,%eax
and    $0x120a000,%eax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = and i64 %9, 914778474
%11 = shl i64 %10, 7
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %16, %2
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i64, i64* %6
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %17
%19 = load i64, i64* %18
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%21 = load i64, i64* %20
%22 = and i64 %21, %19
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 1
store i64 %24, i64* %6
br label %13
25: ; preds = %13
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = and i64 %27, 690137161
%29 = load i64*, i64** %4
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 7
%5 = and i64 %4, 18915328
store i64 %5, i64* %1
ret void
}
__attribute__((always_)) const int ceilk(double x) {
  return (int)x + (x < 0 ? 0 : 1);
}


x86 assembly (clang, -O0):
<ceilk>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
movsd  -0x8(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%ecx
xor    %edx,%edx
ucomisd %xmm1,%xmm0
cmova  %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilk>:
cvttsd2si %xmm0,%ecx
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ceilk(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = load double, double* %2
%6 = fcmp olt double %5, 0.000000e+00
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
%9 = add nsw i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ceilk(double %0) {
%2 = fptosi double %0 to i32
%3 = fcmp uge double %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %2
ret i32 %5
}
float *stbir__get_ring_buffer_entry(float *ring_buffer, int index,
                                    int ring_buffer_length) {
  return &ring_buffer[index * ring_buffer_length];
}


x86 assembly (clang, -O0):
<stbir__get_ring_buffer_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__get_ring_buffer_entry>:
imul   %edx,%esi
movslq %esi,%rax
lea    (%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define float* @stbir__get_ring_buffer_entry(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %7, i64 %11
ret float* %12
}

LLVM IR (-O2):
define float* @stbir__get_ring_buffer_entry(float* readnone %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds float, float* %0, i64 %5
ret float* %6
}
int do_213() { return 213; }


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

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

LLVM IR (-O0):
define i32 @do_213() {
ret i32 213
}

LLVM IR (-O2):
define i32 @do_213() {
ret i32 213
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int bruteforceFile(char const *, int /*<<< orphan*/ *);
int bruteforceFileNoKeys(const char *filename) {
  uint16_t keytable[128] = {0};
  return bruteforceFile(filename, keytable);
}


x86 assembly (clang, -O0):
<bruteforceFileNoKeys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1040 <bruteforceFile@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bruteforceFileNoKeys>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x200,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <bruteforceFile@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @bruteforceFileNoKeys(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i32]
store i8* %0, i8** %2
%4 = bitcast [128 x i32]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 0
%7 = call i32 @bruteforceFile(i8* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @bruteforceFileNoKeys(i8* %0) {
%2 = alloca [128 x i32]
%3 = bitcast [128 x i32]* %2 to i8*
%4 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 0
%5 = call i32 @bruteforceFile(i8* %0, i32* %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlVoltageEventStatus(void) {
  return ((*((volatile uint32_t *)(0x400FE060))));
}


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

x86 assembly (clang, -O2):
<SysCtlVoltageEventStatus>:
mov    0x400fe060,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlVoltageEventStatus() {
%1 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @SysCtlVoltageEventStatus() {
%1 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
ret i32 %1
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
void main(void) {
  int *p;
  p = malloc(sizeof(int));
  *p = 12345;
  if (p == NULL) {
    printf("Malloc com erros para alocar memória!\n");
  } else {
    printf("Valor: %d\n", *p);
    printf("Ponteiro: %p\n", p);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3039,(%rax)
cmpq   $0x0,-0x8(%rbp)
jne    115e <main+0x3e>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1184 <main+0x64>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x3039,(%rax)
lea    0xec5(%rip),%rdi
mov    $0x3039,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Malloc com erros para alocar mem\C3\B3ria!\0A\00"
@.str.1 = [11 x i8] c"Valor: %d\0A\00"
@.str.2 = [14 x i8] c"Ponteiro: %p\0A\00"
define void @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 12345, i32* %3
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %14
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32* %12)
br label %14
14: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"Valor: %d\0A\00"
@.str.2 = [14 x i8] c"Ponteiro: %p\0A\00"
define void @main() {
%1 = tail call i32* @malloc(i32 4)
store i32 12345, i32* %1
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 12345)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
int leaps_thru_end_of_nonneg(int const);
int leaps_thru_end_of(register const int y) {
  return (y < 0 ? -1 - leaps_thru_end_of_nonneg(-1 - y)
                : leaps_thru_end_of_nonneg(y));
}


x86 assembly (clang, -O0):
<leaps_thru_end_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1143 <leaps_thru_end_of+0x33>
mov    $0xffffffff,%edi
sub    -0x4(%rbp),%edi
call   1030 <leaps_thru_end_of_nonneg@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <leaps_thru_end_of+0x3e>
mov    -0x4(%rbp),%edi
call   1030 <leaps_thru_end_of_nonneg@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leaps_thru_end_of>:
test   %edi,%edi
js     1119 <leaps_thru_end_of+0x9>
jmp    1030 <leaps_thru_end_of_nonneg@plt>
push   %rax
not    %edi
call   1030 <leaps_thru_end_of_nonneg@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @leaps_thru_end_of(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 -1, %6
%8 = call i32 @leaps_thru_end_of_nonneg(i32 %7)
%9 = sub nsw i32 -1, %8
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @leaps_thru_end_of_nonneg(i32 %11)
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ %9, %5 ], [ %12, %10 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @leaps_thru_end_of(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = xor i32 %0, -1
%5 = tail call i32 @leaps_thru_end_of_nonneg(i32 %4)
%6 = xor i32 %5, -1
br label %9
7: ; preds = %1
%8 = tail call i32 @leaps_thru_end_of_nonneg(i32 %0)
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %6, %3 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _f_f_i(float a, int b) { printf("a:float, b:int\n"); }


x86 assembly (clang, -O0):
<_f_f_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"a:float, b:int\0A\00"
define void @_f_f_i(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"a:float, b:int\00"
define void @_f_f_i(float %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isgraph(int);
int isprint(int c) { return (isgraph(c) || c == ' '); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isgraph@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <isprint+0x2f>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
push   %rbx
mov    %edi,%ebx
call   1030 <isgraph@plt>
test   %rax,%rax
setne  %al
cmp    $0x20,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isgraph(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 32
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = tail call i64 @isgraph(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
scalar_t__ malloc(int);
int *makeRecCount(int numSubjects) {
  int *r;
  r = (int *)malloc(sizeof(int) * (numSubjects + 1));
  assert(r);
  return r;
}


x86 assembly (clang, -O0):
<makeRecCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeRecCount>:
push   %rbx
lea    0x4(,%rdi,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @makeRecCount(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = call i32 @assert(i32* %11)
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
define i32* @makeRecCount(i32 %0) {
%2 = shl i32 %0, 2
%3 = add i32 %2, 4
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @assert(i32* %5)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int main() {
  unsigned int a[2];
  *((unsigned long long *)a) = 0x123456789abcdef1LL;
  if (a[0] != 0x9abcdef1) {
    _exit(-1);
  }
  if (a[1] != 0x12345678) {
    _exit(-2);
  }
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x123456789abcdef1,%rax
56 34 12
mov    %rax,-0xc(%rbp)
cmpl   $0x9abcdef1,-0xc(%rbp)
je     1144 <main+0x34>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
cmpl   $0x12345678,-0x8(%rbp)
je     115b <main+0x4b>
mov    $0xfffffffe,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
int /*<<< orphan*/ touch();
void *yield_thread2(void *arg) {
  while (1) {
    sched_yield();
    touch();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<yield_thread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <sched_yield@plt>
mov    $0x0,%al
call   1030 <touch@plt>
jmp    112c <yield_thread2+0xc>

x86 assembly (clang, -O2):
<yield_thread2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <sched_yield@plt>
xor    %eax,%eax
call   1030 <touch@plt>
jmp    1130 <yield_thread2+0x10>

LLVM IR (-O0):
define i8* @yield_thread2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @sched_yield()
%5 = call i32 (...) @touch()
br label %3
}

LLVM IR (-O2):
define noalias i8* @yield_thread2(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @sched_yield()
%4 = tail call i32 (...) @touch()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int array_sum(int *);
int /*<<< orphan*/ foo(int *, int);
int main(void) {
  int a[51];
  foo(a, 50);
  int res = array_sum(a);
  if (res != 49)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
mov    $0x32,%esi
call   1040 <foo@plt>
lea    -0xd0(%rbp),%rdi
call   1050 <array_sum@plt>
mov    %eax,-0xd4(%rbp)
cmpl   $0x31,-0xd4(%rbp)
je     1179 <main+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1040 <foo@plt>
mov    %rbx,%rdi
call   1050 <array_sum@plt>
cmp    $0x31,%eax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [51 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [51 x i32], [51 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4, i32 50)
%6 = getelementptr inbounds [51 x i32], [51 x i32]* %2, i64 0, i64 0
%7 = call i32 @array_sum(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 49
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [51 x i32]
%2 = bitcast [51 x i32]* %1 to i8*
%3 = getelementptr inbounds [51 x i32], [51 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3, i32 50)
%5 = call i32 @array_sum(i32* %3)
%6 = icmp eq i32 %5, 49
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
char *BN_options(void) {
  static int init = 0;
  static char data[16];
  if (!init) {
    init++;
    snprintf(data, sizeof(data), "bn(%d,%d)",
             (int)sizeof(unsigned long long) * 8,
             (int)sizeof(unsigned long long) * 8);
  }
  return (data);
}


x86 assembly (clang, -O0):
<BN_options>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f25(%rip)
jne    1151 <BN_options+0x41>
mov    0x2f19(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f10(%rip)
lea    0x2f19(%rip),%rdi
mov    $0x10,%esi
lea    0xebd(%rip),%rdx
mov    $0x40,%r8d
mov    %r8d,%ecx
call   1030 <snprintf@plt>
lea    0x2ef8(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_options>:
push   %rax
cmpb   $0x0,0x2f28(%rip)
jne    1144 <BN_options+0x34>
movb   $0x1,0x2f1f(%rip)
lea    0x2f28(%rip),%rdi
lea    0xed1(%rip),%rdx
mov    $0x10,%esi
mov    $0x40,%ecx
mov    $0x40,%r8d
call   1030 <snprintf@plt>
lea    0x2f05(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@BN_options.init = internal global i32 0
@BN_options.data = internal global [16 x i8] zeroinitializer
@.str = [10 x i8] c"bn(%d,%d)\00"
define i8* @BN_options() {
%1 = load i32, i32* @BN_options.init
%2 = icmp ne i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @BN_options.init
%5 = add nsw i32 %4, 1
store i32 %5, i32* @BN_options.init
%6 = call i32 @snprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @BN_options.data, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 64, i32 64)
br label %7
7: ; preds = %3, %0
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @BN_options.data, i64 0, i64 0)
}

LLVM IR (-O2):
@BN_options.init = internal unnamed_addr global i1 false
@BN_options.data = internal global [16 x i8] zeroinitializer
@.str = [10 x i8] c"bn(%d,%d)\00"
define i8* @BN_options() {
%1 = load i1, i1* @BN_options.init
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @BN_options.init
%3 = tail call i32 @snprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @BN_options.data, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 64, i32 64)
br label %4
4: ; preds = %2, %0
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @BN_options.data, i64 0, i64 0)
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int UINT16_C(int);
__attribute__((always_)) uint16_t __attribute__((const))
OF_BSWAP16_CONST(uint16_t i) {
  return (i & UINT16_C(0xFF00)) >> 8 | (i & UINT16_C(0x00FF)) << 8;
}


x86 assembly (clang, -O0):
<OF_BSWAP16_CONST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xff00,%edi
call   1030 <UINT16_C@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
and    %ecx,%eax
sar    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xff,%edi
call   1030 <UINT16_C@plt>
mov    -0xc(%rbp),%ecx
mov    %eax,%edx
mov    -0x8(%rbp),%eax
and    %edx,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OF_BSWAP16_CONST>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xff00,%edi
call   1030 <UINT16_C@plt>
mov    %eax,%ebp
and    %ebx,%ebp
sar    $0x8,%ebp
mov    $0xff,%edi
call   1030 <UINT16_C@plt>
and    %ebx,%eax
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @OF_BSWAP16_CONST(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @UINT16_C(i32 65280)
%5 = and i32 %3, %4
%6 = ashr i32 %5, 8
%7 = load i32, i32* %2
%8 = call i32 @UINT16_C(i32 255)
%9 = and i32 %7, %8
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @OF_BSWAP16_CONST(i32 %0) {
%2 = tail call i32 @UINT16_C(i32 65280)
%3 = and i32 %2, %0
%4 = ashr i32 %3, 8
%5 = tail call i32 @UINT16_C(i32 255)
%6 = and i32 %5, %0
%7 = shl i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
/* Type definitions */
struct param {
  int dummy;
};
struct fvec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ auto_to_lpc(struct param const *, struct fvec *,
                               struct fvec *, float *);
float my_auto_to_lpc(const struct param *pptr, struct fvec *autoptr,
                     struct fvec *lpcptr) {
  float f;
  auto_to_lpc(pptr, autoptr, lpcptr, &f);
  return f;
}


x86 assembly (clang, -O0):
<my_auto_to_lpc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <auto_to_lpc@plt>
movss  -0x1c(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_auto_to_lpc>:
push   %rax
lea    0x4(%rsp),%rcx
call   1030 <auto_to_lpc@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.param = type { i32 }
%struct.fvec = type { i32 }
define float @my_auto_to_lpc(%struct.param* %0, %struct.fvec* %1, %struct.fvec* %2) {
%4 = alloca %struct.param*
%5 = alloca %struct.fvec*
%6 = alloca %struct.fvec*
%7 = alloca float
store %struct.param* %0, %struct.param** %4
store %struct.fvec* %1, %struct.fvec** %5
store %struct.fvec* %2, %struct.fvec** %6
%8 = load %struct.param*, %struct.param** %4
%9 = load %struct.fvec*, %struct.fvec** %5
%10 = load %struct.fvec*, %struct.fvec** %6
%11 = call i32 @auto_to_lpc(%struct.param* %8, %struct.fvec* %9, %struct.fvec* %10, float* %7)
%12 = load float, float* %7
ret float %12
}

LLVM IR (-O2):
%struct.param = type { i32 }
%struct.fvec = type { i32 }
define float @my_auto_to_lpc(%struct.param* %0, %struct.fvec* %1, %struct.fvec* %2) {
%4 = alloca float
%5 = bitcast float* %4 to i8*
%6 = call i32 @auto_to_lpc(%struct.param* %0, %struct.fvec* %1, %struct.fvec* %2, float* %4)
%7 = load float, float* %4
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strlen(char *);
void strcat(char *dst, const char *src) {
  dst += strlen(dst);
  strcpy(dst, src);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @strcat(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 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret void
}
extern int pos(const int x, const int y, const int size) {
  return x + y * size;
}


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

x86 assembly (clang, -O2):
<pos>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @pos(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 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @pos(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
int str_len(char *s) {
  int n;
  for (n = 0; *s != '\0'; s++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <str_len+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
cmpb   $0x0,(%rdi)
je     111c <str_len+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <str_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int __attribute__((const)) lw6sys_chr_is_digit(char c) {
  return (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<lw6sys_chr_is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <lw6sys_chr_is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw6sys_chr_is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @lw6sys_chr_is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @lw6sys_chr_is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int bbm_bulk_write(void *, unsigned short, unsigned char *, unsigned short);
signed int bbm_com_bulk_write(void *handle, unsigned short addr,
                              unsigned char *data, unsigned short size) {
  signed int res;
  res = bbm_bulk_write(handle, addr, data, size);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_bulk_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
movzwl -0x1a(%rbp),%ecx
call   1030 <bbm_bulk_write@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_bulk_write>:
jmp    1030 <bbm_bulk_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_bulk_write(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i8*, i8** %7
%13 = load i16, i16* %8
%14 = call i32 @bbm_bulk_write(i8* %10, i16 zeroext %11, i8* %12, i16 zeroext %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_bulk_write(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3) {
%5 = tail call i32 @bbm_bulk_write(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ match(char);
int /*<<< orphan*/ term();
void subtract() {
  match('-');
  term();
  emitln("pop\t%ebx");
  emitln("sub\t%ebx,%eax");
  emitln("neg\t%eax");
}


x86 assembly (clang, -O0):
<subtract>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1050 <match@plt>
mov    $0x0,%al
call   1040 <term@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb1(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb3(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract>:
push   %rax
mov    $0x2d,%edi
call   1050 <match@plt>
xor    %eax,%eax
call   1040 <term@plt>
lea    0xeb7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb6(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"pop\09%ebx\00"
@.str.1 = [14 x i8] c"sub\09%ebx,%eax\00"
@.str.2 = [9 x i8] c"neg\09%eax\00"
define void @subtract() {
%1 = call i32 @match(i8 signext 45)
%2 = call i32 (...) @term()
%3 = call i32 @emitln(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @emitln(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"pop\09%ebx\00"
@.str.1 = [14 x i8] c"sub\09%ebx,%eax\00"
@.str.2 = [9 x i8] c"neg\09%eax\00"
define void @subtract() {
%1 = tail call i32 @match(i8 signext 45)
%2 = tail call i32 (...) @term()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @emitln(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int test_imm_96uint16_mem(unsigned short *val) {
  return ((*val) & (-0x96 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_96uint16_mem>:
movzwl (%rdi),%eax
test   $0xff6a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_96uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -150
%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_96uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -150
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}