xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ idc(int *);
int test23(int *q, int *x) {
  idc(q);
  if (x)
    ;
  int *p = q;
  if (!p)
    ;
  return *p;
}


x86 assembly (clang, -O0):
<test23>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <idc@plt>
cmpq   $0x0,-0x10(%rbp)
je     1139 <test23+0x29>
jmp    1139 <test23+0x29>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <test23+0x41>
jmp    1151 <test23+0x41>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test23>:
push   %rbx
mov    %rdi,%rbx
call   1030 <idc@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test23(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 = call i32 @idc(i32* %6)
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %2
%12 = load i32*, i32** %3
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = icmp ne i32* %13, null
br i1 %14, label %16, label %15
15: ; preds = %11
br label %16
16: ; preds = %15, %11
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @test23(i32* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @idc(i32* %0)
%4 = load i32, i32* %0
ret i32 %4
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_event_source_ref(void *s) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_event_source_ref(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
float __rsind(float);
float intr_wrap_065(float p1) { return __rsind(p1); }


x86 assembly (clang, -O0):
<intr_wrap_065>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__rsind@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_065>:
jmp    1030 <__rsind@plt>

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

LLVM IR (-O2):
define float @intr_wrap_065(float %0) {
%2 = tail call float @__rsind(float %0)
ret float %2
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *,
                  char const *);
char *get_distributed_cache_directory(const char *tt_root, const char *user,
                                      const char *unique_string) {
  return concatenate("%s/taskTracker/%s"
                     "/distcache/%s",
                     "dist_cache_unique_path", 3, tt_root, user, unique_string);
}


x86 assembly (clang, -O0):
<get_distributed_cache_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xec9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x3,%edx
call   1030 <concatenate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_distributed_cache_directory>:
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee0(%rip),%rdi
lea    0xef8(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s/taskTracker/%s/distcache/%s\00"
@.str.1 = [23 x i8] c"dist_cache_unique_path\00"
define i8* @get_distributed_cache_directory(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @concatenate(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %7, i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s/taskTracker/%s/distcache/%s\00"
@.str.1 = [23 x i8] c"dist_cache_unique_path\00"
define i8* @get_distributed_cache_directory(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @concatenate(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog) {
  size_t const maxHeaderSize = (((maxSymbolValue + 1) * tableLog) >> 3) + 3;
  return maxSymbolValue ? maxHeaderSize : 512;
}


x86 assembly (clang, -O0):
<FSE_NCountWriteBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   -0x8(%rbp),%eax
shr    $0x3,%eax
add    $0x3,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1137 <FSE_NCountWriteBound+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <FSE_NCountWriteBound+0x45>
mov    $0x200,%eax
mov    %rax,-0x18(%rbp)
jmp    1145 <FSE_NCountWriteBound+0x45>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FSE_NCountWriteBound>:
lea    0x1(%rdi),%ecx
imul   %esi,%ecx
shr    $0x3,%ecx
add    $0x3,%ecx
test   %edi,%edi
mov    $0x200,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i64 @FSE_NCountWriteBound(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 1
%8 = load i32, i32* %4
%9 = mul i32 %7, %8
%10 = lshr i32 %9, 3
%11 = add i32 %10, 3
%12 = zext i32 %11 to i64
store i64 %12, i64* %5
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = load i64, i64* %5
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %15
%19 = phi i64 [ %16, %15 ], [ 512, %17 ]
ret i64 %19
}

LLVM IR (-O2):
define i64 @FSE_NCountWriteBound(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = mul i32 %3, %1
%5 = lshr i32 %4, 3
%6 = add nuw nsw i32 %5, 3
%7 = icmp eq i32 %0, 0
%8 = select i1 %7, i32 512, i32 %6
%9 = zext i32 %8 to i64
ret i64 %9
}
void __sys_tick_handler() {
  for (;;) {
    __asm__ volatile("nop");
  }
}


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

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

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

LLVM IR (-O2):
define void @__sys_tick_handler() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ pskb_trim();
__attribute__((no)) int ___pskb_trim(void) {
  pskb_trim();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @___pskb_trim() {
%1 = call i32 (...) @pskb_trim()
ret i32 0
}

LLVM IR (-O2):
define i32 @___pskb_trim() {
%1 = tail call i32 (...) @pskb_trim()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glk_put_char(int);
int /*<<< orphan*/ glk_put_string(char *);
void trm_chr(int ch) {
  if (ch == '\t')
    glk_put_string("    ");
  else
    glk_put_char(ch);
}


x86 assembly (clang, -O0):
<trm_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jne    1146 <trm_chr+0x26>
lea    0xec4(%rip),%rdi
call   1040 <glk_put_string@plt>
jmp    114e <trm_chr+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <glk_put_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trm_chr>:
cmp    $0x9,%edi
jne    1131 <trm_chr+0x11>
lea    0xed4(%rip),%rdi
jmp    1040 <glk_put_string@plt>
jmp    1030 <glk_put_char@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @trm_chr(i32 %0) {
%2 = icmp eq i32 %0, 9
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @glk_put_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @glk_put_char(i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
int set_rate(struct clk *clk, unsigned long rate) {
  printk("[ww: %s] rate:%d\n", __func__, rate);
  print_clk_name(clk);
  return 0;
}


x86 assembly (clang, -O0):
<set_rate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xec5(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <print_clk_name@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_rate>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
lea    0xedd(%rip),%rsi
xor    %eax,%eax
call   1030 <printk@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <print_clk_name@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.clk = type opaque
@.str = [18 x i8] c"[ww: %s] rate:%d\0A\00"
@__func__.set_rate = [9 x i8] c"set_rate\00"
define i32 @set_rate(%struct.clk* %0, i64 %1) {
%3 = alloca %struct.clk*
%4 = alloca i64
store %struct.clk* %0, %struct.clk** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i64, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.set_rate, i64 0, i64 0), i64 %5)
%7 = load %struct.clk*, %struct.clk** %3
%8 = call i32 (%struct.clk*, ...) bitcast (i32 (...)* @print_clk_name to i32 (%struct.clk*, ...)*)(%struct.clk* %7)
ret i32 0
}

LLVM IR (-O2):
%struct.clk = type opaque
@.str = [18 x i8] c"[ww: %s] rate:%d\0A\00"
@__func__.set_rate = [9 x i8] c"set_rate\00"
define i32 @set_rate(%struct.clk* %0, i64 %1) {
%3 = tail call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i64, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.set_rate, i64 0, i64 0), i64 %1)
%4 = tail call i32 (%struct.clk*, ...) bitcast (i32 (...)* @print_clk_name to i32 (%struct.clk*, ...)*)(%struct.clk* %0)
ret i32 0
}
char int_to_char(int integerValue) {
  char cardValue = 'P';
  if (integerValue <= 9 && integerValue >= 2) {
    cardValue = 0x30 + integerValue;
  } else {
    switch (integerValue) {
    case 10:
      cardValue = 'T';
      break;
    case 11:
      cardValue = 'J';
      break;
    case 12:
      cardValue = 'Q';
      break;
    case 13:
      cardValue = 'K';
      break;
    case 14:
      cardValue = 'A';
      break;
    }
  }
  return cardValue;
}


x86 assembly (clang, -O0):
<int_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x50,-0x5(%rbp)
cmpl   $0x9,-0x4(%rbp)
jg     112d <int_to_char+0x2d>
cmpl   $0x2,-0x4(%rbp)
jl     112d <int_to_char+0x2d>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
jmp    1183 <int_to_char+0x83>
mov    -0x4(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     117e <int_to_char+0x7e>
mov    -0x10(%rbp),%rax
lea    0xeb3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x5(%rbp)
jmp    117e <int_to_char+0x7e>
movb   $0x4a,-0x5(%rbp)
jmp    117e <int_to_char+0x7e>
movb   $0x51,-0x5(%rbp)
jmp    117e <int_to_char+0x7e>
movb   $0x4b,-0x5(%rbp)
jmp    117e <int_to_char+0x7e>
movb   $0x41,-0x5(%rbp)
jmp    1183 <int_to_char+0x83>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_char>:
lea    -0x2(%rdi),%eax
cmp    $0x7,%eax
ja     110f <int_to_char+0xf>
add    $0x30,%dil
mov    %edi,%eax
ret
add    $0xfffffff6,%edi
mov    $0x50,%al
cmp    $0x4,%edi
ja     112b <int_to_char+0x2b>
shl    $0x3,%edi
movabs $0x414b514a54,%rax
mov    %edi,%ecx
shr    %cl,%rax
ret

LLVM IR (-O0):
define signext i8 @int_to_char(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 80, i8* %3
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 9
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 48, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
br label %21
13: ; preds = %6, %1
%14 = load i32, i32* %2
switch i32 %14, label %20 [
i32 10, label %15
i32 11, label %16
i32 12, label %17
i32 13, label %18
i32 14, label %19
]
15: ; preds = %13
store i8 84, i8* %3
br label %20
16: ; preds = %13
store i8 74, i8* %3
br label %20
17: ; preds = %13
store i8 81, i8* %3
br label %20
18: ; preds = %13
store i8 75, i8* %3
br label %20
19: ; preds = %13
store i8 65, i8* %3
br label %20
20: ; preds = %13, %19, %18, %17, %16, %15
br label %21
21: ; preds = %20, %9
%22 = load i8, i8* %3
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @int_to_char(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = trunc i32 %0 to i8
%6 = add nuw nsw i8 %5, 48
br label %15
7: ; preds = %1
%8 = add i32 %0, -10
%9 = icmp ult i32 %8, 5
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = zext i32 %8 to i40
%12 = shl nuw nsw i40 %11, 3
%13 = lshr i40 280436492884, %12
%14 = trunc i40 %13 to i8
br label %15
15: ; preds = %10, %7, %4
%16 = phi i8 [ %6, %4 ], [ 80, %7 ], [ %14, %10 ]
ret i8 %16
}
int __attribute__((no)) test_00(int a, int b) { return a / b; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @test_00(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void spin_tb(long targettb) {
  while (gettb() - targettb < 0)
    __asm__ __volatile__("" : : : "memory");
}


x86 assembly (clang, -O0):
<spin_tb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gettb@plt>
cltq
sub    -0x8(%rbp),%rax
cmp    $0x0,%rax
jge    1138 <spin_tb+0x28>
jmp    111c <spin_tb+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin_tb>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <gettb@plt>
cltq
cmp    %rbx,%rax
jge    1130 <spin_tb+0x20>
jmp    1120 <spin_tb+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @spin_tb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %9, %1
%4 = call i32 (...) @gettb()
%5 = sext i32 %4 to i64
%6 = load i64, i64* %2
%7 = sub nsw i64 %5, %6
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @spin_tb(i64 %0) {
%2 = tail call i32 (...) @gettb()
%3 = sext i32 %2 to i64
%4 = icmp slt i64 %3, %0
br i1 %4, label %5, label %9
5: ; preds = %1, %5
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%6 = tail call i32 (...) @gettb()
%7 = sext i32 %6 to i64
%8 = icmp slt i64 %7, %0
br i1 %8, label %5, label %9
9: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stack_iterator_impl(void (*)(int *));
void stack_iterator(void (*fn)(int *x)) { stack_iterator_impl(fn); }


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

x86 assembly (clang, -O2):
<stack_iterator>:
jmp    1030 <stack_iterator_impl@plt>

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

LLVM IR (-O2):
define void @stack_iterator(void (i32*)* %0) {
%2 = tail call i32 @stack_iterator_impl(void (i32*)* %0)
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
void *malloc(size_t);
void *default_alloc(size_t size, int zero, void *user_data) {
  return zero ? calloc(1, size) : malloc(size);
}


x86 assembly (clang, -O0):
<default_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1154 <default_alloc+0x34>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
jmp    1161 <default_alloc+0x41>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_alloc>:
mov    %rdi,%rax
test   %esi,%esi
je     1134 <default_alloc+0x14>
mov    $0x1,%edi
mov    %rax,%rsi
jmp    1030 <calloc@plt>
mov    %rax,%rdi
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @default_alloc(i64 %0, i32 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i64, i64* %4
%11 = call i8* @calloc(i32 1, i64 %10)
br label %15
12: ; preds = %3
%13 = load i64, i64* %4
%14 = call i8* @malloc(i64 %13)
br label %15
15: ; preds = %12, %9
%16 = phi i8* [ %11, %9 ], [ %14, %12 ]
ret i8* %16
}

LLVM IR (-O2):
define i8* @default_alloc(i64 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i8* @calloc(i32 1, i64 %0)
br label %9
7: ; preds = %3
%8 = tail call i8* @malloc(i64 %0)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
void bwx_STOP(void) {
  bwx_DEBUG(__FUNCTION__);
  break_mes(0);
}


x86 assembly (clang, -O0):
<bwx_STOP>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <bwx_DEBUG@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <break_mes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwx_STOP>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <break_mes@plt>

LLVM IR (-O0):
@__FUNCTION__.bwx_STOP = [9 x i8] c"bwx_STOP\00"
define void @bwx_STOP() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.bwx_STOP, i64 0, i64 0))
%2 = call i32 (i32, ...) bitcast (i32 (...)* @break_mes to i32 (i32, ...)*)(i32 0)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.bwx_STOP = [9 x i8] c"bwx_STOP\00"
define void @bwx_STOP() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.bwx_STOP, i64 0, i64 0))
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @break_mes to i32 (i32, ...)*)(i32 0)
ret void
}
/* Variables and functions */
int extfunc2();
int extfunc() { return extfunc2(); }


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

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

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

LLVM IR (-O2):
define i32 @extfunc() {
%1 = tail call i32 (...) @extfunc2()
ret i32 %1
}
void VendorRequestsOut(void) {}


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

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

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

LLVM IR (-O2):
define void @VendorRequestsOut() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_basic();
int /*<<< orphan*/ test_char_array();
int /*<<< orphan*/ test_double();
int /*<<< orphan*/ test_many_chars();
int /*<<< orphan*/ test_uint();
int /*<<< orphan*/ test_vec();
int /*<<< orphan*/ test_vec_array();
int main(int argc, char **argv) {
  test_basic();
  test_many_chars();
  test_uint();
  test_char_array();
  test_double();
  test_vec();
  test_vec_array();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1090 <test_basic@plt>
mov    $0x0,%al
call   1030 <test_many_chars@plt>
mov    $0x0,%al
call   1080 <test_uint@plt>
mov    $0x0,%al
call   1050 <test_char_array@plt>
mov    $0x0,%al
call   1060 <test_double@plt>
mov    $0x0,%al
call   1070 <test_vec@plt>
mov    $0x0,%al
call   1040 <test_vec_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <test_basic@plt>
xor    %eax,%eax
call   1030 <test_many_chars@plt>
xor    %eax,%eax
call   1080 <test_uint@plt>
xor    %eax,%eax
call   1050 <test_char_array@plt>
xor    %eax,%eax
call   1060 <test_double@plt>
xor    %eax,%eax
call   1070 <test_vec@plt>
xor    %eax,%eax
call   1040 <test_vec_array@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_basic()
%7 = call i32 (...) @test_many_chars()
%8 = call i32 (...) @test_uint()
%9 = call i32 (...) @test_char_array()
%10 = call i32 (...) @test_double()
%11 = call i32 (...) @test_vec()
%12 = call i32 (...) @test_vec_array()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_basic()
%4 = tail call i32 (...) @test_many_chars()
%5 = tail call i32 (...) @test_uint()
%6 = tail call i32 (...) @test_char_array()
%7 = tail call i32 (...) @test_double()
%8 = tail call i32 (...) @test_vec()
%9 = tail call i32 (...) @test_vec_array()
ret i32 0
}
/* Variables and functions */
char get_cell(int, int);
bool is_color(int i, int j) {
  return (get_cell(i, j) != 'v' && get_cell(i, j) != '^');
}


x86 assembly (clang, -O0):
<is_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <get_cell@plt>
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x76,%ecx
mov    %al,-0x9(%rbp)
je     1151 <is_color+0x41>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <get_cell@plt>
movsbl %al,%eax
cmp    $0x5e,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_color>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <get_cell@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x76,%cl
je     1138 <is_color+0x28>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <get_cell@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x5e,%cl
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_color(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call signext i8 @get_cell(i32 %5, i32 %6)
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 118
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call signext i8 @get_cell(i32 %11, i32 %12)
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 94
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_color(i32 %0, i32 %1) {
%3 = tail call signext i8 @get_cell(i32 %0, i32 %1)
%4 = icmp eq i8 %3, 118
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call signext i8 @get_cell(i32 %0, i32 %1)
%7 = icmp ne i8 %6, 94
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
void gtk_viewport_set_hadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_viewport_set_hadjustment() {
ret void
}
/* Variables and functions */
int rand_cmwc();
void makeRandomStr(unsigned char *buf, int length) {
  int i = 0;
  for (i = 0; i < length; i++)
    buf[i] = (rand_cmwc() % (91 - 65)) + 65;
}


x86 assembly (clang, -O0):
<makeRandomStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <makeRandomStr+0x54>
mov    $0x0,%al
call   1030 <rand_cmwc@plt>
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <makeRandomStr+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeRandomStr>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1166 <makeRandomStr+0x56>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand_cmwc@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x41,%al
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <makeRandomStr+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @makeRandomStr(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = tail call i32 (...) @rand_cmwc()
%9 = srem i32 %8, 26
%10 = trunc i32 %9 to i8
%11 = add nsw i8 %10, 65
%12 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %11, i8* %12
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Type definitions */
struct timespec {
  double tv_sec;
  double tv_nsec;
};

/* Variables and functions */
double timediff(struct timespec start, struct timespec stop) {
  double secs = (stop.tv_sec - start.tv_sec) +
                (stop.tv_nsec - start.tv_nsec) / (double)1000000000.0;
  return secs;
}


x86 assembly (clang, -O0):
<timediff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff>:
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
divsd  0xef0(%rip),%xmm3
addsd  %xmm2,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, double }
define double @timediff(double %0, double %1, double %2, double %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = alloca double
%8 = bitcast %struct.timespec* %5 to { double, double }*
%9 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 0
store double %0, double* %9
%10 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 1
store double %1, double* %10
%11 = bitcast %struct.timespec* %6 to { double, double }*
%12 = getelementptr inbounds { double, double }, { double, double }* %11, i32 0, i32 0
store double %2, double* %12
%13 = getelementptr inbounds { double, double }, { double, double }* %11, i32 0, i32 1
store double %3, double* %13
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%17 = load double, double* %16
%18 = fsub double %15, %17
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%20 = load double, double* %19
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%22 = load double, double* %21
%23 = fsub double %20, %22
%24 = fdiv double %23, 1.000000e+09
%25 = fadd double %18, %24
store double %25, double* %7
%26 = load double, double* %7
ret double %26
}

LLVM IR (-O2):
define double @timediff(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = fsub double %3, %1
%7 = fdiv double %6, 1.000000e+09
%8 = fadd double %5, %7
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ BN_add_word(int /*<<< orphan*/ *, unsigned long);
int /*<<< orphan*/ *BN_dup(int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_sub(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
BIGNUM *calc_phi_n(BIGNUM *n, BIGNUM *p, BIGNUM *q) {
  BIGNUM *phi = BN_dup(n);
  BN_sub(phi, phi, p);
  BN_sub(phi, phi, q);
  BN_add_word(phi, 1UL);
  return phi;
}


x86 assembly (clang, -O0):
<calc_phi_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <BN_dup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <BN_sub@plt>
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <BN_sub@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1040 <BN_add_word@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_phi_n>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1050 <BN_dup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rax,%rsi
mov    %r15,%rdx
call   1030 <BN_sub@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <BN_sub@plt>
mov    $0x1,%esi
mov    %rbx,%rdi
call   1040 <BN_add_word@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32* @calc_phi_n(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32* @BN_dup(i32* %0)
%5 = tail call i32 @BN_sub(i32* %4, i32* %4, i32* %1)
%6 = tail call i32 @BN_sub(i32* %4, i32* %4, i32* %2)
%7 = tail call i32 @BN_add_word(i32* %4, i64 1)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _Q_div(void) {
  printf("Unimplemented %s called, exiting\n", "_Q_div");
  exit(-1);
}


x86 assembly (clang, -O0):
<_Q_div>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_Q_div>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [7 x i8] c"_Q_div\00"
define void @_Q_div() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [7 x i8] c"_Q_div\00"
define void @_Q_div() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
void break_here(void) { *(int *)0 = 0; }


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @break_here() {
store i32 0, i32* null
ret void
}

LLVM IR (-O2):
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
scalar_t__ is_whitespace(int);
int skip_whitespace(FILE *file) {
  int c = getc(file);
  while (is_whitespace(c))
    c = getc(file);
  return c;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <is_whitespace@plt>
cmp    $0x0,%rax
je     115b <skip_whitespace+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
jmp    1138 <skip_whitespace+0x18>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
call   1040 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <is_whitespace@plt>
test   %rax,%rax
je     1148 <skip_whitespace+0x28>
mov    %rbx,%rdi
jmp    1130 <skip_whitespace+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @skip_whitespace(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %3
%8 = call i64 @is_whitespace(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32*, i32** %2
%12 = call i32 @getc(i32* %11)
store i32 %12, i32* %3
br label %6
13: ; preds = %6
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @skip_whitespace(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i64 @is_whitespace(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = tail call i32 @getc(i32* %0)
%7 = tail call i64 @is_whitespace(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %1
%10 = phi i32 [ %2, %1 ], [ %6, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void gui_start() {
  FILE *out;
  out = fopen("./signal_start.dat", "w");
  fclose(out);
}


x86 assembly (clang, -O0):
<gui_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_start>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"./signal_start.dat\00"
@.str.1 = [2 x i8] c"w\00"
define void @gui_start() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"./signal_start.dat\00"
@.str.1 = [2 x i8] c"w\00"
define void @gui_start() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret void
}
void free_double_matrix(double **m, int nrl, int ncl) {
  free((m[nrl] + ncl - 1));
  free((m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_double_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_double_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
mov    (%rdi,%rbx,8),%rax
movslq %edx,%rcx
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%r14,%rbx,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_double_matrix(double** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double*, double** %0, i64 %4
%6 = load double*, double** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %6, i64 %7
%9 = getelementptr inbounds double, double* %8, i64 -1
%10 = bitcast double* %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds double*, double** %5, i64 -1
%12 = bitcast double** %11 to i8*
tail call void @free(i8* %12)
ret void
}
void I_NoAppServicesBeginLobbyJoinListener(void) {}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @vdstmp() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @vdstmp() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char, int /*<<< orphan*/, int /*<<< orphan*/);
void iwritec(char ch) { syscall(0x4943, ch, 0, 0); }


x86 assembly (clang, -O0):
<iwritec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x4943,%edi
xor    %ecx,%ecx
movsbl -0x1(%rbp),%esi
mov    %ecx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iwritec>:
mov    %edi,%esi
mov    $0x4943,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define void @iwritec(i8 signext %0) {
%2 = tail call i32 @syscall(i32 18755, i8 signext %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("10 - 5 - 2 - 1"
         " = %d\n",
         (10 - 5 - 2 - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x2,%esi
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):
@.str = [21 x i8] c"10 - 5 - 2 - 1 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"10 - 5 - 2 - 1 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LONG_MAX;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int hlp_long_max(void) {
  printf("%ld\n", LONG_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<hlp_long_max>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
@LONG_MAX = global i32 0
define i32 @hlp_long_max() {
%1 = load i32, i32* @LONG_MAX
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
@LONG_MAX = global i32 0
define i32 @hlp_long_max() {
%1 = load i32, i32* @LONG_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int f3(int j, short *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movswl (%rsi,%rdx,2),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i16* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i64
store i32 %0, i32* %4
store i16* %1, i16** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i16*, i16** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i16, i16* %8, i64 %9
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i16* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i16, i16* %1, i64 %2
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, %0
ret i32 %7
}
long int yystrlen(const char *yystr) {
  long int yylen;
  for (yylen = 0; yystr[yylen]; yylen++)
    continue;
  return yylen;
}


x86 assembly (clang, -O0):
<yystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <yystrlen+0x38>
jmp    1127 <yystrlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <yystrlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yystrlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <yystrlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @yystrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw nsw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
__attribute__((no, noclone)) void bar(double *x, double *y) {
  asm volatile("" : : "rm"(x), "rm"(y) : "memory");
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %rsi,-0x10(%rsp)
mov    %rdi,-0x8(%rsp)
ret

LLVM IR (-O0):
define void @bar(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
ret void
}

LLVM IR (-O2):
define void @bar(double* %0, double* %1) {
tail call void asm sideeffect "", "rm,rm,~{memory},~{dirflag},~{fpsr},~{flags}"(double* %0, double* %1)
ret void
}
int main(void) {
  union {
    char a[10];
    int i;
  } u;
  int *p = 0;
  *p = 17;
  return 0;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
%union.anon = type { i32, [8 x i8] }
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %3
%4 = load i32*, i32** %3
store i32 17, i32* %4
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ foobar(int);
int main() {
  int a = 10;
  foobar(a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <foobar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foobar(i32 10)
ret i32 0
}