xunge/DecIR huggingface dataset:
char TestGE() {
  char r;
  __asm__("cmp $0, %1" : "=@ccge"(r) : "r"(1));
  if (r) {
    __asm__("cmp $2, %1" : "=@ccnge"(r) : "r"(1));
    if (r) {
      __asm__("cmp $1, %1" : "=@ccge"(r) : "r"(1));
      if (r)
        return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestGE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
cmp    $0x0,%eax
setge  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115f <TestGE+0x5f>
mov    $0x1,%eax
cmp    $0x2,%eax
setl   %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115a <TestGE+0x5a>
mov    $0x1,%eax
cmp    $0x1,%eax
setge  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1155 <TestGE+0x55>
movb   $0x1,-0x1(%rbp)
jmp    1163 <TestGE+0x63>
jmp    115a <TestGE+0x5a>
jmp    115f <TestGE+0x5f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestGE>:
mov    $0x1,%eax
cmp    $0x0,%eax
jl     111c <TestGE+0x1c>
cmp    $0x2,%eax
jge    111c <TestGE+0x1c>
mov    $0x1,%eax
cmp    $0x1,%eax
mov    $0x1,%al
jl     111c <TestGE+0x1c>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestGE() {
%1 = alloca i8
%2 = alloca i8
%3 = call i8 asm "cmp $$0, $1", "={@ccge},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = call i8 asm "cmp $$2, $1", "={@ccnge},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = call i8 asm "cmp $$1, $1", "={@ccge},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i8 1, i8* %1
br label %18
15: ; preds = %10
br label %16
16: ; preds = %15, %6
br label %17
17: ; preds = %16, %0
store i8 0, i8* %1
br label %18
18: ; preds = %17, %14
%19 = load i8, i8* %1
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @TestGE() {
%1 = tail call i8 asm "cmp $$0, $1", "={@ccge},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = icmp eq i8 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i8 asm "cmp $$2, $1", "={@ccnge},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i8 asm "cmp $$1, $1", "={@ccge},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3, %6, %0
br label %10
10: ; preds = %6, %9
%11 = phi i8 [ 0, %9 ], [ 1, %6 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit_failure(int ret) { exit(ret); }


x86 assembly (clang, -O0):
<exit_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_failure>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @exit_failure(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int nvram_unset(char const *);
int do_unset(const char *var) { return nvram_unset(var); }


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

x86 assembly (clang, -O2):
<do_unset>:
jmp    1030 <nvram_unset@plt>

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

LLVM IR (-O2):
define i32 @do_unset(i8* %0) {
%2 = tail call i32 @nvram_unset(i8* %0)
ret i32 %2
}
void proc_stat_ctor(void) {}


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

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

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

LLVM IR (-O2):
define void @proc_stat_ctor() {
ret void
}
void swapBytes(unsigned char *byte1, unsigned char *byte2) {
  unsigned char byte = *byte1;
  *byte1 = *byte2;
  *byte2 = byte;
}


x86 assembly (clang, -O0):
<swapBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapBytes>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swapBytes(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 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swapBytes(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
int __attribute__((__weak_import__)) decl_f(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @decl_f() {
ret i32 0
}
void sys_reportidle(void) {}


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

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

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

LLVM IR (-O2):
define void @sys_reportidle() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_f2u32(float);
int /*<<< orphan*/ rgph_u32x3_jenkins2v_u32(int /*<<< orphan*/, uintptr_t,
                                            int /*<<< orphan*/ *);
void rgph_u32x3_jenkins2v_f32(float value, uintptr_t seed, uint32_t *h) {
  rgph_u32x3_jenkins2v_u32(rgph_f2u32(value), seed, h);
}


x86 assembly (clang, -O0):
<rgph_u32x3_jenkins2v_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <rgph_f2u32@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <rgph_u32x3_jenkins2v_u32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32x3_jenkins2v_f32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <rgph_f2u32@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <rgph_u32x3_jenkins2v_u32@plt>

LLVM IR (-O0):
define void @rgph_u32x3_jenkins2v_f32(float %0, i64 %1, i32* %2) {
%4 = alloca float
%5 = alloca i64
%6 = alloca i32*
store float %0, float* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load float, float* %4
%8 = call i32 @rgph_f2u32(float %7)
%9 = load i64, i64* %5
%10 = load i32*, i32** %6
%11 = call i32 @rgph_u32x3_jenkins2v_u32(i32 %8, i64 %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @rgph_u32x3_jenkins2v_f32(float %0, i64 %1, i32* %2) {
%4 = tail call i32 @rgph_f2u32(float %0)
%5 = tail call i32 @rgph_u32x3_jenkins2v_u32(i32 %4, i64 %1, i32* %2)
ret void
}
int lcm(int a, int b) {
  static int c = 1;
  if (c % a == 0 && c % b == 0) {
    return c;
  }
  c++;
  lcm(a, b);
  return c;
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2f04(%rip),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1152 <lcm+0x42>
mov    0x2ef1(%rip),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1152 <lcm+0x42>
mov    0x2ede(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <lcm+0x65>
mov    0x2ed0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ec7(%rip)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <lcm@plt>
mov    0x2eb6(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rax
mov    0x2f11(%rip),%ecx
mov    %ecx,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    1129 <lcm+0x19>
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
je     113d <lcm+0x2d>
add    $0x1,%ecx
mov    %ecx,0x2ef6(%rip)
call   1030 <lcm@plt>
mov    0x2eeb(%rip),%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@lcm.c = internal global i32 1
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* @lcm.c
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32, i32* @lcm.c
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i32, i32* @lcm.c
store i32 %16, i32* %3
br label %24
17: ; preds = %10, %2
%18 = load i32, i32* @lcm.c
%19 = add nsw i32 %18, 1
store i32 %19, i32* @lcm.c
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 @lcm(i32 %20, i32 %21)
%23 = load i32, i32* @lcm.c
store i32 %23, i32* %3
br label %24
24: ; preds = %17, %15
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@lcm.c = internal unnamed_addr global i32 1
define i32 @lcm(i32 %0, i32 %1) {
%3 = load i32, i32* @lcm.c
%4 = srem i32 %3, %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = srem i32 %3, %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6, %11
%10 = phi i32 [ %14, %11 ], [ %3, %6 ]
ret i32 %10
11: ; preds = %6, %2
%12 = add nsw i32 %3, 1
store i32 %12, i32* @lcm.c
%13 = tail call i32 @lcm(i32 %0, i32 %1)
%14 = load i32, i32* @lcm.c
br label %9
}
void option_unset_unit2MODIF_UNGREEDY() {}


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

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

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

LLVM IR (-O2):
define void @option_unset_unit2MODIF_UNGREEDY() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heron_setmem(void *, size_t);
int /*<<< orphan*/ heron_unsetmem(void *);
void *realloc(void *, size_t);
void *heron_realloc(void *p, size_t num) {
  heron_unsetmem(p);
  void *pnew = realloc(p, num);
  heron_setmem(pnew, num);
  return pnew;
}


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

x86 assembly (clang, -O2):
<heron_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <heron_unsetmem@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <heron_setmem@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @heron_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = call i32 @heron_unsetmem(i8* %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i8* @realloc(i8* %8, i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i64, i64* %4
%13 = call i32 @heron_setmem(i8* %11, i64 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @heron_realloc(i8* %0, i64 %1) {
%3 = tail call i32 @heron_unsetmem(i8* %0)
%4 = tail call i8* @realloc(i8* %0, i64 %1)
%5 = tail call i32 @heron_setmem(i8* %4, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *sqlite3_libversion();
int /*<<< orphan*/ stdout;
int main(void) {
  fprintf(stdout, "Your sqlite version: %s\n", sqlite3_libversion());
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <sqlite3_libversion@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <sqlite3_libversion@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [25 x i8] c"Your sqlite version: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i8* (...) @sqlite3_libversion()
%4 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [25 x i8] c"Your sqlite version: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i8* (...) @sqlite3_libversion()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ g();
f(int i) {
  if ((i ^ (1 << 4)) == 0)
    g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0x10,%eax
cmp    $0x0,%eax
jne    1131 <f+0x21>
mov    $0x0,%al
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x10,%edi
jne    1121 <f+0x11>
push   %rax
xor    %eax,%eax
call   1030 <g@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = xor i32 %4, 16
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @g()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 16
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @g()
br label %5
5: ; preds = %3, %1
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t adjust_seed_4(uint32_t seed) { return seed ^ (seed << 4); }


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

x86 assembly (clang, -O2):
<adjust_seed_4>:
mov    %edi,%eax
shl    $0x4,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @adjust_seed_4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 4
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @adjust_seed_4(i32 %0) {
%2 = shl i32 %0, 4
%3 = xor i32 %2, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ anna_blob_payload(void *);
void anna_blob_set(void *blob, void *value) {
  *(void **)anna_blob_payload(blob) = value;
}


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

x86 assembly (clang, -O2):
<anna_blob_set>:
push   %rbx
mov    %rsi,%rbx
call   1030 <anna_blob_payload@plt>
mov    %rbx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @anna_blob_set(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @anna_blob_payload(i8* %6)
%8 = inttoptr i64 %7 to i8**
store i8* %5, i8** %8
ret void
}

LLVM IR (-O2):
define void @anna_blob_set(i8* %0, i8* %1) {
%3 = tail call i64 @anna_blob_payload(i8* %0)
%4 = inttoptr i64 %3 to i8**
store i8* %1, i8** %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART_putnum(unsigned int, int, char);
void UART_putint(int num) {
  unsigned int i;
  char teken = 0;
  if (num < 0) {
    i = ~num + 1;
    teken = 1;
  } else {
    i = num;
  }
  UART_putnum(i, 10, teken);
}


x86 assembly (clang, -O0):
<UART_putint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x9(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113e <UART_putint+0x2e>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movb   $0x1,-0x9(%rbp)
jmp    1144 <UART_putint+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xa,%esi
movsbl -0x9(%rbp),%edx
call   1030 <UART_putnum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_putint>:
mov    %edi,%edx
neg    %edi
cmovs  %edx,%edi
shr    $0x1f,%edx
mov    $0xa,%esi
jmp    1030 <UART_putnum@plt>

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

LLVM IR (-O2):
define void @UART_putint(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
%3 = lshr i32 %0, 31
%4 = trunc i32 %3 to i8
%5 = tail call i32 @UART_putnum(i32 %2, i32 10, i8 signext %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ large_function();
main() { large_function(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @large_function()
ret i32 0
}
double liconv(double *vals, double v) { return ((*vals * v) + *(vals + 1)); }


x86 assembly (clang, -O0):
<liconv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<liconv>:
mulsd  (%rdi),%xmm0
addsd  0x8(%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @liconv(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %5)
ret double %6
}
int _sigaction() { return -1; }


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

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

LLVM IR (-O0):
define i32 @_sigaction() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @_sigaction() {
ret i32 -1
}
/* Type definitions */
struct type_def_cell {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void type_def_cell_print_val(FILE *output, struct type_def_cell *self,
                             void *value) {
  assert(0);
}


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

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

LLVM IR (-O0):
%struct.type_def_cell = type { i32 }
define void @type_def_cell_print_val(i32* %0, %struct.type_def_cell* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca %struct.type_def_cell*
%6 = alloca i8*
store i32* %0, i32** %4
store %struct.type_def_cell* %1, %struct.type_def_cell** %5
store i8* %2, i8** %6
%7 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
%struct.type_def_cell = type { i32 }
define void @type_def_cell_print_val(i32* nocapture readnone %0, %struct.type_def_cell* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ isMatch(char *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char str[] = "aaa";
  char ptr[] = "a*a";
  if (isMatch(str, ptr))
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec6(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <isMatch@plt>
cmp    $0x0,%rax
je     1169 <main+0x49>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
jmp    1175 <main+0x55>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x616161,0x4(%rsp)
movl   $0x612a61,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <isMatch@plt>
test   %rax,%rax
lea    0xeb9(%rip),%rax
lea    0xeb5(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [4 x i8] c"aaa\00"
@__const.main.ptr = [4 x i8] c"a*a\00"
@.str = [5 x i8] c"Yes\0A\00"
@.str.1 = [4 x i8] c"No\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [4 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i64 @isMatch(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"No\00"
@str.2 = [4 x i8] c"Yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 6381921, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 6367841, i32* %2
%5 = call i64 @isMatch(i8* %3, i8* %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, void *);
double second_(void) {
  struct timeval timestr;
  void *Tzp = 0;
  gettimeofday(&timestr, Tzp);
  return (double)timestr.tv_sec + 1.0E-06 * (double)timestr.tv_usec;
}


x86 assembly (clang, -O0):
<second_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<second_>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @second_() {
%1 = alloca %struct.timeval
%2 = alloca i8*
store i8* null, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @gettimeofday(%struct.timeval* %1, i8* %3)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %10, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @second_() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
/* Variables and functions */
scalar_t__ isprint(unsigned char);
int /*<<< orphan*/ printf(char *, unsigned char);
int /*<<< orphan*/ putchar(unsigned char);
void print_char(unsigned char c) {
  if (isprint(c)) {
    putchar(c);
  } else {
    printf("\\%03o", c);
  }
}


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     115f <print_char+0x2f>
movzbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
jmp    116f <print_char+0x3f>
lea    0xe9a(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
push   %rbx
mov    %edi,%ebx
call   1050 <isprint@plt>
test   %rax,%rax
je     1146 <print_char+0x16>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>
movzbl %bl,%esi
lea    0xeb0(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\\%03o\00"
define void @print_char(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isprint(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @putchar(i8 zeroext %7)
br label %12
9: ; preds = %1
%10 = load i8, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\\%03o\00"
define void @print_char(i8 zeroext %0) {
%2 = tail call i64 @isprint(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @putchar(i8 zeroext %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
br label %8
8: ; preds = %6, %4
ret void
}
unsigned short VirtToPhysSeg(void *ptr) { return ((unsigned long)ptr) >> 4; }


x86 assembly (clang, -O0):
<VirtToPhysSeg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VirtToPhysSeg>:
mov    %rdi,%rax
shr    $0x4,%rax
ret

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

LLVM IR (-O2):
define zeroext i16 @VirtToPhysSeg(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 4
%4 = trunc i64 %3 to i16
ret i16 %4
}
int c40_halt(c40)
int c40;
{ return (ioctl(c40, (_IO('v', 5)), 0)); }


x86 assembly (clang, -O0):
<c40_halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x76,%edi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c40_halt>:
push   %rbx
mov    %edi,%ebx
mov    $0x76,%edi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @c40_halt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @_IO to i32 (i32, i32, ...)*)(i32 118, i32 5)
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @c40_halt(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_IO to i32 (i32, i32, ...)*)(i32 118, i32 5)
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isdigit(char);
int is_number(char c) {
  if (isdigit(c) != 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     113d <is_number+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <is_number+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
push   %rax
call   1030 <isdigit@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_number(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isdigit(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_number(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int Update(char *, char *, char *);
int HandleSubmitCROSSTBL(void) {
  return Update("CROSSTBL", "/local/etc/sysconfig/Crosstable.csv",
                "/bin/chmod 644 /local/etc/sysconfig/Crosstable.csv"
                " && "
                "/usr/bin/dos2unix /local/etc/sysconfig/Crosstable.csv");
}


x86 assembly (clang, -O0):
<HandleSubmitCROSSTBL>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf2f(%rip),%rsi
lea    0xee0(%rip),%rdx
call   1030 <Update@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleSubmitCROSSTBL>:
lea    0xee9(%rip),%rdi
lea    0xf33(%rip),%rsi
lea    0xee4(%rip),%rdx
jmp    1030 <Update@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"CROSSTBL\00"
@.str.1 = [36 x i8] c"/local/etc/sysconfig/Crosstable.csv\00"
@.str.2 = [108 x i8] c"/bin/chmod 644 /local/etc/sysconfig/Crosstable.csv && /usr/bin/dos2unix /local/etc/sysconfig/Crosstable.csv\00"
define i32 @HandleSubmitCROSSTBL() {
%1 = call i32 @Update(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"CROSSTBL\00"
@.str.1 = [36 x i8] c"/local/etc/sysconfig/Crosstable.csv\00"
@.str.2 = [108 x i8] c"/bin/chmod 644 /local/etc/sysconfig/Crosstable.csv && /usr/bin/dos2unix /local/etc/sysconfig/Crosstable.csv\00"
define i32 @HandleSubmitCROSSTBL() {
%1 = tail call i32 @Update(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}
void output_free_device_memory_(int *myrank_f) {}


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

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

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

LLVM IR (-O2):
define void @output_free_device_memory_(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void avrasm_rawnamenode_hook_free(void *hook) {
  if (hook) {
    sfree(hook);
  }
  return;
}


x86 assembly (clang, -O0):
<avrasm_rawnamenode_hook_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <avrasm_rawnamenode_hook_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avrasm_rawnamenode_hook_free>:
test   %rdi,%rdi
je     111a <avrasm_rawnamenode_hook_free+0xa>
jmp    1030 <sfree@plt>
ret

LLVM IR (-O0):
define void @avrasm_rawnamenode_hook_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @sfree(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @avrasm_rawnamenode_hook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[8], i;
  for (i = 0; i <= 8; ++i)
    x[i] = i;
  printf("%d\n", x[8]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jg     1149 <main+0x39>
mov    -0x34(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1126 <main+0x16>
mov    -0x10(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xd3() {
  Assert_real((isascii(211) == 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_isascii.c",
              1060, ("isascii should be 0 for 0xd3"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xd3>:
push   %rax
mov    $0xd3,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x424,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd3\00"
define void @t_isascii_0xd3() {
%1 = call i64 @isascii(i32 211)
%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 1060, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd3\00"
define void @t_isascii_0xd3() {
%1 = tail call i64 @isascii(i32 211)
%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 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct llist_head {
  int dummy;
};

/* Variables and functions */
char *nubase_config_table_get(struct llist_head *, char *);
char *nubase_config_table_get_alwaysstring(struct llist_head *config_table_list,
                                           char *key) {
  char *str;
  str = nubase_config_table_get(config_table_list, key);
  if (!str)
    return "";
  return str;
}


x86 assembly (clang, -O0):
<nubase_config_table_get_alwaysstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <nubase_config_table_get@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114c <nubase_config_table_get_alwaysstring+0x3c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <nubase_config_table_get_alwaysstring+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nubase_config_table_get_alwaysstring>:
push   %rax
call   1030 <nubase_config_table_get@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.llist_head = type { i32 }
@.str = [1 x i8] zeroinitializer
define i8* @nubase_config_table_get_alwaysstring(%struct.llist_head* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.llist_head*
%5 = alloca i8*
%6 = alloca i8*
store %struct.llist_head* %0, %struct.llist_head** %4
store i8* %1, i8** %5
%7 = load %struct.llist_head*, %struct.llist_head** %4
%8 = load i8*, i8** %5
%9 = call i8* @nubase_config_table_get(%struct.llist_head* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %15
13: ; preds = %2
%14 = load i8*, i8** %6
store i8* %14, i8** %3
br label %15
15: ; preds = %13, %12
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
%struct.llist_head = type { i32 }
@.str = [1 x i8] zeroinitializer
define i8* @nubase_config_table_get_alwaysstring(%struct.llist_head* %0, i8* %1) {
%3 = tail call i8* @nubase_config_table_get(%struct.llist_head* %0, i8* %1)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int test_imm_0Buint32_mem(unsigned int *val) {
  return ((*val) & (0x0B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Buint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 11
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int dotcpkick(argc, argv)
int argc;
char *argv[];
{
  register struct tcb *tcb;
  extern char notval[];
  tcb = (struct tcb *)htol(argv[1]);
  if (kick_tcp(tcb) == -1) {
    printf(notval);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dotcpkick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <htol@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <kick_tcp@plt>
cmp    $0xffffffff,%eax
jne    1182 <dotcpkick+0x52>
mov    0x2e71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1189 <dotcpkick+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotcpkick>:
push   %rbx
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <htol@plt>
movslq %eax,%rdi
xor    %eax,%eax
call   1040 <kick_tcp@plt>
cmp    $0xffffffff,%eax
jne    1160 <dotcpkick+0x30>
mov    0x2e8c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tcb = type opaque
@notval = external global [0 x i8]
define i32 @dotcpkick(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.tcb*
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @htol to i32 (i8*, ...)*)(i8* %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to %struct.tcb*
store %struct.tcb* %12, %struct.tcb** %6
%13 = load %struct.tcb*, %struct.tcb** %6
%14 = call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @kick_tcp to i32 (%struct.tcb*, ...)*)(%struct.tcb* %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([0 x i8], [0 x i8]* @notval, i64 0, i64 0))
store i32 1, i32* %3
br label %19
18: ; preds = %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
%struct.tcb = type opaque
@notval = external global [0 x i8]
define i32 @dotcpkick(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @htol to i32 (i8*, ...)*)(i8* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.tcb*
%8 = tail call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @kick_tcp to i32 (%struct.tcb*, ...)*)(%struct.tcb* %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([0 x i8], [0 x i8]* @notval, i64 0, i64 0))
br label %12
12: ; preds = %2, %10
%13 = phi i32 [ 1, %10 ], [ 0, %2 ]
ret i32 %13
}
int foo(int x) { return x == 0x123456; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x123456,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x123456,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1193046
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 1193046
%3 = zext i1 %2 to i32
ret i32 %3
}
char *StrChr(char *string, char symbol) {
  do {
    if (*string == symbol) {
      return (string);
    }
  } while (*string++);
  return (((char *)0));
}


x86 assembly (clang, -O0):
<StrChr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    112e <StrChr+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <StrChr+0x53>
jmp    1133 <StrChr+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110e <StrChr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrChr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
cmp    %sil,%cl
je     1122 <StrChr+0x22>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <StrChr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @StrChr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3
%11 = phi i8* [ %4, %3 ], [ null, %7 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long sieveOfEratosthenes(int, int /*<<< orphan*/);
long task7() {
  if (64 == 32) {
    printf("INFO: This is a 32bit OS. Problem 7 can only be calculated under "
           "64bit. =( \n");
    return 104743;
  }
  return sieveOfEratosthenes(10001, 0);
}


x86 assembly (clang, -O0):
<task7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2711,%edi
xor    %esi,%esi
call   1030 <sieveOfEratosthenes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<task7>:
mov    $0x2711,%edi
xor    %esi,%esi
jmp    1030 <sieveOfEratosthenes@plt>

LLVM IR (-O0):
define i64 @task7() {
%1 = call i64 @sieveOfEratosthenes(i32 10001, i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @task7() {
%1 = tail call i64 @sieveOfEratosthenes(i32 10001, i32 0)
ret i64 %1
}