xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int getInsertQuantity() {
  int quantity, status = 0;
  do {
    printf("\n[dao.getInsertQuantity] How much entries do you want to include "
           "at file?");
    scanf("%d", &quantity);
    if (quantity <= 0) {
      status = 1;
    } else {
      status = 0;
    }
  } while (status != 1);
}


x86 assembly (clang, -O0):
<getInsertQuantity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jg     1161 <getInsertQuantity+0x41>
movl   $0x1,-0xc(%rbp)
jmp    1168 <getInsertQuantity+0x48>
movl   $0x0,-0xc(%rbp)
jmp    116d <getInsertQuantity+0x4d>
cmpl   $0x1,-0xc(%rbp)
jne    112f <getInsertQuantity+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInsertQuantity>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xf13(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jg     1140 <getInsertQuantity+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [74 x i8] c"\0A[dao.getInsertQuantity] How much entries do you want to include at file?\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getInsertQuantity() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
store i32 1, i32* %3
br label %11
10: ; preds = %4
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 1
br i1 %14, label %4, label %15
15: ; preds = %12
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [74 x i8] c"\0A[dao.getInsertQuantity] How much entries do you want to include at file?\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getInsertQuantity() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 undef
}
int test_imm_84int64_lowword_reg(long long val) {
  return ((val) & (0x84 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_84int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x84,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_84int64_lowword_reg>:
test   $0x84,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_84int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 132
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float cosf(float);
float sinf(float);
float tanf(float radians) { return (sinf(radians) / cosf(radians)); }


x86 assembly (clang, -O0):
<tanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cosf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanf>:
push   %rax
movss  %xmm0,(%rsp)
call   1030 <sinf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1040 <cosf@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sinf(float %3)
%5 = load float, float* %2
%6 = call float @cosf(float %5)
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @tanf(float %0) {
%2 = tail call float @sinf(float %0)
%3 = tail call float @cosf(float %0)
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ set_type_var(char const *, char const *, int /*<<< orphan*/);
void set_var(const char *name, const char *value) {
  set_type_var(name, value, 0);
}


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

x86 assembly (clang, -O2):
<set_var>:
xor    %edx,%edx
jmp    1030 <set_type_var@plt>

LLVM IR (-O0):
define void @set_var(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 @set_type_var(i8* %5, i8* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @set_var(i8* %0, i8* %1) {
%3 = tail call i32 @set_type_var(i8* %0, i8* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ motion_set(int);
void left(void) { motion_set(0x05); }


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

x86 assembly (clang, -O2):
<left>:
mov    $0x5,%edi
jmp    1030 <motion_set@plt>

LLVM IR (-O0):
define void @left() {
%1 = call i32 @motion_set(i32 5)
ret void
}

LLVM IR (-O2):
define void @left() {
%1 = tail call i32 @motion_set(i32 5)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_timedwait(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           struct timespec const *);
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int do_pthread_cond_wait(pthread_cond_t *__restrict cond,
                         pthread_mutex_t *__restrict mutex,
                         const struct timespec *__restrict ts) {
  if (!ts) {
    return pthread_cond_wait(cond, mutex);
  }
  return pthread_cond_timedwait(cond, mutex, ts);
}


x86 assembly (clang, -O0):
<do_pthread_cond_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <do_pthread_cond_wait+0x34>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <pthread_cond_wait@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <do_pthread_cond_wait+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <pthread_cond_timedwait@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_pthread_cond_wait>:
test   %rdx,%rdx
je     112a <do_pthread_cond_wait+0xa>
jmp    1040 <pthread_cond_timedwait@plt>
jmp    1030 <pthread_cond_wait@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @do_pthread_cond_wait(i32* noalias %0, i32* noalias %1, %struct.timespec* noalias %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca %struct.timespec*
store i32* %0, i32** %5
store i32* %1, i32** %6
store %struct.timespec* %2, %struct.timespec** %7
%8 = load %struct.timespec*, %struct.timespec** %7
%9 = icmp ne %struct.timespec* %8, null
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = call i32 @pthread_cond_wait(i32* %11, i32* %12)
store i32 %13, i32* %4
br label %19
14: ; preds = %3
%15 = load i32*, i32** %5
%16 = load i32*, i32** %6
%17 = load %struct.timespec*, %struct.timespec** %7
%18 = call i32 @pthread_cond_timedwait(i32* %15, i32* %16, %struct.timespec* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %10
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @do_pthread_cond_wait(i32* noalias %0, i32* noalias %1, %struct.timespec* noalias %2) {
%4 = icmp eq %struct.timespec* %2, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @pthread_cond_timedwait(i32* %0, i32* %1, %struct.timespec* %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %8, %7 ], [ %6, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ FatalError(char *, int);
void *calloc(int, int);
void *UtilCalloc(int size) {
  void *ret = calloc(1, size);
  if (!ret)
    FatalError("Out of memory (cannot allocate %d bytes)", size);
  return ret;
}


x86 assembly (clang, -O0):
<UtilCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <UtilCalloc+0x36>
mov    -0x4(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1040 <FatalError@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UtilCalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%edi
mov    %ebp,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <UtilCalloc+0x27>
lea    0xec0(%rip),%rdi
mov    %ebp,%esi
call   1040 <FatalError@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Out of memory (cannot allocate %d bytes)\00"
define i8* @UtilCalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc(i32 1, i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @FatalError(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [41 x i8] c"Out of memory (cannot allocate %d bytes)\00"
define noalias i8* @UtilCalloc(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @FatalError(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ accordion_test();
int /*<<< orphan*/ iteration_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putget_test();
int /*<<< orphan*/ saturation_test();
int main(int argc, char const *argv[]) {
  putget_test();
  saturation_test();
  iteration_test();
  accordion_test();
  printf("All Ok.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <putget_test@plt>
mov    $0x0,%al
call   1030 <saturation_test@plt>
mov    $0x0,%al
call   1070 <iteration_test@plt>
mov    $0x0,%al
call   1050 <accordion_test@plt>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <putget_test@plt>
xor    %eax,%eax
call   1040 <saturation_test@plt>
xor    %eax,%eax
call   1070 <iteration_test@plt>
xor    %eax,%eax
call   1050 <accordion_test@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"All Ok.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @putget_test()
%7 = call i32 (...) @saturation_test()
%8 = call i32 (...) @iteration_test()
%9 = call i32 (...) @accordion_test()
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"All Ok.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @putget_test()
%4 = tail call i32 (...) @saturation_test()
%5 = tail call i32 (...) @iteration_test()
%6 = tail call i32 (...) @accordion_test()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int fib(int n) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  else
    return (fib(n - 1) + fib(n - 2));
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_ldcl(int, int, void const *);
void ldcl(const void *i) { __builtin_arm_ldcl(1, 2, i); }


x86 assembly (clang, -O0):
<ldcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <__builtin_arm_ldcl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldcl>:
mov    %rdi,%rdx
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <__builtin_arm_ldcl@plt>

LLVM IR (-O0):
define void @ldcl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__builtin_arm_ldcl(i32 1, i32 2, i8* %3)
ret void
}

LLVM IR (-O2):
define void @ldcl(i8* %0) {
%2 = tail call i32 @__builtin_arm_ldcl(i32 1, i32 2, i8* %0)
ret void
}
void gameover_draw() {}


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

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

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

LLVM IR (-O2):
define void @gameover_draw() {
ret void
}
/* Variables and functions */
double sqrt(scalar_t__);
scalar_t__ sqv(double);
double sidelen(double x1, double y1, double x2, double y2) {
  return (sqrt(sqv(x1 - x2) + sqv(y1 - y2)));
}


x86 assembly (clang, -O0):
<sidelen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <sqv@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1030 <sqv@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sidelen>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm1,(%rsp)
subsd  %xmm2,%xmm0
call   1030 <sqv@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
call   1030 <sqv@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @sidelen(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fsub double %9, %10
%12 = call i64 @sqv(double %11)
%13 = load double, double* %6
%14 = load double, double* %8
%15 = fsub double %13, %14
%16 = call i64 @sqv(double %15)
%17 = add nsw i64 %12, %16
%18 = call double @sqrt(i64 %17)
ret double %18
}

LLVM IR (-O2):
define double @sidelen(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = tail call i64 @sqv(double %5)
%7 = fsub double %1, %3
%8 = tail call i64 @sqv(double %7)
%9 = add nsw i64 %8, %6
%10 = tail call double @sqrt(i64 %9)
ret double %10
}
/* Variables and functions */
char *i8k_get_bios_version();
int /*<<< orphan*/ printf(char *, char *);
int bios_version() {
  char *version;
  if ((version = i8k_get_bios_version()) == NULL) {
    version = "?";
  }
  printf("%s\n", version);
  return 0;
}


x86 assembly (clang, -O0):
<bios_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <i8k_get_bios_version@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1148 <bios_version+0x28>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bios_version>:
push   %rax
xor    %eax,%eax
call   1040 <i8k_get_bios_version@plt>
test   %rax,%rax
lea    0xece(%rip),%rsi
cmovne %rax,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @bios_version() {
%1 = alloca i8*
%2 = call i8* (...) @i8k_get_bios_version()
store i8* %2, i8** %1
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1
br label %5
5: ; preds = %4, %0
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @bios_version() {
%1 = tail call i8* (...) @i8k_get_bios_version()
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ disp();
int /*<<< orphan*/ getData();
int main() {
  getData();
  disp();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getData()
%2 = tail call i32 (...) @disp()
ret i32 0
}
char *log_ident() { return "$Id: log_reciva.c 230 2007-10-23 17:42:49Z  $"; }


x86 assembly (clang, -O0):
<log_ident>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_ident>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [46 x i8] c"$Id: log_reciva.c 230 2007-10-23 17:42:49Z $\00"
define i8* @log_ident() {
ret i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [46 x i8] c"$Id: log_reciva.c 230 2007-10-23 17:42:49Z $\00"
define i8* @log_ident() {
ret i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int phSendOptions(const char *from, const char *to) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "OPT FROM=%s TO=%s", from, to);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phSendOptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x3e8,%esi
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phSendOptions>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"OPT FROM=%s TO=%s\00"
define i32 @phSendOptions(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 1000, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @ph_rpc(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [18 x i8] c"OPT FROM=%s TO=%s\00"
define i32 @phSendOptions(i8* %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1000, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @ph_rpc(i8* %4)
ret i32 %6
}
/* Variables and functions */
unsigned int register_read(int);
int /*<<< orphan*/ register_write(int, int);
unsigned int register_read_igp(unsigned int key) {
  unsigned int ret;
  register_write(0x168, key & 0x7f);
  ret = register_read(0x16c);
  register_write(0x168, 0x7f);
  return ret;
}


x86 assembly (clang, -O0):
<register_read_igp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
and    $0x7f,%esi
mov    $0x168,%edi
call   1030 <register_write@plt>
mov    $0x16c,%edi
call   1040 <register_read@plt>
mov    %eax,-0x8(%rbp)
mov    $0x168,%edi
mov    $0x7f,%esi
call   1030 <register_write@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_read_igp>:
push   %rbx
mov    %edi,%esi
and    $0x7f,%esi
mov    $0x168,%edi
call   1030 <register_write@plt>
mov    $0x16c,%edi
call   1040 <register_read@plt>
mov    %eax,%ebx
mov    $0x168,%edi
mov    $0x7f,%esi
call   1030 <register_write@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @register_read_igp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 127
%6 = call i32 @register_write(i32 360, i32 %5)
%7 = call i32 @register_read(i32 364)
store i32 %7, i32* %3
%8 = call i32 @register_write(i32 360, i32 127)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @register_read_igp(i32 %0) {
%2 = and i32 %0, 127
%3 = tail call i32 @register_write(i32 360, i32 %2)
%4 = tail call i32 @register_read(i32 364)
%5 = tail call i32 @register_write(i32 360, i32 127)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void main(void) {
  int x;
  foo();
}


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, size_t);
void uninivar_strncpy(void) {
  char *s;
  char *ct;
  size_t n;
  (void)strncpy(s, ct, n);
}


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

x86 assembly (clang, -O2):
<uninivar_strncpy>:
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define void @uninivar_strncpy() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i64
%4 = load i8*, i8** %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = call i32 @strncpy(i8* %4, i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninivar_strncpy() {
%1 = tail call i32 @strncpy(i8* undef, i8* undef, i64 undef)
ret void
}
int ike_alg_init(void) {
  {}
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @ike_alg_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ike_alg_init() {
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ system(char *);
void suspend() {
  char *sh;
  move(21, 0);
  refresh();
  sh = getenv("SHELL");
  if (sh == NULL)
    sh = "/bin/sh";
  system(sh);
  raw();
  noecho();
}


x86 assembly (clang, -O0):
<suspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x15,%edi
xor    %esi,%esi
call   1080 <move@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
lea    0xe7e(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    11a1 <suspend+0x41>
lea    0xe69(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <system@plt>
mov    $0x0,%al
call   1050 <raw@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suspend>:
push   %rax
mov    $0x15,%edi
xor    %esi,%esi
call   1080 <move@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
lea    0xe85(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xe7c(%rip),%rdi
cmovne %rax,%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1050 <raw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <noecho@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"SHELL\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @suspend() {
%1 = alloca i8*
%2 = call i32 @move(i32 21, i32 0)
%3 = call i32 (...) @refresh()
%4 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %8
8: ; preds = %7, %0
%9 = load i8*, i8** %1
%10 = call i32 @system(i8* %9)
%11 = call i32 (...) @raw()
%12 = call i32 (...) @noecho()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"SHELL\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @suspend() {
%1 = tail call i32 @move(i32 21, i32 0)
%2 = tail call i32 (...) @refresh()
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %3
%6 = tail call i32 @system(i8* %5)
%7 = tail call i32 (...) @raw()
%8 = tail call i32 (...) @noecho()
ret void
}
int read_pmu_one(void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @read_pmu_one(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int ePar(int);
bool eImpar(int numero) {
  if (numero == 0)
    return false;
  else
    return ePar(numero - 1);
}


x86 assembly (clang, -O0):
<eImpar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <eImpar+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113f <eImpar+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ePar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eImpar>:
test   %edi,%edi
je     111c <eImpar+0xc>
add    $0xffffffff,%edi
jmp    1030 <ePar@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @eImpar(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @ePar(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
double mod(a)
double a;
{ return (a > 0) ? a : -a; }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <mod+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <mod+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @mod(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @mod(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ PrintHexdump(uintptr_t *, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, uintptr_t **);
int /*<<< orphan*/ stdin;
void dump_address(void) {
  char str[17];
  uintptr_t *trgt = NULL;
  printf("\t[da] Target Address: ");
  fgets(str, 17, stdin);
  sscanf(str, "%p", &trgt);
  PrintHexdump(trgt, 1);
}


x86 assembly (clang, -O0):
<dump_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x28(%rbp)
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
mov    $0x11,%esi
call   1050 <fgets@plt>
lea    -0x20(%rbp),%rdi
lea    0xe99(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
call   1030 <PrintHexdump@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_address>:
push   %rbx
sub    $0x30,%rsp
movq   $0x0,0x8(%rsp)
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x11,%esi
call   1050 <fgets@plt>
lea    0xe9b(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <sscanf@plt>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1030 <PrintHexdump@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\09[da] Target Address: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%p\00"
define void @dump_address() {
%1 = alloca [17 x i8]
%2 = alloca i64*
store i64* null, i64** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 17, i32 %5)
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64** %2)
%9 = load i64*, i64** %2
%10 = call i32 @PrintHexdump(i64* %9, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\09[da] Target Address: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%p\00"
define void @dump_address() {
%1 = alloca [17 x i8]
%2 = alloca i64*
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = bitcast i64** %2 to i8*
store i64* null, i64** %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %3, i32 17, i32 %6)
%8 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64** %2)
%9 = load i64*, i64** %2
%10 = call i32 @PrintHexdump(i64* %9, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end();
int /*<<< orphan*/ marker();
int main() {
  marker();
  end();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @marker()
%2 = tail call i32 (...) @end()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *strncdup(const char *str, size_t n,
               void *(*mmalloc)(void *user_data, size_t n), void *user_data) {
  char *p;
  if ((p = (char *)mmalloc(user_data, n)) == NULL)
    return (NULL);
  memcpy(p, str, n);
  p[n] = '\0';
  return (p);
}


x86 assembly (clang, -O0):
<strncdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1151 <strncdup+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1176 <strncdup+0x66>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rcx,%rdi
call   *%rdx
mov    %rax,%rbx
test   %rax,%rax
je     113b <strncdup+0x2b>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strncdup(i8* %0, i64 %1, i8* (i8*, i64)* nocapture %2, i8* %3) {
%5 = tail call i8* %2(i8* %3, i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
%9 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %9
br label %10
10: ; preds = %4, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ adf_convert(char const *, char const *);
int /*<<< orphan*/ usage();
int main(int argc, const char *argv[]) {
  if (argc == 3) {
    adf_convert(argv[1], argv[2]);
  } else {
    usage();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    115a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <adf_convert@plt>
jmp    1161 <main+0x41>
mov    $0x0,%al
call   1030 <usage@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1135 <main+0x15>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <adf_convert@plt>
jmp    113c <main+0x1c>
xor    %eax,%eax
call   1030 <usage@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @adf_convert(i8* %11, i8* %14)
br label %18
16: ; preds = %2
%17 = call i32 (...) @usage()
br label %18
18: ; preds = %16, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @adf_convert(i8* %6, i8* %8)
br label %12
10: ; preds = %2
%11 = tail call i32 (...) @usage()
br label %12
12: ; preds = %10, %4
ret i32 0
}
/* Variables and functions */
double genrand_close1_open2();
double genrand_open_close(void) { return 2.0 - genrand_close1_open2(); }


x86 assembly (clang, -O0):
<genrand_open_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_close1_open2@plt>
movaps %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_open_close>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_close1_open2@plt>
movsd  0xee0(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_open_close() {
%1 = call double (...) @genrand_close1_open2()
%2 = fsub double 2.000000e+00, %1
ret double %2
}

LLVM IR (-O2):
define double @genrand_open_close() {
%1 = tail call double (...) @genrand_close1_open2()
%2 = fsub double 2.000000e+00, %1
ret double %2
}
double hom_bcs(int i) { return 0.0; }


x86 assembly (clang, -O0):
<hom_bcs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hom_bcs>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @hom_bcs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @hom_bcs(i32 %0) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t twhash32_ptr(const void *ptr) {
  unsigned long val = (unsigned long)ptr;
  return (uint32_t)val;
}


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

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

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

LLVM IR (-O2):
define i32 @twhash32_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int main() {
  int x;
  x = 0;
  x = x ? 0 : 2;
  if (x != 2)
    return 1;
  return x == 2 ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     113b <main+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    114e <main+0x4e>
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x2,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct eucalyptus_opts {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ arguments_release(struct eucalyptus_opts *);
void arguments_free(struct eucalyptus_opts *args_info) {
  arguments_release(args_info);
}


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

x86 assembly (clang, -O2):
<arguments_free>:
jmp    1030 <arguments_release@plt>

LLVM IR (-O0):
%struct.eucalyptus_opts = type { i32 }
define void @arguments_free(%struct.eucalyptus_opts* %0) {
%2 = alloca %struct.eucalyptus_opts*
store %struct.eucalyptus_opts* %0, %struct.eucalyptus_opts** %2
%3 = load %struct.eucalyptus_opts*, %struct.eucalyptus_opts** %2
%4 = call i32 @arguments_release(%struct.eucalyptus_opts* %3)
ret void
}

LLVM IR (-O2):
%struct.eucalyptus_opts = type { i32 }
define void @arguments_free(%struct.eucalyptus_opts* %0) {
%2 = tail call i32 @arguments_release(%struct.eucalyptus_opts* %0)
ret void
}
void ps_raise_window(int id) { id = id; }


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

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

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

LLVM IR (-O2):
define void @ps_raise_window(i32 %0) {
ret void
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void bsts_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<bsts_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <bsts_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsts_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @bsts_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @bsts_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x4b() {
  Assert_real((isascii(75)),
              "/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_isascii.c",
              380, ("isascii should be 1 for K"));
}


x86 assembly (clang, -O0):
<t_isascii_0x4b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4b,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x17c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x4b>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x17c,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for K\00"
define void @t_isascii_0x4b() {
%1 = call i32 @isascii(i32 75)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 380, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for K\00"
define void @t_isascii_0x4b() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 380, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}