xunge/DecIR huggingface dataset:
float *quat_negative(float *result, float *a) {
  result[0] = -a[0];
  result[1] = -a[1];
  result[2] = -a[2];
  result[3] = -a[3];
  return result;
}


x86 assembly (clang, -O0):
<quat_negative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_negative>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movaps 0xef2(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define float* @quat_negative(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = fneg float %7
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fneg float %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = fneg float %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 3
%25 = load float, float* %24
%26 = fneg float %25
%27 = load float*, float** %3
%28 = getelementptr inbounds float, float* %27, i64 3
store float %26, float* %28
%29 = load float*, float** %3
ret float* %29
}

LLVM IR (-O2):
define float* @quat_negative(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = fneg float %10
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 3
%14 = load float, float* %13
%15 = fneg float %14
%16 = getelementptr inbounds float, float* %0, i64 3
store float %15, float* %16
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ test5_0(int /*<<< orphan*/);
int /*<<< orphan*/ test5_1();
int /*<<< orphan*/ test5_2();
int /*<<< orphan*/ write(int, char *, int);
void test5() {
  write(1, "\nTEST 5: UNIX signaling:\n\n",
        sizeof("\nTEST 5: UNIX signaling:\n\n") - 1);
  test5_0(0);
  test5_1();
  test5_2();
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
mov    $0x1a,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1060 <test5_0@plt>
mov    $0x0,%al
call   1040 <test5_1@plt>
mov    $0x0,%al
call   1050 <test5_2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rax
lea    0xeb8(%rip),%rsi
mov    $0x1,%edi
mov    $0x1a,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1060 <test5_0@plt>
xor    %eax,%eax
call   1040 <test5_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test5_2@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\0ATEST 5: UNIX signaling:\0A\0A\00"
define void @test5() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 26)
%2 = call i32 @test5_0(i32 0)
%3 = call i32 (...) @test5_1()
%4 = call i32 (...) @test5_2()
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0ATEST 5: UNIX signaling:\0A\0A\00"
define void @test5() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 26)
%2 = tail call i32 @test5_0(i32 0)
%3 = tail call i32 (...) @test5_1()
%4 = tail call i32 (...) @test5_2()
ret void
}
/* Variables and functions */
int read_fsr();
void wait_ready() {
  while (read_fsr() & (1 << 4))
    ;
}


