xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ zgb_hal_close();
void zgb_terminate() { zgb_hal_close(); }


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

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

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

LLVM IR (-O2):
define void @zgb_terminate() {
%1 = tail call i32 (...) @zgb_hal_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hexchar(int);
void printhex(int x) {
  hexchar(x / 16);
  hexchar(x & 15);
}


x86 assembly (clang, -O0):
<printhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hexchar@plt>
mov    -0x4(%rbp),%edi
and    $0xf,%edi
call   1030 <hexchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhex>:
push   %rbx
mov    %edi,%ebx
lea    0xf(%rbx),%edi
test   %ebx,%ebx
cmovns %ebx,%edi
sar    $0x4,%edi
call   1030 <hexchar@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <hexchar@plt>

LLVM IR (-O0):
define void @printhex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 16
%5 = call i32 @hexchar(i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 15
%8 = call i32 @hexchar(i32 %7)
ret void
}

LLVM IR (-O2):
define void @printhex(i32 %0) {
%2 = sdiv i32 %0, 16
%3 = tail call i32 @hexchar(i32 %2)
%4 = and i32 %0, 15
%5 = tail call i32 @hexchar(i32 %4)
ret void
}
double interp_4_pt(double phim1, double phi, double phip1, double phip2) {
  return (9.0 / 16.0) * (phi + phip1) - (1.0 / 16.0) * (phim1 + phip2);
}


x86 assembly (clang, -O0):
<interp_4_pt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
addsd  -0x20(%rbp),%xmm2
movsd  0xed4(%rip),%xmm1
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xea9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp_4_pt>:
addsd  %xmm3,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  %xmm2,%xmm1
mulsd  0xef0(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @interp_4_pt(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = load double, double* %7
%11 = fadd double %9, %10
%12 = load double, double* %5
%13 = load double, double* %8
%14 = fadd double %12, %13
%15 = fmul double 6.250000e-02, %14
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double 5.625000e-01, double %11, double %16)
ret double %17
}

LLVM IR (-O2):
define double @interp_4_pt(double %0, double %1, double %2, double %3) {
%5 = fadd double %1, %2
%6 = fadd double %0, %3
%7 = fmul double %6, -6.250000e-02
%8 = tail call double @llvm.fmuladd.f64(double %5, double 5.625000e-01, double %7)
ret double %8
}
/* Variables and functions */
int equal(int *, int *, int);
int /*<<< orphan*/ sort(int *, int);
int test_sort_descending() {
  int array[] = {5, 4, 3, 2, 1};
  int expected[] = {5, 3, 4, 1, 2};
  sort(array, 5);
  return equal(expected, array, 5);
}


x86 assembly (clang, -O0):
<test_sort_descending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x5,%edx
call   1040 <equal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sort_descending>:
push   %rbx
sub    $0x40,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeef(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <equal@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_sort_descending.array = [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1]
@__const.test_sort_descending.expected = [5 x i32] [i32 5, i32 3, i32 4, i32 1, i32 2]
define i32 @test_sort_descending() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @sort(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = call i32 @equal(i32* %7, i32* %8, i32 5)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_sort_descending.array = [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1]
@__const.test_sort_descending.expected = [5 x i32] [i32 5, i32 3, i32 4, i32 1, i32 2]
define i32 @test_sort_descending() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @sort(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @equal(i32* %7, i32* %5, i32 5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: webserver.out <root folder> <port> [--daemon]\n");
  printf("Optional arguments:\n");
  printf("--daemon - run as daemon\n");
  printf("--single - enforce single process.\n");
  printf("Example: webserver.out /var/www 8080\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Usage: webserver.out <root folder> <port> [--daemon]\0A\00"
@.str.1 = [21 x i8] c"Optional arguments:\0A\00"
@.str.2 = [26 x i8] c"--daemon - run as daemon\0A\00"
@.str.3 = [36 x i8] c"--single - enforce single process.\0A\00"
@.str.4 = [38 x i8] c"Example: webserver.out /var/www 8080\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"Usage: webserver.out <root folder> <port> [--daemon]\00"
@str.5 = [20 x i8] c"Optional arguments:\00"
@str.6 = [25 x i8] c"--daemon - run as daemon\00"
@str.7 = [35 x i8] c"--single - enforce single process.\00"
@str.8 = [37 x i8] c"Example: webserver.out /var/www 8080\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int setSocketSplice(int const, int const);
bool setBidirectionalSplice(const int socket1, const int socket2) {
  bool retVal = setSocketSplice(socket1, socket2);
  if (retVal) {
    retVal = setSocketSplice(socket2, socket1);
  }
  return retVal;
}


x86 assembly (clang, -O0):
<setBidirectionalSplice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <setSocketSplice@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1144 <setBidirectionalSplice+0x34>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <setSocketSplice@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBidirectionalSplice>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <setSocketSplice@plt>
test   %eax,%eax
je     112f <setBidirectionalSplice+0x1f>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <setSocketSplice@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @setBidirectionalSplice(i32 %0, i32 %1) {
%3 = tail call i32 @setSocketSplice(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @setSocketSplice(i32 %1, i32 %0)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1 != 2;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *basename(char *path) {
  char *ptr = strrchr(path, '/');
  if (ptr != NULL) {
    return &ptr[1];
  }
  return path;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <basename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <basename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int statlibfunc();
int statlibfunc2();
int __attribute__((visibility("default"))) shlibfunc2(void) {
  return statlibfunc() - statlibfunc2();
}


x86 assembly (clang, -O0):
<shlibfunc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <statlibfunc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <statlibfunc2@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shlibfunc2>:
push   %rbx
xor    %eax,%eax
call   1040 <statlibfunc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <statlibfunc2@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @shlibfunc2() {
%1 = call i32 (...) @statlibfunc()
%2 = call i32 (...) @statlibfunc2()
%3 = sub nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @shlibfunc2() {
%1 = tail call i32 (...) @statlibfunc()
%2 = tail call i32 (...) @statlibfunc2()
%3 = sub nsw i32 %1, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, void *, int, char *);
scalar_t__ strlen(char *);
int lstc_dump_str_cb(FILE *o, void *data) {
  char *d = (char *)data;
  return fprintf(o, "%p[len:%d] = \"%s\"\n", data, (int)strlen(d),
                 (char *)data);
}


x86 assembly (clang, -O0):
<lstc_dump_str_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
mov    -0x10(%rbp),%r8
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstc_dump_str_cb>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0xec7(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %rbx,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%p[len:%d] = \22%s\22\0A\00"
define i32 @lstc_dump_str_cb(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = trunc i64 %10 to i32
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [19 x i8] c"%p[len:%d] = \22%s\22\0A\00"
define i32 @lstc_dump_str_cb(i32* nocapture %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4, i8* %1)
ret i32 %5
}
float ColorTableRed(float c) {
  if (c < 0.33)
    return 0.0;
  if (c < 0.67)
    return (c - 0.33) / (0.67 - 0.33);
  return 1.0;
}


x86 assembly (clang, -O0):
<ColorTableRed>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <ColorTableRed+0x31>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1188 <ColorTableRed+0x88>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117b <ColorTableRed+0x7b>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1188 <ColorTableRed+0x88>
movss  0xe95(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ColorTableRed>:
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
movsd  0xef1(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     113a <ColorTableRed+0x3a>
movsd  0xeeb(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <ColorTableRed+0x3b>
addsd  0xee5(%rip),%xmm1
divsd  0xee5(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret
movss  0xedd(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ColorTableRed(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 3.300000e-01
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %19
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp olt double %10, 6.700000e-01
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fsub double %14, 3.300000e-01
%16 = fdiv double %15, 3.400000e-01
%17 = fptrunc double %16 to float
store float %17, float* %2
br label %19
18: ; preds = %8
store float 1.000000e+00, float* %2
br label %19
19: ; preds = %18, %12, %7
%20 = load float, float* %2
ret float %20
}

LLVM IR (-O2):
define float @ColorTableRed(float %0) {
%2 = fpext float %0 to double
%3 = fcmp olt double %2, 3.300000e-01
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = fcmp olt double %2, 6.700000e-01
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = fadd double %2, -3.300000e-01
%8 = fdiv double %7, 3.400000e-01
%9 = fptrunc double %8 to float
br label %10
10: ; preds = %4, %1, %6
%11 = phi float [ %9, %6 ], [ 0.000000e+00, %1 ], [ 1.000000e+00, %4 ]
ret float %11
}
void RTAvlULRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlULRemove() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int direction;
};
typedef TYPE_1__ XFontStruct;

/* Variables and functions */
void set_XFontStruct_direction(void *_p, unsigned _v) {
  ((XFontStruct *)_p)->direction = (unsigned)_v;
}


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

x86 assembly (clang, -O2):
<set_XFontStruct_direction>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XFontStruct_direction(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XFontStruct_direction(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
unsigned int Get_Bits(int);
unsigned int Get_Bits1(void) {
  unsigned int tmp;
  {
    tmp = Get_Bits(1);
    return (tmp);
  }
}


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

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

LLVM IR (-O0):
define i32 @Get_Bits1() {
%1 = alloca i32
%2 = call i32 @Get_Bits(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @Get_Bits1() {
%1 = tail call i32 @Get_Bits(i32 1)
ret i32 %1
}
long ATEXIT(fctn) void (*fctn)();
{ return ((long)atexit(fctn)); }


x86 assembly (clang, -O0):
<ATEXIT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1130 <atexit>
cltq
add    $0x10,%rsp
pop    %rbp
ret
nop

x86 assembly (clang, -O2):
<ATEXIT>:
push   %rax
xor    %eax,%eax
call   1120 <atexit>
cltq
pop    %rcx
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define i64 @ATEXIT(void (...)* %0) {
%2 = alloca void (...)*
store void (...)* %0, void (...)** %2
%3 = load void (...)*, void (...)** %2
%4 = call i32 (void (...)*, ...) bitcast (i32 (...)* @atexit to i32 (void (...)*, ...)*)(void (...)* %3)
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @ATEXIT(void (...)* %0) {
%2 = tail call i32 (void (...)*, ...) bitcast (i32 (...)* @atexit to i32 (void (...)*, ...)*)(void (...)* %0)
%3 = sext i32 %2 to i64
ret i64 %3
}
void int_swap(int *a, int *b) {
  if (!a || !b)
    return;
  int t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<int_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <int_swap+0x22>
cmpq   $0x0,-0x10(%rbp)
jne    1127 <int_swap+0x27>
jmp    1145 <int_swap+0x45>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_swap>:
test   %rdi,%rdi
je     1112 <int_swap+0x12>
test   %rsi,%rsi
je     1112 <int_swap+0x12>
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @int_swap(i32* %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i32* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %0
%8 = load i32, i32* %1
store i32 %8, i32* %0
store i32 %7, i32* %1
br label %9
9: ; preds = %2, %6
ret void
}
void xenoprof_backtrace(struct domain *d, struct vcpu *vcpu,
                        struct pt_regs *const regs, unsigned long depth,
                        int mode) {
  return;
}


x86 assembly (clang, -O0):
<xenoprof_backtrace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.domain = type opaque
%struct.vcpu = type opaque
%struct.pt_regs = type opaque
define void @xenoprof_backtrace(%struct.domain* %0, %struct.vcpu* %1, %struct.pt_regs* %2, i64 %3, i32 %4) {
%6 = alloca %struct.domain*
%7 = alloca %struct.vcpu*
%8 = alloca %struct.pt_regs*
%9 = alloca i64
%10 = alloca i32
store %struct.domain* %0, %struct.domain** %6
store %struct.vcpu* %1, %struct.vcpu** %7
store %struct.pt_regs* %2, %struct.pt_regs** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.domain = type opaque
%struct.vcpu = type opaque
%struct.pt_regs = type opaque
define void @xenoprof_backtrace(%struct.domain* nocapture %0, %struct.vcpu* nocapture %1, %struct.pt_regs* nocapture %2, i64 %3, i32 %4) {
ret void
}
/* Variables and functions */
int pmatch(char *, char *, int);
int patmatch(char *pattern, char *string, int squoted) {
  return pmatch(pattern, string, squoted);
}


x86 assembly (clang, -O0):
<patmatch>:
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   1030 <pmatch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<patmatch>:
jmp    1030 <pmatch@plt>

LLVM IR (-O0):
define i32 @patmatch(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 @pmatch(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @patmatch(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @pmatch(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int syscall(int, void *, void *);
int capget(void *a, void *b) { return syscall(184, a, b); }


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

x86 assembly (clang, -O2):
<capget>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xb8,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @capget(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 184, i8* %0, i8* %1)
ret i32 %3
}
void log_nothing(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @log_nothing(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int rand();
int getRandom(int min, int max, bool minIncluded, bool maxIncluded) {
  min += minIncluded ? 0 : 1;
  max -= maxIncluded ? 0 : 1;
  return min + (rand() % (max - min));
}


x86 assembly (clang, -O0):
<getRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%edx
mov    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getRandom(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
%13 = load i32, i32* %5
%14 = add nsw i32 %13, %12
store i32 %14, i32* %5
%15 = load i32, i32* %8
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, %18
store i32 %20, i32* %6
%21 = load i32, i32* %5
%22 = call i32 (...) @rand()
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = sub nsw i32 %23, %24
%26 = srem i32 %22, %25
%27 = add nsw i32 %21, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @getRandom(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %0
%8 = icmp eq i32 %3, 0
%9 = sext i1 %8 to i32
%10 = add i32 %9, %1
%11 = tail call i32 (...) @rand()
%12 = sub i32 %10, %7
%13 = srem i32 %11, %12
%14 = add nsw i32 %13, %7
ret i32 %14
}
/* Variables and functions */
int call_recursive();
int call_recursive2(void) { return call_recursive(); }


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

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

LLVM IR (-O0):
define i32 @call_recursive2() {
%1 = call i32 (...) @call_recursive()
ret i32 %1
}

LLVM IR (-O2):
define i32 @call_recursive2() {
%1 = tail call i32 (...) @call_recursive()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ bsp_dma_enable();
int /*<<< orphan*/ bsp_dma_stripesToDMABuff();
void bsp_ledsStripes_sendStripes() {
  bsp_dma_stripesToDMABuff();
  bsp_dma_enable();
}


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

x86 assembly (clang, -O2):
<bsp_ledsStripes_sendStripes>:
push   %rax
xor    %eax,%eax
call   1040 <bsp_dma_stripesToDMABuff@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bsp_dma_enable@plt>

LLVM IR (-O0):
define void @bsp_ledsStripes_sendStripes() {
%1 = call i32 (...) @bsp_dma_stripesToDMABuff()
%2 = call i32 (...) @bsp_dma_enable()
ret void
}

LLVM IR (-O2):
define void @bsp_ledsStripes_sendStripes() {
%1 = tail call i32 (...) @bsp_dma_stripesToDMABuff()
%2 = tail call i32 (...) @bsp_dma_enable()
ret void
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void send_end(struct ship *ship) { Write(38, ship, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x26,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_end>:
mov    %rdi,%rsi
mov    $0x26,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_end(%struct.ship* %0) {
%2 = alloca %struct.ship*
store %struct.ship* %0, %struct.ship** %2
%3 = load %struct.ship*, %struct.ship** %2
%4 = call i32 @Write(i32 38, %struct.ship* %3, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_end(%struct.ship* %0) {
%2 = tail call i32 @Write(i32 38, %struct.ship* %0, i32 0, i32 0, i32 0, i32 0)
ret void
}
double f4_sum_long_post_int(long v, int v0) {
  return (double)v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_long_post_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_long_post_int>:
cvtsi2sd %esi,%xmm1
cvtsi2sd %rdi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_long_post_int(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_long_post_int(i64 %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = sitofp i64 %0 to double
%5 = fadd double %4, %3
ret double %5
}
void RTLdrIsLoadable(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLdrIsLoadable() {
ret void
}
/* Variables and functions */
int __send_to_ppe(int, int, char const **);
int unlink(const char *pathname) {
  return __send_to_ppe(0x2101, 24, &pathname);
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2101,%edi
mov    $0x18,%esi
lea    -0x8(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdx
mov    $0x2101,%edi
mov    $0x18,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 24, i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 24, i8** %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write(int, char *, int);
int sim_ready_prompt() {
  printf("\rPress \x1b[32m[ENTER] \x1b[0mto start dispatching workunits\n");
  write(1, "[2K", 4);
  write(1, "\rWaiting for workers to connect...\n", 35);
  return (0);
}


x86 assembly (clang, -O0):
<sim_ready_prompt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
lea    0xefc(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x1,%edi
lea    0xeeb(%rip),%rsi
mov    $0x23,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_ready_prompt>:
push   %rax
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1040 <write@plt>
lea    0xebb(%rip),%rsi
mov    $0x1,%edi
mov    $0x23,%edx
call   1040 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"\0DPress \1B[32m[ENTER] \1B[0mto start dispatching workunits\0A\00"
@.str.1 = [5 x i8] c"\1B[2K\00"
@.str.2 = [36 x i8] c"\0DWaiting for workers to connect...\0A\00"
define i32 @sim_ready_prompt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 35)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"\1B[2K\00"
@.str.2 = [36 x i8] c"\0DWaiting for workers to connect...\0A\00"
@str = [55 x i8] c"\0DPress \1B[32m[ENTER] \1B[0mto start dispatching workunits\00"
define i32 @sim_ready_prompt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 35)
ret i32 0
}
long long dl_strhash(const char *s) {
  unsigned long long h = 0;
  while (*s) {
    h = h * (999983) + (unsigned long long)*s++;
  }
  return (long long)h;
}


x86 assembly (clang, -O0):
<dl_strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <dl_strhash+0x44>
imul   $0xf422f,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <dl_strhash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <dl_strhash+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0xf422f,%rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <dl_strhash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @dl_strhash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %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 %16
8: ; preds = %4
%9 = load i64, i64* %3
%10 = mul i64 %9, 999983
%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 i64
%15 = add i64 %10, %14
store i64 %15, i64* %3
br label %4
16: ; preds = %4
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @dl_strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 999983
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i64
%11 = add i64 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
double fun(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int year, t;
  while (year > 2005) {
    printf("Please enter the year after 2005\n");
    scanf("%d", &year);
    printf("The the billions of dollars of fast food charges U.S. consumers "
           "will make in given year:$ %f\n",
           fun(year));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x7d5,-0x8(%rbp)
jle    1185 <main+0x55>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <fun@plt>
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"Please enter the year after 2005\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [94 x i8] c"The the billions of dollars of fast food charges U.S. consumers will make in given year:$ %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 2005
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = call double @fun(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.2, i64 0, i64 0), double %11)
br label %4
13: ; preds = %4
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void print_hex(unsigned char *buf, int len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%02x", buf[i]);
  }
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print_hex+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_hex+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <print_hex+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_hex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_hex(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void insb(int port, void *addr, unsigned long count) {
  __asm__ __volatile__("rep; insb"
                       : "+D"(addr), "+c"(count)
                       : "d"(port)
                       : "memory");
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep insb (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; insb", "={di},={cx},{dx},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insb(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; insb", "={di},={cx},{dx},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int i2c_close(int pi, unsigned handle) {
  return pigpio_command(pi, 55, handle, 0, 1);
}


x86 assembly (clang, -O0):
<i2c_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x37,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_close>:
mov    %esi,%edx
mov    $0x37,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @i2c_close(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 55, i32 %1, i32 0, i32 1)
ret i32 %3
}
int x_plus_y(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<x_plus_y>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @x_plus_y(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void getIp(char *cont, char *ip) {
  int i = 0;
  while (cont[i] != ':') {
    i++;
  }
  memcpy(ip, cont, i);
  ip[i] = '\0';
  return;
}


x86 assembly (clang, -O0):
<getIp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
je     114a <getIp+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <getIp+0x17>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    $0xffffffffffffffff,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x3a,0x1(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1130 <getIp+0x20>
mov    %edx,%r14d
mov    %rbx,%rdi
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @getIp(i8* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 58
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = and i64 %4, 4294967295
%12 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %10)
%13 = getelementptr inbounds i8, i8* %1, i64 %11
store i8 0, i8* %13
ret void
}
int test_imm_7Auint16_mem(unsigned short *val) {
  return ((*val) & (0x7A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 122
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}