xunge/DecIR huggingface dataset:
int fxor(int a, int b) {
  int tmp;
  a = __builtin_bswap32(a);
  tmp = a == 0;
  return tmp;
}


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

x86 assembly (clang, -O2):
<fxor>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @fxor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @llvm.bswap.i32(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @fxor(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Clamp_init(void) {
  _hmt_register_covercase("HMM_Clamp", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Clamp_init>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"HMM_Clamp\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Clamp_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"HMM_Clamp\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Clamp_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stack_st_OPENSSL_STRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_set(int /*<<< orphan*/ *, int, void const *);
char *sk_OPENSSL_STRING_set(struct stack_st_OPENSSL_STRING *sk, int idx,
                            char *ptr) {
  return (char *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr);
}


x86 assembly (clang, -O0):
<sk_OPENSSL_STRING_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <OPENSSL_sk_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_OPENSSL_STRING_set>:
jmp    1030 <OPENSSL_sk_set@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i8* @sk_OPENSSL_STRING_set(%struct.stack_st_OPENSSL_STRING* %0, i32 %1, i8* %2) {
%4 = alloca %struct.stack_st_OPENSSL_STRING*
%5 = alloca i32
%6 = alloca i8*
store %struct.stack_st_OPENSSL_STRING* %0, %struct.stack_st_OPENSSL_STRING** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.stack_st_OPENSSL_STRING*, %struct.stack_st_OPENSSL_STRING** %4
%8 = bitcast %struct.stack_st_OPENSSL_STRING* %7 to i32*
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i64 @OPENSSL_sk_set(i32* %8, i32 %9, i8* %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i8* @sk_OPENSSL_STRING_set(%struct.stack_st_OPENSSL_STRING* %0, i32 %1, i8* %2) {
%4 = getelementptr %struct.stack_st_OPENSSL_STRING, %struct.stack_st_OPENSSL_STRING* %0, i64 0, i32 0
%5 = tail call i64 @OPENSSL_sk_set(i32* %4, i32 %1, i8* %2)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
long read32(unsigned long reg1) {
  unsigned long *reg;
  signed long val;
  reg = reg1;
  val = (long)*(reg);
  return val;
}


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

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

LLVM IR (-O0):
define i64 @read32(i64 %0) {
%2 = alloca i64
%3 = alloca i64*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @read32(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void raw_dump_table(const char *caller, char *msg, unsigned char *buf,
                    int len) {}


x86 assembly (clang, -O0):
<raw_dump_table>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @raw_dump_table(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @raw_dump_table(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
int mylibB(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mylibB() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Encrypt();
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input;
  do {
    scanf("%c", &input);
    if (input == 'c' || input == 'd') {
      Encrypt();
    }
  } while (input != 'q');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
je     1159 <main+0x39>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    1160 <main+0x40>
mov    $0x0,%al
call   1030 <Encrypt@plt>
jmp    1165 <main+0x45>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0x7(%rsp),%rbx
jmp    1144 <main+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x71,%al
je     116a <main+0x4a>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movzbl 0x7(%rsp),%eax
lea    -0x63(%rax),%ecx
cmp    $0x1,%cl
ja     1140 <main+0x20>
xor    %eax,%eax
call   1030 <Encrypt@plt>
movzbl 0x7(%rsp),%eax
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 99
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 100
br i1 %11, label %12, label %14
12: ; preds = %8, %3
%13 = call i32 (...) @Encrypt()
br label %14
14: ; preds = %12, %8
br label %15
15: ; preds = %14
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 113
br i1 %18, label %3, label %19
19: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %10, %0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = add i8 %4, -99
%6 = icmp ult i8 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 (...) @Encrypt()
%9 = load i8, i8* %1
br label %10
10: ; preds = %7, %2
%11 = phi i8 [ %9, %7 ], [ %4, %2 ]
%12 = icmp eq i8 %11, 113
br i1 %12, label %13, label %2
13: ; preds = %10
ret i32 0
}
void XeviQueryVersion() {}


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

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

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

LLVM IR (-O2):
define void @XeviQueryVersion() {
ret void
}
void GPMCPrefetchEngineDisable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) &=
      (~(0x00000080u));
}


x86 assembly (clang, -O0):
<GPMCPrefetchEngineDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchEngineDisable>:
add    $0x1e0,%edi
andl   $0xffffff7f,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCPrefetchEngineDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 480
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -129
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @GPMCPrefetchEngineDisable(i32 %0) {
%2 = add i32 %0, 480
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -129
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ app();
int main() { app(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @app()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @app()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void mov_curs(int x, int y) { printf("\033[%d;%dH", y, x); }


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

x86 assembly (clang, -O2):
<mov_curs>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @mov_curs(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @mov_curs(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memory_start();
int /*<<< orphan*/ memory_stop();
int /*<<< orphan*/ printf(char *);
int main(void) {
  memory_start();
  printf("This is the user mode version.\n");
  printf("The VM Engine works but we don't really have what to do with it.\n");
  printf("You should know that the user mode version is just for testing, AND "
         "IS NOT THREAD SAFE!\n");
  memory_stop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <memory_start@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
lea    0xefd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <memory_stop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <memory_start@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <memory_stop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"This is the user mode version.\0A\00"
@.str.1 = [66 x i8] c"The VM Engine works but we don't really have what to do with it.\0A\00"
@.str.2 = [89 x i8] c"You should know that the user mode version is just for testing, AND IS NOT THREAD SAFE!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @memory_start()
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @memory_stop()
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"This is the user mode version.\00"
@str.3 = [65 x i8] c"The VM Engine works but we don't really have what to do with it.\00"
@str.4 = [88 x i8] c"You should know that the user mode version is just for testing, AND IS NOT THREAD SAFE!\00"
define i32 @main() {
%1 = tail call i32 (...) @memory_start()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 (...) @memory_stop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR76_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR76_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR76_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void skb_icv_walk(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<skb_icv_walk>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skb_icv_walk>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.skb_icv_walk = [13 x i8] c"skb_icv_walk\00"
define void @skb_icv_walk() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.skb_icv_walk, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.skb_icv_walk = [13 x i8] c"skb_icv_walk\00"
define void @skb_icv_walk() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.skb_icv_walk, i64 0, i64 0))
ret void
}
unsigned int iter_shift(const struct radix_tree_iter *iter) { return 0; }


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

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

LLVM IR (-O0):
%struct.radix_tree_iter = type opaque
define i32 @iter_shift(%struct.radix_tree_iter* %0) {
%2 = alloca %struct.radix_tree_iter*
store %struct.radix_tree_iter* %0, %struct.radix_tree_iter** %2
ret i32 0
}

LLVM IR (-O2):
%struct.radix_tree_iter = type opaque
define i32 @iter_shift(%struct.radix_tree_iter* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_tracers_name_data(int, char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fgmvwrite_tracers_name_data_(int *ntracers, char tracername[],
                                  char *data) {
  char name[10];
  strncpy(name, tracername, 8);
  *(name + 8) = '\0';
  gmvwrite_tracers_name_data(*ntracers, name, data);
}


x86 assembly (clang, -O0):
<fgmvwrite_tracers_name_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <strncpy@plt>
movb   $0x0,-0x1a(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0x22(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <gmvwrite_tracers_name_data@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_tracers_name_data_>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0x6(%rsp),%r15
mov    %r15,%rdi
mov    $0x8,%edx
call   1040 <strncpy@plt>
movb   $0x0,0xe(%rsp)
mov    (%rbx),%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <gmvwrite_tracers_name_data@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fgmvwrite_tracers_name_data_(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [10 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 8)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds i8, i8* %11, i64 8
store i8 0, i8* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %6
%17 = call i32 @gmvwrite_tracers_name_data(i32 %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_tracers_name_data_(i32* nocapture %0, i8* %1, i8* %2) {
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = call i32 @strncpy(i8* %5, i8* %1, i32 8)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 8
store i8 0, i8* %7
%8 = load i32, i32* %0
%9 = call i32 @gmvwrite_tracers_name_data(i32 %8, i8* %5, i8* %2)
ret void
}
/* Type definitions */
struct sNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insertAtBottom(struct sNode **, int);
int /*<<< orphan*/ isEmpty(struct sNode *);
int pop(struct sNode **);
void reverse(struct sNode **top_ref) {
  if (!isEmpty(*top_ref)) {
    int temp = pop(top_ref);
    reverse(top_ref);
    insertAtBottom(top_ref, temp);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1060 <isEmpty@plt>
cmp    $0x0,%eax
jne    1182 <reverse+0x42>
mov    -0x8(%rbp),%rdi
call   1040 <pop@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <insertAtBottom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1060 <isEmpty@plt>
test   %eax,%eax
je     1159 <reverse+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1040 <pop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <insertAtBottom@plt>

LLVM IR (-O0):
%struct.sNode = type { i32 }
define void @reverse(%struct.sNode** %0) {
%2 = alloca %struct.sNode**
%3 = alloca i32
store %struct.sNode** %0, %struct.sNode*** %2
%4 = load %struct.sNode**, %struct.sNode*** %2
%5 = load %struct.sNode*, %struct.sNode** %4
%6 = call i32 @isEmpty(%struct.sNode* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load %struct.sNode**, %struct.sNode*** %2
%10 = call i32 @pop(%struct.sNode** %9)
store i32 %10, i32* %3
%11 = load %struct.sNode**, %struct.sNode*** %2
%12 = load %struct.sNode**, %struct.sNode*** %2
%13 = load i32, i32* %3
%14 = call i32 @insertAtBottom(%struct.sNode** %12, i32 %13)
br label %15
15: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.sNode = type { i32 }
define void @reverse(%struct.sNode** %0) {
%2 = load %struct.sNode*, %struct.sNode** %0
%3 = tail call i32 @isEmpty(%struct.sNode* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1, %6
ret void
6: ; preds = %1
%7 = tail call i32 @pop(%struct.sNode** %0)
tail call void @reverse(%struct.sNode** %0)
%8 = tail call i32 @insertAtBottom(%struct.sNode** %0, i32 %7)
br label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
key_t createKey(void) {
  srandom(time(NULL));
  return random();
}


x86 assembly (clang, -O0):
<createKey>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1050 <random@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createKey>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <random@plt>

LLVM IR (-O0):
define i32 @createKey() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srandom(i32 %1)
%3 = call i32 (...) @random()
ret i32 %3
}

LLVM IR (-O2):
define i32 @createKey() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srandom(i32 %1)
%3 = tail call i32 (...) @random()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ use_fork_and_threads(int);
int main(int argc, char **argv) {
  use_fork_and_threads(2);
  fprintf(stderr, "all done\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <use_fork_and_threads@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"all done\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @use_fork_and_threads(i32 2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, int /*<<< orphan*/);
void localPath(char *req_path, char *local_path) {
  static int counter = 0;
  sprintf(local_path, "%s-%06d", &req_path[1], counter++);
}


x86 assembly (clang, -O0):
<localPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
add    $0x1,%rdx
mov    0x2efa(%rip),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x2eef(%rip)
lea    0xebc(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localPath>:
mov    %rsi,%rax
lea    0x1(%rdi),%rdx
mov    0x2f0f(%rip),%ecx
lea    0x1(%rcx),%esi
mov    %esi,0x2f06(%rip)
lea    0xed3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@localPath.counter = internal global i32 0
@.str = [8 x i8] c"%s-%06d\00"
define void @localPath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i32, i32* @localPath.counter
%9 = add nsw i32 %8, 1
store i32 %9, i32* @localPath.counter
%10 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@localPath.counter = internal unnamed_addr global i32 0
@.str = [8 x i8] c"%s-%06d\00"
define void @localPath(i8* %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i32, i32* @localPath.counter
%5 = add nsw i32 %4, 1
store i32 %5, i32* @localPath.counter
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_string(char *);
char *ipv4_bin(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void ipv4_bin_c(char *userInput, char *buf) {
  char *result = ipv4_bin(userInput);
  strcpy(buf, result);
  free_string(result);
}


x86 assembly (clang, -O0):
<ipv4_bin_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ipv4_bin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ipv4_bin_c(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @ipv4_bin(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @free_string(i8* %11)
ret void
}

LLVM IR (-O2):
define void @ipv4_bin_c(i8* %0, i8* %1) {
%3 = tail call i8* @ipv4_bin(i8* %0)
%4 = tail call i32 @strcpy(i8* %1, i8* %3)
%5 = tail call i32 @free_string(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
a() { printf("a\n"); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [2 x i8] c"a\00"
define i32 @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned long hash_krm(const char *chave, int tamanho) {}


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

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

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

LLVM IR (-O2):
define i64 @hash_krm(i8* nocapture readnone %0, i32 %1) {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, sq, cb;
  scanf("%d", &i);
  sq = i * i;
  cb = sq * i;
  printf("\n%d", sq);
  printf("\n%d", cb);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int left_child(int parent_index) { return (2 * parent_index); }


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

x86 assembly (clang, -O2):
<left_child>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @left_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @left_child(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int comp(const void *e1, const void *e2) {
  int *p1 = *(int **)e1, *p2 = *(int **)e2;
  if (p1[0] == p2[0])
    return p1[1] - p2[1];
  return p1[0] - p2[0];
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    114a <comp+0x4a>
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x28(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <comp+0x59>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%rdx
mov    (%rsi),%rcx
mov    (%rdx),%eax
sub    (%rcx),%eax
jne    1112 <comp+0x12>
mov    0x4(%rdx),%eax
sub    0x4(%rcx),%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = bitcast i8* %1 to i32**
%6 = load i32*, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = getelementptr inbounds i32, i32* %4, i64 1
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %6, i64 1
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
br label %18
16: ; preds = %2
%17 = sub nsw i32 %7, %8
br label %18
18: ; preds = %16, %10
%19 = phi i32 [ %15, %10 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void aeron_close_socket(int socket) { close(socket); }


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

x86 assembly (clang, -O2):
<aeron_close_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @aeron_close_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void kasan_kfree_large(void *ptr, unsigned long ip) {}


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

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

LLVM IR (-O0):
define void @kasan_kfree_large(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @kasan_kfree_large(i8* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m162_commonSet8(int, int);
void m162_initSet8(uint16_t ori_addr) {
  uint16_t proc_addr = ori_addr & 0x7300;
  m162_commonSet8(ori_addr, proc_addr);
}


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

x86 assembly (clang, -O2):
<m162_initSet8>:
mov    %edi,%esi
and    $0x7300,%esi
jmp    1030 <m162_commonSet8@plt>

LLVM IR (-O0):
define void @m162_initSet8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 29440
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @m162_commonSet8(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @m162_initSet8(i32 %0) {
%2 = and i32 %0, 29440
%3 = tail call i32 @m162_commonSet8(i32 %0, i32 %2)
ret void
}
unsigned long gcd(unsigned long a, unsigned long b) {
  unsigned long c;
  if (a > b)
    return gcd(b, a);
  c = b % a;
  if (c == 0)
    return a;
  return gcd(c, a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1144 <gcd+0x34>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
jmp    117d <gcd+0x6d>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116c <gcd+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <gcd+0x6d>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rdx
jmp    111a <gcd+0x1a>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edx,%edx
div    %rsi
test   %rdx,%rdx
je     113d <gcd+0x3d>
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
cmp    %rax,%rsi
ja     111a <gcd+0x1a>
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    111a <gcd+0x1a>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i64 [ %0, %2 ], [ %8, %7 ]
%5 = phi i64 [ %1, %2 ], [ %4, %7 ]
%6 = icmp ugt i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3, %9
%8 = phi i64 [ %5, %3 ], [ %10, %9 ]
br label %3
9: ; preds = %3
%10 = urem i64 %5, %4
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %9
ret i64 %4
}
int main(void) {
  int a = 1;
  switch (a) {
  case 1:
    a = 1;
    break;
  case 2:
    a = 1;
  case 3:
    a = 1;
  case 4:
    a = 1;
  case 5:
    a = 1;
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     1163 <main+0x63>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1163 <main+0x63>
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%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 1, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %9 [
i32 1, label %4
i32 2, label %5
i32 3, label %6
i32 4, label %7
i32 5, label %8
]
4: ; preds = %0
store i32 1, i32* %2
br label %9
5: ; preds = %0
store i32 1, i32* %2
br label %6
6: ; preds = %0, %5
store i32 1, i32* %2
br label %7
7: ; preds = %0, %6
store i32 1, i32* %2
br label %8
8: ; preds = %0, %7
store i32 1, i32* %2
br label %9
9: ; preds = %0, %8, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int rand();
int randint(int low, int high) { return rand() % (high - low) + low; }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ towlower(int /*<<< orphan*/);
void uninitvar_towlower(void) {
  wint_t i;
  (void)towlower(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_towlower>:
jmp    1030 <towlower@plt>

LLVM IR (-O0):
define void @uninitvar_towlower() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @towlower(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_towlower() {
%1 = tail call i32 @towlower(i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sleep(int);
int /*<<< orphan*/ usleep(int);
void cross_sleep(int ms) {
  if (0) {
    Sleep(ms);
  } else {
    usleep(ms);
  }
}


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

x86 assembly (clang, -O2):
<cross_sleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @cross_sleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ INS_0F();
int /*<<< orphan*/ _c_setbyte(int);
void PUSH_GS() {
  ;
  INS_0F();
  _c_setbyte(0xa8);
  ;
}


x86 assembly (clang, -O0):
<PUSH_GS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <INS_0F@plt>
mov    $0xa8,%edi
call   1040 <_c_setbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUSH_GS>:
push   %rax
xor    %eax,%eax
call   1030 <INS_0F@plt>
mov    $0xa8,%edi
pop    %rax
jmp    1040 <_c_setbyte@plt>

LLVM IR (-O0):
define void @PUSH_GS() {
%1 = call i32 (...) @INS_0F()
%2 = call i32 @_c_setbyte(i32 168)
ret void
}

LLVM IR (-O2):
define void @PUSH_GS() {
%1 = tail call i32 (...) @INS_0F()
%2 = tail call i32 @_c_setbyte(i32 168)
ret void
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ IPC_PRIVATE;
int /*<<< orphan*/ handle_fatal_error(char *);
int semget(int /*<<< orphan*/, int, int);
int create_semaphores(int nbr_semaphores) {
  int semid;
  if ((semid = semget(IPC_PRIVATE, nbr_semaphores, IPC_CREAT | 0600)) < 0) {
    handle_fatal_error("Error when creating semaphores!\n");
  }
  return semid;
}


x86 assembly (clang, -O0):
<create_semaphores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
or     $0x180,%edx
call   1030 <semget@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1163 <create_semaphores+0x43>
lea    0xea2(%rip),%rdi
call   1040 <handle_fatal_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_semaphores>:
push   %rbx
mov    %edi,%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rax
mov    $0x180,%edx
or     (%rax),%edx
call   1030 <semget@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1151 <create_semaphores+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <handle_fatal_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@IPC_PRIVATE = global i32 0
@IPC_CREAT = global i32 0
@.str = [33 x i8] c"Error when creating semaphores!\0A\00"
define i32 @create_semaphores(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @IPC_PRIVATE
%5 = load i32, i32* %2
%6 = load i32, i32* @IPC_CREAT
%7 = or i32 %6, 384
%8 = call i32 @semget(i32 %4, i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @handle_fatal_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@IPC_PRIVATE = global i32 0
@IPC_CREAT = global i32 0
@.str = [33 x i8] c"Error when creating semaphores!\0A\00"
define i32 @create_semaphores(i32 %0) {
%2 = load i32, i32* @IPC_PRIVATE
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 384
%5 = tail call i32 @semget(i32 %2, i32 %0, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @handle_fatal_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i32 %5
}
unsigned long long fib(int x) {
  if (x < 3)
    return 1;
  return fib(x - 1) + fib(x - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1132 <fib+0x22>
movq   $0x1,-0x8(%rbp)
jmp    115a <fib+0x4a>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x3,%edi
jl     1147 <fib+0x37>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %rax,%r14
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fib+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i64 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add i64 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i64 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 1, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void reg8_write(volatile uint8_t *reg, uint8_t value) { *reg = value; }


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

x86 assembly (clang, -O2):
<reg8_write>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @reg8_write(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
store volatile i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @reg8_write(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}