x86 assembly (clang, -O0):
<wait_ready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_ready+0x9>
mov    $0x0,%al
call   1030 <read_fsr@plt>
and    $0x10,%eax
cmp    $0x0,%eax
je     1131 <wait_ready+0x21>
jmp    1119 <wait_ready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_ready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_fsr@plt>
test   $0x10,%al
jne    1120 <wait_ready+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_ready() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @read_fsr()
%3 = and i32 %2, 16
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @wait_ready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @read_fsr()
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
main() {
  int true = 1;
#pragma omp parallel
  {
#pragma omp for
    while (true) {
      true = 0;
    }
  }
  printf("err_for 002 : FAILED, can not compile this program.\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113c <main+0x2c>
movl   $0x0,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"err_for 002 : FAILED, can not compile this program.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 0, i32* %2
br label %3
7: ; preds = %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [52 x i8] c"err_for 002 : FAILED, can not compile this program.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int execute_unshare() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_unshare() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CloseFlexCatCatalog();
int /*<<< orphan*/ exit(int);
void MyExit(int Code) {
  CloseFlexCatCatalog();
  ((void)0);
  exit(Code);
}


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

x86 assembly (clang, -O2):
<MyExit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <CloseFlexCatCatalog@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @MyExit(i32 %0) {
%2 = tail call i32 (...) @CloseFlexCatCatalog()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xd9() {
  Assert_real((ispunct(217) == 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_ispunct.c",
              1090, ("ispunct should be 0 for 0xd9"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xd9>:
push   %rax
mov    $0xd9,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x442,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xd9\00"
define void @t_ispunct_0xd9() {
%1 = call i64 @ispunct(i32 217)
%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 1090, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xd9\00"
define void @t_ispunct_0xd9() {
%1 = tail call i64 @ispunct(i32 217)
%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 1090, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *slugify(const char string) { return ""; }


x86 assembly (clang, -O0):
<slugify>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xeef(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slugify>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @slugify(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @slugify(i8 signext %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
int log(int /*<<< orphan*/);
double optpath2(double r) { return r + 4 * log(fabs(r / 2 - 1)); }


x86 assembly (clang, -O0):
<optpath2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <log@plt>
movsd  -0x10(%rbp),%xmm0
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optpath2>:
push   %rax
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xeca(%rip),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <log@plt>
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @optpath2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 2.000000e+00
%6 = fsub double %5, 1.000000e+00
%7 = call i32 @fabs(double %6)
%8 = call i32 @log(i32 %7)
%9 = mul nsw i32 4, %8
%10 = sitofp i32 %9 to double
%11 = fadd double %3, %10
ret double %11
}

LLVM IR (-O2):
define double @optpath2(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = fadd double %2, -1.000000e+00
%4 = tail call i32 @fabs(double %3)
%5 = tail call i32 @log(i32 %4)
%6 = shl nsw i32 %5, 2
%7 = sitofp i32 %6 to double
%8 = fadd double %7, %0
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ ks0108_set_address(unsigned short);
int /*<<< orphan*/ ks0108_set_page(unsigned short);
void __ks0108_GOTO_XY(unsigned short X, unsigned short Y) {
  ks0108_set_page(X);
  ks0108_set_address(Y);
}


x86 assembly (clang, -O0):
<__ks0108_GOTO_XY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <ks0108_set_page@plt>
movzwl -0x4(%rbp),%edi
call   1040 <ks0108_set_address@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ks0108_GOTO_XY>:
push   %rbx
mov    %esi,%ebx
call   1030 <ks0108_set_page@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <ks0108_set_address@plt>

LLVM IR (-O0):
define void @__ks0108_GOTO_XY(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @ks0108_set_page(i16 zeroext %5)
%7 = load i16, i16* %4
%8 = call i32 @ks0108_set_address(i16 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @__ks0108_GOTO_XY(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @ks0108_set_page(i16 zeroext %0)
%4 = tail call i32 @ks0108_set_address(i16 zeroext %1)
ret void
}
int charup(int c) {
  if ((c >= 'a') && (c <= 'z'))
    c -= 32;
  return c;
}


x86 assembly (clang, -O0):
<charup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <charup+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <charup+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charup>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @charup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @charup(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ OAL_DELETE_SEMAPHORE();
signed int fc8180_ppi_deinit(void *handle) {
  OAL_DELETE_SEMAPHORE();
  return 0;
}


x86 assembly (clang, -O0):
<fc8180_ppi_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <OAL_DELETE_SEMAPHORE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fc8180_ppi_deinit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @OAL_DELETE_SEMAPHORE()
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8180_ppi_deinit(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @OAL_DELETE_SEMAPHORE()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int begin_test() {
  printf("BEGIN TEST\n\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"BEGIN TEST\0A\0A\00"
define i32 @begin_test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"BEGIN TEST\0A\00"
define i32 @begin_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_fn(void *data, void *hint) { free(data); }


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

x86 assembly (clang, -O2):
<free_fn>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_fn(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
unsigned twocint(char *buff) { return (buff[0] - '0') * 10 + (buff[1] - '0'); }


x86 assembly (clang, -O0):
<twocint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twocint>:
movsbl (%rdi),%eax
lea    (%rax,%rax,4),%eax
movsbl 0x1(%rdi),%ecx
lea    (%rcx,%rax,2),%eax
add    $0xfffffdf0,%eax
ret

LLVM IR (-O0):
define i32 @twocint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 48
%8 = mul nsw i32 %7, 10
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = add nsw i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @twocint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = mul nsw i32 %3, 10
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, -528
%9 = add nsw i32 %8, %4
ret i32 %9
}
/* Type definitions */
struct mark {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mark_free(struct mark *);
int /*<<< orphan*/ vmark_clear(struct mark *);
void vmark_free(struct mark *m) {
  vmark_clear(m);
  mark_free(m);
}


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

x86 assembly (clang, -O2):
<vmark_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <vmark_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mark_free@plt>

LLVM IR (-O0):
%struct.mark = type { i32 }
define void @vmark_free(%struct.mark* %0) {
%2 = alloca %struct.mark*
store %struct.mark* %0, %struct.mark** %2
%3 = load %struct.mark*, %struct.mark** %2
%4 = call i32 @vmark_clear(%struct.mark* %3)
%5 = load %struct.mark*, %struct.mark** %2
%6 = call i32 @mark_free(%struct.mark* %5)
ret void
}

LLVM IR (-O2):
%struct.mark = type { i32 }
define void @vmark_free(%struct.mark* %0) {
%2 = tail call i32 @vmark_clear(%struct.mark* %0)
%3 = tail call i32 @mark_free(%struct.mark* %0)
ret void
}
/* Type definitions */
struct aFILE {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int fseeko(int /*<<< orphan*/, int /*<<< orphan*/, int);
int my_fseeko(struct aFILE *fp, off_t offset, int whence) {
  return fseeko(_get_actual_fp(fp), offset, whence);
}


x86 assembly (clang, -O0):
<my_fseeko>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <fseeko@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_fseeko(%struct.aFILE* %0, i32 %1, i32 %2) {
%4 = alloca %struct.aFILE*
%5 = alloca i32
%6 = alloca i32
store %struct.aFILE* %0, %struct.aFILE** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.aFILE*, %struct.aFILE** %4
%8 = call i32 @_get_actual_fp(%struct.aFILE* %7)
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fseeko(i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_fseeko(%struct.aFILE* %0, i32 %1, i32 %2) {
%4 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%5 = tail call i32 @fseeko(i32 %4, i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int epoll_create(int);
int kevent(void) { return epoll_create(1); }


x86 assembly (clang, -O0):
<kevent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <epoll_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kevent>:
mov    $0x1,%edi
jmp    1030 <epoll_create@plt>

LLVM IR (-O0):
define i32 @kevent() {
%1 = call i32 @epoll_create(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @kevent() {
%1 = tail call i32 @epoll_create(i32 1)
ret i32 %1
}
char *str_cat(char *dest, const char *src) {
  while (*dest)
    dest++;
  while ((*dest++ = *src++))
    ;
  return --dest;
}


x86 assembly (clang, -O0):
<str_cat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <str_cat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <str_cat+0xc>
jmp    112f <str_cat+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <str_cat+0x5e>
jmp    112f <str_cat+0x2f>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cat>:
mov    %rdi,%rax
add    $0xfffffffffffffffe,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x2(%rax)
lea    0x1(%rax),%rax
jne    1110 <str_cat+0x10>
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <str_cat+0x20>
ret

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

LLVM IR (-O2):
define i8* @str_cat(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %9
}
struct tc_node *copy_node(const struct tc_node *node, struct tc_tree *tree) {}


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

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

LLVM IR (-O0):
%struct.tc_node = type opaque
%struct.tc_tree = type opaque
define %struct.tc_node* @copy_node(%struct.tc_node* %0, %struct.tc_tree* %1) {
%3 = alloca %struct.tc_node*
%4 = alloca %struct.tc_node*
%5 = alloca %struct.tc_tree*
store %struct.tc_node* %0, %struct.tc_node** %4
store %struct.tc_tree* %1, %struct.tc_tree** %5
%6 = load %struct.tc_node*, %struct.tc_node** %3
ret %struct.tc_node* %6
}

LLVM IR (-O2):
%struct.tc_node = type opaque
%struct.tc_tree = type opaque
define noalias %struct.tc_node* @copy_node(%struct.tc_node* nocapture readnone %0, %struct.tc_tree* nocapture readnone %1) {
ret %struct.tc_node* undef
}
int ss_revSeq(char *seq, int length) {
  char temp;
  char *end_ptr;
  end_ptr = seq + (length - 1);
  while (end_ptr > seq) {
    temp = *end_ptr;
    *end_ptr-- = *seq;
    *seq++ = temp;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ss_revSeq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1166 <ss_revSeq+0x66>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111f <ss_revSeq+0x1f>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_revSeq>:
cmp    $0x2,%esi
jl     112c <ss_revSeq+0x2c>
add    $0xffffffff,%esi
add    %rdi,%rsi
add    $0x1,%rdi
nop
movzbl (%rsi),%eax
movzbl -0x1(%rdi),%ecx
mov    %cl,(%rsi)
add    $0xffffffffffffffff,%rsi
mov    %al,-0x1(%rdi)
lea    0x1(%rdi),%rax
cmp    %rdi,%rsi
mov    %rax,%rdi
ja     1110 <ss_revSeq+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ss_revSeq(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
br label %8
8: ; preds = %4, %8
%9 = phi i8* [ %13, %8 ], [ %7, %4 ]
%10 = phi i8* [ %14, %8 ], [ %0, %4 ]
%11 = load i8, i8* %9
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 -1
store i8 %12, i8* %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %11, i8* %10
%15 = icmp ugt i8* %13, %14
br i1 %15, label %8, label %16
16: ; preds = %8, %2
ret i32 0
}
int isatty(int id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void sr_syslog_deinit(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @sr_syslog_deinit() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ pfatal(char *, size_t);
void *xmalloc(size_t n) {
  void *p = malloc(n);
  if (!p)
    pfatal("xmalloc(%d)", n);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <pfatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <pfatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"xmalloc(%d)\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pfatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void dump_profile(void) { system("readprofile"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"readprofile\00"
define void @dump_profile() {
%1 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"readprofile\00"
define void @dump_profile() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void times(int i, void (*f)()) {
  for (; i > 0; i--) {
    f();
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1148 <times+0x38>
mov    $0x0,%al
call   *-0x10(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <times+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<times>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1136 <times+0x26>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
nop
xor    %eax,%eax
call   *%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <times+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @times(i32 %0, void (...)* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
tail call void (...) %1()
%6 = tail call i32 @putchar(i32 10)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
unsigned long djb2(unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <djb2+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djb2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <djb2+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
long abstract_text___Int_int_to_s_len___impl(long);
long core__abstract_text___Int___int_to_s_len(long self) {
  long var;
  long var1;
  var1 = abstract_text___Int_int_to_s_len___impl(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<core__abstract_text___Int___int_to_s_len>:
jmp    1030 <abstract_text___Int_int_to_s_len___impl@plt>

LLVM IR (-O0):
define i64 @core__abstract_text___Int___int_to_s_len(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i64 @abstract_text___Int_int_to_s_len___impl(i64 %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %3
br label %8
8: ; preds = %1
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @core__abstract_text___Int___int_to_s_len(i64 %0) {
%2 = tail call i64 @abstract_text___Int_int_to_s_len___impl(i64 %0)
ret i64 %2
}
/* Variables and functions */
int RAND_MAX;
int rand();
int rand_between(int low, int high) {
  return low + rand() / (RAND_MAX / (high - low + 1) + 1);
}


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

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

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rand_between(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 = call i32 (...) @rand()
%7 = load i32, i32* @RAND_MAX
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sdiv i32 %7, %11
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %6, %13
%15 = add nsw i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand_between(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = sdiv i32 %4, %6
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %3, %8
%10 = add nsw i32 %9, %0
ret i32 %10
}
/* Variables and functions */
int verificaParImpar(int *, int *, int, int, int /*<<< orphan*/);
int verificaImpar(int *vet, int *vetImpar, int tamVet, int tamVetImpar) {
  return verificaParImpar(vet, vetImpar, tamVet, tamVetImpar, 0);
}


x86 assembly (clang, -O0):
<verificaImpar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <verificaParImpar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verificaImpar>:
xor    %r8d,%r8d
jmp    1030 <verificaParImpar@plt>

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

LLVM IR (-O2):
define i32 @verificaImpar(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @verificaParImpar(i32* %0, i32* %1, i32 %2, i32 %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void outraFuncao(char *temp) {
  strcpy(temp, "11");
  printf("tempTest = %s\n", temp);
}


x86 assembly (clang, -O0):
<outraFuncao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outraFuncao>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"11\00"
@.str.1 = [15 x i8] c"tempTest = %s\0A\00"
define void @outraFuncao(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"11\00"
@.str.1 = [15 x i8] c"tempTest = %s\0A\00"
define void @outraFuncao(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void view_foo(void *f) {}


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

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

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

LLVM IR (-O2):
define void @view_foo(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ drand48();
int rnd(int i) { return (int)((double)drand48() * i); }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <drand48@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @drand48()
%4 = sitofp i64 %3 to double
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fmul double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i64 (...) @drand48()
%3 = sitofp i64 %2 to double
%4 = sitofp i32 %0 to double
%5 = fmul double %4, %3
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/, char *);
int nondet_int();
int main() {
  int i = 0;
  int x = 0;
  int y = 0;
  int n = nondet_int();
  int k = 1;
  for (i = 0; k == 1; i++) {
    if (!(x == 0))
      goto ERROR1;
  }
ERROR1:
  assert(0, "ERROR1");
ERROR2:
  assert(0, "ERROR2");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1188 <main+0x68>
cmpl   $0x0,-0xc(%rbp)
je     1175 <main+0x55>
jmp    118d <main+0x6d>
jmp    117a <main+0x5a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <main+0x3c>
jmp    118d <main+0x6d>
xor    %edi,%edi
lea    0xe6a(%rip),%rsi
call   1040 <assert@plt>
xor    %edi,%edi
lea    0xe63(%rip),%rsi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"ERROR1\00"
@.str.1 = [7 x i8] c"ERROR2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%7 = call i32 (...) @nondet_int()
store i32 %7, i32* %5
store i32 1, i32* %6
store i32 0, i32* %2
br label %8
8: ; preds = %16, %0
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %11
br label %20
15: ; preds = %11
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %8
19: ; preds = %8
br label %20
20: ; preds = %19, %14
%21 = call i32 @assert(i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20
%23 = call i32 @assert(i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
unreachable
}
int check_char(char c, char *str) {
  while (*str) {
    if (c == *str)
      return (1);
    str++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<check_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <check_char+0x4b>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113a <check_char+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1152 <check_char+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <check_char+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_char>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <check_char+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <check_char+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <check_char+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_char(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i8, i8* %12
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %12, %5 ], [ %1, %2 ]
%11 = icmp eq i8 %9, %0
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %14
}
char *langRomTypeDumas() { return "Dumas"; }


x86 assembly (clang, -O0):
<langRomTypeDumas>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeDumas>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Dumas\00"
define i8* @langRomTypeDumas() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Dumas\00"
define i8* @langRomTypeDumas() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}