xunge/DecIR huggingface dataset:
double inner_product(double *a, double *b, int n) {
  if (n == 0) {
    return 0.0;
  } else {
    return ((*a) * (*b)) + inner_product((a + 1), (b + 1), n - 1);
  }
}


x86 assembly (clang, -O0):
<inner_product>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    113a <inner_product+0x2a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1189 <inner_product+0x79>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1030 <inner_product@plt>
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inner_product>:
test   %edx,%edx
je     1139 <inner_product+0x29>
push   %rax
movsd  (%rdi),%xmm0
add    $0x8,%rdi
add    $0xffffffff,%edx
mulsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
add    $0x8,%rsi
call   1030 <inner_product@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @inner_product(double* %0, double* %1, i32 %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store double 0.000000e+00, double* %4
br label %24
11: ; preds = %3
%12 = load double*, double** %5
%13 = load double, double* %12
%14 = load double*, double** %6
%15 = load double, double* %14
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, 1
%22 = call double @inner_product(double* %17, double* %19, i32 %21)
%23 = call double @llvm.fmuladd.f64(double %13, double %15, double %22)
store double %23, double* %4
br label %24
24: ; preds = %11, %10
%25 = load double, double* %4
ret double %25
}

LLVM IR (-O2):
define double @inner_product(double* nocapture %0, double* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3, %7
%6 = phi double [ %14, %7 ], [ 0.000000e+00, %3 ]
ret double %6
7: ; preds = %3
%8 = load double, double* %0
%9 = load double, double* %1
%10 = getelementptr inbounds double, double* %0, i64 1
%11 = getelementptr inbounds double, double* %1, i64 1
%12 = add nsw i32 %2, -1
%13 = tail call double @inner_product(double* %10, double* %11, i32 %12)
%14 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %13)
br label %5
}
/* Variables and functions */
char *malloc(size_t);
void *ft_memalloc(size_t size) {
  char *tmp;
  int i;
  if (!(tmp = malloc(size)))
    return (NULL);
  i = 0;
  while (i < (int)size)
    *(tmp + i++) = 0;
  return ((void *)tmp);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1140 <ft_memalloc+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1179 <ft_memalloc+0x69>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    %ecx,%eax
jge    1171 <ft_memalloc+0x61>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1147 <ft_memalloc+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1144 <ft_memalloc+0x24>
test   %ebx,%ebx
jle    1144 <ft_memalloc+0x24>
mov    %ebx,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @ft_memalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = trunc i64 %0 to i32
%5 = icmp sgt i32 %4, 0
%6 = and i1 %3, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = and i64 %0, 4294967295
br label %9
9: ; preds = %7, %1
ret i8* %2
}
unsigned char inportb(unsigned short _port) {
  unsigned char rv;
  __asm volatile("inb %1, %0" : "=a"(rv) : "dN"(_port));
  return rv;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
float ltom_f(uint8_t in[4]) {
  float out = 0.0;
  uint8_t *fp = (uint8_t *)&out;
  fp[0] = in[0];
  fp[1] = in[1];
  fp[2] = in[2];
  fp[3] = in[3];
  return out;
}


x86 assembly (clang, -O0):
<ltom_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltom_f>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @ltom_f(i32* %0) {
%2 = alloca i32*
%3 = alloca float
%4 = alloca i32*
store i32* %0, i32** %2
store float 0.000000e+00, float* %3
%5 = bitcast float* %3 to i32*
store i32* %5, i32** %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32 %18, i32* %20
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 3
%23 = load i32, i32* %22
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 3
store i32 %23, i32* %25
%26 = load float, float* %3
ret float %26
}

LLVM IR (-O2):
define float @ltom_f(i32* nocapture %0) {
%2 = bitcast i32* %0 to float*
%3 = load float, float* %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void say_help(void) { fprintf(stderr, "use '-h' for help.\n"); }


x86 assembly (clang, -O0):
<say_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"use '-h' for help.\0A\00"
define void @say_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"use '-h' for help.\0A\00"
define void @say_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ printf(char *, int volatile);
int main(void) {
  printf("%d\n", INT_MIN % -1);
  volatile int i = INT_MIN;
  volatile int j = -1;
  printf("%d\n", i % j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    $0xffffffff,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
mov    0xc(%rsp),%eax
cltd
idivl  0x8(%rsp)
mov    %rbx,%rdi
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @INT_MIN
%5 = srem i32 %4, -1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @INT_MIN
store volatile i32 %7, i32* %2
store volatile i32 -1, i32* %3
%8 = load volatile i32, i32* %2
%9 = load volatile i32, i32* %3
%10 = srem i32 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = bitcast i32* %1 to i8*
%5 = load i32, i32* @INT_MIN
store volatile i32 %5, i32* %1
%6 = bitcast i32* %2 to i8*
store volatile i32 -1, i32* %2
%7 = load volatile i32, i32* %1
%8 = load volatile i32, i32* %2
%9 = srem i32 %7, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
int comp(void const *e1, void const *e2) {
  int *i = *((int **)e1);
  int *j = *((int **)e2);
  if (*i < *j)
    return -1;
  if (*i > *j)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1140 <comp+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <comp+0x65>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    115e <comp+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <comp+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    (%rax),%eax
xor    %edx,%edx
cmp    (%rcx),%eax
setg   %dl
mov    $0xffffffff,%eax
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = bitcast i8* %1 to i32**
%6 = load i32*, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp slt i32 %7, %8
%10 = icmp sgt i32 %7, %8
%11 = zext i1 %10 to i32
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
void function_empty_est_date_ini() {}


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

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

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

LLVM IR (-O2):
define void @function_empty_est_date_ini() {
ret void
}
/* Variables and functions */
unsigned int get_cycles_rate();
unsigned int trace_clock_frequency(void) { return get_cycles_rate(); }


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

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

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

LLVM IR (-O2):
define i32 @trace_clock_frequency() {
%1 = tail call i32 (...) @get_cycles_rate()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
int /*<<< orphan*/ Send_Byte(int);
void EWSR() {
  CE_Low();
  Send_Byte(0x50);
  CE_High();
}


x86 assembly (clang, -O0):
<EWSR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <CE_Low@plt>
mov    $0x50,%edi
call   1030 <Send_Byte@plt>
mov    $0x0,%al
call   1040 <CE_High@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EWSR>:
push   %rax
xor    %eax,%eax
call   1050 <CE_Low@plt>
mov    $0x50,%edi
call   1030 <Send_Byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CE_High@plt>

LLVM IR (-O0):
define void @EWSR() {
%1 = call i32 (...) @CE_Low()
%2 = call i32 @Send_Byte(i32 80)
%3 = call i32 (...) @CE_High()
ret void
}

LLVM IR (-O2):
define void @EWSR() {
%1 = tail call i32 (...) @CE_Low()
%2 = tail call i32 @Send_Byte(i32 80)
%3 = tail call i32 (...) @CE_High()
ret void
}
foo(a, b) long b;
{
  auto c = a + b;
  return bar(c, a * a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
lea    (%rsi,%rax,1),%edi
imul   %eax,%eax
mov    %eax,%esi
xor    %eax,%eax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i64, i64* %4
%9 = add nsw i64 %7, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = mul nsw i32 %12, %13
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @bar to i32 (i32, i32, ...)*)(i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %3, %0
%5 = mul nsw i32 %0, %0
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @bar to i32 (i32, i32, ...)*)(i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int *);
void test_cast(void *ptr) { __emit_expression_range(0, (int *)ptr); }


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

x86 assembly (clang, -O2):
<test_cast>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_cast(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @__emit_expression_range(i32 0, i32* %4)
ret void
}

LLVM IR (-O2):
define void @test_cast(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__emit_expression_range(i32 0, i32* %2)
ret void
}
int pcapack_colmeans(const int m, const int n, double *x, double *colsums) {
  int i, j;
  double tmp;
  const double divbym = 1. / ((double)m);
  for (j = 0; j < m; j++) {
    tmp = 0.;
    for (i = 0; i < n; i++) {
      tmp += x[i + m * j] * divbym;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<pcapack_colmeans>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a6 <pcapack_colmeans+0xa6>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1193 <pcapack_colmeans+0x93>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    -0x4(%rbp),%edx
imul   -0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114a <pcapack_colmeans+0x4a>
jmp    1198 <pcapack_colmeans+0x98>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112f <pcapack_colmeans+0x2f>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pcapack_colmeans(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to double
%15 = fdiv double 1.000000e+00, %14
store double %15, double* %12
store i32 0, i32* %10
br label %16
16: ; preds = %42, %4
%17 = load i32, i32* %10
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %45
20: ; preds = %16
store double 0.000000e+00, double* %11
store i32 0, i32* %9
br label %21
21: ; preds = %38, %20
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %41
25: ; preds = %21
%26 = load double*, double** %7
%27 = load i32, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = mul nsw i32 %28, %29
%31 = add nsw i32 %27, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %26, i64 %32
%34 = load double, double* %33
%35 = load double, double* %12
%36 = load double, double* %11
%37 = call double @llvm.fmuladd.f64(double %34, double %35, double %36)
store double %37, double* %11
br label %38
38: ; preds = %25
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
br label %21
41: ; preds = %21
br label %42
42: ; preds = %41
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
br label %16
45: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @pcapack_colmeans(i32 %0, i32 %1, double* nocapture %2, double* nocapture readnone %3) {
ret i32 0
}
void COORDINADOR_TASK_FCN(void const *argument) {}


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

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

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

LLVM IR (-O2):
define void @COORDINADOR_TASK_FCN(i8* nocapture %0) {
ret void
}
int is_multiple_of_4(unsigned long val) { return !(val & 0x03); }


x86 assembly (clang, -O0):
<is_multiple_of_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_multiple_of_4>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_multiple_of_4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 3
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_multiple_of_4(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t enrange(uint32_t x) { x = x & 0x00ffffff; }


x86 assembly (clang, -O0):
<enrange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @enrange(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int fill_http_method(char *, int, char **);
int fill_http_full_path(char *line, int lineLen, char **fullPathPtr) {
  return fill_http_method(line, lineLen, fullPathPtr);
}


x86 assembly (clang, -O0):
<fill_http_full_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fill_http_method@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_http_full_path>:
jmp    1030 <fill_http_method@plt>

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

LLVM IR (-O2):
define i32 @fill_http_full_path(i8* %0, i32 %1, i8** %2) {
%4 = tail call i32 @fill_http_method(i8* %0, i32 %1, i8** %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  scanf("%d", &num);
  if (num % 2)
    printf("Ímpar.\n");
  else
    printf("Par.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1164 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xec5(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [5 x i8] c"Par.\00"
@str.3 = [8 x i8] c"\C3\8Dmpar.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void CRYPTOIntEnable(uint32_t ui32IntFlags) {

  ;
  (*((volatile unsigned long *)(0x40024000 + 0x00000780))) = 0x00000001;
  (*((volatile unsigned long *)(0x40024000 + 0x00000784))) |= ui32IntFlags;
}


x86 assembly (clang, -O0):
<CRYPTOIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40024780,%eax
movq   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x40024784,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40024784,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTOIntEnable>:
mov    %rdi,-0x8(%rsp)
movq   $0x1,0x40024780
mov    -0x8(%rsp),%rax
or     %rax,0x40024784
40
ret

LLVM IR (-O0):
define void @CRYPTOIntEnable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
store volatile i64 1, i64* inttoptr (i64 1073891200 to i64*)
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1073891204 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1073891204 to i64*)
ret void
}

LLVM IR (-O2):
define void @CRYPTOIntEnable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
store volatile i64 1, i64* inttoptr (i64 1073891200 to i64*)
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1073891204 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1073891204 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ spin();
void panic(char *msg) {
  if (msg)
    printf("PANIC: %s\n", msg);
  else
    printf("PANIC\n");
  spin();
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <panic+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115c <panic+0x3c>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <spin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic>:
push   %rax
test   %rdi,%rdi
je     1149 <panic+0x19>
mov    %rdi,%rsi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1155 <panic+0x25>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <spin@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"PANIC: %s\0A\00"
@str = [6 x i8] c"PANIC\00"
define void @panic(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = tail call i32 (...) @spin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check(int, int);
void unitTest() {
  check(0, 19000101);
  check(1, 19000102);
  check(31, 19000201);
  check(60, 19000301);
  check(365, 19001231);
  check(366, 19010101);
}


x86 assembly (clang, -O0):
<unitTest>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x121eb25,%esi
call   1030 <check@plt>
mov    $0x1,%edi
mov    $0x121eb26,%esi
call   1030 <check@plt>
mov    $0x1f,%edi
mov    $0x121eb89,%esi
call   1030 <check@plt>
mov    $0x3c,%edi
mov    $0x121ebed,%esi
call   1030 <check@plt>
mov    $0x16d,%edi
mov    $0x121ef8f,%esi
call   1030 <check@plt>
mov    $0x16e,%edi
mov    $0x1221235,%esi
call   1030 <check@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unitTest>:
push   %rax
xor    %edi,%edi
mov    $0x121eb25,%esi
call   1030 <check@plt>
mov    $0x1,%edi
mov    $0x121eb26,%esi
call   1030 <check@plt>
mov    $0x1f,%edi
mov    $0x121eb89,%esi
call   1030 <check@plt>
mov    $0x3c,%edi
mov    $0x121ebed,%esi
call   1030 <check@plt>
mov    $0x16d,%edi
mov    $0x121ef8f,%esi
call   1030 <check@plt>
mov    $0x16e,%edi
mov    $0x1221235,%esi
pop    %rax
jmp    1030 <check@plt>

LLVM IR (-O0):
define void @unitTest() {
%1 = call i32 @check(i32 0, i32 19000101)
%2 = call i32 @check(i32 1, i32 19000102)
%3 = call i32 @check(i32 31, i32 19000201)
%4 = call i32 @check(i32 60, i32 19000301)
%5 = call i32 @check(i32 365, i32 19001231)
%6 = call i32 @check(i32 366, i32 19010101)
ret void
}

LLVM IR (-O2):
define void @unitTest() {
%1 = tail call i32 @check(i32 0, i32 19000101)
%2 = tail call i32 @check(i32 1, i32 19000102)
%3 = tail call i32 @check(i32 31, i32 19000201)
%4 = tail call i32 @check(i32 60, i32 19000301)
%5 = tail call i32 @check(i32 365, i32 19001231)
%6 = tail call i32 @check(i32 366, i32 19010101)
ret void
}
char *strerror(int errnum) {
  extern char *sys_errlist[];
  extern int sys_nerr;
  if (errnum > 0 && errnum < sys_nerr)
    return sys_errlist[errnum];
  return "Unknown system error";
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113b <strerror+0x3b>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jge    113b <strerror+0x3b>
movslq -0xc(%rbp),%rcx
mov    0x2eca(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <strerror+0x46>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
jle    1123 <strerror+0x23>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1123 <strerror+0x23>
mov    %edi,%eax
mov    0x2ed9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [21 x i8] c"Unknown system error\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %12
%14 = load i8*, i8** %13
store i8* %14, i8** %2
br label %16
15: ; preds = %6, %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [21 x i8] c"Unknown system error\00"
define i8* @strerror(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ send_http_response_header(int, int, char *, int, int,
                                             char *);
int process_http_head_request(int soc, int version, char *file, int size,
                              int isdir, char *dirhtml) {
  send_http_response_header(soc, version, file, size, isdir, dirhtml);
  close(soc);
}


x86 assembly (clang, -O0):
<process_http_head_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x28(%rbp),%r9
call   1040 <send_http_response_header@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_http_head_request>:
push   %rbx
mov    %edi,%ebx
call   1040 <send_http_response_header@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @process_http_head_request(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i8* %5) {
%7 = tail call i32 @send_http_response_header(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i8* %5)
%8 = tail call i32 @close(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ glmMix3fv(float *, float *, float const *, float const *);
void glmMix3fv_(float x[3], const float y[3], const float a[3]) {
  glmMix3fv(x, x, y, a);
}


x86 assembly (clang, -O0):
<glmMix3fv_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <glmMix3fv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMix3fv_>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <glmMix3fv@plt>

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

LLVM IR (-O2):
define void @glmMix3fv_(float* %0, float* %1, float* %2) {
%4 = tail call i32 @glmMix3fv(float* %0, float* %0, float* %1, float* %2)
ret void
}
int putchar(int integer_char) { return integer_char; }


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

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

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

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
void foo() { __VERIFIER_error(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @__VERIFIER_error()
ret void
}
void e_clipboard_copy(char *str) {}


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

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

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

LLVM IR (-O2):
define void @e_clipboard_copy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *prgname) {
  printf("%s [EAL options] -- -p PORTMASK -P"
         "  [--config (port,queue,lcore)[,(port,queue,lcore]]"
         "  -p PORTMASK: hexadecimal bitmask of ports to configure\n"
         "  -P : enable promiscuous mode\n"
         "  --config (port,queue,lcore): rx queues configuration\n"
         "  --no-numa: optional, disable numa awareness\n"
         " which max packet len is PKTLEN in decimal (64-9600)\n"
         "  --hash-entry-num: specify the hash entry number in hexadecimal to "
         "be setup\n",
         prgname);
}


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

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

LLVM IR (-O0):
@.str = [405 x i8] c"%s [EAL options] -- -p PORTMASK -P [--config (port,queue,lcore)[,(port,queue,lcore]] -p PORTMASK: hexadecimal bitmask of ports to configure\0A -P : enable promiscuous mode\0A --config (port,queue,lcore): rx queues configuration\0A --no-numa: optional, disable numa awareness\0A which max packet len is PKTLEN in decimal (64-9600)\0A --hash-entry-num: specify the hash entry number in hexadecimal to be setup\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([405 x i8], [405 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [405 x i8] c"%s [EAL options] -- -p PORTMASK -P [--config (port,queue,lcore)[,(port,queue,lcore]] -p PORTMASK: hexadecimal bitmask of ports to configure\0A -P : enable promiscuous mode\0A --config (port,queue,lcore): rx queues configuration\0A --no-numa: optional, disable numa awareness\0A which max packet len is PKTLEN in decimal (64-9600)\0A --hash-entry-num: specify the hash entry number in hexadecimal to be setup\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([405 x i8], [405 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char get_hex_from_int(int);
int get_int_from_hex(char);
char characterXOR(char c1, char c2) {
  int i1 = get_int_from_hex(c1);
  int i2 = get_int_from_hex(c2);
  i1 = i1 ^ i2;
  return (get_hex_from_int(i1));
}


x86 assembly (clang, -O0):
<characterXOR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <get_int_from_hex@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <get_int_from_hex@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <get_hex_from_int@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @characterXOR(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = call i32 @get_int_from_hex(i8 signext %7)
store i32 %8, i32* %5
%9 = load i8, i8* %4
%10 = call i32 @get_int_from_hex(i8 signext %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = xor i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call signext i8 @get_hex_from_int(i32 %14)
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @characterXOR(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @get_int_from_hex(i8 signext %0)
%4 = tail call i32 @get_int_from_hex(i8 signext %1)
%5 = xor i32 %4, %3
%6 = tail call signext i8 @get_hex_from_int(i32 %5)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ reset_twriter();
void Reset_Tiff_Writer() { reset_twriter(); }


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

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

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

LLVM IR (-O2):
define void @Reset_Tiff_Writer() {
%1 = tail call i32 (...) @reset_twriter()
ret void
}
/* Variables and functions */
int task_flag_asserted(int, int);
int task_active_asserted(int id) { return task_flag_asserted(id, (1 << 2)); }


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

x86 assembly (clang, -O2):
<task_active_asserted>:
mov    $0x4,%esi
jmp    1030 <task_flag_asserted@plt>

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

LLVM IR (-O2):
define i32 @task_active_asserted(i32 %0) {
%2 = tail call i32 @task_flag_asserted(i32 %0, i32 4)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void show(unsigned long l) { printf("%lu\n", l); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define void @show(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
char *my_stristr(char *, char *);
scalar_t__ strlen(char *);
scalar_t__ strncasecmp(char *, char *, scalar_t__);
char *header_get_field(char *header, char *field) {
  char *t = my_stristr(header, field);
  if (!t && (strncasecmp(header, field + 1, strlen(field) - 1) == 0))
    t = header;
  return t;
}


x86 assembly (clang, -O0):
<header_get_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <my_stristr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    119f <header_get_field+0x6f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
sub    $0x1,%rdx
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
jne    119f <header_get_field+0x6f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_get_field>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1050 <my_stristr@plt>
test   %rax,%rax
jne    116c <header_get_field+0x3c>
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strncasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmove  %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @header_get_field(i8* %0, i8* %1) {
%3 = tail call i8* @my_stristr(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = add nsw i64 %7, -1
%9 = tail call i64 @strncasecmp(i8* %0, i8* %6, i64 %8)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* %0, i8* null
br label %12
12: ; preds = %5, %2
%13 = phi i8* [ %3, %2 ], [ %11, %5 ]
ret i8* %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void swap_uint16(uint16_t *x) {
  char n = ((char *)x)[0];
  ((char *)x)[0] = ((char *)x)[1];
  ((char *)x)[1] = n;
}


x86 assembly (clang, -O0):
<swap_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uint16>:
rolw   $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define void @swap_uint16(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = load i8, i8* %4
store i8 %5, i8* %2
store i8 %3, i8* %4
ret void
}