xunge/DecIR huggingface dataset:
float GetMaxFitness(void) { return (100 * 64); }


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

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

LLVM IR (-O0):
define float @GetMaxFitness() {
ret float 6.400000e+03
}

LLVM IR (-O2):
define float @GetMaxFitness() {
ret float 6.400000e+03
}
/* Variables and functions */
int func(int, int);
int f(int a, int b, int c, int d) { return func(func(a, b), c + d); }


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

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1030 <func@plt>
add    %ebx,%ebp
mov    %eax,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <func@plt>

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @func(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = add nsw i32 %12, %13
%15 = call i32 @func(i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @func(i32 %0, i32 %1)
%6 = add nsw i32 %3, %2
%7 = tail call i32 @func(i32 %5, i32 %6)
ret i32 %7
}
unsigned int *exception(unsigned int *registers, unsigned int reason) {
  return registers;
}


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

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

LLVM IR (-O0):
define i32* @exception(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
ret i32* %5
}

LLVM IR (-O2):
define i32* @exception(i32* readnone returned %0, i32 %1) {
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void task_b(void) {
  unsigned int n = 0;
  while (1) {
    printf("  task b: %i\n", n++);
    volatile int i;
    for (i = 0; i < 10000000; ++i)
      ;
  }
}


x86 assembly (clang, -O0):
<task_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x989680,%eax
jge    115e <task_b+0x4e>
jmp    1150 <task_b+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <task_b+0x2d>
jmp    111f <task_b+0xf>

x86 assembly (clang, -O2):
<task_b>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    1123 <task_b+0x13>
nop
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x98967f,%eax
jg     1120 <task_b+0x10>
addl   $0x1,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x989680,%eax
jl     1140 <task_b+0x30>
jmp    1120 <task_b+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c" task b: %i\0A\00"
define void @task_b() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %14
%4 = load i32, i32* %1
%5 = add i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
store volatile i32 0, i32* %2
br label %7
7: ; preds = %11, %3
%8 = load volatile i32, i32* %2
%9 = icmp slt i32 %8, 10000000
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load volatile i32, i32* %2
%13 = add nsw i32 %12, 1
store volatile i32 %13, i32* %2
br label %7
14: ; preds = %7
br label %3
}

LLVM IR (-O2):
@.str = [14 x i8] c" task b: %i\0A\00"
define void @task_b() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %14, %0
%4 = phi i32 [ 0, %0 ], [ %5, %14 ]
%5 = add i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
store volatile i32 0, i32* %1
%7 = load volatile i32, i32* %1
%8 = icmp slt i32 %7, 10000000
br i1 %8, label %9, label %14
9: ; preds = %3, %9
%10 = load volatile i32, i32* %1
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %1
%12 = load volatile i32, i32* %1
%13 = icmp slt i32 %12, 10000000
br i1 %13, label %9, label %14
14: ; preds = %9, %3
br label %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char **argv) {
  float value = 9.87657;
  char format[] = "%.2f";
  printf(format, value);
  return (EXIT_SUCCESS);
}


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)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x19(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x15(%rbp)
lea    -0x19(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x66322e25,(%rsp)
mov    %rsp,%rdi
movss  0xed8(%rip),%xmm0
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.format = [5 x i8] c"%.2f\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca [5 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x4023C0CDC0000000, float* %6
%8 = bitcast [5 x i8]* %7 to i8*
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%10 = load float, float* %6
%11 = call i32 @printf(i8* %9, float %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@__const.main.format = [5 x i8] c"%.2f\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* %4, float 0x4023C0CDC0000000)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ address();
int /*<<< orphan*/ assign();
int /*<<< orphan*/ call();
main() {
  assign();
  call();
  address();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @assign()
%2 = tail call i32 (...) @call()
%3 = tail call i32 (...) @address()
ret i32 0
}
/* Type definitions */
struct file_cache {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cctools_debug(long long, char *, char const *, char const *);
int unlink(char const *);
int file_cache_abort(struct file_cache *f, const char *path, const char *txn) {
  cctools_debug((1LL << 30), "abort %s %s", path, txn);
  return unlink(txn);
}


x86 assembly (clang, -O0):
<file_cache_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x40000000,%edi
lea    0xeb8(%rip),%rsi
call   1040 <cctools_debug@plt>
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_cache_abort>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
lea    0xed2(%rip),%rsi
mov    $0x40000000,%edi
mov    %rbx,%rcx
call   1040 <cctools_debug@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unlink@plt>

LLVM IR (-O0):
%struct.file_cache = type { i32 }
@.str = [12 x i8] c"abort %s %s\00"
define i32 @file_cache_abort(%struct.file_cache* %0, i8* %1, i8* %2) {
%4 = alloca %struct.file_cache*
%5 = alloca i8*
%6 = alloca i8*
store %struct.file_cache* %0, %struct.file_cache** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = call i32 @cctools_debug(i64 1073741824, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @unlink(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.file_cache = type { i32 }
@.str = [12 x i8] c"abort %s %s\00"
define i32 @file_cache_abort(%struct.file_cache* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i32 @cctools_debug(i64 1073741824, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%5 = tail call i32 @unlink(i8* %2)
ret i32 %5
}
int rms$wait(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<rms$wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rms$wait>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"rms$wait"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"rms$wait"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int bitRead(int x, int n) {
  int bit;
  bit = x >> n;
  bit = bit & 0x0001;
  return (bit);
}


x86 assembly (clang, -O0):
<bitRead>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitRead>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bitRead(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 = ashr i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @bitRead(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void doit(const char *msg) { printf("Hello %s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @doit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned long hash_djbm(const char *chave, int tamanho) {
  unsigned long h, i;
  i = 0;
  h = 5347;
  while (chave[i]) {
    h *= 31;
    h ^= chave[i++];
    h &= 0xffffffff;
  }
  return h % tamanho;
}


x86 assembly (clang, -O0):
<hash_djbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x14e3,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116d <hash_djbm+0x6d>
imul   $0x1f,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movsbq (%rax,%rcx,1),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movabs $0xffffffff,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    111b <hash_djbm+0x1b>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_djbm>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <hash_djbm+0x29>
add    $0x1,%rdi
mov    $0x14e3,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_djbm+0x10>
jmp    112e <hash_djbm+0x2e>
mov    $0x14e3,%eax
movslq %esi,%rcx
cmp    %rcx,%rax
jb     113c <hash_djbm+0x3c>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @hash_djbm(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
store i64 0, i64* %6
store i64 5347, i64* %5
br label %7
7: ; preds = %13, %2
%8 = load i8*, i8** %3
%9 = load i64, i64* %6
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %7
%14 = load i64, i64* %5
%15 = mul i64 %14, 31
store i64 %15, i64* %5
%16 = load i8*, i8** %3
%17 = load i64, i64* %6
%18 = add i64 %17, 1
store i64 %18, i64* %6
%19 = getelementptr inbounds i8, i8* %16, i64 %17
%20 = load i8, i8* %19
%21 = sext i8 %20 to i64
%22 = load i64, i64* %5
%23 = xor i64 %22, %21
store i64 %23, i64* %5
%24 = load i64, i64* %5
%25 = and i64 %24, 4294967295
store i64 %25, i64* %5
br label %7
26: ; preds = %7
%27 = load i64, i64* %5
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = urem i64 %27, %29
ret i64 %30
}

LLVM IR (-O2):
define i64 @hash_djbm(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %15, %5 ], [ %3, %2 ]
%7 = phi i64 [ %10, %5 ], [ 0, %2 ]
%8 = phi i64 [ %13, %5 ], [ 5347, %2 ]
%9 = mul nuw nsw i64 %8, 31
%10 = add i64 %7, 1
%11 = sext i8 %6 to i64
%12 = xor i64 %9, %11
%13 = and i64 %12, 4294967295
%14 = getelementptr inbounds i8, i8* %0, i64 %10
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i64 [ 5347, %2 ], [ %13, %5 ]
%19 = sext i32 %1 to i64
%20 = urem i64 %18, %19
ret i64 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void output_invalidcss(FILE *outputf) {
  fprintf(outputf, "{\n\t\terror = CSS_INVALID;\n\t}\n\n");
}


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

x86 assembly (clang, -O2):
<output_invalidcss>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"{\0A\09\09error = CSS_INVALID;\0A\09}\0A\0A\00"
define void @output_invalidcss(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"{\0A\09\09error = CSS_INVALID;\0A\09}\0A\0A\00"
define void @output_invalidcss(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 29, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pause_and_exit(int error) {
  printf("\nCUSUM has encountered an unrecoverable error\nPress any key to "
         "continue\n");
  getchar();
  exit(error);
}


x86 assembly (clang, -O0):
<pause_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<pause_and_exit>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"\0ACUSUM has encountered an unrecoverable error\0APress any key to continue\0A\00"
define void @pause_and_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getchar()
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@str = [72 x i8] c"\0ACUSUM has encountered an unrecoverable error\0APress any key to continue\00"
define void @pause_and_exit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int chroot(char const *);
__attribute__((__weak__, __always___)) int
softboundcets_chroot(const char *path) {
  return chroot(path);
}


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

x86 assembly (clang, -O2):
<softboundcets_chroot>:
jmp    1030 <chroot@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_chroot(i8* %0) {
%2 = tail call i32 @chroot(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_llroundf();
scalar_t__ llroundf(float);
void test_llroundf(float f) {
  if (llroundf(f) != llroundf(f))
    link_failure_llroundf();
}


x86 assembly (clang, -O0):
<test_llroundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <llroundf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <llroundf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_llroundf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_llroundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_llroundf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <llroundf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <llroundf@plt>
cmp    %rax,%rbx
jne    1149 <test_llroundf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_llroundf@plt>

LLVM IR (-O0):
define void @test_llroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @llroundf(float %3)
%5 = load float, float* %2
%6 = call i64 @llroundf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_llroundf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_llroundf(float %0) {
%2 = tail call i64 @llroundf(float %0)
%3 = tail call i64 @llroundf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_llroundf()
br label %7
7: ; preds = %5, %1
ret void
}
void f(unsigned int counter) {
  if (counter == 0)
    return;
  f(counter - 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <f+0x1a>
jmp    1135 <f+0x25>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void lv_fatal(const char *message) { fprintf(stderr, "FATAL: %s", message); }


x86 assembly (clang, -O0):
<lv_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lv_fatal>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"FATAL: %s\00"
define void @lv_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"FATAL: %s\00"
define void @lv_fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void SPI_set_12_bit() {
  (*((volatile unsigned char *)0xE0068004)) = 0x01;
  (*((volatile unsigned short *)0xE0068000)) = 0x10B;
  (*((volatile unsigned char *)0xE0068004)) = 0x02;
}


x86 assembly (clang, -O0):
<SPI_set_12_bit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0068004,%eax
movb   $0x1,(%rax)
mov    $0xe0068000,%eax
movw   $0x10b,(%rax)
mov    $0xe0068004,%eax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_set_12_bit>:
mov    $0xe0068004,%eax
movb   $0x1,(%rax)
movw   $0x10b,-0x4(%rax)
movb   $0x2,(%rax)
ret

LLVM IR (-O0):
define void @SPI_set_12_bit() {
store volatile i8 1, i8* inttoptr (i64 3758522372 to i8*)
store volatile i16 267, i16* inttoptr (i64 3758522368 to i16*)
store volatile i8 2, i8* inttoptr (i64 3758522372 to i8*)
ret void
}

LLVM IR (-O2):
define void @SPI_set_12_bit() {
store volatile i8 1, i8* inttoptr (i64 3758522372 to i8*)
store volatile i16 267, i16* inttoptr (i64 3758522368 to i16*)
store volatile i8 2, i8* inttoptr (i64 3758522372 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: gpmakesubwa [-w] [-kbprogcos/-diff1cos/-diff2cos]\n");
  fprintf(stderr,
          "\t[-diff1/-diff2/-diff1c] [-mrl maxreducelen] [-nc nochange]\n");
  fprintf(stderr,
          "\t[-v] [-silent] [-l] [-ms maxstates] groupname [subname]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: gpmakesubwa [-w] [-kbprogcos/-diff1cos/-diff2cos]\0A\00"
@.str.1 = [61 x i8] c"\09[-diff1/-diff2/-diff1c] [-mrl maxreducelen] [-nc nochange]\0A\00"
@.str.2 = [58 x i8] c"\09[-v] [-silent] [-l] [-ms maxstates] groupname [subname]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: gpmakesubwa [-w] [-kbprogcos/-diff1cos/-diff2cos]\0A\00"
@.str.1 = [61 x i8] c"\09[-diff1/-diff2/-diff1c] [-mrl maxreducelen] [-nc nochange]\0A\00"
@.str.2 = [58 x i8] c"\09[-v] [-silent] [-l] [-ms maxstates] groupname [subname]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
void swap(char s[], int i, int j) {
  char tmp;
  tmp = s[i];
  s[i] = s[j];
  s[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ISR(int);
int /*<<< orphan*/ oosmos_RunStateMachines();
int /*<<< orphan*/ uartNew(int);
extern int main() {
  uartNew(1);
  uartNew(3);
  uartNew(7);
  ISR(3);
  oosmos_RunStateMachines();
  ISR(7);
  oosmos_RunStateMachines();
  ISR(1);
  oosmos_RunStateMachines();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <uartNew@plt>
mov    $0x3,%edi
call   1030 <uartNew@plt>
mov    $0x7,%edi
call   1030 <uartNew@plt>
mov    $0x3,%edi
call   1040 <ISR@plt>
mov    $0x0,%al
call   1050 <oosmos_RunStateMachines@plt>
mov    $0x7,%edi
call   1040 <ISR@plt>
mov    $0x0,%al
call   1050 <oosmos_RunStateMachines@plt>
mov    $0x1,%edi
call   1040 <ISR@plt>
mov    $0x0,%al
call   1050 <oosmos_RunStateMachines@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <uartNew@plt>
mov    $0x3,%edi
call   1030 <uartNew@plt>
mov    $0x7,%edi
call   1030 <uartNew@plt>
mov    $0x3,%edi
call   1040 <ISR@plt>
xor    %eax,%eax
call   1050 <oosmos_RunStateMachines@plt>
mov    $0x7,%edi
call   1040 <ISR@plt>
xor    %eax,%eax
call   1050 <oosmos_RunStateMachines@plt>
mov    $0x1,%edi
call   1040 <ISR@plt>
xor    %eax,%eax
call   1050 <oosmos_RunStateMachines@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @uartNew(i32 1)
%3 = call i32 @uartNew(i32 3)
%4 = call i32 @uartNew(i32 7)
%5 = call i32 @ISR(i32 3)
%6 = call i32 (...) @oosmos_RunStateMachines()
%7 = call i32 @ISR(i32 7)
%8 = call i32 (...) @oosmos_RunStateMachines()
%9 = call i32 @ISR(i32 1)
%10 = call i32 (...) @oosmos_RunStateMachines()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @uartNew(i32 1)
%2 = tail call i32 @uartNew(i32 3)
%3 = tail call i32 @uartNew(i32 7)
%4 = tail call i32 @ISR(i32 3)
%5 = tail call i32 (...) @oosmos_RunStateMachines()
%6 = tail call i32 @ISR(i32 7)
%7 = tail call i32 (...) @oosmos_RunStateMachines()
%8 = tail call i32 @ISR(i32 1)
%9 = tail call i32 (...) @oosmos_RunStateMachines()
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_multprec_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(494, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_multprec_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1ee,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_multprec_start_system>:
mov    $0x1ee,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_multprec_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 494, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_multprec_start_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 494, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/ *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_error(int, char *);
int pthread_mutexattr_init(int /*<<< orphan*/ *);
void mutexattrInit(pthread_mutexattr_t *attrs) {
  ASSERT(attrs);
  int r = pthread_mutexattr_init(attrs);
  if (r != 0) {
    log_error(r, "Error pthread_mutexattr_init()");
    abort();
  }
}


x86 assembly (clang, -O0):
<mutexattrInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1060 <pthread_mutexattr_init@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1181 <mutexattrInit+0x41>
mov    -0xc(%rbp),%edi
lea    0xe8b(%rip),%rsi
call   1040 <log_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutexattrInit>:
push   %rbx
mov    %rdi,%rbx
call   1050 <ASSERT@plt>
mov    %rbx,%rdi
call   1060 <pthread_mutexattr_init@plt>
test   %eax,%eax
jne    1157 <mutexattrInit+0x17>
pop    %rbx
ret
lea    0xea2(%rip),%rsi
mov    %eax,%edi
call   1040 <log_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error pthread_mutexattr_init()\00"
define void @mutexattrInit(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @ASSERT(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @pthread_mutexattr_init(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @log_error(i32 %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error pthread_mutexattr_init()\00"
define void @mutexattrInit(i32* %0) {
%2 = tail call i32 @ASSERT(i32* %0)
%3 = tail call i32 @pthread_mutexattr_init(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @log_error(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
unsigned short htons(unsigned short);
scalar_t__ strtoul(char *, char **, int);
int strtoport(char *str, unsigned short *out) {
  char *err;
  *out = htons((unsigned short)strtoul(str, &err, 10));
  return *err == 0;
}


x86 assembly (clang, -O0):
<strtoport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtoul@plt>
movzwl %ax,%edi
call   1030 <htons@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoport>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1040 <strtoul@plt>
movzwl %ax,%edi
call   1030 <htons@plt>
mov    %ax,(%rbx)
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @strtoport(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i8*
store i8* %0, i8** %3
store i16* %1, i16** %4
%6 = load i8*, i8** %3
%7 = call i64 @strtoul(i8* %6, i8** %5, i32 10)
%8 = trunc i64 %7 to i16
%9 = call zeroext i16 @htons(i16 zeroext %8)
%10 = load i16*, i16** %4
store i16 %9, i16* %10
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @strtoport(i8* %0, i16* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtoul(i8* %0, i8** %3, i32 10)
%6 = trunc i64 %5 to i16
%7 = tail call zeroext i16 @htons(i16 zeroext %6)
store i16 %7, i16* %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
int end_star(char *s2) {
  while (s2 && *s2 && *s2 == '*')
    s2++;
  if (*s2 == '\0')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<end_star>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     113d <end_star+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     113d <end_star+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114d <end_star+0x4d>
jmp    115e <end_star+0x5e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <end_star+0x8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117a <end_star+0x7a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <end_star+0x81>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_star>:
test   %rdi,%rdi
je     1124 <end_star+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x2a,%cl
je     1110 <end_star+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @end_star(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %19, %1
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 42
br label %17
17: ; preds = %12, %7, %4
%18 = phi i1 [ false, %7 ], [ false, %4 ], [ %16, %12 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %4
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %22
store i32 1, i32* %2
br label %29
28: ; preds = %22
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @end_star(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 42
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = icmp eq i8 %5, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %8
%12 = phi i32 [ %10, %8 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int delete_key(int, long, int, char const *, int *, int *);
edf_delete_key(int stream, long int DataNumber, int DataChain,
               const char *keyword, int *pErrorValue, int *pstatus) {
  return (
      delete_key(stream, DataNumber, DataChain, keyword, pErrorValue, pstatus));
}


x86 assembly (clang, -O0):
<edf_delete_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <delete_key@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edf_delete_key>:
jmp    1030 <delete_key@plt>

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

LLVM IR (-O2):
define i32 @edf_delete_key(i32 %0, i64 %1, i32 %2, i8* %3, i32* %4, i32* %5) {
%7 = tail call i32 @delete_key(i32 %0, i64 %1, i32 %2, i8* %3, i32* %4, i32* %5)
ret i32 %7
}
void ignore(void *cc, unsigned char c) {}


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

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

LLVM IR (-O0):
define void @ignore(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
ret void
}

LLVM IR (-O2):
define void @ignore(i8* nocapture %0, i8 zeroext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
void sanity_requires(int exp) {
  if (!exp)
    fail("that doesn't make any sense");
}


x86 assembly (clang, -O0):
<sanity_requires>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <sanity_requires+0x21>
lea    0xed4(%rip),%rdi
call   1030 <fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanity_requires>:
test   %edi,%edi
je     1115 <sanity_requires+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <fail@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"that doesn't make any sense\00"
define void @sanity_requires(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @fail(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"that doesn't make any sense\00"
define void @sanity_requires(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @fail(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
double Average(double sum, int count) {
  return ((double)sum / ((double)count + .0001));
}


x86 assembly (clang, -O0):
<Average>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xee2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Average>:
cvtsi2sd %edi,%xmm1
addsd  0xef4(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Average(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 = sitofp i32 %6 to double
%8 = fadd double %7, 1.000000e-04
%9 = fdiv double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @Average(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fadd double %3, 1.000000e-04
%5 = fdiv double %0, %4
ret double %5
}
/* Variables and functions */
int f460(int *);
int f461(int *p) { return f460(p); }


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

x86 assembly (clang, -O2):
<f461>:
jmp    1030 <f460@plt>

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

LLVM IR (-O2):
define i32 @f461(i32* %0) {
%2 = tail call i32 @f460(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int clone_fn(void *unused) {
  while (1)
    sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<clone_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111c <clone_fn+0xc>

x86 assembly (clang, -O2):
<clone_fn>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <clone_fn+0x10>

LLVM IR (-O0):
define i32 @clone_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define i32 @clone_fn(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
unsigned short __max_impl_ushort(unsigned short a, unsigned short b) {
  return (a > b) ? a : b;
}


x86 assembly (clang, -O0):
<__max_impl_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    112e <__max_impl_ushort+0x2e>
movzwl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <__max_impl_ushort+0x35>
movzwl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__max_impl_ushort>:
mov    %esi,%eax
cmp    %ax,%di
cmova  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @__max_impl_ushort(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @__max_impl_ushort(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp ugt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Type definitions */
struct board {
  int dummy;
};

/* Variables and functions */
char board_merge_down(struct board *);
char board_shift_down(struct board *);
int board_move_down(struct board *board) {
  char a = board_merge_down(board);
  return a | board_shift_down(board);
}


x86 assembly (clang, -O0):
<board_move_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <board_merge_down@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <board_shift_down@plt>
mov    %al,%cl
mov    -0x10(%rbp),%eax
movsbl %cl,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_move_down>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <board_merge_down@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <board_shift_down@plt>
or     %bpl,%al
movsbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.board = type { i32 }
define i32 @board_move_down(%struct.board* %0) {
%2 = alloca %struct.board*
%3 = alloca i8
store %struct.board* %0, %struct.board** %2
%4 = load %struct.board*, %struct.board** %2
%5 = call signext i8 @board_merge_down(%struct.board* %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = load %struct.board*, %struct.board** %2
%9 = call signext i8 @board_shift_down(%struct.board* %8)
%10 = sext i8 %9 to i32
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.board = type { i32 }
define i32 @board_move_down(%struct.board* %0) {
%2 = tail call signext i8 @board_merge_down(%struct.board* %0)
%3 = tail call signext i8 @board_shift_down(%struct.board* %0)
%4 = or i8 %3, %2
%5 = sext i8 %4 to i32
ret i32 %5
}