xunge/DecIR huggingface dataset:
void sleep(int count) {
  for (int i = 0; i < count; i++)
    __asm("nop");
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1129 <sleep+0x29>
nop
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <sleep+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
test   %edi,%edi
jle    1116 <sleep+0x16>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
nop
add    $0xffffffff,%edi
jne    1110 <sleep+0x10>
ret

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

LLVM IR (-O2):
define void @sleep(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%6 = add nuw nsw i32 %5, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Rocketf() {
  printf("This module is on development process.Please try again later.");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"This module is on development process.Please try again later.\00"
define void @Rocketf() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"This module is on development process.Please try again later.\00"
define void @Rocketf() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}
void bs_version(int *major, int *minor, int *patch) {
  *major = 1;
  *minor = 3;
  *patch = 0;
}


x86 assembly (clang, -O0):
<bs_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_version>:
movl   $0x1,(%rdi)
movl   $0x3,(%rsi)
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @bs_version(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
store i32 1, i32* %7
%8 = load i32*, i32** %5
store i32 3, i32* %8
%9 = load i32*, i32** %6
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
define void @bs_version(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 1, i32* %0
store i32 3, i32* %1
store i32 0, i32* %2
ret void
}
int mDB_add(fn, data, dst) { return mDBi_msg('a', fn, 0, 0, 0, 0, data, dst); }


x86 assembly (clang, -O0):
<mDB_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%r10d
mov    -0xc(%rbp),%eax
mov    $0x61,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_add>:
push   %rax
mov    %edx,%r10d
mov    %esi,%r11d
mov    %edi,%esi
mov    $0x61,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   %r10
push   %r11
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_add(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 97, i32 %7, i32 0, i32 0, i32 0, i32 0, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mDB_add(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 97, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 %1, i32 %2)
ret i32 %4
}
void ExttVUTEntriesAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttVUTEntriesAuxTable() {
ret void
}
void test_5(int code) {
  _Bool temp = testit();
  _Bool rotate = (code == 22);
  if (temp == 0 && !rotate)
    oof();
}


x86 assembly (clang, -O0):
<test_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testit@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
cmpl   $0x16,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    116b <test_5+0x4b>
testb  $0x1,-0x6(%rbp)
jne    116b <test_5+0x4b>
mov    $0x0,%al
call   1040 <oof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_5>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <testit@plt>
cmp    $0x16,%ebx
je     113b <test_5+0x1b>
test   %eax,%eax
jne    113b <test_5+0x1b>
xor    %eax,%eax
pop    %rbx
jmp    1040 <oof@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_5(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
%5 = call i32 (...) @testit()
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i8
store i8 %7, i8* %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 22
%10 = zext i1 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %3
%12 = trunc i8 %11 to i1
%13 = zext i1 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %1
%16 = load i8, i8* %4
%17 = trunc i8 %16 to i1
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = call i32 (...) @oof()
br label %20
20: ; preds = %18, %15, %1
ret void
}

LLVM IR (-O2):
define void @test_5(i32 %0) {
%2 = tail call i32 (...) @testit()
%3 = icmp ne i32 %2, 0
%4 = icmp eq i32 %0, 22
%5 = or i1 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %6, %1
ret void
}
void hlt(void) { asm volatile("hlt" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @hlt() {
tail call void asm sideeffect "hlt", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SmcConn;
typedef int /*<<< orphan*/ SmPointer;

/* Variables and functions */
int /*<<< orphan*/ Terminate(int /*<<< orphan*/);
void session_die(SmcConn smc_conn, SmPointer client_data) { Terminate(0); }


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

x86 assembly (clang, -O2):
<session_die>:
xor    %edi,%edi
jmp    1030 <Terminate@plt>

LLVM IR (-O0):
define void @session_die(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @Terminate(i32 0)
ret void
}

LLVM IR (-O2):
define void @session_die(i32 %0, i32 %1) {
%3 = tail call i32 @Terminate(i32 0)
ret void
}
/* Variables and functions */
double ranf();
double randRange(double min, double max) {
  double res = ranf() * (max - min) + min;
  return res;
}


x86 assembly (clang, -O0):
<randRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ranf@plt>
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randRange>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <ranf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @randRange(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = call double (...) @ranf()
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %6, double %9, double %10)
store double %11, double* %5
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @randRange(double %0, double %1) {
%3 = tail call double (...) @ranf()
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
int linearSearch(int *A, int n, int key) {
  for (int i = 0; i < n; i++) {
    if (*(A + i) == key) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<linearSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <linearSearch+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <linearSearch+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <linearSearch+0x5a>
jmp    1145 <linearSearch+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <linearSearch+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int asn1_item_ex_combine_new(int /*<<< orphan*/ **, int /*<<< orphan*/ const *,
                             int /*<<< orphan*/);
int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) {
  return asn1_item_ex_combine_new(pval, it, 0);
}


x86 assembly (clang, -O0):
<ASN1_item_ex_new>:
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 <asn1_item_ex_combine_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ASN1_item_ex_new(i32** %0, i32* %1) {
%3 = tail call i32 @asn1_item_ex_combine_new(i32** %0, i32* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ reverse_range_equals_test();
int /*<<< orphan*/ reverse_range_expand_test();
int /*<<< orphan*/ reverse_range_extend_to_include_value_test();
int /*<<< orphan*/ reverse_range_length_test();
void reverse_range_test(void) {
  reverse_range_equals_test();
  reverse_range_expand_test();
  reverse_range_extend_to_include_value_test();
  reverse_range_length_test();
}


x86 assembly (clang, -O0):
<reverse_range_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <reverse_range_equals_test@plt>
mov    $0x0,%al
call   1050 <reverse_range_expand_test@plt>
mov    $0x0,%al
call   1030 <reverse_range_extend_to_include_value_test@plt>
mov    $0x0,%al
call   1060 <reverse_range_length_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_range_test>:
push   %rax
xor    %eax,%eax
call   1040 <reverse_range_equals_test@plt>
xor    %eax,%eax
call   1050 <reverse_range_expand_test@plt>
xor    %eax,%eax
call   1030 <reverse_range_extend_to_include_value_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <reverse_range_length_test@plt>

LLVM IR (-O0):
define void @reverse_range_test() {
%1 = call i32 (...) @reverse_range_equals_test()
%2 = call i32 (...) @reverse_range_expand_test()
%3 = call i32 (...) @reverse_range_extend_to_include_value_test()
%4 = call i32 (...) @reverse_range_length_test()
ret void
}

LLVM IR (-O2):
define void @reverse_range_test() {
%1 = tail call i32 (...) @reverse_range_equals_test()
%2 = tail call i32 (...) @reverse_range_expand_test()
%3 = tail call i32 (...) @reverse_range_extend_to_include_value_test()
%4 = tail call i32 (...) @reverse_range_length_test()
ret void
}
/* Variables and functions */
size_t base64_decoded_length(size_t srclen) { return ((srclen + 3) / 4 * 3); }


x86 assembly (clang, -O0):
<base64_decoded_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
shr    $0x2,%rax
imul   $0x3,%rax,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decoded_length>:
add    $0x3,%rdi
shr    $0x2,%rdi
lea    (%rdi,%rdi,2),%rax
ret

LLVM IR (-O0):
define i64 @base64_decoded_length(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3
%5 = udiv i64 %4, 4
%6 = mul i64 %5, 3
ret i64 %6
}

LLVM IR (-O2):
define i64 @base64_decoded_length(i64 %0) {
%2 = add i64 %0, 3
%3 = lshr i64 %2, 2
%4 = mul nuw i64 %3, 3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ CL_MM_Login(char const *, char const *);
int Cmd_Argc();
char *Cmd_Argv(int);
void CL_MM_Login_f(void) {
  const char *user = ((void *)0), *password = ((void *)0);
  if (Cmd_Argc() > 1)
    user = Cmd_Argv(1);
  if (Cmd_Argc() > 2)
    password = Cmd_Argv(2);
  CL_MM_Login(user, password);
}


x86 assembly (clang, -O0):
<CL_MM_Login_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x1,%eax
jle    1166 <CL_MM_Login_f+0x36>
mov    $0x1,%edi
call   1040 <Cmd_Argv@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jle    1184 <CL_MM_Login_f+0x54>
mov    $0x2,%edi
call   1040 <Cmd_Argv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <CL_MM_Login@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_MM_Login_f>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jl     1150 <CL_MM_Login_f+0x20>
mov    $0x1,%edi
call   1040 <Cmd_Argv@plt>
mov    %rax,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x3,%eax
jl     116b <CL_MM_Login_f+0x3b>
mov    $0x2,%edi
call   1040 <Cmd_Argv@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <CL_MM_Login@plt>

LLVM IR (-O0):
define void @CL_MM_Login_f() {
%1 = alloca i8*
%2 = alloca i8*
store i8* null, i8** %1
store i8* null, i8** %2
%3 = call i32 (...) @Cmd_Argc()
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i8* @Cmd_Argv(i32 1)
store i8* %6, i8** %1
br label %7
7: ; preds = %5, %0
%8 = call i32 (...) @Cmd_Argc()
%9 = icmp sgt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i8* @Cmd_Argv(i32 2)
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %7
%13 = load i8*, i8** %1
%14 = load i8*, i8** %2
%15 = call i32 @CL_MM_Login(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
define void @CL_MM_Login_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @Cmd_Argv(i32 1)
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %4, %3 ], [ null, %0 ]
%7 = tail call i32 (...) @Cmd_Argc()
%8 = icmp sgt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i8* @Cmd_Argv(i32 2)
br label %11
11: ; preds = %9, %5
%12 = phi i8* [ %10, %9 ], [ null, %5 ]
%13 = tail call i32 @CL_MM_Login(i8* %6, i8* %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sqrt(double);
void sqrtByReference(double *iptr) {
  *iptr = sqrt(*iptr);
  printf("square root of input is %f\n", *iptr);
}


x86 assembly (clang, -O0):
<sqrtByReference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <sqrt@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtByReference>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1138 <sqrtByReference+0x18>
sqrtsd %xmm0,%xmm0
jmp    113d <sqrtByReference+0x1d>
call   1040 <sqrt@plt>
movsd  %xmm0,(%rbx)
lea    0xeb8(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"square root of input is %f\0A\00"
define void @sqrtByReference(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @sqrt(double %4)
%6 = load double*, double** %2
store double %5, double* %6
%7 = load double*, double** %2
%8 = load double, double* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"square root of input is %f\0A\00"
define void @sqrtByReference(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @sqrt(double %2)
store double %3, double* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendByte(int, unsigned char);
char *write_string(char *ptr) {
  unsigned char c;
  while ((c = *ptr++) != 0) {
    sendByte(1, c);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
je     114f <write_string+0x3f>
mov    $0x1,%edi
movzbl -0x9(%rbp),%esi
call   1030 <sendByte@plt>
jmp    111c <write_string+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
test   %al,%al
je     113a <write_string+0x2a>
movzbl %al,%esi
mov    $0x1,%edi
call   1030 <sendByte@plt>
movzbl (%rbx),%eax
jmp    1120 <write_string+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @write_string(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %10, %5 ], [ %3, %1 ]
%7 = phi i8* [ %9, %5 ], [ %2, %1 ]
%8 = tail call i32 @sendByte(i32 1, i8 zeroext %6)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i8* [ %2, %1 ], [ %9, %5 ]
ret i8* %13
}
int test_fun(int x, int y, int tmp) {
  while (x > y) {
    tmp = x;
    x = y;
    y = tmp;
  }
  return tmp;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1130 <test_fun+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110d <test_fun+0xd>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
mov    %edx,%eax
mov    %edi,%edx
mov    %esi,%edi
cmp    %esi,%edx
mov    %edx,%esi
jg     1100 <test_fun>
ret

LLVM IR (-O0):
define i32 @test_fun(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
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %4
store i32 %12, i32* %6
%13 = load i32, i32* %5
store i32 %13, i32* %4
%14 = load i32, i32* %6
store i32 %14, i32* %5
br label %7
15: ; preds = %7
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ %0, %3 ], [ %6, %4 ]
%6 = phi i32 [ %1, %3 ], [ %5, %4 ]
%7 = phi i32 [ %2, %3 ], [ %5, %4 ]
%8 = icmp sgt i32 %5, %6
br i1 %8, label %4, label %9
9: ; preds = %4
ret i32 %7
}
int test13(int a, int b, int c, int d, int e, int f) {
  int x = a == b;
  int y = c == 0;
  int z = d == e;
  return x == y || x == z;
}


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%ecx
mov    $0x1,%al
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
je     1166 <test13+0x66>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
sete   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test13>:
cmp    %esi,%edi
sete   %al
test   %edx,%edx
setne  %dl
cmp    %r8d,%ecx
setne  %cl
xor    %al,%dl
xor    %al,%cl
or     %dl,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @test13(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp eq i32 %0, %1
%8 = icmp ne i32 %2, 0
%9 = icmp ne i32 %3, %4
%10 = xor i1 %7, %8
%11 = xor i1 %7, %9
%12 = or i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
scalar_t__ malloc(int);
int rand();
int main() {
  char *p;
  int k;
  int cnt = 0;
  for (;;) {
    p = (char *)malloc(1024 * 1024);
    for (k = 0; k < 1024; k++)
      p[k] = rand() % 256;
    cnt++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x100000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1180 <main+0x60>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x2b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x100000,%edi
call   1030 <malloc@plt>
mov    %rax,%r14
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1040 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1140 <main+0x20>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %22, %0
%6 = call i64 @malloc(i32 1048576)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %2
store i32 0, i32* %3
br label %8
8: ; preds = %19, %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 1024
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 256
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 %14, i8* %18
br label %19
19: ; preds = %11
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %8
22: ; preds = %8
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %5
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %4, %0
%2 = tail call i64 @malloc(i32 1048576)
%3 = inttoptr i64 %2 to i8*
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %9, %4 ]
%6 = tail call i32 (...) @rand()
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 %7, i8* %8
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 1024
br i1 %10, label %1, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct emvpn_socket {
  int dummy;
};

/* Variables and functions */
int none_encrypt(struct emvpn_socket *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *, int);
int none_decrypt(struct emvpn_socket *v, uint8_t *to, uint8_t *from, int len) {
  return none_encrypt(v, to, from, len);
}


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

x86 assembly (clang, -O2):
<none_decrypt>:
jmp    1030 <none_encrypt@plt>

LLVM IR (-O0):
%struct.emvpn_socket = type { i32 }
define i32 @none_decrypt(%struct.emvpn_socket* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca %struct.emvpn_socket*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store %struct.emvpn_socket* %0, %struct.emvpn_socket** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load %struct.emvpn_socket*, %struct.emvpn_socket** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @none_encrypt(%struct.emvpn_socket* %9, i32* %10, i32* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.emvpn_socket = type { i32 }
define i32 @none_decrypt(%struct.emvpn_socket* %0, i32* %1, i32* %2, i32 %3) {
%5 = tail call i32 @none_encrypt(%struct.emvpn_socket* %0, i32* %1, i32* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
struct libkeccak_hmac_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct libkeccak_hmac_state *);
int /*<<< orphan*/
libkeccak_hmac_destroy(struct libkeccak_hmac_state volatile *);
__attribute__((__optimize__("-O0"))) void
libkeccak_hmac_free(volatile struct libkeccak_hmac_state *restrict state) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
  libkeccak_hmac_destroy(state);
  free((struct libkeccak_hmac_state *)state);
#pragma GCC diagnostic pop
}


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

x86 assembly (clang, -O2):
<libkeccak_hmac_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <libkeccak_hmac_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libkeccak_hmac_state = type { i32 }
define void @libkeccak_hmac_free(%struct.libkeccak_hmac_state* noalias %0) {
%2 = alloca %struct.libkeccak_hmac_state*
store %struct.libkeccak_hmac_state* %0, %struct.libkeccak_hmac_state** %2
%3 = load %struct.libkeccak_hmac_state*, %struct.libkeccak_hmac_state** %2
%4 = call i32 @libkeccak_hmac_destroy(%struct.libkeccak_hmac_state* %3)
%5 = load %struct.libkeccak_hmac_state*, %struct.libkeccak_hmac_state** %2
%6 = call i32 @free(%struct.libkeccak_hmac_state* %5)
ret void
}

LLVM IR (-O2):
%struct.libkeccak_hmac_state = type { i32 }
define void @libkeccak_hmac_free(%struct.libkeccak_hmac_state* noalias %0) {
%2 = tail call i32 @libkeccak_hmac_destroy(%struct.libkeccak_hmac_state* %0)
%3 = tail call i32 @free(%struct.libkeccak_hmac_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
void genereate_dummy_traffic() {
  char *dummydata = (char *)malloc(2 * 1024 * 1024);
  int i_dummy;
  while (1) {
    i_dummy++;
    if (i_dummy == 2 * 1024 * 1024)
      i_dummy = 0;
    dummydata[i_dummy] = dummydata[i_dummy] + 1;
  }
  free(dummydata);
}


x86 assembly (clang, -O0):
<genereate_dummy_traffic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x200000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x200000,-0xc(%rbp)
jne    1143 <genereate_dummy_traffic+0x33>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x1,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1126 <genereate_dummy_traffic+0x16>

x86 assembly (clang, -O2):
<genereate_dummy_traffic>:
push   %rax
mov    $0x200000,%edi
call   1030 <malloc@plt>
xor    %ecx,%ecx
nopl   (%rax)
add    $0x1,%edx
cmp    $0x200000,%edx
cmove  %ecx,%edx
movslq %edx,%rsi
addb   $0x1,(%rax,%rsi,1)
jmp    1120 <genereate_dummy_traffic+0x10>

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

LLVM IR (-O2):
define void @genereate_dummy_traffic() {
%1 = tail call i64 @malloc(i32 2097152)
%2 = inttoptr i64 %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ undef, %0 ], [ %7, %3 ]
%5 = add nsw i32 %4, 1
%6 = icmp eq i32 %5, 2097152
%7 = select i1 %6, i32 0, i32 %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %2, i64 %8
%10 = load i8, i8* %9
%11 = add i8 %10, 1
store i8 %11, i8* %9
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x9b() {
  Assert_real((islower(155) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              780, ("islower should be 0 for 0x9b"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x9b\00"
define void @t_islower_0x9b() {
%1 = tail call i64 @islower(i32 155)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int SEEK_SET;
__attribute__((visibility("default"))) int get_seek_set() { return SEEK_SET; }


x86 assembly (clang, -O0):
<get_seek_set>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_seek_set>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @get_seek_set() {
%1 = load i32, i32* @SEEK_SET
ret i32 %1
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @get_seek_set() {
%1 = load i32, i32* @SEEK_SET
ret i32 %1
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_output {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
void wl_output_destroy(struct wl_output *wl_output) {
  wl_proxy_destroy((struct wl_proxy *)wl_output);
}


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

x86 assembly (clang, -O2):
<wl_output_destroy>:
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_output = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_output_destroy(%struct.wl_output* %0) {
%2 = alloca %struct.wl_output*
store %struct.wl_output* %0, %struct.wl_output** %2
%3 = load %struct.wl_output*, %struct.wl_output** %2
%4 = bitcast %struct.wl_output* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %4)
ret void
}

LLVM IR (-O2):
%struct.wl_output = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_output_destroy(%struct.wl_output* %0) {
%2 = bitcast %struct.wl_output* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
unsigned short inw_p(unsigned short port) {
  unsigned short _v;
  asm volatile("in"
               "w"
               " %"
               "w"
               "1,%"
               ""
               "0"
               : "=a"(_v)
               : "Nd"(port));
  slow_down_io();
  return _v;
}


x86 assembly (clang, -O0):
<inw_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw_p>:
push   %rbx
mov    %edi,%edx
in     (%dx),%ax
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <slow_down_io@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = call i32 (...) @slow_down_io()
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = tail call i32 (...) @slow_down_io()
ret i16 %2
}
/* Type definitions */
struct clad_sb {
  int dummy;
};

/* Variables and functions */
int clad_sb_index_double(struct clad_sb *, int /*<<< orphan*/, double *);
int clad_sb_to_double(struct clad_sb *me, double *result) {
  return clad_sb_index_double(me, 0, result);
}


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

x86 assembly (clang, -O2):
<clad_sb_to_double>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <clad_sb_index_double@plt>

LLVM IR (-O0):
%struct.clad_sb = type { i32 }
define i32 @clad_sb_to_double(%struct.clad_sb* %0, double* %1) {
%3 = alloca %struct.clad_sb*
%4 = alloca double*
store %struct.clad_sb* %0, %struct.clad_sb** %3
store double* %1, double** %4
%5 = load %struct.clad_sb*, %struct.clad_sb** %3
%6 = load double*, double** %4
%7 = call i32 @clad_sb_index_double(%struct.clad_sb* %5, i32 0, double* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.clad_sb = type { i32 }
define i32 @clad_sb_to_double(%struct.clad_sb* %0, double* %1) {
%3 = tail call i32 @clad_sb_index_double(%struct.clad_sb* %0, i32 0, double* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(char);
scalar_t__ isgraph(char);
unsigned ispunct(char c) { return isgraph(c) && !isalnum(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isgraph@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     115d <ispunct+0x3d>
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbx
mov    %edi,%ebx
call   1040 <isgraph@plt>
test   %rax,%rax
je     1140 <ispunct+0x20>
movsbl %bl,%edi
call   1030 <isalnum@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ispunct(i8 signext %0) {
%2 = tail call i64 @isgraph(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @isalnum(i8 signext %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
float sqrtf(int /*<<< orphan*/);
int /*<<< orphan*/ vec3f_dot(float const *, float const *);
float vec3f_norm(const float A[3]) { return sqrtf(vec3f_dot(A, A)); }


x86 assembly (clang, -O0):
<vec3f_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <vec3f_dot@plt>
mov    %eax,%edi
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3f_norm>:
push   %rax
mov    %rdi,%rsi
call   1040 <vec3f_dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @vec3f_norm(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @vec3f_dot(float* %3, float* %4)
%6 = call float @sqrtf(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @vec3f_norm(float* %0) {
%2 = tail call i32 @vec3f_dot(float* %0, float* %0)
%3 = tail call float @sqrtf(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((noreturn)) void main(void) {
  printf("Hello OS expanded!");
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [19 x i8] c"Hello OS expanded!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [19 x i8] c"Hello OS expanded!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int foo(int a) {
  int b = 5;
  int c = 6;
  printf("a is %d\n", a);
  return a + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"a is %d\0A\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 5, i32* %3
store i32 6, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"a is %d\0A\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = add nsw i32 %0, 1
ret i32 %3
}
void swr_config_frame() {}


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

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

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

LLVM IR (-O2):
define void @swr_config_frame() {
ret void
}
/* Variables and functions */
float average(int, int, int, int, int);
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int a = 3, b = 5, c = 6, d = 8;
  float ave = 0.0;
  ave = average(4, a, b, c, d);
  printf("the average is: %g\n", ave);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x4,%edi
call   1040 <average@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x3,%esi
mov    $0x5,%edx
mov    $0x6,%ecx
mov    $0x8,%r8d
call   1040 <average@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"the average is: %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
store i32 3, i32* %2
store i32 5, i32* %3
store i32 6, i32* %4
store i32 8, i32* %5
store float 0.000000e+00, float* %6
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call float @average(i32 4, i32 %7, i32 %8, i32 %9, i32 %10)
store float %11, float* %6
%12 = load float, float* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"the average is: %g\0A\00"
define i32 @main() {
%1 = tail call float @average(i32 4, i32 3, i32 5, i32 6, i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 0
}
/* Type definitions */
struct s_smc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ timer_done(struct s_smc *, int);
void smt_timer_done(struct s_smc *smc) { timer_done(smc, 1); }


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

x86 assembly (clang, -O2):
<smt_timer_done>:
mov    $0x1,%esi
jmp    1030 <timer_done@plt>

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

LLVM IR (-O2):
%struct.s_smc = type { i32 }
define void @smt_timer_done(%struct.s_smc* %0) {
%2 = tail call i32 @timer_done(%struct.s_smc* %0, i32 1)
ret void
}