xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ do_list_command(int /*<<< orphan*/, int, int /*<<< orphan*/);
void list_command(void) { do_list_command(0, 65534, 0); }


x86 assembly (clang, -O0):
<list_command>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0xfffe,%esi
mov    %edx,%edi
call   1030 <do_list_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_command>:
xor    %edi,%edi
mov    $0xfffe,%esi
xor    %edx,%edx
jmp    1030 <do_list_command@plt>

LLVM IR (-O0):
define void @list_command() {
%1 = call i32 @do_list_command(i32 0, i32 65534, i32 0)
ret void
}

LLVM IR (-O2):
define void @list_command() {
%1 = tail call i32 @do_list_command(i32 0, i32 65534, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gps_parse();
void gps_process(void) { gps_parse(); }


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

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

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

LLVM IR (-O2):
define void @gps_process() {
%1 = tail call i32 (...) @gps_parse()
ret void
}
void set_cr3_raw(unsigned long value) {
  __asm__ volatile("mov %0, %%cr3" : : "r"(value));
}


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

x86 assembly (clang, -O2):
<set_cr3_raw>:
mov    %rdi,%cr3
ret

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

LLVM IR (-O2):
define void @set_cr3_raw(i64 %0) {
tail call void asm sideeffect "mov $0, %cr3", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
void main() {
  float a, area;
  int b = 3;
  a = 3.6;
  area = 3.14159265 * a + 3 * a + 3;
  printf("r = %f\narea = %f\n", a, area);
  void printint(int);
  void printflo(float);
  printint(a);
  printflo(b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0xc(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xeb3(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe9a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe82(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
cvttss2si -0x4(%rbp),%edi
call   1030 <printint@plt>
cvtsi2ssl -0xc(%rbp),%xmm0
call   1050 <printflo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed4(%rip),%rdi
movss  0xec0(%rip),%xmm0
movss  0xebc(%rip),%xmm1
call   1040 <printf@plt>
mov    $0x3,%edi
call   1030 <printint@plt>
movss  0xea9(%rip),%xmm0
pop    %rax
jmp    1050 <printflo@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"r = %f\0Aarea = %f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32
store i32 3, i32* %3
store float 0x400CCCCCC0000000, float* %1
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = load float, float* %1
%7 = fmul float 3.000000e+00, %6
%8 = fpext float %7 to double
%9 = call double @llvm.fmuladd.f64(double 0x400921FB53C8D4F1, double %5, double %8)
%10 = fadd double %9, 3.000000e+00
%11 = fptrunc double %10 to float
store float %11, float* %2
%12 = load float, float* %1
%13 = load float, float* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %12, float %13)
%15 = load float, float* %1
%16 = fptosi float %15 to i32
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to float
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"r = %f\0Aarea = %f\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float 0x400CCCCCC0000000, float 0x40391C1760000000)
tail call void @printint(i32 3)
tail call void @printflo(float 3.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ first_line(char const *, char *, int);
char *strip_newline(int /*<<< orphan*/, int);
char *first_line_no_nl(const char *path, char *buff, int len) {
  return strip_newline(first_line(path, buff, len), len);
}


x86 assembly (clang, -O0):
<first_line_no_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <first_line@plt>
mov    %eax,%edi
mov    -0x14(%rbp),%esi
call   1030 <strip_newline@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_line_no_nl>:
push   %rbx
mov    %edx,%ebx
call   1040 <first_line@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <strip_newline@plt>

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

LLVM IR (-O2):
define i8* @first_line_no_nl(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @first_line(i8* %0, i8* %1, i32 %2)
%5 = tail call i8* @strip_newline(i32 %4, i32 %2)
ret i8* %5
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ flushinp();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_flushinp(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(flushinp());
}


x86 assembly (clang, -O0):
<cmd_flushinp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_flushinp+0x27>
jmp    117f <cmd_flushinp+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <flushinp@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_flushinp>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_flushinp+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <flushinp@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_flushinp(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @flushinp()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_flushinp(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @flushinp()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
int qd_geq_qd_d(const double *a, double b) {
  return (a[0] > b || (a[0] == b && a[1] >= 0.0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<qd_geq_qd_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
ja     115f <qd_geq_qd_d+0x5f>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x12(%rbp)
jne    1159 <qd_geq_qd_d+0x59>
jp     1159 <qd_geq_qd_d+0x59>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_geq_qd_d>:
movsd  (%rdi),%xmm1
mov    $0x1,%eax
ucomisd %xmm0,%xmm1
ja     1129 <qd_geq_qd_d+0x29>
ucomisd %xmm0,%xmm1
jne    112a <qd_geq_qd_d+0x2a>
jp     112a <qd_geq_qd_d+0x2a>
movsd  0x8(%rdi),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @qd_geq_qd_d(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double, double* %4
%9 = fcmp ogt double %7, %8
br i1 %9, label %23, label %10
10: ; preds = %2
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double, double* %4
%15 = fcmp oeq double %13, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fcmp oge double %19, 0.000000e+00
br label %21
21: ; preds = %16, %10
%22 = phi i1 [ false, %10 ], [ %20, %16 ]
br label %23
23: ; preds = %21, %2
%24 = phi i1 [ true, %2 ], [ %22, %21 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 1, i32 0
ret i32 %26
}

LLVM IR (-O2):
define i32 @qd_geq_qd_d(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ogt double %3, %1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = fcmp oeq double %3, %1
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fcmp oge double %9, 0.000000e+00
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %7, %2
%13 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %11, %7 ]
ret i32 %13
}
int _printf(char *fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
int comp(const void *e1, const void *e2) {
  int f = *((int *)e1), s = *((int *)e2);
  return f > s ? 1 : (f == s ? 0 : -1);
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1137 <comp+0x37>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <comp+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp eq i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 0, i32 -1
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ 1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ cleanup(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ print_version();
void version_and_exit() {
  print_version();
  cleanup(EXIT_SUCCESS, 0);
}


x86 assembly (clang, -O0):
<version_and_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <print_version@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_and_exit>:
push   %rax
xor    %eax,%eax
call   1030 <print_version@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <cleanup@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @version_and_exit() {
%1 = call i32 (...) @print_version()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @cleanup(i32 %2, i32 0)
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @version_and_exit() {
%1 = tail call i32 (...) @print_version()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @cleanup(i32 %2, i32 0)
ret void
}
int do_197() { return 197; }


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

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

LLVM IR (-O0):
define i32 @do_197() {
ret i32 197
}

LLVM IR (-O2):
define i32 @do_197() {
ret i32 197
}
/* Variables and functions */
int WEXITSTATUS(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ wait(int *);
void deal(int s) {
  int status;
  printf("child......\n");
  wait(&status);
  printf("child(%d) over.\n", WEXITSTATUS(status));
}


x86 assembly (clang, -O0):
<deal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1050 <wait@plt>
mov    -0x8(%rbp),%edi
call   1040 <WEXITSTATUS@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deal>:
push   %rax
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rdi
call   1060 <wait@plt>
mov    0x4(%rsp),%edi
call   1050 <WEXITSTATUS@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"child......\0A\00"
@.str.1 = [17 x i8] c"child(%d) over.\0A\00"
define void @deal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @wait(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @WEXITSTATUS(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"child(%d) over.\0A\00"
@str = [12 x i8] c"child......\00"
define void @deal(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%5 = call i32 @wait(i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @WEXITSTATUS(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
int(wcheck_int)(int to_check) { return to_check; }


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

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

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

LLVM IR (-O2):
define i32 @wcheck_int(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int child = fork();
  if (!child)
    return 0;
  printf("%d %d\n", getpid(), child);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1162 <main+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x14(%rbp),%edx
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
jmp    117a <main+0x4a>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     1162 <main+0x32>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
ret i32 0
6: ; preds = %2
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %3)
br label %9
9: ; preds = %9, %6
br label %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, int);
void st_memset(void *s, int c, int n) { memset(s, c, n); }


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

x86 assembly (clang, -O2):
<st_memset>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @st_memset(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int ece_read_uint64_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ ece_write_uint64_be(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          size_t);
void ece_generate_iv(const uint8_t *nonce, uint64_t counter, uint8_t *iv) {
  size_t offset = 12 - 8;
  memcpy(iv, nonce, offset);
  uint64_t mask = ece_read_uint64_be(&nonce[offset]);
  ece_write_uint64_be(&iv[offset], mask ^ counter);
}


x86 assembly (clang, -O0):
<ece_generate_iv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x4,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ece_read_uint64_be@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
xor    -0xc(%rbp),%esi
call   1050 <ece_write_uint64_be@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece_generate_iv>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    $0x4,%edx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <memcpy@plt>
add    $0x10,%rbp
mov    %rbp,%rdi
call   1030 <ece_read_uint64_be@plt>
add    $0x10,%rbx
xor    %eax,%r14d
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <ece_write_uint64_be@plt>

LLVM IR (-O0):
define void @ece_generate_iv(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i64 4, i64* %7
%9 = load i32*, i32** %6
%10 = load i32*, i32** %4
%11 = load i64, i64* %7
%12 = call i32 @memcpy(i32* %9, i32* %10, i64 %11)
%13 = load i32*, i32** %4
%14 = load i64, i64* %7
%15 = getelementptr inbounds i32, i32* %13, i64 %14
%16 = call i32 @ece_read_uint64_be(i32* %15)
store i32 %16, i32* %8
%17 = load i32*, i32** %6
%18 = load i64, i64* %7
%19 = getelementptr inbounds i32, i32* %17, i64 %18
%20 = load i32, i32* %8
%21 = load i32, i32* %5
%22 = xor i32 %20, %21
%23 = call i32 @ece_write_uint64_be(i32* %19, i32 %22)
ret void
}

LLVM IR (-O2):
define void @ece_generate_iv(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @memcpy(i32* %2, i32* %0, i64 4)
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = tail call i32 @ece_read_uint64_be(i32* %5)
%7 = getelementptr inbounds i32, i32* %2, i64 4
%8 = xor i32 %6, %1
%9 = tail call i32 @ece_write_uint64_be(i32* %7, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage:  %s [-n] [stream|dgram] port\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s [-n] [stream|dgram] port\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s [-n] [stream|dgram] port\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ GLvoid;
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
void glTexImage2D(GLenum target, GLint level, GLint internalformat,
                  GLsizei width, GLsizei height, GLint border, GLenum format,
                  GLenum type, const GLvoid *texels) {}


x86 assembly (clang, -O0):
<glTexImage2D>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glTexImage2D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32*
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32* %8, i32** %18
ret void
}

LLVM IR (-O2):
define void @glTexImage2D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* nocapture %8) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(void *i) { printf("job_cb, %s\n", (char *)i); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"job_cb, %s\0A\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"job_cb, %s\0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned int isAlpha(int s) {
  if (((s >= 'a') && (s <= 'z')) || ((s >= 'A') && (s <= 'Z')) || (s == '_')) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<isAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     111b <isAlpha+0x1b>
cmpl   $0x7a,-0x8(%rbp)
jle    1139 <isAlpha+0x39>
cmpl   $0x41,-0x8(%rbp)
jl     112f <isAlpha+0x2f>
cmpl   $0x5a,-0x8(%rbp)
jle    1139 <isAlpha+0x39>
cmpl   $0x5f,-0x8(%rbp)
jne    1145 <isAlpha+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <isAlpha+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlpha>:
lea    -0x61(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1a,%ecx
jb     1121 <isAlpha+0x21>
lea    -0x41(%rdi),%eax
cmp    $0x1a,%eax
setb   %al
cmp    $0x5f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isAlpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %18, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 90
br i1 %14, label %18, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 95
br i1 %17, label %18, label %19
18: ; preds = %15, %12, %6
store i32 1, i32* %2
br label %20
19: ; preds = %15
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @isAlpha(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 26
%7 = icmp eq i32 %0, 95
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %9, %4 ]
ret i32 %11
}
void rpmvi_(dx, dy, dz) int *dx, *dy, *dz;
{ rpmv((float)*dx, (float)*dy, (float)*dz); }


x86 assembly (clang, -O0):
<rpmvi_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
cvtsi2ssl (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <rpmv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmvi_>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
cvtsi2ssl (%rdx),%xmm2
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <rpmv@plt>

LLVM IR (-O0):
define void @rpmvi_(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to float
%10 = fpext float %9 to double
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sitofp i32 %12 to float
%14 = fpext float %13 to double
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @rpmv to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @rpmvi_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to float
%9 = fpext float %8 to double
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @rpmv to i32 (double, double, double, ...)*)(double %6, double %9, double %12)
ret void
}
/* Variables and functions */
size_t hash_combine(size_t seed, size_t hash) {
  seed ^= hash + 0x9e3779b9 + (seed << 6) + (seed >> 2);
  return seed;
}


x86 assembly (clang, -O0):
<hash_combine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x9e3779b9,%rax
add    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
add    %rcx,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_combine>:
mov    %rdi,%rax
shl    $0x6,%rax
add    %rsi,%rax
mov    %rdi,%rcx
shr    $0x2,%rcx
add    %rax,%rcx
mov    $0x9e3779b9,%eax
add    %rcx,%rax
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @hash_combine(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = add i64 %5, 2654435769
%7 = load i64, i64* %3
%8 = shl i64 %7, 6
%9 = add i64 %6, %8
%10 = load i64, i64* %3
%11 = lshr i64 %10, 2
%12 = add i64 %9, %11
%13 = load i64, i64* %3
%14 = xor i64 %13, %12
store i64 %14, i64* %3
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @hash_combine(i64 %0, i64 %1) {
%3 = add i64 %1, 2654435769
%4 = shl i64 %0, 6
%5 = add i64 %3, %4
%6 = lshr i64 %0, 2
%7 = add i64 %5, %6
%8 = xor i64 %7, %0
ret i64 %8
}
int test_imm_7Duint8_reg(unsigned char val) {
  return ((val) & (-0x7D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Duint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff83,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Duint8_reg>:
test   $0x83,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -125
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void display_exit(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double, double,
                           double);
void draw_line(FILE *output, double x1, double y1, double x2, double y2) {
  fprintf(output, "plot [0:1] %f + %f * t, %f + %f * t notitle\n", x1, x2 - x1,
          y1, y2 - y1);
  fflush(output);
}


x86 assembly (clang, -O0):
<draw_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_line>:
push   %rbx
movapd %xmm1,%xmm4
mov    %rdi,%rbx
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
lea    0xec9(%rip),%rsi
movapd %xmm2,%xmm1
movapd %xmm4,%xmm2
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"plot [0:1] %f + %f * t, %f + %f * t notitle\0A\00"
define void @draw_line(i32* %0, double %1, double %2, double %3, double %4) {
%6 = alloca i32*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32* %0, i32** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load i32*, i32** %6
%12 = load double, double* %7
%13 = load double, double* %9
%14 = load double, double* %7
%15 = fsub double %13, %14
%16 = load double, double* %8
%17 = load double, double* %10
%18 = load double, double* %8
%19 = fsub double %17, %18
%20 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %12, double %15, double %16, double %19)
%21 = load i32*, i32** %6
%22 = call i32 @fflush(i32* %21)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"plot [0:1] %f + %f * t, %f + %f * t notitle\0A\00"
define void @draw_line(i32* nocapture %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %3, %1
%7 = fsub double %4, %2
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %1, double %6, double %2, double %7)
%9 = tail call i32 @fflush(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *strstr(char *, char *);
int main(int argc, char **argv) {
  char *r = 0;
  char s1[] = "ab";
  char s2[] = {'c'};
  char s3 = 0;
  r = strstr(s1, s2);
  assert(r == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x1b(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x19(%rbp)
mov    0xeab(%rip),%al
mov    %al,-0x1c(%rbp)
movb   $0x0,-0x1d(%rbp)
lea    -0x1b(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0x6261,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x63,%esi
call   1030 <strchr@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s1 = [3 x i8] c"ab\00"
@__const.main.s2 = [1 x i8] c"c"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [3 x i8]
%8 = alloca [1 x i8]
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%10 = bitcast [3 x i8]* %7 to i8*
%11 = bitcast [1 x i8]* %8 to i8*
store i8 0, i8* %9
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %8, i64 0, i64 0
%14 = call i8* @strstr(i8* %12, i8* %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = icmp eq i8* %15, null
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [3 x i8] c"ab\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = call i8* @strchr(i8* %4, i32 99)
%6 = icmp eq i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_stats(int, int, int, int, int);
int /*<<< orphan*/ print_world(int **, int, int);
void display_simulation(int t, int **world, int population, int worldSize,
                        int width, int height) {
  print_stats(t, population, worldSize, width, height);
  print_world(world, width, height);
}


x86 assembly (clang, -O0):
<display_simulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1040 <print_stats@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1030 <print_world@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_simulation>:
push   %rbp
push   %r14
push   %rbx
mov    %r9d,%ebx
mov    %r8d,%ebp
mov    %rsi,%r14
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %r9d,%r8d
call   1040 <print_stats@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <print_world@plt>

LLVM IR (-O0):
define void @display_simulation(i32 %0, i32** %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32**
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32** %1, i32*** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load i32, i32* %11
%17 = load i32, i32* %12
%18 = call i32 @print_stats(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17)
%19 = load i32**, i32*** %8
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @print_world(i32** %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @display_simulation(i32 %0, i32** %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @print_stats(i32 %0, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = tail call i32 @print_world(i32** %1, i32 %4, i32 %5)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
size_t minipack_sizeof_map(uint32_t count) {
  if (count <= 15) {
    return 1;
  } else if (count <= 65535) {
    return 3;
  }
  return 5;
}


x86 assembly (clang, -O0):
<minipack_sizeof_map>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jg     111e <minipack_sizeof_map+0x1e>
movq   $0x1,-0x8(%rbp)
jmp    1145 <minipack_sizeof_map+0x45>
cmpl   $0xffff,-0xc(%rbp)
jg     1138 <minipack_sizeof_map+0x38>
movq   $0x3,-0x8(%rbp)
jmp    1145 <minipack_sizeof_map+0x45>
jmp    113d <minipack_sizeof_map+0x3d>
movq   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_sizeof_map>:
xor    %eax,%eax
cmp    $0x10000,%edi
setge  %al
cmp    $0x10,%edi
lea    0x3(%rax,%rax,1),%rcx
mov    $0x1,%eax
cmovge %rcx,%rax
ret

LLVM IR (-O0):
define i64 @minipack_sizeof_map(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 15
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 65535
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 3, i64* %2
br label %13
11: ; preds = %7
br label %12
12: ; preds = %11
store i64 5, i64* %2
br label %13
13: ; preds = %12, %10, %6
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @minipack_sizeof_map(i32 %0) {
%2 = icmp slt i32 %0, 16
%3 = icmp slt i32 %0, 65536
%4 = select i1 %3, i64 3, i64 5
%5 = select i1 %2, i64 1, i64 %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ Sync();
void UNLEDU2000Restore(int version) { Sync(); }


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

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

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

LLVM IR (-O2):
define void @UNLEDU2000Restore(i32 %0) {
%2 = tail call i32 (...) @Sync()
ret void
}
/* Variables and functions */
int xtod(char);
int hextodec(char *hex) {
  if (*hex == 0)
    return 0;
  return hextodec(hex - 1) * 16 + xtod(*hex);
}


x86 assembly (clang, -O0):
<hextodec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1148 <hextodec+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1171 <hextodec+0x51>
mov    -0x10(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
call   1040 <hextodec@plt>
shl    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <xtod@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hextodec>:
push   %rbp
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1145 <hextodec+0x25>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdi
call   1040 <hextodec@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl (%rbx),%edi
call   1030 <xtod@plt>
add    %ebp,%eax
jmp    1147 <hextodec+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hextodec(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1, %6
%5 = phi i32 [ %12, %6 ], [ 0, %1 ]
ret i32 %5
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 -1
%8 = tail call i32 @hextodec(i8* %7)
%9 = shl nsw i32 %8, 4
%10 = load i8, i8* %0
%11 = tail call i32 @xtod(i8 signext %10)
%12 = add nsw i32 %11, %9
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  strncpy(argv[0], "PROGRAM_NAME", strlen(argv[0]));
  pause();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xe86(%rip),%rsi
call   1030 <strncpy@plt>
mov    $0x0,%al
call   1050 <pause@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    (%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
call   1050 <pause@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"PROGRAM_NAME\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @strncpy(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @pause()
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"PROGRAM_NAME\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @strlen(i8* %3)
%5 = tail call i32 @strncpy(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @pause()
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, size_t);
void *malloc(size_t);
void *emalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == NULL) {
    eprintf("Fatal error!  malloc of %u bytes failed:", n);
  }
  return p;
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Fatal error! malloc of %u bytes failed:\00"
define i8* @emalloc(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 eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @eprintf(i8* getelementptr inbounds ([41 x i8], [41 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 = [41 x i8] c"Fatal error! malloc of %u bytes failed:\00"
define noalias i8* @emalloc(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 @eprintf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
char *getPath() { return "/dev/ttyUSB0"; }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/ttyUSB0\00"
define i8* @getPath() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/ttyUSB0\00"
define i8* @getPath() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}