xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cgen_pop();
int /*<<< orphan*/ print_instr(char *);
void cgen_div() {
  print_instr("lw $t0 4($sp)");
  cgen_pop();
  print_instr("div $t0 $a0");
  print_instr("mflo $a0");
}


x86 assembly (clang, -O0):
<cgen_div>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <print_instr@plt>
mov    $0x0,%al
call   1040 <cgen_pop@plt>
lea    0xed0(%rip),%rdi
call   1030 <print_instr@plt>
lea    0xed0(%rip),%rdi
call   1030 <print_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgen_div>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print_instr@plt>
xor    %eax,%eax
call   1040 <cgen_pop@plt>
lea    0xed3(%rip),%rdi
call   1030 <print_instr@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <print_instr@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"lw $t0 4($sp)\00"
@.str.1 = [12 x i8] c"div $t0 $a0\00"
@.str.2 = [9 x i8] c"mflo $a0\00"
define void @cgen_div() {
%1 = call i32 @print_instr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @cgen_pop()
%3 = call i32 @print_instr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @print_instr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"lw $t0 4($sp)\00"
@.str.1 = [12 x i8] c"div $t0 $a0\00"
@.str.2 = [9 x i8] c"mflo $a0\00"
define void @cgen_div() {
%1 = tail call i32 @print_instr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @cgen_pop()
%3 = tail call i32 @print_instr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @print_instr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
double negate(double x) { return -x; }


x86 assembly (clang, -O0):
<negate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<negate>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @negate(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
ret double %4
}

LLVM IR (-O2):
define double @negate(double %0) {
%2 = fneg double %0
ret double %2
}
/* Type definitions */
struct userrec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cmd_stick_yn(int, char *, int /*<<< orphan*/);
void cmd_unstick(struct userrec *u, int idx, char *par) {
  cmd_stick_yn(idx, par, 0);
}


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

x86 assembly (clang, -O2):
<cmd_unstick>:
mov    %esi,%edi
mov    %rdx,%rsi
xor    %edx,%edx
jmp    1030 <cmd_stick_yn@plt>

LLVM IR (-O0):
%struct.userrec = type { i32 }
define void @cmd_unstick(%struct.userrec* %0, i32 %1, i8* %2) {
%4 = alloca %struct.userrec*
%5 = alloca i32
%6 = alloca i8*
store %struct.userrec* %0, %struct.userrec** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @cmd_stick_yn(i32 %7, i8* %8, i32 0)
ret void
}

LLVM IR (-O2):
%struct.userrec = type { i32 }
define void @cmd_unstick(%struct.userrec* nocapture readnone %0, i32 %1, i8* %2) {
%4 = tail call i32 @cmd_stick_yn(i32 %1, i8* %2, i32 0)
ret void
}
/* Variables and functions */
int strlen(char *);
signed char str2char(char *str) {
  if (strlen(str) != 1)
    return -1;
  return *str;
}


x86 assembly (clang, -O0):
<str2char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
je     1137 <str2char+0x27>
movb   $0xff,-0x1(%rbp)
jmp    1140 <str2char+0x30>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2char>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0xff,%al
cmp    $0x1,%ecx
jne    1124 <str2char+0x14>
mov    (%rbx),%al
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @str2char(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i8, i8* %0
br label %6
6: ; preds = %1, %4
%7 = phi i8 [ %5, %4 ], [ -1, %1 ]
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t GETLEN(char *buffer) {
  uint16_t *len = (uint16_t *)(buffer + 3);
  return ntohs(*len);
}


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

x86 assembly (clang, -O2):
<GETLEN>:
mov    0x3(%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @GETLEN(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = call i32 @ntohs(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @GETLEN(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @ntohs(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
main() { foo(2); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_8_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_uint64_be(const uint8_t *src, uint32_t offs,
                                      uint64_t *dst) {
  uint64_t tmp = ivory_serialize_unpack_prim_8_be(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_uint64_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_8_be@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_uint64_be>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_8_be@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_uint64_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_8_be(i32* %11)
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = call i32 @memcpy(i32* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_uint64_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_8_be(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("main()\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"main()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a_fetch_add(int volatile *, int);
void a_dec(volatile int *x) { a_fetch_add(x, -1); }


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

x86 assembly (clang, -O2):
<a_dec>:
mov    $0xffffffff,%esi
jmp    1030 <a_fetch_add@plt>

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

LLVM IR (-O2):
define void @a_dec(i32* %0) {
%2 = tail call i32 @a_fetch_add(i32* %0, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
size_t fileExists(const char *path) {
  int fd = open(path, O_RDONLY);
  if (fd >= 0) {
    close(fd);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1160 <fileExists+0x40>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
movq   $0x1,-0x8(%rbp)
jmp    1168 <fileExists+0x48>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     1141 <fileExists+0x21>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i64 @fileExists(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %4
%12 = call i32 @close(i32 %11)
store i64 1, i64* %2
br label %14
13: ; preds = %1
store i64 0, i64* %2
br label %14
14: ; preds = %13, %10
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i64 @fileExists(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %1, %5
%8 = phi i64 [ 1, %5 ], [ 0, %1 ]
ret i64 %8
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stdout;
char *strerror(int);
void printError() {
  fprintf(stdout, "ERROR! (errno %d: %s)\n", errno, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    %rax,%rcx
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printError>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebx
mov    0x2e9d(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1050 <strerror@plt>
lea    0xead(%rip),%rsi
mov    %ebx,%edi
mov    %ebp,%edx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [23 x i8] c"ERROR! (errno %d: %s)\0A\00"
@errno = global i32 0
define void @printError() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @errno
%3 = load i32, i32* @errno
%4 = call i8* @strerror(i32 %3)
%5 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [23 x i8] c"ERROR! (errno %d: %s)\0A\00"
@errno = global i32 0
define void @printError() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ sqrt(float);
float SCE_Math_Sqrt(float number) { return (float)sqrt(number); }


x86 assembly (clang, -O0):
<SCE_Math_Sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCE_Math_Sqrt>:
push   %rax
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @SCE_Math_Sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @sqrt(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @SCE_Math_Sqrt(float %0) {
%2 = tail call i64 @sqrt(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ hmod(uintptr_t, uintptr_t, uintptr_t);
void hmod_copy(uintptr_t h, uintptr_t copy) { hmod(h, h, copy); }


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

x86 assembly (clang, -O2):
<hmod_copy>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <hmod@plt>

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

LLVM IR (-O2):
define void @hmod_copy(i64 %0, i64 %1) {
%3 = tail call i32 @hmod(i64 %0, i64 %0, i64 %1)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void signalHandler(int signr) {
  printf("SIGINT system interrupt invoked [%d] ...\n", getpid());
}


x86 assembly (clang, -O0):
<signalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalHandler>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"SIGINT system interrupt invoked [%d] ...\0A\00"
define void @signalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"SIGINT system interrupt invoked [%d] ...\0A\00"
define void @signalHandler(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_copy_target_solution_to_container(int k, int i) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(104, &k, &i, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_target_solution_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x68,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_target_solution_to_container>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x68,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_copy_target_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc(i32 104, i32* %3, i32* %4, double* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_copy_target_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc(i32 104, i32* %3, i32* %4, double* undef)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main(void) {
  foo(23, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x17,%edi
mov    $0x1,%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 23, i32 1)
ret i32 0
}
int test_imm_FFuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xFF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FFuint64_midword_mem>:
cmpb   $0x0,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FFuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16711680
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  int j;
  i = __VERIFIER_nondet_int();
  while (i < 10) {
    j = i;
    while (j > 5) {
      j = j + 1;
    }
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115f <main+0x4f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    1151 <main+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x29>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterTimeoutSet(uint32_t ui32Base, uint32_t ui32Value) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000024))) = ui32Value;
}


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

x86 assembly (clang, -O2):
<I2CMasterTimeoutSet>:
mov    %rsi,0x24(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterTimeoutSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 36
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterTimeoutSet(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 36
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
int octave_o_rdonly_wrapper(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @octave_o_rdonly_wrapper() {
ret i32 -1
}
/* Variables and functions */
float powf(float, float);
float SLOW_OperatorPow(float a, float b) { return powf(a, b); }


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

x86 assembly (clang, -O2):
<SLOW_OperatorPow>:
jmp    1030 <powf@plt>

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

LLVM IR (-O2):
define float @SLOW_OperatorPow(float %0, float %1) {
%3 = tail call float @powf(float %0, float %1)
ret float %3
}
int find_byte(const char *str, const char target, int size) {
  for (int i = 0; i < size; i++) {
    if (str[i] == target) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<find_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    115a <find_byte+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <find_byte+0x47>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <find_byte+0x61>
jmp    114c <find_byte+0x4c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1118 <find_byte+0x18>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_byte>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111f <find_byte+0x1f>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,(%rdi,%rcx,1)
je     1120 <find_byte+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <find_byte+0x10>
ret
mov    %ecx,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define i32 @execute_setpriority() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int read_int16(FILE *in) {
  int i;
  i = getc(in);
  i |= getc(in) << 8;
  return i;
}


x86 assembly (clang, -O0):
<read_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_int16(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ system(char *);
void Focus(int focuscmd, int focusspd) {
  char cmdstr[256];
  sprintf(cmdstr, "setfocus %d %d  1>/dev/null 2>/dev/null", focuscmd,
          focusspd);
  system(cmdstr);
}


x86 assembly (clang, -O0):
<Focus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Focus>:
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ecx
mov    %edi,%edx
lea    0xecd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"setfocus %d %d 1>/dev/null 2>/dev/null\00"
define void @Focus(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"setfocus %d %d 1>/dev/null 2>/dev/null\00"
define void @Focus(i32 %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @system(i8* %4)
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t avg7(int8_t i, int8_t j) { return ((i + j) >> 1) + (i & 0x1); }


x86 assembly (clang, -O0):
<avg7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg7>:
lea    (%rsi,%rdi,1),%eax
sar    %eax
and    $0x1,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @avg7(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = ashr i32 %7, 1
%9 = load i32, i32* %3
%10 = and i32 %9, 1
%11 = add nsw i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @avg7(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = ashr i32 %3, 1
%5 = and i32 %0, 1
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ builder_placesettlement(int, int, int);
int /*<<< orphan*/ marker_setposition(int);
void ai_buildpregame(int player, int pos) {
  marker_setposition(pos);
  builder_placesettlement(pos, player, 1);
}


x86 assembly (clang, -O0):
<ai_buildpregame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <marker_setposition@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1030 <builder_placesettlement@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_buildpregame>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <marker_setposition@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <builder_placesettlement@plt>

LLVM IR (-O0):
define void @ai_buildpregame(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 = call i32 @marker_setposition(i32 %5)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @builder_placesettlement(i32 %7, i32 %8, i32 1)
ret void
}

LLVM IR (-O2):
define void @ai_buildpregame(i32 %0, i32 %1) {
%3 = tail call i32 @marker_setposition(i32 %1)
%4 = tail call i32 @builder_placesettlement(i32 %1, i32 %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_call(int);
void write_call_table(void) {
  int i;
  for (i = 0; i < 63; i++)
    write_call(i);
}


x86 assembly (clang, -O0):
<write_call_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3f,-0x4(%rbp)
jge    113f <write_call_table+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <write_call@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <write_call_table+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_call_table>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <write_call@plt>
add    $0x1,%ebx
cmp    $0x3f,%ebx
jne    1120 <write_call_table+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @write_call_table() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @write_call(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 63
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  float result, a[3];
  a[0] = 1.0000;
  a[1] = -0.375;
  a[2] = 0.1875;
  result = a[0] + a[1] + a[2];
  assert(result == 0.8126);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xef0(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xedf(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xece(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9c(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca [3 x float]
%3 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
store float 1.000000e+00, float* %3
%4 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float -3.750000e-01, float* %4
%5 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
store float 1.875000e-01, float* %5
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%7 = load float, float* %6
%8 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
%9 = load float, float* %8
%10 = fadd float %7, %9
%11 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
%12 = load float, float* %11
%13 = fadd float %10, %12
store float %13, float* %1
%14 = load float, float* %1
%15 = fpext float %14 to double
%16 = fcmp oeq double %15, 0x3FEA00D1B71758E2
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
int char_value(char chr) {
  if (chr <= '9')
    return chr - '0';
  else
    return chr - 'A' + 10;
}


x86 assembly (clang, -O0):
<char_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1126 <char_value+0x26>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <char_value+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_value>:
lea    -0x37(%rdi),%ecx
lea    -0x30(%rdi),%eax
cmp    $0x3a,%dil
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @char_value(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 58
%4 = select i1 %3, i32 -48, i32 -55
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
struct tcmi_rpc {
  int dummy;
};

/* Variables and functions */
long tcmi_rpc_do(struct tcmi_rpc *, unsigned int, long *);
long tcmi_rpc_call0(struct tcmi_rpc *self, unsigned int rpc_num) {
  long parameters[6] = {0, 0, 0, 0, 0, 0};
  return tcmi_rpc_do(self, rpc_num, parameters);
}


x86 assembly (clang, -O0):
<tcmi_rpc_call0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1040 <tcmi_rpc_do@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcmi_rpc_call0>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
call   1030 <tcmi_rpc_do@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.tcmi_rpc = type { i32 }
define i64 @tcmi_rpc_call0(%struct.tcmi_rpc* %0, i32 %1) {
%3 = alloca %struct.tcmi_rpc*
%4 = alloca i32
%5 = alloca [6 x i64]
store %struct.tcmi_rpc* %0, %struct.tcmi_rpc** %3
store i32 %1, i32* %4
%6 = bitcast [6 x i64]* %5 to i8*
%7 = load %struct.tcmi_rpc*, %struct.tcmi_rpc** %3
%8 = load i32, i32* %4
%9 = getelementptr inbounds [6 x i64], [6 x i64]* %5, i64 0, i64 0
%10 = call i64 @tcmi_rpc_do(%struct.tcmi_rpc* %7, i32 %8, i64* %9)
ret i64 %10
}

LLVM IR (-O2):
%struct.tcmi_rpc = type { i32 }
define i64 @tcmi_rpc_call0(%struct.tcmi_rpc* %0, i32 %1) {
%3 = alloca [6 x i64]
%4 = bitcast [6 x i64]* %3 to i8*
%5 = getelementptr inbounds [6 x i64], [6 x i64]* %3, i64 0, i64 0
%6 = call i64 @tcmi_rpc_do(%struct.tcmi_rpc* %0, i32 %1, i64* %5)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIOCADDRT;
int route_manip(int /*<<< orphan*/, char *, int, char *, char *, char *);
int route_add(char *name, int metric, char *dst, char *gateway, char *genmask) {
  return route_manip(SIOCADDRT, name, metric, dst, gateway, genmask);
}


x86 assembly (clang, -O0):
<route_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <route_manip@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<route_add>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <route_manip@plt>

LLVM IR (-O0):
@SIOCADDRT = global i32 0
define i32 @route_add(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* @SIOCADDRT
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = call i32 @route_manip(i32 %11, i8* %12, i32 %13, i8* %14, i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@SIOCADDRT = global i32 0
define i32 @route_add(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = load i32, i32* @SIOCADDRT
%7 = tail call i32 @route_manip(i32 %6, i8* %0, i32 %1, i8* %2, i8* %3, i8* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Formatted string: '%s'\n", "separate string");
  printf("Numeric digit: %d, floating-point digit: %f\n", 2, 3.14);
  printf("Signed integer: %i, unsigned integer: %u\n", -1, -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    0xef3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
mov    $0x2,%esi
movsd  0xeb8(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
mov    $0xffffffff,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
lea    0xf01(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
movsd  0xecb(%rip),%xmm0
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Formatted string: '%s'\0A\00"
@.str.1 = [16 x i8] c"separate string\00"
@.str.2 = [45 x i8] c"Numeric digit: %d, floating-point digit: %f\0A\00"
@.str.3 = [42 x i8] c"Signed integer: %i, unsigned integer: %u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 2, double 3.140000e+00)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 -1, i32 -1)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Formatted string: '%s'\0A\00"
@.str.1 = [16 x i8] c"separate string\00"
@.str.2 = [45 x i8] c"Numeric digit: %d, floating-point digit: %f\0A\00"
@.str.3 = [42 x i8] c"Signed integer: %i, unsigned integer: %u\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 2, double 3.140000e+00)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 -1, i32 -1)
ret i32 0
}
void freeMatrix(int **matrix) {
  int i;
  for (i = 0; i < 40; i++) {
    free(matrix[i]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<freeMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x28,-0xc(%rbp)
jge    114c <freeMatrix+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <freeMatrix+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0x28,%rbx
jne    1120 <freeMatrix+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeMatrix(i32** nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i32*, i32** %0, i64 %3
%5 = bitcast i32** %4 to i8**
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 40
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = bitcast i32** %0 to i8*
tail call void @free(i8* %10)
ret void
}
/* Type definitions */
struct mypacket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_fake_RST(struct mypacket *, unsigned int);
int /*<<< orphan*/ usleep(int);
int x17_process_request(struct mypacket *packet) {
  unsigned int rflags = (1 << 4) | (1 << 5);
  if (1) {
    rflags |= 1;
  }
  if (1) {
    rflags |= (1 << 1);
  }
  send_fake_RST(packet, rflags);
  usleep(20000);
  send_fake_RST(packet, rflags);
  usleep(20000);
  send_fake_RST(packet, rflags);
  return 1;
}


x86 assembly (clang, -O0):
<x17_process_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x30,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <send_fake_RST@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x17_process_request>:
push   %rbx
mov    %rdi,%rbx
mov    $0x33,%esi
call   1030 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
mov    %rbx,%rdi
mov    $0x33,%esi
call   1030 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
mov    %rbx,%rdi
mov    $0x33,%esi
call   1030 <send_fake_RST@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mypacket = type { i32 }
define i32 @x17_process_request(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
%3 = alloca i32
store %struct.mypacket* %0, %struct.mypacket** %2
store i32 48, i32* %3
%4 = load i32, i32* %3
%5 = or i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = or i32 %6, 2
store i32 %7, i32* %3
%8 = load %struct.mypacket*, %struct.mypacket** %2
%9 = load i32, i32* %3
%10 = call i32 @send_fake_RST(%struct.mypacket* %8, i32 %9)
%11 = call i32 @usleep(i32 20000)
%12 = load %struct.mypacket*, %struct.mypacket** %2
%13 = load i32, i32* %3
%14 = call i32 @send_fake_RST(%struct.mypacket* %12, i32 %13)
%15 = call i32 @usleep(i32 20000)
%16 = load %struct.mypacket*, %struct.mypacket** %2
%17 = load i32, i32* %3
%18 = call i32 @send_fake_RST(%struct.mypacket* %16, i32 %17)
ret i32 1
}

LLVM IR (-O2):
%struct.mypacket = type { i32 }
define i32 @x17_process_request(%struct.mypacket* %0) {
%2 = tail call i32 @send_fake_RST(%struct.mypacket* %0, i32 51)
%3 = tail call i32 @usleep(i32 20000)
%4 = tail call i32 @send_fake_RST(%struct.mypacket* %0, i32 51)
%5 = tail call i32 @usleep(i32 20000)
%6 = tail call i32 @send_fake_RST(%struct.mypacket* %0, i32 51)
ret i32 1
}