xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("'h'   - help\n");
  printf("'w'   - wire frame\n");
  printf("UP	  - faster\n");
  printf("DOWN  - slower\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"'h' - help\0A\00"
@.str.1 = [20 x i8] c"'w' - wire frame\0A\00"
@.str.2 = [15 x i8] c"UP\09 - faster\0A\00"
@.str.3 = [16 x i8] c"DOWN - slower\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"'h' - help\00"
@str.4 = [19 x i8] c"'w' - wire frame\00"
@str.5 = [14 x i8] c"UP\09 - faster\00"
@str.6 = [15 x i8] c"DOWN - slower\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
double rangelimit(double, int, int);
double cumulative_squared_parabola(double x) {
  double x2;
  x = rangelimit(x, -1., 1.);
  x2 = x * x;
  return ((0.375 * x2 - 1.25) * x2 + 1.875) * x;
}


x86 assembly (clang, -O0):
<cumulative_squared_parabola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <rangelimit@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8d(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cumulative_squared_parabola>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <rangelimit@plt>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xed0(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xecc(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xec8(%rip),%xmm2
mulsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cumulative_squared_parabola(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @rangelimit(double %4, i32 -1, i32 1)
store double %5, double* %2
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double 3.750000e-01, double %9, double -1.250000e+00)
%11 = load double, double* %3
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double 1.875000e+00)
%13 = load double, double* %2
%14 = fmul double %12, %13
ret double %14
}

LLVM IR (-O2):
define double @cumulative_squared_parabola(double %0) {
%2 = tail call double @rangelimit(double %0, i32 -1, i32 1)
%3 = fmul double %2, %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double 3.750000e-01, double -1.250000e+00)
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double 1.875000e+00)
%6 = fmul double %2, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ test_byte();
int /*<<< orphan*/ test_one_bit();
int /*<<< orphan*/ test_two_byte();
int main() {
  test_one_bit();
  test_byte();
  test_two_byte();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_one_bit@plt>
xor    %eax,%eax
call   1050 <test_byte@plt>
xor    %eax,%eax
call   1040 <test_two_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_one_bit()
%2 = tail call i32 (...) @test_byte()
%3 = tail call i32 (...) @test_two_byte()
ret i32 0
}
/* Variables and functions */
void *kmalloc(int);
void *alloc_page(void) { return kmalloc(12); }


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

x86 assembly (clang, -O2):
<alloc_page>:
mov    $0xc,%edi
jmp    1030 <kmalloc@plt>

LLVM IR (-O0):
define i8* @alloc_page() {
%1 = call i8* @kmalloc(i32 12)
ret i8* %1
}

LLVM IR (-O2):
define i8* @alloc_page() {
%1 = tail call i8* @kmalloc(i32 12)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void *mt_malloc(size_t, char *, char *, int);
void *mt_calloc(size_t size1, size_t size2, char *callfunc, char *file,
                int line) {
  void *buf;
  buf = mt_malloc(size1 * size2, callfunc, file, line);
  if (buf) {
    memset(buf, 0x00, size1 * size2);
  }
  return buf;
}


x86 assembly (clang, -O0):
<mt_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <mt_malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1178 <mt_calloc+0x58>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
call   1040 <mt_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1151 <mt_calloc+0x31>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mt_calloc(i64 %0, i64 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = mul i64 %12, %13
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = call i8* @mt_malloc(i64 %14, i8* %15, i8* %16, i32 %17)
store i8* %18, i8** %11
%19 = load i8*, i8** %11
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %27
21: ; preds = %5
%22 = load i8*, i8** %11
%23 = load i64, i64* %6
%24 = load i64, i64* %7
%25 = mul i64 %23, %24
%26 = call i32 @memset(i8* %22, i32 0, i64 %25)
br label %27
27: ; preds = %21, %5
%28 = load i8*, i8** %11
ret i8* %28
}

LLVM IR (-O2):
define i8* @mt_calloc(i64 %0, i64 %1, i8* %2, i8* %3, i32 %4) {
%6 = mul i64 %1, %0
%7 = tail call i8* @mt_malloc(i64 %6, i8* %2, i8* %3, i32 %4)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @memset(i8* %7, i32 0, i64 %6)
br label %11
11: ; preds = %9, %5
ret i8* %7
}
/* Variables and functions */
float fabs(float x) { return x - (x < 0) * (2 * x); }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  0xed7(%rip),%xmm2
mulss  -0x4(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm2
cmpltss %xmm1,%xmm2
movss  0xeed(%rip),%xmm1
andps  %xmm2,%xmm1
movaps %xmm0,%xmm2
addss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
subss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @fabs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = sitofp i32 %6 to float
%8 = load float, float* %2
%9 = fmul float 2.000000e+00, %8
%10 = fneg float %7
%11 = call float @llvm.fmuladd.f32(float %10, float %9, float %3)
ret float %11
}

LLVM IR (-O2):
define float @fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = uitofp i1 %2 to float
%4 = fmul float %0, 2.000000e+00
%5 = fneg float %3
%6 = tail call float @llvm.fmuladd.f32(float %5, float %4, float %0)
ret float %6
}
/* Variables and functions */
double log(double);
double _p3dJohannsenThresholding_entropy(double h) {
  if (h > 0.0)
    return (-h * log(h));
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<_p3dJohannsenThresholding_entropy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1170 <_p3dJohannsenThresholding_entropy+0x60>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1178 <_p3dJohannsenThresholding_entropy+0x68>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_p3dJohannsenThresholding_entropy>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <_p3dJohannsenThresholding_entropy+0x31>
sub    $0x18,%rsp
movapd 0xeda(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
call   1030 <log@plt>
movapd %xmm0,%xmm1
mulsd  (%rsp),%xmm1
add    $0x18,%rsp
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @_p3dJohannsenThresholding_entropy(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = load double, double* %3
%10 = call double @log(double %9)
%11 = fmul double %8, %10
store double %11, double* %2
br label %13
12: ; preds = %1
store double 0.000000e+00, double* %2
br label %13
13: ; preds = %12, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @_p3dJohannsenThresholding_entropy(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @log(double %0)
%6 = fmul double %5, %4
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 0.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
size_t strlen(const char *string) {
  const char *s;
  s = string;
  while (*s) {
    s++;
  }
  return s - string;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *submissionSetPart(struct sqlConnection *, int, char *);
char *bioImageItemUrl(struct sqlConnection *conn, int id) {
  return submissionSetPart(conn, id, "itemUrl");
}


x86 assembly (clang, -O0):
<bioImageItemUrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <submissionSetPart@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bioImageItemUrl>:
lea    0xee9(%rip),%rdx
jmp    1030 <submissionSetPart@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"itemUrl\00"
define i8* @bioImageItemUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @submissionSetPart(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"itemUrl\00"
define i8* @bioImageItemUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @submissionSetPart(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error(char *message) {
  fprintf(stderr, "\nERROR: ");
  fprintf(stderr, "\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"\0AERROR: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"\0AERROR: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @error(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uLong;

/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void put_uLong(uLong val) {
  putchar(val >> 24);
  putchar(val >> 16);
  putchar(val >> 8);
  putchar(val >> 0);
}


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

x86 assembly (clang, -O2):
<put_uLong>:
push   %rbx
mov    %edi,%ebx
sar    $0x18,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
sar    $0x10,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
sar    $0x8,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @put_uLong(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = call i32 @putchar(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = call i32 @putchar(i32 %7)
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = call i32 @putchar(i32 %10)
%12 = load i32, i32* %2
%13 = ashr i32 %12, 0
%14 = call i32 @putchar(i32 %13)
ret void
}

LLVM IR (-O2):
define void @put_uLong(i32 %0) {
%2 = ashr i32 %0, 24
%3 = tail call i32 @putchar(i32 %2)
%4 = ashr i32 %0, 16
%5 = tail call i32 @putchar(i32 %4)
%6 = ashr i32 %0, 8
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 @putchar(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ write(int, char *, int);
int die(char *msg, int code) {
  syslog(LOG_NOTICE, "(%u) %s", code, msg);
  write(1, "?", 1);
  return code;
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeba(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x1,%edx
lea    0xeb1(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    %ebx,%edx
call   1040 <syslog@plt>
lea    0xec4(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [8 x i8] c"(%u) %s\00"
@.str.1 = [2 x i8] c"?\00"
define i32 @die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @LOG_NOTICE
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [8 x i8] c"(%u) %s\00"
@.str.1 = [2 x i8] c"?\00"
define i32 @die(i8* %0, i32 returned %1) {
%3 = load i32, i32* @LOG_NOTICE
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 %1
}
/* Variables and functions */
unsigned char proto_assembleFrame(unsigned char *, unsigned short *,
                                  unsigned char *, int, int, int,
                                  unsigned char *);
unsigned char protoR_readMultiInfo(unsigned char *buf, unsigned short *bufSize,
                                   unsigned char *gatewayId,
                                   unsigned char *seq) {
  return proto_assembleFrame(buf, bufSize, gatewayId, 0x00, 0x11, 1, seq);
}


x86 assembly (clang, -O0):
<protoR_readMultiInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    $0x11,%r8d
mov    $0x1,%r9d
mov    %rax,(%rsp)
call   1030 <proto_assembleFrame@plt>
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protoR_readMultiInfo>:
push   %rax
mov    %rcx,(%rsp)
xor    %ecx,%ecx
mov    $0x11,%r8d
mov    $0x1,%r9d
call   1030 <proto_assembleFrame@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i8 @protoR_readMultiInfo(i8* %0, i16* %1, i8* %2, i8* %3) {
%5 = tail call zeroext i8 @proto_assembleFrame(i8* %0, i16* %1, i8* %2, i32 0, i32 17, i32 1, i8* %3)
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _help(void) {
  printf("B+ Tree options:\n");
  printf("\t args: [1]branching factor r \n");
}


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

x86 assembly (clang, -O2):
<_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"B+ Tree options:\0A\00"
@.str.1 = [32 x i8] c"\09 args: [1]branching factor r \0A\00"
define void @_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"B+ Tree options:\00"
@str.2 = [31 x i8] c"\09 args: [1]branching factor r \00"
define void @_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
ret void
}
void foo631() {}


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

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

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

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

/* Variables and functions */
int priv_encdec_proxy(char *, int, unsigned char const *, unsigned char *,
                      int /*<<< orphan*/ *, int);
int priv_dec_proxy(int flen, const unsigned char *from, unsigned char *to,
                   RSA *rsa, int padding) {
  return priv_encdec_proxy("priv_dec", flen, from, to, rsa, padding);
}


x86 assembly (clang, -O0):
<priv_dec_proxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
lea    0xebb(%rip),%rdi
call   1030 <priv_encdec_proxy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<priv_dec_proxy>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xedb(%rip),%rdi
jmp    1030 <priv_encdec_proxy@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"priv_dec\00"
define i32 @priv_dec_proxy(i32 %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32*, i32** %9
%15 = load i32, i32* %10
%16 = call i32 @priv_encdec_proxy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13, i32* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [9 x i8] c"priv_dec\00"
define i32 @priv_dec_proxy(i32 %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = tail call i32 @priv_encdec_proxy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2, i32* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ mpgdecoder_free(void *);
void default_mpgdecoder_free(void *ctx) { mpgdecoder_free(ctx); }


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

x86 assembly (clang, -O2):
<default_mpgdecoder_free>:
jmp    1030 <mpgdecoder_free@plt>

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

LLVM IR (-O2):
define void @default_mpgdecoder_free(i8* %0) {
%2 = tail call i32 @mpgdecoder_free(i8* %0)
ret void
}
float d_sign(float a, float b) {
  float x;
  x = (a >= 0 ? a : -a);
  return (b >= 0 ? x : -x);
}


x86 assembly (clang, -O0):
<d_sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112e <d_sign+0x2e>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1145 <d_sign+0x45>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     116f <d_sign+0x6f>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1186 <d_sign+0x86>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_sign>:
movaps 0xef9(%rip),%xmm2
movaps %xmm0,%xmm3
xorps  %xmm2,%xmm3
xorps  %xmm4,%xmm4
xorps  %xmm5,%xmm5
cmpless %xmm0,%xmm5
andps  %xmm5,%xmm0
andnps %xmm3,%xmm5
orps   %xmm5,%xmm0
xorps  %xmm0,%xmm2
cmpless %xmm1,%xmm4
andps  %xmm4,%xmm0
andnps %xmm2,%xmm4
orps   %xmm4,%xmm0
ret

LLVM IR (-O0):
define float @d_sign(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fcmp oge float %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %13
10: ; preds = %2
%11 = load float, float* %3
%12 = fneg float %11
br label %13
13: ; preds = %10, %8
%14 = phi float [ %9, %8 ], [ %12, %10 ]
store float %14, float* %5
%15 = load float, float* %4
%16 = fcmp oge float %15, 0.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %5
br label %22
19: ; preds = %13
%20 = load float, float* %5
%21 = fneg float %20
br label %22
22: ; preds = %19, %17
%23 = phi float [ %18, %17 ], [ %21, %19 ]
ret float %23
}

LLVM IR (-O2):
define float @d_sign(float %0, float %1) {
%3 = fcmp oge float %0, 0.000000e+00
%4 = fneg float %0
%5 = select i1 %3, float %0, float %4
%6 = fcmp oge float %1, 0.000000e+00
%7 = fneg float %5
%8 = select i1 %6, float %5, float %7
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ pifacecad_lcd_set_enable(int);
int /*<<< orphan*/ sleep_ns(int);
void pifacecad_lcd_pulse_enable(void) {
  pifacecad_lcd_set_enable(1);
  sleep_ns(1000);
  pifacecad_lcd_set_enable(0);
  sleep_ns(1000);
}


x86 assembly (clang, -O0):
<pifacecad_lcd_pulse_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <pifacecad_lcd_set_enable@plt>
mov    $0x3e8,%edi
call   1030 <sleep_ns@plt>
xor    %edi,%edi
call   1040 <pifacecad_lcd_set_enable@plt>
mov    $0x3e8,%edi
call   1030 <sleep_ns@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pifacecad_lcd_pulse_enable>:
push   %rax
mov    $0x1,%edi
call   1040 <pifacecad_lcd_set_enable@plt>
mov    $0x3e8,%edi
call   1030 <sleep_ns@plt>
xor    %edi,%edi
call   1040 <pifacecad_lcd_set_enable@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1030 <sleep_ns@plt>

LLVM IR (-O0):
define void @pifacecad_lcd_pulse_enable() {
%1 = call i32 @pifacecad_lcd_set_enable(i32 1)
%2 = call i32 @sleep_ns(i32 1000)
%3 = call i32 @pifacecad_lcd_set_enable(i32 0)
%4 = call i32 @sleep_ns(i32 1000)
ret void
}

LLVM IR (-O2):
define void @pifacecad_lcd_pulse_enable() {
%1 = tail call i32 @pifacecad_lcd_set_enable(i32 1)
%2 = tail call i32 @sleep_ns(i32 1000)
%3 = tail call i32 @pifacecad_lcd_set_enable(i32 0)
%4 = tail call i32 @sleep_ns(i32 1000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_i2f();
int /*<<< orphan*/ build_l2s();
int /*<<< orphan*/ build_s2l();
void oil_global_init() {
  build_s2l();
  build_l2s();
  build_i2f();
}


x86 assembly (clang, -O0):
<oil_global_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <build_s2l@plt>
mov    $0x0,%al
call   1030 <build_l2s@plt>
mov    $0x0,%al
call   1050 <build_i2f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<oil_global_init>:
push   %rax
xor    %eax,%eax
call   1040 <build_s2l@plt>
xor    %eax,%eax
call   1030 <build_l2s@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <build_i2f@plt>

LLVM IR (-O0):
define void @oil_global_init() {
%1 = call i32 (...) @build_s2l()
%2 = call i32 (...) @build_l2s()
%3 = call i32 (...) @build_i2f()
ret void
}

LLVM IR (-O2):
define void @oil_global_init() {
%1 = tail call i32 (...) @build_s2l()
%2 = tail call i32 (...) @build_l2s()
%3 = tail call i32 (...) @build_i2f()
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
struct timeval convert_sec_to_timeval(double sec) {
  struct timeval tv;
  tv.tv_sec = (long int)sec;
  tv.tv_usec = (long int)((sec - ((double)tv.tv_sec)) * 1.0e6);
  return tv;
}


x86 assembly (clang, -O0):
<convert_sec_to_timeval>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_sec_to_timeval>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xeea(%rip),%xmm0
cvttsd2si %xmm0,%rdx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define { i64, i64 } @convert_sec_to_timeval(double %0) {
%2 = alloca %struct.timeval
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fptosi double %4 to i64
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load double, double* %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fsub double %7, %10
%12 = fmul double %11, 1.000000e+06
%13 = fptosi double %12 to i64
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 %13, i64* %14
%15 = bitcast %struct.timeval* %2 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @convert_sec_to_timeval(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fmul double %4, 1.000000e+06
%6 = fptosi double %5 to i64
%7 = insertvalue { i64, i64 } poison, i64 %2, 0
%8 = insertvalue { i64, i64 } %7, i64 %6, 1
ret { i64, i64 } %8
}
int from_errno(int err) { return err; }


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

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

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

LLVM IR (-O2):
define i32 @from_errno(i32 returned %0) {
ret i32 %0
}
void RTAvlroIOPortGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroIOPortGet() {
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ client;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ setnonblock(int);
int accept_new_connection(int socket) {
  struct sockaddr_in client;
  socklen_t client_len = sizeof(client);
  int new_sock = accept(socket, (struct sockaddr *)&client, &client_len);
  if (new_sock < 0) {
    return -1;
  }
  setnonblock(new_sock);
  return new_sock;
}


x86 assembly (clang, -O0):
<accept_new_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115b <accept_new_connection+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <accept_new_connection+0x49>
mov    -0x18(%rbp),%edi
call   1030 <setnonblock@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_new_connection>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <accept@plt>
test   %eax,%eax
js     114b <accept_new_connection+0x2b>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <setnonblock@plt>
jmp    1150 <accept_new_connection+0x30>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @accept_new_connection(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%7 = load i32, i32* %3
%8 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%9 = call i32 @accept(i32 %7, %struct.sockaddr* %8, i32* %5)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %17
13: ; preds = %1
%14 = load i32, i32* %6
%15 = call i32 @setnonblock(i32 %14)
%16 = load i32, i32* %6
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @accept_new_connection(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp slt i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @setnonblock(i32 %7)
br label %11
11: ; preds = %1, %9
%12 = phi i32 [ %7, %9 ], [ -1, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ command(char *);
void cdup() { (void)command("CDUP"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"CDUP\00"
define void @cdup() {
%1 = tail call i32 @command(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ENXIO;
int pm8921_bms_get_percent_charge(int chg_state) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_bms_get_percent_charge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_bms_get_percent_charge>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_bms_get_percent_charge(i32 %0) {
%2 = load i32, i32* @ENXIO
%3 = sub nsw i32 0, %2
ret i32 %3
}
double return_double() { return 3.14; }


x86 assembly (clang, -O0):
<return_double>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_double>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @return_double() {
ret double 3.140000e+00
}

LLVM IR (-O2):
define double @return_double() {
ret double 3.140000e+00
}
/* Variables and functions */
scalar_t__ getc();
int getchar(void) {
  int c;
  c = (int)getc();
  if (c == '\r')
    return '\n';
  return c;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xd,-0x8(%rbp)
jne    1138 <getchar+0x28>
movl   $0xa,-0x4(%rbp)
jmp    113e <getchar+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
xor    %eax,%eax
call   1030 <getc@plt>
cmp    $0xd,%eax
mov    $0xa,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getchar() {
%1 = tail call i64 (...) @getc()
%2 = trunc i64 %1 to i32
%3 = icmp eq i32 %2, 13
%4 = select i1 %3, i32 10, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void shellcodeGenerator() { printf("Not yet implemented.\n"); }


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Not yet implemented.\00"
define void @shellcodeGenerator() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void _clear(void *m) {
  size_t *x = (size_t *)m - 2;
  memset(m, 0, x[0] * x[1]);
}


x86 assembly (clang, -O0):
<_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
imul   0x8(%rax),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clear>:
mov    -0x8(%rdi),%rdx
imul   -0x10(%rdi),%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @_clear(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
%6 = getelementptr inbounds i64, i64* %5, i64 -2
store i64* %6, i64** %3
%7 = load i8*, i8** %2
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = load i64*, i64** %3
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = mul i64 %10, %13
%15 = call i32 @memset(i8* %7, i32 0, i64 %14)
ret void
}

LLVM IR (-O2):
define void @_clear(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -16
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
%5 = getelementptr inbounds i8, i8* %0, i64 -8
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = mul i64 %7, %4
%9 = tail call i32 @memset(i8* %0, i32 0, i64 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *test = NULL;
  printf("%c\n", test[0]);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext undef)
ret i32 0
}
/* Type definitions */
struct node_description {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dst_filter1_reset(struct node_description *);
void dst_rcdiscN_reset(struct node_description *node) {
  dst_filter1_reset(node);
}


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

x86 assembly (clang, -O2):
<dst_rcdiscN_reset>:
jmp    1030 <dst_filter1_reset@plt>

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

LLVM IR (-O2):
%struct.node_description = type { i32 }
define void @dst_rcdiscN_reset(%struct.node_description* %0) {
%2 = tail call i32 @dst_filter1_reset(%struct.node_description* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, char *);
const char *derp_version() {
  static char str[128];
  sprintf(str, "%d.%d build %d (%s)", 1, 2, 56, "Mar 15 2022");
  return str;
}


x86 assembly (clang, -O0):
<derp_version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x38,%r8d
lea    0xedb(%rip),%r9
call   1030 <sprintf@plt>
lea    0x2efb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<derp_version>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
lea    0xeee(%rip),%r9
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x38,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@derp_version.str = internal global [128 x i8] zeroinitializer
@.str = [20 x i8] c"%d.%d build %d (%s)\00"
@.str.1 = [12 x i8] c"Mar 15 2022\00"
define i8* @derp_version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @derp_version.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 56, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @derp_version.str, i64 0, i64 0)
}

LLVM IR (-O2):
@derp_version.str = internal global [128 x i8] zeroinitializer
@.str = [20 x i8] c"%d.%d build %d (%s)\00"
@.str.1 = [12 x i8] c"Mar 15 2022\00"
define i8* @derp_version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @derp_version.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 56, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @derp_version.str, i64 0, i64 0)
}
/* Variables and functions */
int PARTITION(int *, int, int);
int QUICKSORT(int A[1000000], int p, int r) {
  int i, q;
  if (p < r) {
    q = PARTITION(A, p, r);
    QUICKSORT(A, p, q - 1);
    QUICKSORT(A, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<QUICKSORT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1174 <QUICKSORT+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <PARTITION@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%edx
sub    $0x1,%edx
call   1030 <QUICKSORT@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
call   1030 <QUICKSORT@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QUICKSORT>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <QUICKSORT+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <PARTITION@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <QUICKSORT@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <QUICKSORT+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @QUICKSORT(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %1, %3 ]
%7 = tail call i32 @PARTITION(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
%9 = tail call i32 @QUICKSORT(i32* %0, i32 %6, i32 %8)
%10 = add nsw i32 %7, 1
%11 = icmp slt i32 %10, %2
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret i32 undef
}