xunge/DecIR huggingface dataset:
int negafibonacci(int n) {
  if (n == 0) {
    return 0;
  }
  if (n == -1) {
    return 1;
  }
  return negafibonacci(n + 2) - negafibonacci(n + 1);
}


x86 assembly (clang, -O0):
<negafibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <negafibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <negafibonacci+0x5a>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1147 <negafibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <negafibonacci+0x5a>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1030 <negafibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <negafibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<negafibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
je     113d <negafibonacci+0x2d>
cmp    $0xffffffff,%ebx
jne    1125 <negafibonacci+0x15>
mov    $0x1,%ebx
jmp    113d <negafibonacci+0x2d>
lea    0x2(%rbx),%edi
call   1030 <negafibonacci@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <negafibonacci@plt>
sub    %eax,%ebp
mov    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @negafibonacci(i32 %0) {
switch i32 %0, label %5 [
i32 0, label %3
i32 -1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %2, %1, %5
%4 = phi i32 [ %10, %5 ], [ 1, %2 ], [ %0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, 2
%7 = tail call i32 @negafibonacci(i32 %6)
%8 = add nuw nsw i32 %0, 1
%9 = tail call i32 @negafibonacci(i32 %8)
%10 = sub nsw i32 %7, %9
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ GPIO_Clr(int);
int /*<<< orphan*/ GPIO_Dir(int, int);
int /*<<< orphan*/ GPIO_Set(int);
int /*<<< orphan*/ SPI_Init(int, int);
void LCD_LowLevelInit() {
  GPIO_Dir(2, 1);
  GPIO_Dir(3, 1);
  GPIO_Set(3);
  GPIO_Clr(2);
  GPIO_Set(2);
  SPI_Init(8, 9);
}


x86 assembly (clang, -O0):
<LCD_LowLevelInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <GPIO_Dir@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1050 <GPIO_Dir@plt>
mov    $0x3,%edi
call   1030 <GPIO_Set@plt>
mov    $0x2,%edi
call   1060 <GPIO_Clr@plt>
mov    $0x2,%edi
call   1030 <GPIO_Set@plt>
mov    $0x8,%edi
mov    $0x9,%esi
call   1040 <SPI_Init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_LowLevelInit>:
push   %rax
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <GPIO_Dir@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1050 <GPIO_Dir@plt>
mov    $0x3,%edi
call   1030 <GPIO_Set@plt>
mov    $0x2,%edi
call   1060 <GPIO_Clr@plt>
mov    $0x2,%edi
call   1030 <GPIO_Set@plt>
mov    $0x8,%edi
mov    $0x9,%esi
pop    %rax
jmp    1040 <SPI_Init@plt>

LLVM IR (-O0):
define void @LCD_LowLevelInit() {
%1 = call i32 @GPIO_Dir(i32 2, i32 1)
%2 = call i32 @GPIO_Dir(i32 3, i32 1)
%3 = call i32 @GPIO_Set(i32 3)
%4 = call i32 @GPIO_Clr(i32 2)
%5 = call i32 @GPIO_Set(i32 2)
%6 = call i32 @SPI_Init(i32 8, i32 9)
ret void
}

LLVM IR (-O2):
define void @LCD_LowLevelInit() {
%1 = tail call i32 @GPIO_Dir(i32 2, i32 1)
%2 = tail call i32 @GPIO_Dir(i32 3, i32 1)
%3 = tail call i32 @GPIO_Set(i32 3)
%4 = tail call i32 @GPIO_Clr(i32 2)
%5 = tail call i32 @GPIO_Set(i32 2)
%6 = tail call i32 @SPI_Init(i32 8, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ce_coroutine_pause(int);
void ce_coroutine_block() { ce_coroutine_pause(4); }


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

x86 assembly (clang, -O2):
<ce_coroutine_block>:
mov    $0x4,%edi
jmp    1030 <ce_coroutine_pause@plt>

LLVM IR (-O0):
define void @ce_coroutine_block() {
%1 = call i32 @ce_coroutine_pause(i32 4)
ret void
}

LLVM IR (-O2):
define void @ce_coroutine_block() {
%1 = tail call i32 @ce_coroutine_pause(i32 4)
ret void
}
/* Variables and functions */
double exp(double);
__attribute__((always_)) double drmp3_exp(double x) { return exp(x); }


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

x86 assembly (clang, -O2):
<drmp3_exp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @drmp3_exp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
void a_and(volatile int *p, int v) { (void)__sync_fetch_and_and(p, v); }


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

x86 assembly (clang, -O2):
<a_and>:
lock and %esi,(%rdi)
ret

LLVM IR (-O0):
define void @a_and(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 = atomicrmw and i32* %5, i32 %6 seq_cst
ret void
}

LLVM IR (-O2):
define void @a_and(i32* nocapture %0, i32 %1) {
%3 = atomicrmw and i32* %0, i32 %1 seq_cst
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mempool_vacuum() {
  printf("NOT IMPLEMENTED:"
         "pa_mempool_vacuum"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_mempool_vacuum\0A\00"
define i32 @pa_mempool_vacuum() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_mempool_vacuum\00"
define i32 @pa_mempool_vacuum() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double mhz(int, int);
double mhz_def(int verbose) { return mhz(verbose, 2); }


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

x86 assembly (clang, -O2):
<mhz_def>:
mov    $0x2,%esi
jmp    1030 <mhz@plt>

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

LLVM IR (-O2):
define double @mhz_def(i32 %0) {
%2 = tail call double @mhz(i32 %0, i32 2)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ args;

/* Variables and functions */
int spawn(int, char **);
int main(int argc, char *argv[]) {
  char *args[] = {"/usr/bin/env", NULL};
  return (spawn((sizeof(args) / sizeof((args)[0])) - 1, args));
}


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    0x2ce3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ce0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1030 <spawn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1030 <spawn@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/usr/bin/env\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%9 = call i32 @spawn(i32 1, i8** %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"/usr/bin/env\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%6 = call i32 @spawn(i32 1, i8** %5)
ret i32 %6
}
/* Variables and functions */
double umath_double_cos(double);
double umath_double_sin(double);
double umath_double_cot(double x) {
  return umath_double_cos(x) / umath_double_sin(x);
}


x86 assembly (clang, -O0):
<umath_double_cot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <umath_double_cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <umath_double_sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umath_double_cot>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <umath_double_cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <umath_double_sin@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @umath_double_cot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @umath_double_cos(double %3)
%5 = load double, double* %2
%6 = call double @umath_double_sin(double %5)
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @umath_double_cot(double %0) {
%2 = tail call double @umath_double_cos(double %0)
%3 = tail call double @umath_double_sin(double %0)
%4 = fdiv double %2, %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_GetIPInfo() {
  char msg[] = "Aborting: "
               "_Unwind_GetIPInfo"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_GetIPInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x49,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x48,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_GetIPInfo>:
sub    $0x58,%rsp
movups 0xf0e(%rip),%xmm0
movups %xmm0,0x39(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x48,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_GetIPInfo.msg = [73 x i8] c"Aborting: _Unwind_GetIPInfo called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetIPInfo() {
%1 = alloca [73 x i8]
%2 = bitcast [73 x i8]* %1 to i8*
%3 = getelementptr inbounds [73 x i8], [73 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 72)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_GetIPInfo.msg = [73 x i8] c"Aborting: _Unwind_GetIPInfo called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetIPInfo() {
%1 = alloca [73 x i8]
%2 = getelementptr inbounds [73 x i8], [73 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 72)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ solveDiscriminant(double, double, double);
double sqrt(int /*<<< orphan*/);
double solveRootTwoPos(double a, double b, double c) {
  return (-b + sqrt(solveDiscriminant(a, b, c))) / (2 * a);
}


x86 assembly (clang, -O0):
<solveRootTwoPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <solveDiscriminant@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solveRootTwoPos>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <solveDiscriminant@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
subsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @solveRootTwoPos(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fneg double %7
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call i32 @solveDiscriminant(double %9, double %10, double %11)
%13 = call double @sqrt(i32 %12)
%14 = fadd double %8, %13
%15 = load double, double* %4
%16 = fmul double 2.000000e+00, %15
%17 = fdiv double %14, %16
ret double %17
}

LLVM IR (-O2):
define double @solveRootTwoPos(double %0, double %1, double %2) {
%4 = tail call i32 @solveDiscriminant(double %0, double %1, double %2)
%5 = tail call double @sqrt(i32 %4)
%6 = fsub double %5, %1
%7 = fmul double %0, 2.000000e+00
%8 = fdiv double %6, %7
ret double %8
}
float *vector(nl, nh)
int nl, nh;
{
  float *v;
  v = (float *)malloc((unsigned)(nh - nl + 1) * sizeof(float));
  if (!v)
    nrerror("allocation failure in vector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <vector+0x41>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1149 <vector+0x29>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = call i8* @malloc(i64 %11)
%13 = bitcast i8* %12 to float*
store float* %13, float** %5
%14 = load float*, float** %5
%15 = icmp ne float* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load float*, float** %5
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = sub i64 0, %21
%23 = getelementptr inbounds float, float* %19, i64 %22
ret float* %23
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 %5, 2
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = bitcast i8* %7 to float*
%13 = sext i32 %0 to i64
%14 = sub nsw i64 0, %13
%15 = getelementptr inbounds float, float* %12, i64 %14
ret float* %15
}
/* Variables and functions */
int syscall(int, char *, int /*<<< orphan*/);
int settty(char *tty) { return syscall(40, tty, 0); }


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

x86 assembly (clang, -O2):
<settty>:
mov    %rdi,%rsi
mov    $0x28,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @settty(i8* %0) {
%2 = tail call i32 @syscall(i32 40, i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get_keysize(const void *ks_desc) {
  uint8_t type;
  uint16_t keysize;
  type = *((uint8_t *)ks_desc);
  if (type == 0x01) {
    ks_desc = (uint8_t *)ks_desc + 1;
  }
  ks_desc = (uint8_t *)ks_desc + 1;
  keysize = *((uint8_t *)ks_desc);
  return keysize;
}


x86 assembly (clang, -O0):
<get_keysize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1127 <get_keysize+0x27>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_keysize>:
xor    %eax,%eax
cmpl   $0x1,(%rdi)
sete   %al
mov    0x4(%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @get_keysize(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i64 4, i64 0
%6 = getelementptr i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; argv[i] != NULL; ++i)
    printf("ARG %d = %s\n", i, argv[i]);
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1169 <main+0x59>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%rdx
test   %rdx,%rdx
je     1148 <main+0x38>
mov    %rsi,%r14
xor    %ebx,%ebx
lea    0xed7(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x8(%r14,%rbx,8),%rdx
add    $0x1,%rbx
test   %rdx,%rdx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"ARG %d = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i8* [ %12, %5 ], [ %3, %2 ]
%8 = trunc i64 %6 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %7)
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int __internal_syscall(int, long, long, long, long);
int _access(const char *file, int mode) {
  return __internal_syscall(1033, (long)(file), (long)(mode), (long)(0),
                            (long)(0));
}


x86 assembly (clang, -O0):
<_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
mov    $0x409,%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1030 <__internal_syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_access>:
mov    %rdi,%rax
movslq %esi,%rdx
mov    $0x409,%edi
mov    %rax,%rsi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <__internal_syscall@plt>

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

LLVM IR (-O2):
define i32 @_access(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sext i32 %1 to i64
%5 = tail call i32 @__internal_syscall(i32 1033, i64 %3, i64 %4, i64 0, i64 0)
ret i32 %5
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_delete_region(struct buffer *, int /*<<< orphan*/,
                                        int /*<<< orphan*/, char **, int *);
int /*<<< orphan*/ buffer_get_line_beginning(struct buffer *);
int /*<<< orphan*/ buffer_get_line_end(struct buffer *);
void buffer_delete_line(struct buffer *buf, char **out, int *n_out) {
  buffer_delete_region(buf, buffer_get_line_beginning(buf),
                       buffer_get_line_end(buf), out, n_out);
}


x86 assembly (clang, -O0):
<buffer_delete_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <buffer_get_line_beginning@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <buffer_get_line_end@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1040 <buffer_delete_region@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_delete_line>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1050 <buffer_get_line_beginning@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <buffer_get_line_end@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
mov    %r15,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <buffer_delete_region@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_delete_line(%struct.buffer* %0, i8** %1, i32* %2) {
%4 = alloca %struct.buffer*
%5 = alloca i8**
%6 = alloca i32*
store %struct.buffer* %0, %struct.buffer** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load %struct.buffer*, %struct.buffer** %4
%8 = load %struct.buffer*, %struct.buffer** %4
%9 = call i32 @buffer_get_line_beginning(%struct.buffer* %8)
%10 = load %struct.buffer*, %struct.buffer** %4
%11 = call i32 @buffer_get_line_end(%struct.buffer* %10)
%12 = load i8**, i8*** %5
%13 = load i32*, i32** %6
%14 = call i32 @buffer_delete_region(%struct.buffer* %7, i32 %9, i32 %11, i8** %12, i32* %13)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_delete_line(%struct.buffer* %0, i8** %1, i32* %2) {
%4 = tail call i32 @buffer_get_line_beginning(%struct.buffer* %0)
%5 = tail call i32 @buffer_get_line_end(%struct.buffer* %0)
%6 = tail call i32 @buffer_delete_region(%struct.buffer* %0, i32 %4, i32 %5, i8** %1, i32* %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBDMAChannelCountSet(uint32_t ui32Base, uint32_t ui32Channel,
                           uint32_t ui32Count) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000020C + (0x10 * ui32Channel)))) =
      ui32Count;
}


x86 assembly (clang, -O0):
<USBDMAChannelCountSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x20c,%eax
mov    -0x8(%rbp),%edx
shl    $0x4,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDMAChannelCountSet>:
movslq %edi,%rax
movslq %esi,%rcx
shl    $0x4,%rcx
mov    %edx,0x20c(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @USBDMAChannelCountSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 524
%10 = load i32, i32* %5
%11 = mul nsw i32 16, %10
%12 = add nsw i32 %9, %11
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @USBDMAChannelCountSet(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 524
%5 = shl nsw i32 %1, 4
%6 = add nsw i32 %4, %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double leafarea(int libcropcode) {
  if (libcropcode == 0) {
    printf("unknown crop\n");
    return (-28768);
  }
  if (libcropcode == 1) {
    printf("CIA Corn 2008-2010 (unpublished)\n");
    return (560);
  }
}


x86 assembly (clang, -O0):
<leafarea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <leafarea+0x33>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <leafarea+0x56>
cmpl   $0x1,-0xc(%rbp)
jne    1166 <leafarea+0x56>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leafarea>:
push   %rax
test   %edi,%edi
je     1130 <leafarea+0x20>
cmp    $0x1,%edi
jne    114e <leafarea+0x3e>
movsd  0xee6(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xee2(%rip),%rdi
jmp    1144 <leafarea+0x34>
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unknown crop\0A\00"
@.str.1 = [34 x i8] c"CIA Corn 2008-2010 (unpublished)\0A\00"
define double @leafarea(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store double -2.876800e+04, double* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store double 5.600000e+02, double* %2
br label %13
13: ; preds = %6, %11, %8
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
@str = [33 x i8] c"CIA Corn 2008-2010 (unpublished)\00"
@str.2 = [13 x i8] c"unknown crop\00"
define double @leafarea(i32 %0) {
switch i32 %0, label %7 [
i32 0, label %3
i32 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0), %1 ]
%5 = phi double [ 5.600000e+02, %2 ], [ -2.876800e+04, %1 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
br label %7
7: ; preds = %3, %1
%8 = phi double [ undef, %1 ], [ %5, %3 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(int, unsigned int);
void print_debug_hex32(unsigned int value) { __console_tx_hex32(7, value); }


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

x86 assembly (clang, -O2):
<print_debug_hex32>:
mov    %edi,%esi
mov    $0x7,%edi
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_debug_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 7, i32 %0)
ret void
}
int main(int argc, char **argv) {
  char x[5];
  char *y = x;
  void *z = x;
  return x[0] + x[2] + *x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x15(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x15(%rbp),%rax
mov    %rax,-0x28(%rbp)
movsbl -0x15(%rbp),%eax
movsbl -0x13(%rbp),%ecx
add    %ecx,%eax
movsbl -0x15(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8]
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
store i8* %9, i8** %7
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
store i8* %10, i8** %8
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = add nsw i32 %13, %16
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = add nsw i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void gtk_file_filter_add_custom() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_filter_add_custom() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_ghosts(int, int, char *);
void fgmvwrite_ghosts_(int data_type, int numghst, char *ghost_data) {
  gmvwrite_ghosts(data_type, numghst, ghost_data);
}


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

x86 assembly (clang, -O2):
<fgmvwrite_ghosts_>:
jmp    1030 <gmvwrite_ghosts@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_ghosts_(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @gmvwrite_ghosts(i32 %0, i32 %1, i8* %2)
ret void
}
void gui_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @gui_exit() {
ret void
}
char test5(void) { return '\a'; }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
mov    $0x7,%al
ret

LLVM IR (-O0):
define signext i8 @test5() {
ret i8 7
}

LLVM IR (-O2):
define signext i8 @test5() {
ret i8 7
}
void handler(int signum) {}


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
void *__ctor0_hoo_string(char *arg1) { return (void *)0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @__ctor0_hoo_string(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
struct nl_handle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ NETLINK_ROUTE;
int nl_open(struct nl_handle *, int /*<<< orphan*/);
int rtnl_open(struct nl_handle *hnd) { return nl_open(hnd, NETLINK_ROUTE); }


x86 assembly (clang, -O0):
<rtnl_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <nl_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtnl_open>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <nl_open@plt>

LLVM IR (-O0):
%struct.nl_handle = type { i32 }
@NETLINK_ROUTE = global i32 0
define i32 @rtnl_open(%struct.nl_handle* %0) {
%2 = alloca %struct.nl_handle*
store %struct.nl_handle* %0, %struct.nl_handle** %2
%3 = load %struct.nl_handle*, %struct.nl_handle** %2
%4 = load i32, i32* @NETLINK_ROUTE
%5 = call i32 @nl_open(%struct.nl_handle* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.nl_handle = type { i32 }
@NETLINK_ROUTE = global i32 0
define i32 @rtnl_open(%struct.nl_handle* %0) {
%2 = load i32, i32* @NETLINK_ROUTE
%3 = tail call i32 @nl_open(%struct.nl_handle* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void defaultFatalErrorFunc(void) { exit(EXIT_FAILURE); }


x86 assembly (clang, -O0):
<defaultFatalErrorFunc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<defaultFatalErrorFunc>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @defaultFatalErrorFunc() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @defaultFatalErrorFunc() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int floatToRawIntBits(float);
float intBitsToFloat(int);
float upperf(float d) {
  return intBitsToFloat(floatToRawIntBits(d) & 0xfffff000);
}


x86 assembly (clang, -O0):
<upperf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floatToRawIntBits@plt>
mov    %eax,%edi
and    $0xfffff000,%edi
call   1030 <intBitsToFloat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upperf>:
push   %rax
call   1040 <floatToRawIntBits@plt>
and    $0xfffff000,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <intBitsToFloat@plt>

LLVM IR (-O0):
define float @upperf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @floatToRawIntBits(float %3)
%5 = and i32 %4, -4096
%6 = call float @intBitsToFloat(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @upperf(float %0) {
%2 = tail call i32 @floatToRawIntBits(float %0)
%3 = and i32 %2, -4096
%4 = tail call float @intBitsToFloat(i32 %3)
ret float %4
}
int i32sign(int n) {
  int tmp = n >> 31;
  return ~(tmp & 1) + (!(tmp ^ 0) & !!n) + 1;
}


x86 assembly (clang, -O0):
<i32sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0x0,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmpl   $0x0,-0x4(%rbp)
setne  %dl
xor    $0xff,%dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i32sign>:
mov    %edi,%ecx
sar    $0x1f,%ecx
mov    %edi,%edx
not    %edx
shr    $0x1f,%edx
xor    %eax,%eax
test   %edi,%edi
setne  %al
and    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @i32sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 1
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = xor i32 %9, 0
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = and i32 %13, %18
%20 = add nsw i32 %8, %19
%21 = add nsw i32 %20, 1
ret i32 %21
}

LLVM IR (-O2):
define i32 @i32sign(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %0, -1
%4 = lshr i32 %3, 31
%5 = icmp ne i32 %0, 0
%6 = zext i1 %5 to i32
%7 = and i32 %4, %6
%8 = add nsw i32 %7, %2
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int wcslen(int /*<<< orphan*/ *);
wchar_t *wcscat(wchar_t *restrict whither, const wchar_t *restrict whence) {
  wcscpy(whither + wcslen(whither), whence);
  return whither;
}


x86 assembly (clang, -O0):
<wcscat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wcslen@plt>
mov    -0x18(%rbp),%rdi
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <wcscpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <wcslen@plt>
cltq
lea    (%rbx,%rax,4),%rdi
mov    %r14,%rsi
call   1040 <wcscpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @wcscat(i32* noalias %0, i32* noalias %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** %3
%7 = call i32 @wcslen(i32* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32*, i32** %4
%11 = call i32 @wcscpy(i32* %9, i32* %10)
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @wcscat(i32* noalias returned %0, i32* noalias %1) {
%3 = tail call i32 @wcslen(i32* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = tail call i32 @wcscpy(i32* %5, i32* %1)
ret i32* %0
}
space(ch) {
  switch (ch) {
  case ' ':
  case '\t':
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x9,%eax
je     112c <space+0x2c>
jmp    111b <space+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1138 <space+0x38>
jmp    112c <space+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    113f <space+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @space(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 32, label %5
i32 9, label %5
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @space(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void ieee80211_debugfs_key_add(struct ieee80211_local *local,
                               struct ieee80211_key *key) {}


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

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

LLVM IR (-O0):
%struct.ieee80211_local = type opaque
%struct.ieee80211_key = type opaque
define void @ieee80211_debugfs_key_add(%struct.ieee80211_local* %0, %struct.ieee80211_key* %1) {
%3 = alloca %struct.ieee80211_local*
%4 = alloca %struct.ieee80211_key*
store %struct.ieee80211_local* %0, %struct.ieee80211_local** %3
store %struct.ieee80211_key* %1, %struct.ieee80211_key** %4
ret void
}

LLVM IR (-O2):
%struct.ieee80211_local = type opaque
%struct.ieee80211_key = type opaque
define void @ieee80211_debugfs_key_add(%struct.ieee80211_local* nocapture %0, %struct.ieee80211_key* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, float *);
double input(char *s) {
  float x;
  printf("%s", s);
  scanf("%f", &x);
  return (x);
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
define double @input(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%7 = load float, float* %3
%8 = fpext float %7 to double
ret double %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
define double @input(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fpext float %6 to double
ret double %7
}
const char *NextSearchBegin(const char *const curSearch, int skip) {
  return (curSearch + ((skip < 1) ? 1 : skip));
}


x86 assembly (clang, -O0):
<NextSearchBegin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    112a <NextSearchBegin+0x2a>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1130 <NextSearchBegin+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextSearchBegin>:
test   %esi,%esi
mov    $0x1,%eax
cmovg  %esi,%eax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @NextSearchBegin(i8* readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
%4 = select i1 %3, i32 %1, i32 1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
int parser();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("\n%d\n\n", parser());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%d\0A\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @parser()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}