xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printarray(int a[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printarray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printarray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printarray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printarray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printarray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void on_write(int sock, short event, void *arg) {
  char *buffer = (char *)arg;
  send(sock, buffer, strlen(buffer), 0);
  free(buffer);
}


x86 assembly (clang, -O0):
<on_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_write>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @on_write(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
store i8* %8, i8** %7
%9 = load i32, i32* %4
%10 = load i8*, i8** %7
%11 = load i8*, i8** %7
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @send(i32 %9, i8* %10, i32 %12, i32 0)
%14 = load i8*, i8** %7
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
define void @on_write(i32 %0, i16 signext %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @send(i32 %0, i8* %2, i32 %4, i32 0)
%6 = tail call i32 @free(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rte_jhash_3words(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t rte_jhash_1word(uint32_t a, uint32_t initval) {
  return rte_jhash_3words(a, 0, 0, initval);
}


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

x86 assembly (clang, -O2):
<rte_jhash_1word>:
mov    %esi,%ecx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <rte_jhash_3words@plt>

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

LLVM IR (-O2):
define i32 @rte_jhash_1word(i32 %0, i32 %1) {
%3 = tail call i32 @rte_jhash_3words(i32 %0, i32 0, i32 0, i32 %1)
ret i32 %3
}
int f_le_cr1(float a1) { return (((100) <= (a1))); }


x86 assembly (clang, -O0):
<f_le_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_le_cr1>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @f_le_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ole float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_le_cr1(float %0) {
%2 = fcmp oge float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double log_rd(double);
double log_ru(double);
double log_rz(double x) {
  if (x > 1)
    return log_rd(x);
  else
    return log_ru(x);
}


x86 assembly (clang, -O0):
<log_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1158 <log_rz+0x38>
movsd  -0x10(%rbp),%xmm0
call   1030 <log_rd@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <log_rz+0x47>
movsd  -0x10(%rbp),%xmm0
call   1040 <log_ru@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_rz>:
ucomisd 0xed8(%rip),%xmm0
jbe    112f <log_rz+0xf>
jmp    1030 <log_rd@plt>
jmp    1040 <log_ru@plt>

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

LLVM IR (-O2):
define double @log_rz(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @log_rd(double %0)
br label %7
5: ; preds = %1
%6 = tail call double @log_ru(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float float_neg_inf() {
  union {
    float f;
    uint32_t i;
  } u;
  u.i = 0xFF800000;
  return u.f;
}


x86 assembly (clang, -O0):
<float_neg_inf>:
push   %rbp
mov    %rsp,%rbp
movl   $0xff800000,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { float }
define float @float_neg_inf() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 -8388608, i32* %2
%3 = bitcast %union.anon* %1 to float*
%4 = load float, float* %3
ret float %4
}

LLVM IR (-O2):
define float @float_neg_inf() {
ret float 0xFFF0000000000000
}
int insy_gcm_mult_lena_lsb_csr_debug_set(
    unsigned int dev_id, union insy_gcm_mult_lena_lsb_csr_debug_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<insy_gcm_mult_lena_lsb_csr_debug_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.insy_gcm_mult_lena_lsb_csr_debug_u = type opaque
define i32 @insy_gcm_mult_lena_lsb_csr_debug_set(i32 %0, %union.insy_gcm_mult_lena_lsb_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.insy_gcm_mult_lena_lsb_csr_debug_u*
store i32 %0, i32* %3
store %union.insy_gcm_mult_lena_lsb_csr_debug_u* %1, %union.insy_gcm_mult_lena_lsb_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.insy_gcm_mult_lena_lsb_csr_debug_u = type opaque
define i32 @insy_gcm_mult_lena_lsb_csr_debug_set(i32 %0, %union.insy_gcm_mult_lena_lsb_csr_debug_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
scalar_t__ instr_util_lssat(long long, unsigned int);
int instr_util_ssat(int val, unsigned int bitc) {
  return (int)instr_util_lssat((long long int)val, bitc);
}


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

x86 assembly (clang, -O2):
<instr_util_ssat>:
movslq %edi,%rdi
jmp    1030 <instr_util_lssat@plt>

LLVM IR (-O0):
define i32 @instr_util_ssat(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = call i64 @instr_util_lssat(i64 %6, i32 %7)
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @instr_util_ssat(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = tail call i64 @instr_util_lssat(i64 %3, i32 %1)
%5 = trunc i64 %4 to i32
ret i32 %5
}
void foo_2_1_2_2_1_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_1_1_2_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *x_calloc(size_t nmemb, size_t size) {
  void *p = calloc(nmemb, size);
  if (p == NULL) {
    perror("failed to allocate memory");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<x_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <x_calloc+0x46>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_calloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <x_calloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"failed to allocate memory\00"
@EXIT_FAILURE = global i32 0
define i8* @x_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [26 x i8] c"failed to allocate memory\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
void __cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
             unsigned int *edx) {
  asm volatile("cpuid\n"
               : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
               : "0"(*eax), "2"(*ecx));
}


x86 assembly (clang, -O0):
<__cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
cpuid
mov    %eax,%r9d
mov    -0x38(%rbp),%rax
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cpuid>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%r9
mov    (%rdi),%eax
mov    (%rdx),%ecx
cpuid
mov    %eax,(%rdi)
mov    %ebx,(%rsi)
mov    %ecx,(%r9)
mov    %edx,(%r8)
pop    %rbx
ret

LLVM IR (-O0):
define void @__cpuid(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
%17 = call { i32, i32, i32, i32 } asm sideeffect "cpuid\0A", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %14, i32 %16)
%18 = extractvalue { i32, i32, i32, i32 } %17, 0
%19 = extractvalue { i32, i32, i32, i32 } %17, 1
%20 = extractvalue { i32, i32, i32, i32 } %17, 2
%21 = extractvalue { i32, i32, i32, i32 } %17, 3
store i32 %18, i32* %9
store i32 %19, i32* %10
store i32 %20, i32* %11
store i32 %21, i32* %12
ret void
}

LLVM IR (-O2):
define void @__cpuid(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid\0A", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
%8 = extractvalue { i32, i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32, i32 } %7, 2
%11 = extractvalue { i32, i32, i32, i32 } %7, 3
store i32 %8, i32* %0
store i32 %9, i32* %1
store i32 %10, i32* %2
store i32 %11, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test_oracle_1(void) {
  assert(0 && "ERROR: oracle support not compiled in!");
}


x86 assembly (clang, -O0):
<test_oracle_1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_oracle_1>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_oracle_1() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_oracle_1() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
void *realloc(void *, unsigned long);
void *gp_realloc(void *old, unsigned long size, char *usage) {
  (void)usage;
  return realloc(old, size);
}


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

x86 assembly (clang, -O2):
<gp_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @gp_realloc(i8* nocapture %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
long double ceill(long double);
long double test3l(long double x) { return ceill(x); }


x86 assembly (clang, -O0):
<test3l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <ceill@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3l>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <ceill@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @test3l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.ceil.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test3l(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.ceil.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ tempString;

/* Variables and functions */
int /*<<< orphan*/ getSexComponents(double, int *, int *, int *);
int setStandardProcedure(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int setObjAz(double az) {
  int d, m, s;
  char tempString[16];
  getSexComponents(az, &d, &m, &s);
  snprintf(tempString, sizeof(tempString), "#:Sz%03d:%02d#", d, m);
  return (setStandardProcedure(tempString));
}


x86 assembly (clang, -O0):
<setObjAz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <getSexComponents@plt>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    $0x10,%esi
lea    0xe96(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <setStandardProcedure@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setObjAz>:
push   %rbx
sub    $0x20,%rsp
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <getSexComponents@plt>
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
lea    0xea7(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <setStandardProcedure@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"#:Sz%03d:%02d#\00"
define i32 @setObjAz(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [16 x i8]
store double %0, double* %2
%7 = load double, double* %2
%8 = call i32 @getSexComponents(double %7, i32* %3, i32* %4, i32* %5)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @snprintf(i8* %9, i32 16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%14 = call i32 @setStandardProcedure(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"#:Sz%03d:%02d#\00"
define i32 @setObjAz(double %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [16 x i8]
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%10 = call i32 @getSexComponents(double %0, i32* %2, i32* %3, i32* %4)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @snprintf(i8* %9, i32 16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = call i32 @setStandardProcedure(i8* %9)
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void handler(int s) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <handler+0x31>
jmp    111b <handler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <handler+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @handler(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void handlerChangeHnd2(const char *msgName, int num, void *clientData) {
  fprintf(stderr, "HANDLER CHANGE2: %s: %d\n", msgName, num);
}


x86 assembly (clang, -O0):
<handlerChangeHnd2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handlerChangeHnd2>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"HANDLER CHANGE2: %s: %d\0A\00"
define void @handlerChangeHnd2(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 i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"HANDLER CHANGE2: %s: %d\0A\00"
define void @handlerChangeHnd2(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ litend();
int bigend(void) { return !litend(); }


x86 assembly (clang, -O0):
<bigend>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <litend@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigend>:
push   %rax
xor    %eax,%eax
call   1030 <litend@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bigend() {
%1 = call i32 (...) @litend()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @bigend() {
%1 = tail call i32 (...) @litend()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int fu_hook_replace(int argc, ...) {
  (void)argc;
  puts("fu_hook_replace: called instead of original fu");
  return -1;
}


x86 assembly (clang, -O0):
<fu_hook_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fu_hook_replace>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"fu_hook_replace: called instead of original fu\00"
define i32 @fu_hook_replace(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [47 x i8] c"fu_hook_replace: called instead of original fu\00"
define i32 @fu_hook_replace(i32 %0, ...) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
scalar_t__ exp(float);
float floor(scalar_t__);
float bico(int n, int k) {
  float factln(int n);
  return floor(0.5 + exp(factln(n) - factln(k) - factln(n - k)));
}


x86 assembly (clang, -O0):
<bico>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factln@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factln@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factln@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
subss  %xmm1,%xmm0
call   1040 <exp@plt>
cvtsi2sd %rax,%xmm1
movsd  0xe73(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bico>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <factln@plt>
movss  %xmm0,0x4(%rsp)
mov    %ebx,%edi
call   1030 <factln@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <factln@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1040 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xe7c(%rip),%xmm0
cvttsd2si %xmm0,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <floor@plt>

LLVM IR (-O0):
define float @bico(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call float @factln(i32 %5)
%7 = load i32, i32* %4
%8 = call float @factln(i32 %7)
%9 = fsub float %6, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = call float @factln(i32 %12)
%14 = fsub float %9, %13
%15 = call i64 @exp(float %14)
%16 = sitofp i64 %15 to double
%17 = fadd double 5.000000e-01, %16
%18 = fptosi double %17 to i64
%19 = call float @floor(i64 %18)
ret float %19
}

LLVM IR (-O2):
define float @bico(i32 %0, i32 %1) {
%3 = tail call float @factln(i32 %0)
%4 = tail call float @factln(i32 %1)
%5 = fsub float %3, %4
%6 = sub nsw i32 %0, %1
%7 = tail call float @factln(i32 %6)
%8 = fsub float %5, %7
%9 = tail call i64 @exp(float %8)
%10 = sitofp i64 %9 to double
%11 = fadd double %10, 5.000000e-01
%12 = fptosi double %11 to i64
%13 = tail call float @floor(i64 %12)
ret float %13
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
float vec2i_length(int /*<<< orphan*/ *);
__attribute__((always_)) float psvec2i_length(struct vec2i *a) {
  return vec2i_length((int32_t *)a);
}


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

x86 assembly (clang, -O2):
<psvec2i_length>:
jmp    1030 <vec2i_length@plt>

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define float @psvec2i_length(%struct.vec2i* %0) {
%2 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %2
%3 = load %struct.vec2i*, %struct.vec2i** %2
%4 = bitcast %struct.vec2i* %3 to i32*
%5 = call float @vec2i_length(i32* %4)
ret float %5
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define float @psvec2i_length(%struct.vec2i* %0) {
%2 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%3 = tail call float @vec2i_length(i32* %2)
ret float %3
}
/* Variables and functions */
int doPostProcess();
int doPreProcess();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int retCd;
  retCd = doPreProcess();
  printf("ReturnCode = %d\n", retCd);
  printf("MainProcess running\n");
  retCd = doPostProcess();
  printf("ReturnCode = %d\n", retCd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <doPreProcess@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <doPostProcess@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <doPreProcess@plt>
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <doPostProcess@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"ReturnCode = %d\0A\00"
@.str.1 = [21 x i8] c"MainProcess running\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @doPreProcess()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @doPostProcess()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"ReturnCode = %d\0A\00"
@str = [20 x i8] c"MainProcess running\00"
define i32 @main() {
%1 = tail call i32 (...) @doPreProcess()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @doPostProcess()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int getconnections() {
  FILE *pp;
  char *line;
  char buf[1000];
  pp = popen("netstat -ant | grep ESTABLISHED | wc -l ", "r");
  if (pp != NULL) {
    line = fgets(buf, sizeof buf, pp);
    pclose(pp);
  }
  return atoi(line);
}


x86 assembly (clang, -O0):
<getconnections>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    0xeae(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118f <getconnections+0x4f>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x3e8,%esi
call   1040 <fgets@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pclose@plt>
mov    -0x10(%rbp),%rdi
call   1060 <atoi@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getconnections>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
lea    0xeaf(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x3e8,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <pclose@plt>
mov    %r14,%rdi
call   1060 <atoi@plt>
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [41 x i8] c"netstat -ant | grep ESTABLISHED | wc -l \00"
@.str.1 = [2 x i8] c"r\00"
define i32 @getconnections() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca [1000 x i8]
%4 = call i32* @popen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%9 = load i32*, i32** %1
%10 = call i8* @fgets(i8* %8, i32 1000, i32* %9)
store i8* %10, i8** %2
%11 = load i32*, i32** %1
%12 = call i32 @pclose(i32* %11)
br label %13
13: ; preds = %7, %0
%14 = load i8*, i8** %2
%15 = call i32 @atoi(i8* %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [41 x i8] c"netstat -ant | grep ESTABLISHED | wc -l \00"
@.str.1 = [2 x i8] c"r\00"
define i32 @getconnections() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32* @popen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i32* %3, null
tail call void @llvm.assume(i1 %4)
%5 = call i8* @fgets(i8* %2, i32 1000, i32* %3)
%6 = call i32 @pclose(i32* %3)
%7 = call i32 @atoi(i8* %5)
ret i32 %7
}
/* Type definitions */
struct HTTPRequest {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free_request(struct HTTPRequest *);
struct HTTPRequest *read_request(int /*<<< orphan*/ *);
int /*<<< orphan*/ respond_to(struct HTTPRequest *, int /*<<< orphan*/ *,
                              char const *);
void service(FILE *in, FILE *out, const char *docroot) {
  struct HTTPRequest *req;
  req = read_request(in);
  respond_to(req, out, docroot);
  free_request(req);
}


x86 assembly (clang, -O0):
<service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_request@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <respond_to@plt>
mov    -0x20(%rbp),%rdi
call   1050 <free_request@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<service>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1030 <read_request@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <respond_to@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <free_request@plt>

LLVM IR (-O0):
%struct.HTTPRequest = type { i32 }
define void @service(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca %struct.HTTPRequest*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%8 = load i32*, i32** %4
%9 = call %struct.HTTPRequest* @read_request(i32* %8)
store %struct.HTTPRequest* %9, %struct.HTTPRequest** %7
%10 = load %struct.HTTPRequest*, %struct.HTTPRequest** %7
%11 = load i32*, i32** %5
%12 = load i8*, i8** %6
%13 = call i32 @respond_to(%struct.HTTPRequest* %10, i32* %11, i8* %12)
%14 = load %struct.HTTPRequest*, %struct.HTTPRequest** %7
%15 = call i32 @free_request(%struct.HTTPRequest* %14)
ret void
}

LLVM IR (-O2):
%struct.HTTPRequest = type { i32 }
define void @service(i32* %0, i32* %1, i8* %2) {
%4 = tail call %struct.HTTPRequest* @read_request(i32* %0)
%5 = tail call i32 @respond_to(%struct.HTTPRequest* %4, i32* %1, i8* %2)
%6 = tail call i32 @free_request(%struct.HTTPRequest* %4)
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
char *is_http(char *p) {
  if (strncmp(p, "http://", 7) == 0)
    return p + 7;
  return NULL;
}


x86 assembly (clang, -O0):
<is_http>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    114c <is_http+0x3c>
mov    -0x10(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <is_http+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_http>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
add    $0x7,%rbx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"http://\00"
define i8* @is_http(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 7
store i8* %9, i8** %2
br label %11
10: ; preds = %1
store i8* null, i8** %2
br label %11
11: ; preds = %10, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"http://\00"
define i8* @is_http(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = icmp eq i64 %2, 0
%4 = getelementptr inbounds i8, i8* %0, i64 7
%5 = select i1 %3, i8* %4, i8* null
ret i8* %5
}
int write(int fd, const char *buffer, int len) { return -1; }


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
AR0AR1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[10000000]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<AR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x87a22(%rax),%cx
mov    -0x18(%rbp),%rax
mov    %cx,0x1312d00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AR1>:
movzwl 0x87a22(%r9),%eax
mov    %ax,0x1312d00(%r8)
01
ret

LLVM IR (-O0):
define i32 @AR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = getelementptr inbounds i16, i16* %16, i64 277777
%18 = load i16, i16* %17
%19 = load i16*, i16** %12
%20 = getelementptr inbounds i16, i16* %19, i64 10000000
store i16 %18, i16* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @AR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %5, i64 277777
%8 = load i16, i16* %7
%9 = getelementptr inbounds i16, i16* %4, i64 10000000
store i16 %8, i16* %9
ret i32 undef
}
unsigned int explicit_voidptr_to_unsigned_int(void *src) {
  return (unsigned int)src;
}


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

x86 assembly (clang, -O2):
<explicit_voidptr_to_unsigned_int>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @explicit_voidptr_to_unsigned_int(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int usage(void) {
  fprintf(stdout, "spawn_inodes <-n num_inodes> <-m num_processes> "
                  "<-w work_place> [-r]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [70 x i8] c"spawn_inodes <-n num_inodes> <-m num_processes> <-w work_place> [-r]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [70 x i8] c"spawn_inodes <-n num_inodes> <-m num_processes> <-w work_place> [-r]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int numa_node_id();
__attribute__((always_)) int numa_mem_id(void) { return numa_node_id(); }


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

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

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

LLVM IR (-O2):
define i32 @numa_mem_id() {
%1 = tail call i32 (...) @numa_node_id()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
void descarta_resto_linha(FILE *arq) {
  char c;
  do
    fscanf(arq, "%c", &c);
  while (c != '\n');
}


x86 assembly (clang, -O0):
<descarta_resto_linha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x9(%rbp),%rdx
call   1030 <fscanf@plt>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    111c <descarta_resto_linha+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<descarta_resto_linha>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xedd(%rip),%r14
lea    0xf(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <fscanf@plt>
cmpb   $0xa,0xf(%rsp)
jne    1130 <descarta_resto_linha+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @descarta_resto_linha(i32* nocapture %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
int func(int x) { return x; }


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

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

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

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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
int CheckZ(float Z, float z, float Z_tile, float z_tile) {
  if (Z < z_tile)
    return 0;
  if (z > Z_tile)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<CheckZ>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1137 <CheckZ+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1159 <CheckZ+0x59>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1152 <CheckZ+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1159 <CheckZ+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckZ>:
ucomiss %xmm0,%xmm3
setbe  %al
ucomiss %xmm2,%xmm1
setbe  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @CheckZ(float %0, float %1, float %2, float %3) {
%5 = fcmp uge float %0, %3
%6 = fcmp ule float %1, %2
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *strdup(char *);
char *new_str(char *str) {
  if (!str)
    return NULL;
  return strdup(str);
}


x86 assembly (clang, -O0):
<new_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <new_str+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <new_str+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_str>:
test   %rdi,%rdi
je     111a <new_str+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @new_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @new_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}