xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, short *);
int /*<<< orphan*/ stdin;
void readShort2(short *variableAddress, char headerMessage[]) {
  bool ret;
  do {
    printf("%s", headerMessage);
    ret = scanf("\n%hi", variableAddress);
    __fpurge(stdin);
  } while (ret != true);
}


x86 assembly (clang, -O0):
<readShort2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1140 <readShort2+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readShort2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb8(%rip),%r15
lea    0xeb4(%rip),%r12
mov    0x2e92(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %eax,%ebp
mov    0x0(%r13),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebp
jne    1160 <readShort2+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\0A%hi\00"
@stdin = global i32 0
define void @readShort2(i16* %0, i8* %1) {
%3 = alloca i16*
%4 = alloca i8*
%5 = alloca i32
store i16* %0, i16** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %13, %2
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i16*, i16** %3
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i16* %9)
store i32 %10, i32* %5
%11 = load i32, i32* @stdin
%12 = call i32 @__fpurge(i32 %11)
br label %13
13: ; preds = %6
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 1
br i1 %15, label %6, label %16
16: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"\0A%hi\00"
@stdin = global i32 0
define void @readShort2(i16* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i16* %0)
%6 = load i32, i32* @stdin
%7 = tail call i32 @__fpurge(i32 %6)
%8 = icmp eq i32 %5, 1
br i1 %8, label %9, label %3
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int ar = 3 * 3 + 5 + 1 * 3 + 5 + 1;
  printf("%d", ar);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 23)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void cgiDown(float lines) {
  printf("<div style='height:%fem;'></div>\n", lines);
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"<div style='height:%fem;'></div>\0A\00"
define void @cgiDown(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"<div style='height:%fem;'></div>\0A\00"
define void @cgiDown(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
int pass2_parser(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pass2_parser() {
ret i32 1
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
void check(void *a) {
  if (((ptrdiff_t)a & (128 - 1)) != 0)
    abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7f,%eax
cmp    $0x0,%eax
je     1133 <check+0x23>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   $0x7f,%dil
jne    1117 <check+0x7>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = and i32 %4, 127
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @check(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 127
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_w39_common(struct flashctx *, int);
int printlock_w39_fwh(struct flashctx *);
int printlock_w39v040fc(struct flashctx *flash) {
  int ret = 0;
  ret = printlock_w39_common(flash, 0x7fff2);
  ret |= printlock_w39_fwh(flash);
  return ret;
}


x86 assembly (clang, -O0):
<printlock_w39v040fc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7fff2,%esi
call   1040 <printlock_w39_common@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printlock_w39_fwh@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlock_w39v040fc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x7fff2,%esi
call   1040 <printlock_w39_common@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <printlock_w39_fwh@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040fc(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
%3 = alloca i32
store %struct.flashctx* %0, %struct.flashctx** %2
store i32 0, i32* %3
%4 = load %struct.flashctx*, %struct.flashctx** %2
%5 = call i32 @printlock_w39_common(%struct.flashctx* %4, i32 524274)
store i32 %5, i32* %3
%6 = load %struct.flashctx*, %struct.flashctx** %2
%7 = call i32 @printlock_w39_fwh(%struct.flashctx* %6)
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040fc(%struct.flashctx* %0) {
%2 = tail call i32 @printlock_w39_common(%struct.flashctx* %0, i32 524274)
%3 = tail call i32 @printlock_w39_fwh(%struct.flashctx* %0)
%4 = or i32 %3, %2
ret i32 %4
}
/* Variables and functions */
double cosh(double);
double sqrt(int);
double tanh(double);
double ftrans(double x) {
  double t = tanh(x);
  double c = cosh(x);
  return (sqrt(1 + t * t) / c) / c;
}


x86 assembly (clang, -O0):
<ftrans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cosh@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
divsd  -0x18(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftrans>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <tanh@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cosh@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  0xe98(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ftrans(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @tanh(double %5)
store double %6, double* %3
%7 = load double, double* %2
%8 = call double @cosh(double %7)
store double %8, double* %4
%9 = load double, double* %3
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %9, double %10, double 1.000000e+00)
%12 = fptosi double %11 to i32
%13 = call double @sqrt(i32 %12)
%14 = load double, double* %4
%15 = fdiv double %13, %14
%16 = load double, double* %4
%17 = fdiv double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @ftrans(double %0) {
%2 = tail call double @tanh(double %0)
%3 = tail call double @cosh(double %0)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %2, double 1.000000e+00)
%5 = fptosi double %4 to i32
%6 = tail call double @sqrt(i32 %5)
%7 = fdiv double %6, %3
%8 = fdiv double %7, %3
ret double %8
}
/* Variables and functions */
int board_get_revision();
int board_with_ap6212(void) {
  return ((board_get_revision() == 0x1) || (board_get_revision() == 0x7));
}


x86 assembly (clang, -O0):
<board_with_ap6212>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <board_get_revision@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x1(%rbp)
je     113f <board_with_ap6212+0x2f>
mov    $0x0,%al
call   1030 <board_get_revision@plt>
cmp    $0x7,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_with_ap6212>:
push   %rax
xor    %eax,%eax
call   1030 <board_get_revision@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1135 <board_with_ap6212+0x25>
xor    %eax,%eax
call   1030 <board_get_revision@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x7,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @board_with_ap6212() {
%1 = call i32 (...) @board_get_revision()
%2 = icmp eq i32 %1, 1
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 (...) @board_get_revision()
%5 = icmp eq i32 %4, 7
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @board_with_ap6212() {
%1 = tail call i32 (...) @board_get_revision()
%2 = icmp eq i32 %1, 1
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 (...) @board_get_revision()
%5 = icmp eq i32 %4, 7
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ libpla_connections_flush();
void libpla_connections_cleanup(void) { libpla_connections_flush(); }


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

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

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

LLVM IR (-O2):
define void @libpla_connections_cleanup() {
%1 = tail call i32 (...) @libpla_connections_flush()
ret void
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ do_gettimeofday(struct timeval *);
unsigned long get_seconds(void) {
  struct timeval now;
  do_gettimeofday(&now);
  return now.tv_sec;
}


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

x86 assembly (clang, -O2):
<get_seconds>:
push   %rax
mov    %rsp,%rdi
call   1030 <do_gettimeofday@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @get_seconds() {
%1 = alloca %struct.timeval
%2 = call i32 @do_gettimeofday(%struct.timeval* %1)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @get_seconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @do_gettimeofday(%struct.timeval* %1)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_meta_data();
int /*<<< orphan*/ test_normalize_assembly_format();
int /*<<< orphan*/ test_parse_line();
int /*<<< orphan*/ test_parse_ovp_disassembled_line();
int main() {
  test_parse_line();
  test_meta_data();
  test_normalize_assembly_format();
  test_parse_ovp_disassembled_line();
  printf("All tests have passed!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_parse_line@plt>
mov    $0x0,%al
call   1070 <test_meta_data@plt>
mov    $0x0,%al
call   1060 <test_normalize_assembly_format@plt>
mov    $0x0,%al
call   1040 <test_parse_ovp_disassembled_line@plt>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_parse_line@plt>
xor    %eax,%eax
call   1070 <test_meta_data@plt>
xor    %eax,%eax
call   1060 <test_normalize_assembly_format@plt>
xor    %eax,%eax
call   1040 <test_parse_ovp_disassembled_line@plt>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"All tests have passed!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_parse_line()
%3 = call i32 (...) @test_meta_data()
%4 = call i32 (...) @test_normalize_assembly_format()
%5 = call i32 (...) @test_parse_ovp_disassembled_line()
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"All tests have passed!\00"
define i32 @main() {
%1 = tail call i32 (...) @test_parse_line()
%2 = tail call i32 (...) @test_meta_data()
%3 = tail call i32 (...) @test_normalize_assembly_format()
%4 = tail call i32 (...) @test_parse_ovp_disassembled_line()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
putchar(c) char c;
{
  if (c == 10)
    bdos(2, 13);
  bdos(2, c);
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    113c <putchar+0x2c>
mov    $0x2,%edi
mov    $0xd,%esi
mov    $0x0,%al
call   1030 <bdos@plt>
movsbl -0x1(%rbp),%esi
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <bdos@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
movsbl %dil,%ebx
shl    $0x18,%edi
cmp    $0xa000000,%edi
jne    1131 <putchar+0x21>
mov    $0x2,%edi
mov    $0xd,%esi
xor    %eax,%eax
call   1030 <bdos@plt>
mov    $0x2,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <bdos@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @bdos to i32 (i32, i32, ...)*)(i32 2, i32 13)
br label %9
9: ; preds = %7, %1
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @bdos to i32 (i32, i32, ...)*)(i32 2, i32 %11)
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = icmp eq i32 %2, 167772160
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @bdos to i32 (i32, i32, ...)*)(i32 2, i32 13)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @bdos to i32 (i32, i32, ...)*)(i32 2, i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *dyn_alloc(long, int);
void *zmalloc(long size) {
  void *res = dyn_alloc(size, 8);
  assert(res);
  return res;
}


x86 assembly (clang, -O0):
<zmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <dyn_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmalloc>:
push   %rbx
mov    $0x8,%esi
call   1030 <dyn_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @zmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @dyn_alloc(i64 %4, i32 8)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @zmalloc(i64 %0) {
%2 = tail call i8* @dyn_alloc(i64 %0, i32 8)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
int boolsquare(int num) {
  int i = 0;
  if (num == 1)
    return 1;
  for (; i <= num / 2; i++) {
    if (i * i == num)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<boolsquare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1124 <boolsquare+0x24>
movl   $0x1,-0x4(%rbp)
jmp    117d <boolsquare+0x7d>
jmp    1129 <boolsquare+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1176 <boolsquare+0x76>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1163 <boolsquare+0x63>
movl   $0x1,-0x4(%rbp)
jmp    117d <boolsquare+0x7d>
jmp    1168 <boolsquare+0x68>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <boolsquare+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<boolsquare>:
cmp    $0x1,%edi
jne    110c <boolsquare+0xc>
mov    $0x1,%eax
jmp    1113 <boolsquare+0x13>
xor    %eax,%eax
cmp    $0xffffffff,%edi
jge    1114 <boolsquare+0x14>
ret
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
add    $0x1,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1105 <boolsquare+0x5>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1130 <boolsquare+0x30>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @boolsquare(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, -1
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = sdiv i32 %0, 2
br label %10
7: ; preds = %10
%8 = add nuw nsw i32 %11, 1
%9 = icmp eq i32 %11, %6
br i1 %9, label %14, label %10
10: ; preds = %5, %7
%11 = phi i32 [ %8, %7 ], [ 0, %5 ]
%12 = mul nsw i32 %11, %11
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %7
14: ; preds = %10, %7, %3, %1
%15 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %10 ], [ 0, %7 ]
ret i32 %15
}
/* Variables and functions */
float powf(float, int);
float quartic_in(float step, float max_steps, float max_val) {
  float ratio = step / max_steps;
  return max_val * powf(ratio, 4);
}


x86 assembly (clang, -O0):
<quartic_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quartic_in>:
push   %rax
movss  %xmm2,0x4(%rsp)
divss  %xmm1,%xmm0
mov    $0x4,%edi
call   1030 <powf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @quartic_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
store float %10, float* %7
%11 = load float, float* %6
%12 = load float, float* %7
%13 = call float @powf(float %12, i32 4)
%14 = fmul float %11, %13
ret float %14
}

LLVM IR (-O2):
define float @quartic_in(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = tail call float @powf(float %4, i32 4)
%6 = fmul float %5, %2
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ murmurhash2(char const *, size_t, int);
size_t strlen(char const *);
uint32_t _bloom_hash(const char *data) {
  size_t len = strlen(data);
  return murmurhash2(data, len, 0xbc9f1d34);
}


x86 assembly (clang, -O0):
<_bloom_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xbc9f1d34,%edx
call   1030 <murmurhash2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bloom_hash>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0xbc9f1d34,%edx
pop    %rbx
jmp    1030 <murmurhash2@plt>

LLVM IR (-O0):
define i32 @_bloom_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i32 @murmurhash2(i8* %6, i64 %7, i32 -1130422988)
ret i32 %8
}

LLVM IR (-O2):
define i32 @_bloom_hash(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 @murmurhash2(i8* %0, i64 %2, i32 -1130422988)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ get_log_file();
void fatal_error(char *message) {
  fprintf(get_log_file(), "[libpeggo FATAL]: %s\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <get_log_file@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <get_log_file@plt>
lea    0xebe(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"[libpeggo FATAL]: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @get_log_file()
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"[libpeggo FATAL]: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal_error(i8* %0) {
%2 = tail call i32 (...) @get_log_file()
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int speakup_diacr(unsigned char ch, unsigned int fg_console) { return 0; }


x86 assembly (clang, -O0):
<speakup_diacr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @speakup_diacr(i8 zeroext %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ __builtin_lround(double);
int /*<<< orphan*/ link_failure_builtin_lround();
void test_builtin_lround(double d) {
  if (__builtin_lround(d) != __builtin_lround(d))
    link_failure_builtin_lround();
}


x86 assembly (clang, -O0):
<test_builtin_lround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lround@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lround@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_lround+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_lround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_lround>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <lround@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <lround@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_lround+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_lround@plt>

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

LLVM IR (-O2):
define void @test_builtin_lround(double %0) {
%2 = tail call i64 @lround(double %0)
%3 = tail call i64 @lround(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_lround()
br label %7
7: ; preds = %5, %1
ret void
}
void foo063() {}


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

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

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

LLVM IR (-O2):
define void @foo063() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_SwitchPower_SetTarget(void *);
int /*<<< orphan*/ printf(char *, int);
void SwitchPower_SetTarget(void *upnptoken, int newTargetValue) {
  printf("UPnP Invoke: SwitchPower_SetTarget(%d);\r\n", newTargetValue);
  UPnPResponse_SwitchPower_SetTarget(upnptoken);
}


x86 assembly (clang, -O0):
<SwitchPower_SetTarget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_SwitchPower_SetTarget@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [42 x i8] c"UPnP Invoke: SwitchPower_SetTarget(%d);\0D\0A\00"
define void @SwitchPower_SetTarget(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 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_SwitchPower_SetTarget(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"UPnP Invoke: SwitchPower_SetTarget(%d);\0D\0A\00"
define void @SwitchPower_SetTarget(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_SwitchPower_SetTarget(i8* %0)
ret void
}
int __attribute__((no, noclone)) foo(int *p) { return *p; }


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

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int);
int /*<<< orphan*/ usleep(int);
int write(int, char *, int);
void sendCommand(int fd, char *cmd) {
  int len = sizeof(cmd);
  int sentBytes = write(fd, cmd, len);
  if (0)
    printf("Command sent: %s Len of %d, total %d bytes sent\n", cmd, len,
           sentBytes);
  usleep(100000);
}


x86 assembly (clang, -O0):
<sendCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    $0x186a0,%edi
call   1040 <usleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendCommand>:
push   %rax
mov    $0x8,%edx
call   1030 <write@plt>
mov    $0x186a0,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @sendCommand(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 8, i32* %5
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = call i32 @usleep(i32 100000)
ret void
}

LLVM IR (-O2):
define void @sendCommand(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* %1, i32 8)
%4 = tail call i32 @usleep(i32 100000)
ret void
}
/* Variables and functions */
bool selectAll(const char *name) {
  (void)name;
  return true;
}


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

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

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

LLVM IR (-O2):
define i32 @selectAll(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ DetectMaxFlameValue();
int /*<<< orphan*/ GetThresholdValue();
int /*<<< orphan*/ ReadFlameValues();
void EnableFlameSensor(void) {
  ReadFlameValues();
  DetectMaxFlameValue();
  GetThresholdValue();
}


x86 assembly (clang, -O0):
<EnableFlameSensor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ReadFlameValues@plt>
mov    $0x0,%al
call   1050 <DetectMaxFlameValue@plt>
mov    $0x0,%al
call   1040 <GetThresholdValue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnableFlameSensor>:
push   %rax
xor    %eax,%eax
call   1030 <ReadFlameValues@plt>
xor    %eax,%eax
call   1050 <DetectMaxFlameValue@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <GetThresholdValue@plt>

LLVM IR (-O0):
define void @EnableFlameSensor() {
%1 = call i32 (...) @ReadFlameValues()
%2 = call i32 (...) @DetectMaxFlameValue()
%3 = call i32 (...) @GetThresholdValue()
ret void
}

LLVM IR (-O2):
define void @EnableFlameSensor() {
%1 = tail call i32 (...) @ReadFlameValues()
%2 = tail call i32 (...) @DetectMaxFlameValue()
%3 = tail call i32 (...) @GetThresholdValue()
ret void
}
int sequenItera(int *array, int size, int target) {
  int i;
  for (i = 0; i <= size; i++) {
    if (array[i] == target)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<sequenItera>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1153 <sequenItera+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <sequenItera+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <sequenItera+0x5a>
jmp    1145 <sequenItera+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <sequenItera+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequenItera>:
mov    $0xffffffff,%eax
test   %esi,%esi
js     111e <sequenItera+0x1e>
add    $0x1,%esi
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %edx,(%rdi,%rcx,4)
je     111f <sequenItera+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <sequenItera+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sequenItera(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 0
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = add nuw i32 %1, 1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %5, %13
%9 = phi i64 [ 0, %5 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %2
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %18, label %8
16: ; preds = %8
%17 = trunc i64 %9 to i32
br label %18
18: ; preds = %13, %16, %3
%19 = phi i32 [ -1, %3 ], [ %17, %16 ], [ -1, %13 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void choice_back(int n) {
  int i;
  for (i = 0; i < n; i++) {
    putchar('\010');
    putchar('\010');
  }
  printf("\033[K");
}


x86 assembly (clang, -O0):
<choice_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1160 <choice_back+0x40>
mov    $0x8,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <choice_back+0x12>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choice_back>:
push   %rbx
test   %edi,%edi
jle    1149 <choice_back+0x29>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x8,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <choice_back+0x10>
lea    0xeb0(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[K\00"
define void @choice_back(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i8 signext 8)
%6 = tail call i32 @putchar(i8 signext 8)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
char *format(char *, int, char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *buffer = "Buffer";
  printf("%s\n", format(buffer, sizeof(buffer), "Axle", 37, 73));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
lea    0xec1(%rip),%rdx
mov    $0x25,%ecx
mov    $0x49,%r8d
call   1040 <format@plt>
mov    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rdx
mov    $0x8,%esi
mov    $0x25,%ecx
mov    $0x49,%r8d
call   1040 <format@plt>
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Buffer\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"Axle\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @format(i8* %3, i32 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 37, i32 73)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Buffer\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"Axle\00"
define i32 @main() {
%1 = tail call i8* @format(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 37, i32 73)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t set_H_0(uint64_t x) { return x &= 0x3FFFFFFFFFFFFFFF; }


x86 assembly (clang, -O0):
<set_H_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x3fffffffffffffff,%rcx
ff ff 3f
and    %rcx,%rax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_H_0>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @set_H_0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 4611686018427387903
%6 = trunc i64 %5 to i32
store i32 %6, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @set_H_0(i32 returned %0) {
ret i32 %0
}
int test_imm_66uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x66 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_66uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 438086664192
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int DJBHash(char *str) {
  unsigned int hash = 5381;
  while (*str) {
    hash += (hash << 5) + (*str++);
  }
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<DJBHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <DJBHash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <DJBHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DJBHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <DJBHash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <DJBHash+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @DJBHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = mul i32 %6, 33
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5381, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ say_hi();
void say_hi_b(void) { say_hi(); }


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

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

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

LLVM IR (-O2):
define void @say_hi_b() {
%1 = tail call i32 (...) @say_hi()
ret void
}
int eloop_register_signal_terminate(void (*handler)(int sig, void *eloop_ctx,
                                                    void *signal_ctx),
                                    void *user_data) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @eloop_register_signal_terminate(void (i32, i8*, i8*)* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *realloc(void *, size_t);
void *h2o_mem_realloc(void *oldp, size_t sz) {
  void *newp = realloc(oldp, sz);
  if (newp == NULL) {
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/"
               "heads/master/include/h2o/h2o/memory.h"
               ":"
               "318"
               ":"
               "no memory");
    return oldp;
  }
  return newp;
}


x86 assembly (clang, -O0):
<h2o_mem_realloc>:
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   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <h2o_mem_realloc+0x45>
lea    0xead(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <h2o_mem_realloc+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_realloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1130 <h2o_mem_realloc+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/heads/master/include/h2o/h2o/memory.h:318:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @h2o__fatal(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/heads/master/include/h2o/h2o/memory.h:318:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %0, %5 ], [ %3, %2 ]
ret i8* %8
}