xunge/DecIR huggingface dataset:
int fib(int n) {
  switch (n) {
  case 0:
    return 0;
    break;
  case 1:
    return 1;
    break;
  default:
    return fib(n - 2) + fib(n - 1);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113f <fib+0x2f>
jmp    112e <fib+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     114b <fib+0x3b>
jmp    1157 <fib+0x47>
movl   $0x0,-0x4(%rbp)
jmp    117a <fib+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    117a <fib+0x6a>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x2(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i32 0, i32* %2
br label %15
6: ; preds = %1
store i32 1, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 2
%10 = call i32 @fib(i32 %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i32 @fib(i32 %12)
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %6, %5
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -2
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -1
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ merge_sort(void *, void *, size_t, int (*)(void *, void *));
void AL_merge_sort(void *arr, size_t size, size_t count,
                   int (*comp)(void *key1, void *key2)) {
  void *l = arr;
  void *r = arr + size * count;
  merge_sort(l, r, size, comp);
}


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

x86 assembly (clang, -O2):
<AL_merge_sort>:
mov    %rsi,%rax
imul   %rsi,%rdx
lea    (%rdx,%rdi,1),%rsi
mov    %rax,%rdx
jmp    1030 <merge_sort@plt>

LLVM IR (-O0):
define void @AL_merge_sort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%11 = load i8*, i8** %5
store i8* %11, i8** %9
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = load i64, i64* %7
%15 = mul i64 %13, %14
%16 = getelementptr i8, i8* %12, i64 %15
store i8* %16, i8** %10
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i64, i64* %6
%20 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%21 = call i32 @merge_sort(i8* %17, i8* %18, i64 %19, i32 (i8*, i8*)* %20)
ret void
}

LLVM IR (-O2):
define void @AL_merge_sort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = mul i64 %2, %1
%6 = getelementptr i8, i8* %0, i64 %5
%7 = tail call i32 @merge_sort(i8* %0, i8* %6, i64 %1, i32 (i8*, i8*)* %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
__attribute__((always_)) const long double upperl(long double d) {
  union {
    long double ld;
    uint32_t u[4];
  } cnv;
  cnv.ld = d;
  cnv.u[0] = 0;
  return cnv.ld;
}


x86 assembly (clang, -O0):
<upperl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x30(%rbp)
movq   $0x0,-0x30(%rbp)
fldt   -0x30(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<upperl>:
movzwl 0x10(%rsp),%eax
mov    %ax,-0x10(%rsp)
movq   $0x0,-0x18(%rsp)
fldt   -0x18(%rsp)
ret

LLVM IR (-O0):
%union.anon = type { x86_fp80, [16 x i8] }
define x86_fp80 @upperl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca %union.anon
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = bitcast %union.anon* %3 to x86_fp80*
store x86_fp80 %4, x86_fp80* %5
%6 = bitcast %union.anon* %3 to [4 x i64]*
%7 = getelementptr inbounds [4 x i64], [4 x i64]* %6, i64 0, i64 0
store i64 0, i64* %7
%8 = bitcast %union.anon* %3 to x86_fp80*
%9 = load x86_fp80, x86_fp80* %8
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @upperl(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = and i80 %2, -18446744073709551616
%4 = bitcast i80 %3 to x86_fp80
ret x86_fp80 %4
}
int foo16() { return 16; }


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

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

LLVM IR (-O0):
define i32 @foo16() {
ret i32 16
}

LLVM IR (-O2):
define i32 @foo16() {
ret i32 16
}
/* Type definitions */
typedef int /*<<< orphan*/ POLICYQUALINFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ POLICYQUALINFO_it;
int i2d_POLICYQUALINFO(POLICYQUALINFO *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &POLICYQUALINFO_it);
}


x86 assembly (clang, -O0):
<i2d_POLICYQUALINFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ec1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_POLICYQUALINFO>:
mov    0x2ed9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@POLICYQUALINFO_it = global i32 0
define i32 @i2d_POLICYQUALINFO(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @POLICYQUALINFO_it)
ret i32 %3
}
void ScaleRowDown4_16_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown4_16_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("Hello.\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Hello.\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Hello.\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
void decpex(int flag) {
  if (flag)
    sm("?19");
  else
    rm("?19");
}


x86 assembly (clang, -O0):
<decpex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <decpex+0x26>
lea    0xec4(%rip),%rdi
call   1040 <sm@plt>
jmp    1152 <decpex+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <rm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decpex>:
test   %edi,%edi
je     1130 <decpex+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <sm@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <rm@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"?19\00"
define void @decpex(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 %5, label %7
5: ; preds = %1
%6 = call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"?19\00"
define void @decpex(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void byte_copy(void *to, size_t l, const void *from) { memcpy(to, from, l); }


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

x86 assembly (clang, -O2):
<byte_copy>:
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @byte_copy(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int puts(char *s) {
  int i = 0;
  while (*s) {
    putchar(*s++);
    i++;
  }
  putchar('\n');
  return i + 1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <puts+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <puts+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1147 <puts+0x37>
mov    %rdi,%r14
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <puts+0x20>
jmp    114c <puts+0x3c>
mov    $0x1,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 1, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @putchar(i8 signext %5)
%10 = add i32 %6, 1
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 1, %1 ], [ %10, %4 ]
%15 = tail call i32 @putchar(i8 signext 10)
ret i32 %14
}
int rng_rand(unsigned char *mystate) {
  int r;
  unsigned long int b = (mystate[16] << 24) | (mystate[17] << 16) |
                        (mystate[18] << 8) | (mystate[19] << 0);
  b = b & 0x7fffffff;
  r = (int)b;
  return r;
}


x86 assembly (clang, -O0):
<rng_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x10(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x11(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x12(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x13(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x7fffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_rand>:
movzbl 0x10(%rdi),%eax
movzbl 0x11(%rdi),%ecx
shl    $0x10,%ecx
movzbl 0x12(%rdi),%edx
shl    $0x8,%edx
movzbl 0x13(%rdi),%esi
and    $0x7f,%eax
shl    $0x18,%eax
or     %ecx,%eax
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @rng_rand(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 16
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 24
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 17
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 18
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 19
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl i32 %25, 0
%27 = or i32 %21, %26
%28 = sext i32 %27 to i64
store i64 %28, i64* %4
%29 = load i64, i64* %4
%30 = and i64 %29, 2147483647
store i64 %30, i64* %4
%31 = load i64, i64* %4
%32 = trunc i64 %31 to i32
store i32 %32, i32* %3
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @rng_rand(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 16
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 17
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = getelementptr inbounds i8, i8* %0, i64 18
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = getelementptr inbounds i8, i8* %0, i64 19
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = and i32 %5, 2130706432
%18 = or i32 %17, %9
%19 = or i32 %18, %13
%20 = or i32 %19, %16
ret i32 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t fnv_hash(const void *data, size_t size) {
  const uint8_t *p = data;
  const uint8_t *q = p + size;
  uint32_t hash = (0x811c9dc5);
  while (p != q) {
    hash *= (0x01000193);
    hash ^= (uint32_t)(*p++);
  }
  return hash;
}


x86 assembly (clang, -O0):
<fnv_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
movl   $0x811c9dc5,-0x24(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1162 <fnv_hash+0x62>
imul   $0x1000193,-0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%eax
xor    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    112e <fnv_hash+0x2e>
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnv_hash>:
shl    $0x2,%rsi
mov    $0x811c9dc5,%eax
test   %rsi,%rsi
je     1122 <fnv_hash+0x22>
xor    %ecx,%ecx
imul   $0x1000193,%eax,%eax
xor    (%rdi,%rcx,1),%eax
add    $0x4,%rcx
cmp    %rcx,%rsi
jne    1110 <fnv_hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @fnv_hash(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 %1
%5 = icmp eq i32* %4, %3
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ -2128831035, %2 ]
%8 = phi i32* [ %10, %6 ], [ %3, %2 ]
%9 = mul nsw i32 %7, 16777619
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* %8
%12 = xor i32 %11, %9
%13 = icmp eq i32* %10, %4
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = phi i32 [ -2128831035, %2 ], [ %12, %6 ]
ret i32 %15
}
void ol_if_dfs_configure(struct ieee80211com *ic) { return; }


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

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

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

LLVM IR (-O2):
%struct.ieee80211com = type opaque
define void @ol_if_dfs_configure(%struct.ieee80211com* nocapture %0) {
ret void
}
/* Type definitions */
struct programmer_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buspirate_bb_setpin_internal(struct programmer_t *, int,
                                                int);
void buspirate_bb_powerup(struct programmer_t *pgm) {
  buspirate_bb_setpin_internal(pgm, 7, 1);
}


x86 assembly (clang, -O0):
<buspirate_bb_powerup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
call   1030 <buspirate_bb_setpin_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buspirate_bb_powerup>:
mov    $0x7,%esi
mov    $0x1,%edx
jmp    1030 <buspirate_bb_setpin_internal@plt>

LLVM IR (-O0):
%struct.programmer_t = type { i32 }
define void @buspirate_bb_powerup(%struct.programmer_t* %0) {
%2 = alloca %struct.programmer_t*
store %struct.programmer_t* %0, %struct.programmer_t** %2
%3 = load %struct.programmer_t*, %struct.programmer_t** %2
%4 = call i32 @buspirate_bb_setpin_internal(%struct.programmer_t* %3, i32 7, i32 1)
ret void
}

LLVM IR (-O2):
%struct.programmer_t = type { i32 }
define void @buspirate_bb_powerup(%struct.programmer_t* %0) {
%2 = tail call i32 @buspirate_bb_setpin_internal(%struct.programmer_t* %0, i32 7, i32 1)
ret void
}
/* Type definitions */
struct daemon_session {
  int dummy;
};

/* Variables and functions */
int serve_reg_write(struct daemon_session *);
int serve_daq_write(struct daemon_session *dsess) {
  return serve_reg_write(dsess);
}


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

x86 assembly (clang, -O2):
<serve_daq_write>:
jmp    1030 <serve_reg_write@plt>

LLVM IR (-O0):
%struct.daemon_session = type { i32 }
define i32 @serve_daq_write(%struct.daemon_session* %0) {
%2 = alloca %struct.daemon_session*
store %struct.daemon_session* %0, %struct.daemon_session** %2
%3 = load %struct.daemon_session*, %struct.daemon_session** %2
%4 = call i32 @serve_reg_write(%struct.daemon_session* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.daemon_session = type { i32 }
define i32 @serve_daq_write(%struct.daemon_session* %0) {
%2 = tail call i32 @serve_reg_write(%struct.daemon_session* %0)
ret i32 %2
}
void RTMpGetMaxCpuId(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMpGetMaxCpuId() {
ret void
}
/* Variables and functions */
int process_messages();
int main() { return process_messages(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @process_messages()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ do_query();
int main() {
  for (;;) {
    do_query();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <do_query@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <do_query@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @do_query()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @do_query()
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ moveToString(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void printMove(uint16_t move, int chess960) {
  char str[6];
  moveToString(move, str, chess960);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<printMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <moveToString@plt>
lea    -0xe(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMove>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%edx
lea    0xa(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <moveToString@plt>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printMove(i32 %0, i32 %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = call i32 @moveToString(i32 %0, i8* %4, i32 %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int time(int /*<<< orphan*/ *);
int main(void) {
  time_t lt;
  lt = time(NULL);
  printf("The number of seconds since January 1, 1970\n");
  printf("The Calendar Time now is %d\n", lt);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"The number of seconds since January 1, 1970\0A\00"
@.str.1 = [29 x i8] c"The Calendar Time now is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c"The Calendar Time now is %d\0A\00"
@str = [44 x i8] c"The number of seconds since January 1, 1970\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct sockaddr_un {
  int dummy;
};
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int main(void) {
  struct sockaddr_un addr;
  (void)addr;
  return sizeof(addr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
unsigned int BigLong(unsigned int x) {
  return (unsigned int)((x >> 24) | ((x >> 8) & 0xff00) |
                        ((x << 8) & 0xff0000) | (x << 24));
}


x86 assembly (clang, -O0):
<BigLong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BigLong(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @BigLong(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int voCore_gpioSetValueByIndex(int, int);
int ActiverRelai(int index) { return voCore_gpioSetValueByIndex(index, 1); }


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

x86 assembly (clang, -O2):
<ActiverRelai>:
mov    $0x1,%esi
jmp    1030 <voCore_gpioSetValueByIndex@plt>

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

LLVM IR (-O2):
define i32 @ActiverRelai(i32 %0) {
%2 = tail call i32 @voCore_gpioSetValueByIndex(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
char *strrpad(char *s, char pad, int size) {
  int i = strlen(s);
  while (i < size) {
    s[i] = pad;
    i++;
  }
  s[i] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<strrpad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1159 <strrpad+0x49>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <strrpad+0x21>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrpad>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rdx
cmp    %ebp,%eax
jge    1150 <strrpad+0x30>
lea    (%rbx,%rdx,1),%rdi
not    %edx
add    %ebp,%edx
add    $0x1,%rdx
movzbl %r14b,%esi
call   1040 <memset@plt>
movslq %ebp,%rdx
movb   $0x0,(%rbx,%rdx,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strrpad(i8* returned %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, %2
%6 = sext i32 %4 to i64
br i1 %5, label %7, label %14
7: ; preds = %3
%8 = getelementptr i8, i8* %0, i64 %6
%9 = xor i32 %4, -1
%10 = add i32 %9, %2
%11 = zext i32 %10 to i64
%12 = add nuw nsw i64 %11, 1
%13 = sext i32 %2 to i64
br label %14
14: ; preds = %7, %3
%15 = phi i64 [ %6, %3 ], [ %13, %7 ]
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 0, i8* %16
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ airLogRician(double, double, double);
double exp(int /*<<< orphan*/);
double airRician(double mes, double tru, double sig) {
  return exp(airLogRician(mes, tru, sig));
}


x86 assembly (clang, -O0):
<airRician>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <airLogRician@plt>
mov    %eax,%edi
call   1040 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<airRician>:
push   %rax
call   1030 <airLogRician@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <exp@plt>

LLVM IR (-O0):
define double @airRician(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* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @airLogRician(double %7, double %8, double %9)
%11 = call double @exp(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @airRician(double %0, double %1, double %2) {
%4 = tail call i32 @airLogRician(double %0, double %1, double %2)
%5 = tail call double @exp(i32 %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void fail(char *s) {
  puts(s);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fail(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(char const *, char const *);
void diag(const char *s, const char *arg) {
  msg(s, arg);
  exit(1);
}


x86 assembly (clang, -O0):
<diag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<diag>:
push   %rax
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @diag(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @msg(i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @diag(i8* %0, i8* %1) {
%3 = tail call i32 @msg(i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned int Get_Bits(int);
unsigned int Get_Bits1() { return Get_Bits(1); }


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

x86 assembly (clang, -O2):
<Get_Bits1>:
mov    $0x1,%edi
jmp    1030 <Get_Bits@plt>

LLVM IR (-O0):
define i32 @Get_Bits1() {
%1 = call i32 @Get_Bits(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @Get_Bits1() {
%1 = tail call i32 @Get_Bits(i32 1)
ret i32 %1
}
int is_alive(int *g, int l) {
  int i = 0;
  for (; i < l; i = i + 1) {
    if (g[i] == 1) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_alive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <is_alive+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    113c <is_alive+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1156 <is_alive+0x56>
jmp    1141 <is_alive+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <is_alive+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alive>:
test   %esi,%esi
jle    111f <is_alive+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpl   $0x1,(%rdi,%rcx,4)
je     1122 <is_alive+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <is_alive+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_alive(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %2
%15 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %15
}
int setbits(int x, int p, int n, int y) {}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[3] = {1, 2, 3};
  printf("arr: [%i] \n", arr[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [12 x i8] c"arr: [%i] \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"arr: [%i] \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
void mdp4_dtv_base_swap(int cndx, struct mdp4_overlay_pipe *pipe) {}


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

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

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

LLVM IR (-O2):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_dtv_base_swap(i32 %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
void foo659(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo659(i32 %0) {
ret void
}
int aux_int_cmp(const void *const a, const void *const b) {
  const int *const x = (const int *const)a;
  const int *const y = (const int *const)b;
  return (*x > *y) - (*x < *y);
}


x86 assembly (clang, -O0):
<aux_int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aux_int_cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @aux_int_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
%16 = zext i1 %15 to i32
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = icmp slt i32 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @aux_int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int mkint(int high, int low) {
  int res = high << 16 + low;
  return res;
}


x86 assembly (clang, -O0):
<mkint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x10,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkint>:
mov    %edi,%eax
lea    0x10(%rsi),%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @mkint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 16, %7
%9 = shl i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @mkint(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 16
%4 = shl i32 %0, %3
ret i32 %4
}
/* Variables and functions */
int CHAR_MAX;
int CHAR_MIN;
int /*<<< orphan*/ printf(char *, char *, int, int);
void chk_char(void) { printf("%12s: %d..%d\n", "char", CHAR_MIN, CHAR_MAX); }


x86 assembly (clang, -O0):
<chk_char>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edx
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
lea    0xed3(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_char>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
lea    0xed7(%rip),%rdi
lea    0xede(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%12s: %d..%d\0A\00"
@.str.1 = [5 x i8] c"char\00"
@CHAR_MIN = global i32 0
@CHAR_MAX = global i32 0
define void @chk_char() {
%1 = load i32, i32* @CHAR_MIN
%2 = load i32, i32* @CHAR_MAX
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%12s: %d..%d\0A\00"
@.str.1 = [5 x i8] c"char\00"
@CHAR_MIN = global i32 0
@CHAR_MAX = global i32 0
define void @chk_char() {
%1 = load i32, i32* @CHAR_MIN
%2 = load i32, i32* @CHAR_MAX
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
void asus_bat_write_phone_bat_capacity_tofile(void) {}


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

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

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

LLVM IR (-O2):
define void @asus_bat_write_phone_bat_capacity_tofile() {
ret void
}
/* Type definitions */
struct chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ background_chunk(struct chunk *);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void background_free(struct chunk *chunk) { free(background_chunk(chunk)); }


x86 assembly (clang, -O0):
<background_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <background_chunk@plt>
mov    %eax,%edi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<background_free>:
push   %rax
call   1040 <background_chunk@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.chunk = type { i32 }
define void @background_free(%struct.chunk* %0) {
%2 = alloca %struct.chunk*
store %struct.chunk* %0, %struct.chunk** %2
%3 = load %struct.chunk*, %struct.chunk** %2
%4 = call i32 @background_chunk(%struct.chunk* %3)
%5 = call i32 @free(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.chunk = type { i32 }
define void @background_free(%struct.chunk* %0) {
%2 = tail call i32 @background_chunk(%struct.chunk* %0)
%3 = tail call i32 @free(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int hash(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/ const *, size_t, int,
         int);
int keccak_256(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen) {
  if (outlen > (256 / 8)) {
    return -1;
  }
  return hash(out, outlen, in, inlen, 200 - (256 / 4), 0x01);
}


x86 assembly (clang, -O0):
<keccak_256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x20,-0x18(%rbp)
jbe    113f <keccak_256+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <keccak_256+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x88,%r8d
mov    $0x1,%r9d
call   1030 <hash@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keccak_256>:
cmp    $0x20,%rsi
jbe    111c <keccak_256+0xc>
mov    $0xffffffff,%eax
ret
mov    $0x88,%r8d
mov    $0x1,%r9d
jmp    1030 <hash@plt>

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

LLVM IR (-O2):
define i32 @keccak_256(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = icmp ugt i64 %1, 32
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @hash(i32* %0, i64 %1, i32* %2, i64 %3, i32 136, i32 1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ -1, %4 ]
ret i32 %9
}
void main(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <main+0x9>
jmp    1109 <main+0x9>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
br label %1
}