xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mf_write_meta_event(int, char *, int);
void copy_metatext(int type, int length, char *m) {
  mf_write_meta_event(type, m, length);
}


x86 assembly (clang, -O0):
<copy_metatext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <mf_write_meta_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_metatext>:
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <mf_write_meta_event@plt>

LLVM IR (-O0):
define void @copy_metatext(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %6
%9 = load i32, i32* %5
%10 = call i32 @mf_write_meta_event(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @copy_metatext(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @mf_write_meta_event(i32 %0, i8* %2, i32 %1)
ret void
}
void yy_1_tXmlAttributePlus(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_tXmlAttributePlus(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xf7() {
  Assert_real((isalnum(247) == 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_isalnum.c",
              1240, ("isalnum should be 0 for 0xf7"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xf7>:
push   %rax
mov    $0xf7,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d8,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xf7\00"
define void @t_isalnum_0xf7() {
%1 = call i64 @isalnum(i32 247)
%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 1240, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xf7\00"
define void @t_isalnum_0xf7() {
%1 = tail call i64 @isalnum(i32 247)
%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 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(unsigned char *, int, unsigned char *, int,
                                 int, int);
void pixel_avg_16x16(unsigned char *pix1, int i_stride_pix1,
                     unsigned char *pix2, int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 16, 16);
}


x86 assembly (clang, -O0):
<pixel_avg_16x16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x10,%r9d
mov    %r9d,%r8d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_16x16>:
mov    $0x10,%r8d
mov    $0x10,%r9d
jmp    1030 <pixel_avg_wxh@plt>

LLVM IR (-O0):
define void @pixel_avg_16x16(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_avg_wxh(i8* %9, i32 %10, i8* %11, i32 %12, i32 16, i32 16)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_16x16(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i8* %0, i32 %1, i8* %2, i32 %3, i32 16, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strlen(char *);
int main() {
  assert(strlen("asdasd") == 6);
  assert(strlen("") == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xebf(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xec4(%rip),%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"asdasd\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"asdasd\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
gerror(char error[255]) {
  printf("Error: %s", error);
  exit(1);
}


x86 assembly (clang, -O0):
<gerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<gerror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error: %s\00"
define i32 @gerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error: %s\00"
define i32 @gerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void test2_ptr(int x) {
  int buf[100];
  int *p = buf;
  p[-1] = 1;
}


x86 assembly (clang, -O0):
<test2_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rax
movl   $0x1,-0x4(%rax)
add    $0x130,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test2_ptr(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = alloca i32*
store i32 %0, i32* %2
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 -1
store i32 1, i32* %7
ret void
}

LLVM IR (-O2):
define void @test2_ptr(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo3() {
  printf("foo3 in main\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"foo3 in main\00"
define void @foo3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float floor(float);
float ptiso(float HADoverEM) { return floor(HADoverEM); }


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

x86 assembly (clang, -O2):
<ptiso>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define float @ptiso(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @floor(float %3)
ret float %4
}

LLVM IR (-O2):
define float @ptiso(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ s3c2410_nand_select_chip();
int /*<<< orphan*/ s3c2440_nand_select_chip();
void nand_select_chip(void) {
  int i;
  if (((*(volatile unsigned int *)0x560000B0) == 0x32410000) ||
      ((*(volatile unsigned int *)0x560000B0) == 0x32410002)) {
    s3c2410_nand_select_chip();
  } else {
    s3c2440_nand_select_chip();
  }
  for (i = 0; i < 10; i++)
    ;
}


x86 assembly (clang, -O0):
<nand_select_chip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x560000b0,%eax
mov    (%rax),%eax
cmp    $0x32410000,%eax
je     114c <nand_select_chip+0x2c>
mov    $0x560000b0,%eax
mov    (%rax),%eax
cmp    $0x32410002,%eax
jne    1158 <nand_select_chip+0x38>
mov    $0x0,%al
call   1040 <s3c2410_nand_select_chip@plt>
jmp    115f <nand_select_chip+0x3f>
mov    $0x0,%al
call   1030 <s3c2440_nand_select_chip@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1183 <nand_select_chip+0x63>
jmp    1175 <nand_select_chip+0x55>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <nand_select_chip+0x46>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_select_chip>:
mov    0x560000b0,%eax
cmp    $0x32410000,%eax
je     113c <nand_select_chip+0x1c>
mov    0x560000b0,%eax
cmp    $0x32410002,%eax
jne    1143 <nand_select_chip+0x23>
xor    %eax,%eax
jmp    1040 <s3c2410_nand_select_chip@plt>
xor    %eax,%eax
jmp    1030 <s3c2440_nand_select_chip@plt>

LLVM IR (-O0):
define void @nand_select_chip() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%3 = icmp eq i32 %2, 843120640
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%6 = icmp eq i32 %5, 843120642
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = call i32 (...) @s3c2410_nand_select_chip()
br label %11
9: ; preds = %4
%10 = call i32 (...) @s3c2440_nand_select_chip()
br label %11
11: ; preds = %9, %7
store i32 0, i32* %1
br label %12
12: ; preds = %16, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %19
15: ; preds = %12
br label %16
16: ; preds = %15
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %12
19: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @nand_select_chip() {
%1 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%2 = icmp eq i32 %1, 843120640
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%5 = icmp eq i32 %4, 843120642
br i1 %5, label %6, label %8
6: ; preds = %3, %0
%7 = tail call i32 (...) @s3c2410_nand_select_chip()
br label %10
8: ; preds = %3
%9 = tail call i32 (...) @s3c2440_nand_select_chip()
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int cpDirectory(char const *, char const *);
int rmDirectory(char const *);
int mvDirectory(const char *srcpath, const char *dstpath) {
  int error;
  if ((error = cpDirectory(srcpath, dstpath)) != 0)
    return error;
  if ((error = rmDirectory(srcpath)) != 0)
    return error;
  return 0;
}


x86 assembly (clang, -O0):
<mvDirectory>:
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 <cpDirectory@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1154 <mvDirectory+0x34>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <mvDirectory+0x5b>
mov    -0x10(%rbp),%rdi
call   1040 <rmDirectory@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1174 <mvDirectory+0x54>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <mvDirectory+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvDirectory>:
push   %rbx
mov    %rdi,%rbx
call   1030 <cpDirectory@plt>
test   %eax,%eax
je     112f <mvDirectory+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rmDirectory@plt>

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

LLVM IR (-O2):
define i32 @mvDirectory(i8* %0, i8* %1) {
%3 = tail call i32 @cpDirectory(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @rmDirectory(i8* %0)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ %3, %2 ], [ %6, %5 ]
ret i32 %8
}
void overhaul_quit() {}


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

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

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

LLVM IR (-O2):
define void @overhaul_quit() {
ret void
}
/* Variables and functions */
int abs(int);
int distance(int a, int b, int w) {
  return abs(a / w - b / w) + abs(a % w - b % w);
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
sub    %eax,%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
sub    %edx,%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
mov    %edx,%ecx
mov    %esi,%r8d
mov    %edi,%eax
cltd
idiv   %ecx
mov    %edx,%edi
mov    %eax,%esi
mov    %r8d,%eax
cltd
idiv   %ecx
sub    %eax,%esi
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
sub    %edx,%edi
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @distance(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = sdiv i32 %7, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sdiv i32 %10, %11
%13 = sub nsw i32 %9, %12
%14 = call i32 @abs(i32 %13)
%15 = load i32, i32* %4
%16 = load i32, i32* %6
%17 = srem i32 %15, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = srem i32 %18, %19
%21 = sub nsw i32 %17, %20
%22 = call i32 @abs(i32 %21)
%23 = add nsw i32 %14, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @distance(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, %2
%5 = sdiv i32 %1, %2
%6 = sub nsw i32 %4, %5
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
%8 = srem i32 %0, %2
%9 = srem i32 %1, %2
%10 = sub nsw i32 %8, %9
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
%12 = add nuw nsw i32 %11, %7
ret i32 %12
}
/* Variables and functions */
int NXCTRLMain();
int main(void) { return NXCTRLMain(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @NXCTRLMain()
ret i32 %1
}
/* Variables and functions */
int toascii(int);
void test_toascii_symbolic2(int x) {
  if (x > 255) {
    int ret = toascii(x);
    (void)ret;
  }
}


x86 assembly (clang, -O0):
<test_toascii_symbolic2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1133 <test_toascii_symbolic2+0x23>
mov    -0x4(%rbp),%edi
call   1030 <toascii@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_toascii_symbolic2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 255
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @toascii(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @test_toascii_symbolic2(i32 %0) {
ret void
}
void g_cclosure_marshal_VOID__OBJECT() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ display_checksums(int /*<<< orphan*/ *);
int /*<<< orphan*/ display_counts(int /*<<< orphan*/ *);
int /*<<< orphan*/ display_metadata(int /*<<< orphan*/ *);
int display_stats(FILE *fp) {
  display_counts(fp);
  display_metadata(fp);
  display_checksums(fp);
  return 0;
}


x86 assembly (clang, -O0):
<display_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <display_counts@plt>
mov    -0x8(%rbp),%rdi
call   1040 <display_metadata@plt>
mov    -0x8(%rbp),%rdi
call   1050 <display_checksums@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_stats>:
push   %rbx
mov    %rdi,%rbx
call   1030 <display_counts@plt>
mov    %rbx,%rdi
call   1040 <display_metadata@plt>
mov    %rbx,%rdi
call   1050 <display_checksums@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @display_stats(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @display_counts(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @display_metadata(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @display_checksums(i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @display_stats(i32* %0) {
%2 = tail call i32 @display_counts(i32* %0)
%3 = tail call i32 @display_metadata(i32* %0)
%4 = tail call i32 @display_checksums(i32* %0)
ret i32 0
}
int x(double i) { return i >= (i - 2.0); }


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee5(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @x(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 2.000000e+00
%6 = fcmp oge double %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @x(double %0) {
%2 = fadd double %0, -2.000000e+00
%3 = fcmp ole double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ OpenVaultDialog(int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char const *);
void MenuSwitchVault(const char *key) { OpenVaultDialog(atoi(key)); }


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

x86 assembly (clang, -O2):
<MenuSwitchVault>:
push   %rax
call   1040 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <OpenVaultDialog@plt>

LLVM IR (-O0):
define void @MenuSwitchVault(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @atoi(i8* %3)
%5 = call i32 @OpenVaultDialog(i32 %4)
ret void
}

LLVM IR (-O2):
define void @MenuSwitchVault(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = tail call i32 @OpenVaultDialog(i32 %2)
ret void
}
signed long signedlong_ignoring_signedshortint(signed long x,
                                               signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlong_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @signedlong_ignoring_signedshortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlong_ignoring_signedshortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, ...);
int /*<<< orphan*/ stdout;
void clear_screen(void) {
  fprintf(stdout, "%c[2J", 0x1B);
  fprintf(stdout, "%c[%d;%dH", 0x1B, 1, 1);
}


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x1b,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
mov    $0x1b,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed0(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"%c[2J\00"
@.str.1 = [10 x i8] c"%c[%d;%dH\00"
define void @clear_screen() {
%1 = load i32, i32* @stdout
%2 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 27)
%3 = load i32, i32* @stdout
%4 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 27, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"%c[2J\00"
@.str.1 = [10 x i8] c"%c[%d;%dH\00"
define void @clear_screen() {
%1 = load i32, i32* @stdout
%2 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 27)
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 27, i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char const *, char const *);
int /*<<< orphan*/ string_empty(char const *);
int string_equal_ignore_case(const char *string, const char *other_string) {
  if (!string_empty(string) && !string_empty(other_string))
    return !strcasecmp(string, other_string);
  return 1;
}


x86 assembly (clang, -O0):
<string_equal_ignore_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <string_empty@plt>
cmp    $0x0,%eax
jne    1176 <string_equal_ignore_case+0x56>
mov    -0x18(%rbp),%rdi
call   1040 <string_empty@plt>
cmp    $0x0,%eax
jne    1176 <string_equal_ignore_case+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    117d <string_equal_ignore_case+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equal_ignore_case>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <string_empty@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    1157 <string_equal_ignore_case+0x37>
mov    %r14,%rdi
call   1040 <string_empty@plt>
test   %eax,%eax
jne    1157 <string_equal_ignore_case+0x37>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcasecmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @string_equal_ignore_case(i8* %0, i8* %1) {
%3 = tail call i32 @string_empty(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = tail call i32 @string_empty(i8* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i32 @strcasecmp(i8* %0, i8* %1)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %2, %5, %8
%13 = phi i32 [ %11, %8 ], [ 1, %5 ], [ 1, %2 ]
ret i32 %13
}
/* Variables and functions */
int bit_num_trailing_zeros(unsigned int);
int bit_ntz(unsigned int n) { return bit_num_trailing_zeros(n); }


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

x86 assembly (clang, -O2):
<bit_ntz>:
jmp    1030 <bit_num_trailing_zeros@plt>

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

LLVM IR (-O2):
define i32 @bit_ntz(i32 %0) {
%2 = tail call i32 @bit_num_trailing_zeros(i32 %0)
ret i32 %2
}
void __rc_spinlock_release(volatile int *l) { *l = 0; }


x86 assembly (clang, -O0):
<__rc_spinlock_release>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rc_spinlock_release>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @__rc_spinlock_release(i32* %0) {
store volatile i32 0, i32* %0
ret void
}
void putword(unsigned char *p, int a) {
  p[0] = a;
  p[1] = a >> 8;
}


x86 assembly (clang, -O0):
<putword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putword>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @putword(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
ret void
}

LLVM IR (-O2):
define void @putword(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
int test_imm_84int16_mem(short *val) {
  return ((*val) & (0x84 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_84int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 132
%7 = icmp ne i32 %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_84int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 132
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ mb();
void smp_mb() { mb(); }


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

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

LLVM IR (-O0):
define void @smp_mb() {
%1 = call i32 (...) @mb()
ret void
}

LLVM IR (-O2):
define void @smp_mb() {
%1 = tail call i32 (...) @mb()
ret void
}
/* Variables and functions */
int num_inverso(int);
int /*<<< orphan*/ printf(char *);
void numpalin(int p) {
  if (p == num_inverso(p))
    printf("\nEl nombre introducido ES un palindromo");
  else
    printf("\nEl nombre introducido NO es un palindromo");
}


x86 assembly (clang, -O0):
<numpalin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <num_inverso@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jne    1157 <numpalin+0x37>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <numpalin+0x43>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numpalin>:
push   %rbx
mov    %edi,%ebx
call   1040 <num_inverso@plt>
cmp    %ebx,%eax
lea    0xecf(%rip),%rax
lea    0xef0(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0AEl nombre introducido ES un palindromo\00"
@.str.1 = [43 x i8] c"\0AEl nombre introducido NO es un palindromo\00"
define void @numpalin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @num_inverso(i32 %4)
%6 = icmp eq i32 %3, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0AEl nombre introducido ES un palindromo\00"
@.str.1 = [43 x i8] c"\0AEl nombre introducido NO es un palindromo\00"
define void @numpalin(i32 %0) {
%2 = tail call i32 @num_inverso(i32 %0)
%3 = icmp eq i32 %2, %0
%4 = select i1 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ failure(char *);
void test_new(struct list *list) {
  if (list == NULL)
    failure("list should not have been null");
}


x86 assembly (clang, -O0):
<test_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <test_new+0x23>
lea    0xed2(%rip),%rdi
call   1030 <failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_new>:
test   %rdi,%rdi
je     1116 <test_new+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <failure@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
@.str = [31 x i8] c"list should not have been null\00"
define void @test_new(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = icmp eq %struct.list* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @failure(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
@.str = [31 x i8] c"list should not have been null\00"
define void @test_new(%struct.list* readnone %0) {
%2 = icmp eq %struct.list* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @failure(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
int fun1326() { return 1326; }


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

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

LLVM IR (-O0):
define i32 @fun1326() {
ret i32 1326
}

LLVM IR (-O2):
define i32 @fun1326() {
ret i32 1326
}
/* Variables and functions */
int /*<<< orphan*/ dfs(int, int /*<<< orphan*/, int *, int *);
int *malloc(int);
int totalNQueens(int n) {
  int count = 0;
  int *stack = malloc(n * sizeof(int));
  dfs(n, 0, stack, &count);
  return count;
}


x86 assembly (clang, -O0):
<totalNQueens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
lea    -0x8(%rbp),%rcx
call   1040 <dfs@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<totalNQueens>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x0,0xc(%rsp)
lea    0x0(,%rbx,4),%edi
call   1030 <malloc@plt>
lea    0xc(%rsp),%rcx
mov    %ebx,%edi
xor    %esi,%esi
mov    %rax,%rdx
call   1040 <dfs@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @totalNQueens(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i32* @malloc(i32 %8)
store i32* %9, i32** %4
%10 = load i32, i32* %2
%11 = load i32*, i32** %4
%12 = call i32 @dfs(i32 %10, i32 0, i32* %11, i32* %3)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @totalNQueens(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = shl i32 %0, 2
%5 = tail call i32* @malloc(i32 %4)
%6 = call i32 @dfs(i32 %0, i32 0, i32* %5, i32* %2)
%7 = load i32, i32* %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
void send_user_packet(int sock, char nick[]) {
  char user_packet[512];
  sprintf(user_packet, "USER %s 0 * :%s\r\n", nick, nick);
  send(sock, user_packet, strlen(user_packet), 0);
}


x86 assembly (clang, -O0):
<send_user_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea8(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21c(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
lea    -0x210(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x21c(%rbp),%edi
mov    -0x218(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_user_packet>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%rcx
mov    %edi,%ebp
lea    0xebb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rcx,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"USER %s 0 * :%s\0D\0A\00"
define void @send_user_packet(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [512 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i32, i32* %3
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @send(i32 %10, i8* %11, i32 %13, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"USER %s 0 * :%s\0D\0A\00"
define void @send_user_packet(i32 %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @send(i32 %0, i8* %4, i32 %6, i32 0)
ret void
}
int Quote_Finalize(struct Quote *quote) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.Quote = type opaque
define i32 @Quote_Finalize(%struct.Quote* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
unsigned int lt(unsigned int, unsigned int);
unsigned int gt(unsigned int i, unsigned int j) { return lt(j, i); }


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

x86 assembly (clang, -O2):
<gt>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <lt@plt>

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

LLVM IR (-O2):
define i32 @gt(i32 %0, i32 %1) {
%3 = tail call i32 @lt(i32 %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ start_confd();
int main(int argc, char *argv[]) {
  if (argc != 1) {
    printf("Usage: ./firewall \n");
    exit(-1);
  }
  start_confd();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1166 <main+0x36>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1040 <start_confd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1141 <main+0x11>
xor    %eax,%eax
call   1040 <start_confd@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Usage: ./firewall \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = call i32 (...) @start_confd()
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Usage: ./firewall \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
%8 = tail call i32 (...) @start_confd()
ret i32 0
}
/* Variables and functions */
scalar_t__ pow(unsigned long, int);
scalar_t__ round(double);
unsigned long int quadraticBrightness(long unsigned int x) {
  return (unsigned long int)round(0.003921568627 * (double)pow(x, 2));
}


x86 assembly (clang, -O0):
<quadraticBrightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm1
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadraticBrightness>:
push   %rax
mov    $0x2,%esi
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xec8(%rip),%xmm0
pop    %rax
jmp    1040 <round@plt>

LLVM IR (-O0):
define i64 @quadraticBrightness(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @pow(i64 %3, i32 2)
%5 = sitofp i64 %4 to double
%6 = fmul double 0x3F70101010082107, %5
%7 = call i64 @round(double %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @quadraticBrightness(i64 %0) {
%2 = tail call i64 @pow(i64 %0, i32 2)
%3 = sitofp i64 %2 to double
%4 = fmul double %3, 0x3F70101010082107
%5 = tail call i64 @round(double %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *tlib_malloc(int);
char *tlib_strdup(const char *str) {
  int length = strlen(str);
  char *ret = tlib_malloc(length + 1);
  strcpy(ret, str);
  return ret;
}


x86 assembly (clang, -O0):
<tlib_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <tlib_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlib_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <tlib_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @tlib_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @tlib_malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @tlib_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @tlib_malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long ftell(int /*<<< orphan*/ *);
long ftell_internal(void *fp) { return ftell((FILE *)fp); }


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

x86 assembly (clang, -O2):
<ftell_internal>:
jmp    1030 <ftell@plt>

LLVM IR (-O0):
define i64 @ftell_internal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i64 @ftell(i32* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @ftell_internal(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @ftell(i32* %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(void *);
void bvfs_unistd_close(void *handle) {
  int *fd = handle;
  close(*fd);
  free(handle);
}


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

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

LLVM IR (-O0):
define void @bvfs_unistd_close(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @close(i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @bvfs_unistd_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
char *evbuffer_readline(struct evbuffer *);
char *redsocks_evbuffer_readline(struct evbuffer *buf) {
  return evbuffer_readline(buf);
}


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

x86 assembly (clang, -O2):
<redsocks_evbuffer_readline>:
jmp    1030 <evbuffer_readline@plt>

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define i8* @redsocks_evbuffer_readline(%struct.evbuffer* %0) {
%2 = alloca %struct.evbuffer*
store %struct.evbuffer* %0, %struct.evbuffer** %2
%3 = load %struct.evbuffer*, %struct.evbuffer** %2
%4 = call i8* @evbuffer_readline(%struct.evbuffer* %3)
ret i8* %4
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define i8* @redsocks_evbuffer_readline(%struct.evbuffer* %0) {
%2 = tail call i8* @evbuffer_readline(%struct.evbuffer* %0)
ret i8* %2
}