xunge/DecIR huggingface dataset:
void ll_no_teardown(void *n) { n += 0; }


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

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

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

LLVM IR (-O2):
define void @ll_no_teardown(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
void LeakedSymbol(int in) {
  int *m = 0;
  int *p;
  p = (int *)malloc(12);
  (*p)++;
  m = p;
  p = 0;
  (*m)++;
  in++;
}


x86 assembly (clang, -O0):
<LeakedSymbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeakedSymbol>:
push   %rax
mov    $0xc,%edi
call   1030 <malloc@plt>
addl   $0x2,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @LeakedSymbol(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 %0, i32* %2
store i32* null, i32** %3
%5 = call i64 @malloc(i32 12)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = load i32*, i32** %4
store i32* %10, i32** %3
store i32* null, i32** %4
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %11
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
ret void
}

LLVM IR (-O2):
define void @LeakedSymbol(i32 %0) {
%2 = tail call i64 @malloc(i32 12)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 2
store i32 %5, i32* %3
ret void
}
void RTDbgAsCreateV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsCreateV() {
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double asinh(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<asinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @asinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @asinh(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ on_off();
void LED_alternate2(int numFlash) {
  for (int i = 0; i < numFlash; ++i) {
    on_off();
  }
}


x86 assembly (clang, -O0):
<LED_alternate2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <LED_alternate2+0x33>
mov    $0x0,%al
call   1030 <on_off@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <LED_alternate2+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LED_alternate2>:
push   %rbx
test   %edi,%edi
jle    112c <LED_alternate2+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <on_off@plt>
add    $0xffffffff,%ebx
jne    1120 <LED_alternate2+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @LED_alternate2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @on_off()
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @LED_alternate2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @on_off()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
double __infer_nondet_double();
double ldexp(double x, int exp) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mdelay(unsigned long msec) { udelay(1000 * msec); }


x86 assembly (clang, -O0):
<mdelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <udelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdelay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <udelay@plt>

LLVM IR (-O0):
define void @mdelay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 1000, %3
%5 = trunc i64 %4 to i32
%6 = call i32 @udelay(i32 %5)
ret void
}

LLVM IR (-O2):
define void @mdelay(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = mul i32 %2, 1000
%4 = tail call i32 @udelay(i32 %3)
ret void
}
void fn_SYSCALL2(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_SYSCALL2() {
ret void
}
int *__errno_location(void) { return (int *)0; }


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

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

LLVM IR (-O0):
define i32* @__errno_location() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @__errno_location() {
ret i32* null
}
int port_offset(const char str[5]) { return 0x400 * (str[1] - 'A'); }


x86 assembly (clang, -O0):
<port_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
sub    $0x41,%eax
shl    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_offset>:
movsbl 0x1(%rdi),%eax
shl    $0xa,%eax
add    $0xfffefc00,%eax
ret

LLVM IR (-O0):
define i32 @port_offset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 65
%8 = mul nsw i32 1024, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @port_offset(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = shl nsw i32 %4, 10
%6 = add nsw i32 %5, -66560
ret i32 %6
}
/* Variables and functions */
scalar_t__ floor(scalar_t__);
scalar_t__ xpercent(double, double);
int xpercentInt(double part, double whole) {
  return (int)floor(xpercent(part, whole) + 0.5);
}


x86 assembly (clang, -O0):
<xpercentInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <xpercent@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpercentInt>:
push   %rax
call   1030 <xpercent@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xeca(%rip),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1040 <floor@plt>

LLVM IR (-O0):
define i32 @xpercentInt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i64 @xpercent(double %5, double %6)
%8 = sitofp i64 %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fptosi double %9 to i64
%11 = call i64 @floor(i64 %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @xpercentInt(double %0, double %1) {
%3 = tail call i64 @xpercent(double %0, double %1)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i64
%7 = tail call i64 @floor(i64 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pluscconlyia(unsigned int a, unsigned int b) {
  unsigned int sum = a + b;
  if (sum < a)
    abort();
}


x86 assembly (clang, -O0):
<pluscconlyia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    113a <pluscconlyia+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluscconlyia>:
add    %esi,%edi
jb     1115 <pluscconlyia+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @pluscconlyia(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @pluscconlyia(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = icmp ult i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
size_t __dynarray_error_marker(void) { return -1; }


x86 assembly (clang, -O0):
<__dynarray_error_marker>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dynarray_error_marker>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @__dynarray_error_marker() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @__dynarray_error_marker() {
ret i64 -1
}
void free_matrix(double ***M, int nx) {
  int i;
  for (i = 0; i < nx; i++)
    free((*M)[i]);
  free(*M);
}


x86 assembly (clang, -O0):
<free_matrix>:
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    1154 <free_matrix+0x44>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_matrix+0x16>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1145 <free_matrix+0x35>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    (%r14),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(double*** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = load double**, double*** %0
%9 = getelementptr inbounds double*, double** %8, i64 %7
%10 = bitcast double** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = bitcast double*** %0 to i8**
%16 = load i8*, i8** %15
tail call void @free(i8* %16)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_dec2bn(int /*<<< orphan*/ **, char const *);
int parsedecBN(BIGNUM **out, const char *in) {
  *out = NULL;
  return BN_dec2bn(out, in);
}


x86 assembly (clang, -O0):
<parsedecBN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <BN_dec2bn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsedecBN>:
movq   $0x0,(%rdi)
jmp    1030 <BN_dec2bn@plt>

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

LLVM IR (-O2):
define i32 @parsedecBN(i32** %0, i8* %1) {
store i32* null, i32** %0
%3 = tail call i32 @BN_dec2bn(i32** %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ call_global_ctors();
int /*<<< orphan*/ call_init_array();
int main(int, char **);
int _main(int argc, char *argv[]) {
  call_global_ctors();
  call_init_array();
  return main(argc, argv);
}


x86 assembly (clang, -O0):
<_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <call_global_ctors@plt>
mov    $0x0,%al
call   1030 <call_init_array@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <call_global_ctors@plt>
xor    %eax,%eax
call   1030 <call_init_array@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <main@plt>

LLVM IR (-O0):
define i32 @_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @call_global_ctors()
%6 = call i32 (...) @call_init_array()
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 @main(i32 %7, i8** %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @call_global_ctors()
%4 = tail call i32 (...) @call_init_array()
%5 = tail call i32 @main(i32 %0, i8** %1)
ret i32 %5
}
int test_imm_D9uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xD9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D9uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xd9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D9uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14221312
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[], char *envp[]) {
  int pid = 0;
  pid = fork();
  if (pid > 0) {
    while (1) {
      write(1, "THIS IS PARENT 2\n\0", 20);
    }
  } else {
    while (1) {
      write(1, "THIS IS CHILD 2\n\0", 20);
    }
  }
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1175 <main+0x55>
jmp    115a <main+0x3a>
mov    $0x1,%edi
lea    0xe9a(%rip),%rsi
mov    $0x14,%edx
call   1030 <write@plt>
jmp    115a <main+0x3a>
jmp    117a <main+0x5a>
mov    $0x1,%edi
lea    0xe8d(%rip),%rsi
mov    $0x14,%edx
call   1030 <write@plt>
jmp    117a <main+0x5a>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
jle    1154 <main+0x34>
lea    0xecd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x14,%edx
call   1030 <write@plt>
jmp    1140 <main+0x20>
lea    0xeb8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x14,%edx
call   1030 <write@plt>
jmp    1160 <main+0x40>

LLVM IR (-O0):
@.str = [19 x i8] c"THIS IS PARENT 2\0A\00\00"
@.str.1 = [18 x i8] c"THIS IS CHILD 2\0A\00\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 0, i32* %8
%9 = call i32 (...) @fork()
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %3
br label %13
13: ; preds = %12, %13
%14 = call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 20)
br label %13
15: ; preds = %3
br label %16
16: ; preds = %15, %16
%17 = call i32 @write(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 20)
br label %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"THIS IS PARENT 2\0A\00\00"
@.str.1 = [18 x i8] c"THIS IS CHILD 2\0A\00\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @fork()
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %6
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 20)
br label %6
8: ; preds = %3, %8
%9 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 20)
br label %8
}
int toascii(int c) { return ((c)&0177); }


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

x86 assembly (clang, -O2):
<toascii>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Variables and functions */
char toupper(char);
void strtoup(char *s) {
  if (s != 0)
    while (*s) {
      *s = toupper(*s);
      s++;
    }
}


x86 assembly (clang, -O0):
<strtoup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <strtoup+0x53>
jmp    112c <strtoup+0x1c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <strtoup+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <strtoup+0x1c>
jmp    1163 <strtoup+0x53>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoup>:
push   %rbx
test   %rdi,%rdi
je     1146 <strtoup+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <strtoup+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtoup+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @strtoup(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 %18
5: ; preds = %1
br label %6
6: ; preds = %10, %5
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = call signext i8 @toupper(i8 signext %12)
%14 = load i8*, i8** %2
store i8 %13, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
br label %6
17: ; preds = %6
br label %18
18: ; preds = %17, %1
ret void
}

LLVM IR (-O2):
define void @strtoup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @toupper(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ init();
int /*<<< orphan*/ log_event(char *, char const *);
char *modify_path(char const *);
int /*<<< orphan*/ *p_opendir(char const *);
DIR *opendir(const char *name) {
  init();
  log_event("opendir(%s)", name);
  name = modify_path(name);
  DIR *retVal = p_opendir(name);
  free((void *)name);
  return retVal;
}


x86 assembly (clang, -O0):
<opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1060 <log_event@plt>
mov    -0x8(%rbp),%rdi
call   1050 <modify_path@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <p_opendir@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendir>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <init@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
call   1060 <log_event@plt>
mov    %rbx,%rdi
call   1050 <modify_path@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <p_opendir@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"opendir(%s)\00"
define i32* @opendir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32 (...) @init()
%5 = load i8*, i8** %2
%6 = call i32 @log_event(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i8* @modify_path(i8* %7)
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = call i32* @p_opendir(i8* %9)
store i32* %10, i32** %3
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"opendir(%s)\00"
define i32* @opendir(i8* %0) {
%2 = tail call i32 (...) @init()
%3 = tail call i32 @log_event(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i8* @modify_path(i8* %0)
%5 = tail call i32* @p_opendir(i8* %4)
%6 = tail call i32 @free(i8* %4)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void show_version(char const *app_name) {
  printf("%s: "
         "libevent"
         " "
         "1.4.13-stable"
         " compiled on "
         "Mar 18 2022"
         " "
         "12:33:31"
         "\n",
         app_name);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_version>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"%s: libevent 1.4.13-stable compiled on Mar 18 2022 12:33:31\0A\00"
@EXIT_SUCCESS = global i32 0
define void @show_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [61 x i8] c"%s: libevent 1.4.13-stable compiled on Mar 18 2022 12:33:31\0A\00"
@EXIT_SUCCESS = global i32 0
define void @show_version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ spotri_(char *, int *, float *, int *, int *);
void clapack_spotri(char uplo, int n, float *a, int lda, int *info) {
  spotri_(&uplo, &n, a, &lda, info);
}


x86 assembly (clang, -O0):
<clapack_spotri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
call   1030 <spotri_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clapack_spotri>:
sub    $0x18,%rsp
mov    %dil,0xf(%rsp)
mov    %esi,0x14(%rsp)
mov    %ecx,0x10(%rsp)
lea    0xf(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rcx
call   1030 <spotri_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @clapack_spotri(i8 signext %0, i32 %1, float* %2, i32 %3, i32* %4) {
%6 = alloca i8
%7 = alloca i32
%8 = alloca float*
%9 = alloca i32
%10 = alloca i32*
store i8 %0, i8* %6
store i32 %1, i32* %7
store float* %2, float** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load float*, float** %8
%12 = load i32*, i32** %10
%13 = call i32 @spotri_(i8* %6, i32* %7, float* %11, i32* %9, i32* %12)
ret void
}

LLVM IR (-O2):
define void @clapack_spotri(i8 signext %0, i32 %1, float* %2, i32 %3, i32* %4) {
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %6
store i32 %1, i32* %7
store i32 %3, i32* %8
%9 = call i32 @spotri_(i8* %6, i32* %7, float* %2, i32* %8, i32* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
char *get_name(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
char *get_user_name() {
  uid_t real_uid = getuid();
  return get_name(real_uid);
}


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

x86 assembly (clang, -O2):
<get_user_name>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <get_name@plt>

LLVM IR (-O0):
define i8* @get_user_name() {
%1 = alloca i32
%2 = call i32 (...) @getuid()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i8* @get_name(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @get_user_name() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i8* @get_name(i32 %1)
ret i8* %2
}
unsigned long long pythagorean(int a, int b) {
  return (unsigned long long)a * a + b * b;
}


x86 assembly (clang, -O0):
<pythagorean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pythagorean>:
movslq %edi,%rax
imul   %rax,%rax
imul   %esi,%esi
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @pythagorean(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* %3
%8 = sext i32 %7 to i64
%9 = mul i64 %6, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = add i64 %9, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @pythagorean(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = mul nsw i64 %3, %3
%5 = mul nsw i32 %1, %1
%6 = zext i32 %5 to i64
%7 = add nuw nsw i64 %4, %6
ret i64 %7
}
yylex() { return -1; }


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

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

LLVM IR (-O0):
define i32 @yylex() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @yylex() {
ret i32 -1
}
int p2() { return 0; }


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

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

LLVM IR (-O0):
define i32 @p2() {
ret i32 0
}

LLVM IR (-O2):
define i32 @p2() {
ret i32 0
}
/* Variables and functions */
void *strdup(void const *);
void *charptr_dup(const void *o) {
  if (!o)
    return 0;
  return strdup(o);
}


x86 assembly (clang, -O0):
<charptr_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <charptr_dup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <charptr_dup+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):
<charptr_dup>:
test   %rdi,%rdi
je     111a <charptr_dup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @charptr_dup(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* @charptr_dup(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
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int sock_reuseaddr(int *fd) {
  int val = 1;
  return setsockopt((*fd), SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val));
}


x86 assembly (clang, -O0):
<sock_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    (%rdi),%edi
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @sock_reuseaddr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_REUSEADDR
%8 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i32* %3, i32 4)
ret i32 %8
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @sock_reuseaddr(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* %0
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %2, i32 4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ destroy1DArray(char *);
int freeArrayForProfile(float *profileArray) {
  destroy1DArray((char *)profileArray);
  return (1);
}


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

x86 assembly (clang, -O2):
<freeArrayForProfile>:
push   %rax
call   1030 <destroy1DArray@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @freeArrayForProfile(float* %0) {
%2 = bitcast float* %0 to i8*
%3 = tail call i32 @destroy1DArray(i8* %2)
ret i32 1
}
void f2(int *p) {
  if ((*p) != 1) {
  ERROR:
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
je     111f <f2+0x1f>
jmp    111a <f2+0x1a>
jmp    111a <f2+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
cmpl   $0x1,(%rdi)
jne    1110 <f2+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
jmp    1110 <f2+0x10>

LLVM IR (-O0):
define void @f2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
br label %7
7: ; preds = %7, %6
br label %7
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 1
br i1 %3, label %5, label %4
4: ; preds = %1, %4
br label %4
5: ; preds = %1
ret void
}
const char *numpos(const char *n) {
  while (*n < '0' || *n > '9')
    n++;
  return n;
}


x86 assembly (clang, -O0):
<numpos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     112d <numpos+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <numpos+0x3d>
jmp    114e <numpos+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <numpos+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numpos>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xc6,%cl
cmp    $0xf6,%cl
jb     1110 <numpos+0x10>
ret

LLVM IR (-O0):
define i8* @numpos(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 48
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sgt i32 %11, 57
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @numpos(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -58
%6 = icmp ult i8 %5, -10
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void exitmessage(const char *message) {
  printf("%s\n", message);
  exit(0);
}


x86 assembly (clang, -O0):
<exitmessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitmessage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @exitmessage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void MUTEX_LOCK_INIT(struct brcmf_pub *drvr) {}


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

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

LLVM IR (-O0):
%struct.brcmf_pub = type opaque
define void @MUTEX_LOCK_INIT(%struct.brcmf_pub* %0) {
%2 = alloca %struct.brcmf_pub*
store %struct.brcmf_pub* %0, %struct.brcmf_pub** %2
ret void
}

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define void @MUTEX_LOCK_INIT(%struct.brcmf_pub* nocapture %0) {
ret void
}
double getArrayD(double *arr, int idx) { return arr[idx]; }


x86 assembly (clang, -O0):
<getArrayD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArrayD>:
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm0
ret

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

LLVM IR (-O2):
define double @getArrayD(double* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds double, double* %0, i64 %3
%5 = load double, double* %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int ftruncate(int, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int
softboundcets_ftruncate(int fd, off_t length) {
  return ftruncate(fd, length);
}


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

x86 assembly (clang, -O2):
<softboundcets_ftruncate>:
jmp    1030 <ftruncate@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_ftruncate(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 @ftruncate(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @softboundcets_ftruncate(i32 %0, i32 %1) {
%3 = tail call i32 @ftruncate(i32 %0, i32 %1)
ret i32 %3
}
double compute_total_score(double harris_poll, double coaches_poll,
                           double computer_ranking) {
  double value = 0.0;
  value = ((harris_poll / 2850) + (coaches_poll / 1475) + computer_ranking) / 3;
  return value;
}


x86 assembly (clang, -O0):
<compute_total_score>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xecf(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_total_score>:
unpcklpd %xmm1,%xmm0
divpd  0xef4(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
divsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @compute_total_score(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%8 = load double, double* %4
%9 = fdiv double %8, 2.850000e+03
%10 = load double, double* %5
%11 = fdiv double %10, 1.475000e+03
%12 = fadd double %9, %11
%13 = load double, double* %6
%14 = fadd double %12, %13
%15 = fdiv double %14, 3.000000e+00
store double %15, double* %7
%16 = load double, double* %7
ret double %16
}

LLVM IR (-O2):
define double @compute_total_score(double %0, double %1, double %2) {
%4 = insertelement <2 x double> poison, double %0, i64 0
%5 = insertelement <2 x double> %4, double %1, i64 1
%6 = fdiv <2 x double> %5, <double 2.850000e+03, double 1.475000e+03>
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%8 = fadd <2 x double> %6, %7
%9 = extractelement <2 x double> %8, i64 0
%10 = fadd double %9, %2
%11 = fdiv double %10, 3.000000e+00
ret double %11
}
int iio_trigger_attach_poll_func(struct iio_dev *indio_dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @iio_trigger_attach_poll_func(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @iio_trigger_attach_poll_func(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fn();
int main() {
  fn();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_solar_short_off() {
  mbus_remote_register_write(
      0x6, 0x0E, ((1 << 10) | (1 << 9) | (0 << 8) | (1 << 4) | (0)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x0E, ((1 << 10) | (1 << 9) | (0 << 8) | (1 << 4) | (0)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_solar_short_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0xe,%esi
mov    $0x610,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0xe,%esi
mov    $0x610,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_solar_short_off>:
push   %rax
mov    $0x6,%edi
mov    $0xe,%esi
mov    $0x610,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0xe,%esi
mov    $0x610,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_solar_short_off() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 14, i32 1552)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 14, i32 1552)
%4 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_solar_short_off() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 14, i32 1552)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 14, i32 1552)
%4 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: ./trafficmgr [directions]\n");
  printf("The directions must be the string containing 'n', 'w', 's' or 'e'\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"usage: ./trafficmgr [directions]\0A\00"
@.str.1 = [67 x i8] c"The directions must be the string containing 'n', 'w', 's' or 'e'\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"usage: ./trafficmgr [directions]\00"
@str.2 = [66 x i8] c"The directions must be the string containing 'n', 'w', 's' or 'e'\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.2, i64 0, i64 0))
ret void
}
void g_thread_pool_stop_unused_threads() {}


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

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

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

LLVM IR (-O2):
define void @g_thread_pool_stop_unused_threads() {
ret void
}