xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strrindex(char *, char *);
int main() {
  char s[] = "Hello, this is a test case. Hello again!";
  char t[] = "Hello";
  printf("%d\n", strrindex(s, t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x29,%edx
call   1050 <memcpy@plt>
mov    0xecf(%rip),%eax
mov    %eax,-0x36(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x32(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x36(%rbp),%rsi
call   1040 <strrindex@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xeee(%rip),%xmm0
movups %xmm0,0x29(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x6f,0xc(%rsp)
movl   $0x6c6c6548,0x8(%rsp)
6c
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <strrindex@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [41 x i8] c"Hello, this is a test case. Hello again!\00"
@__const.main.t = [6 x i8] c"Hello\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [41 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [41 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [41 x i8], [41 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = call i32 @strrindex(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [41 x i8] c"Hello, this is a test case. Hello again!\00"
@__const.main.t = [6 x i8] c"Hello\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [41 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [41 x i8], [41 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @strrindex(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int exists_main(int argc, char *argv[]) {
  struct stat s;
  if (argc < 2)
    return 1;
  if (stat(argv[1], &s)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<exists_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1135 <exists_main+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1163 <exists_main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     115c <exists_main+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <exists_main+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists_main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1136 <exists_main+0x26>
push   %rax
mov    0x8(%rsi),%rdi
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @exists_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %18
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @stat(i8* %13, %struct.stat* %6)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %3
br label %18
17: ; preds = %10
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @exists_main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i64 @stat(i8* %8, %struct.stat* %3)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %2
%13 = phi i32 [ 1, %2 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void test18_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<test18_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @test18_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int hvt_gdb_disable_ss(struct hvt *hvt) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.hvt = type opaque
define i32 @hvt_gdb_disable_ss(%struct.hvt* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void manos_async_watcher_destroy(void *watcher) { free(watcher); }


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

x86 assembly (clang, -O2):
<manos_async_watcher_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @manos_async_watcher_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *);
void sig_call_back(int signal) {
  printf("\n\nUnsaved Data!\nAre you sure you want to quit? (y\\n) ");
  if (getchar() == 'y')
    exit(0);
}


x86 assembly (clang, -O0):
<sig_call_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x79,%eax
jne    1161 <sig_call_back+0x31>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_call_back>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x79,%al
je     114a <sig_call_back+0x1a>
pop    %rax
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"\0A\0AUnsaved Data!\0AAre you sure you want to quit? (y\\n) \00"
define void @sig_call_back(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 121
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"\0A\0AUnsaved Data!\0AAre you sure you want to quit? (y\\n) \00"
define void @sig_call_back(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 121
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 get_cia_sample_point(__u32 bitrate) {
  __u32 sampl_pt;
  if (bitrate > 800000)
    sampl_pt = 750;
  else if (bitrate > 500000)
    sampl_pt = 800;
  else
    sampl_pt = 875;
  return sampl_pt;
}


x86 assembly (clang, -O0):
<get_cia_sample_point>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xc3500,-0x4(%rbp)
jle    1120 <get_cia_sample_point+0x20>
movl   $0x2ee,-0x8(%rbp)
jmp    1145 <get_cia_sample_point+0x45>
cmpl   $0x7a120,-0x4(%rbp)
jle    1139 <get_cia_sample_point+0x39>
movl   $0x320,-0x8(%rbp)
jmp    1140 <get_cia_sample_point+0x40>
movl   $0x36b,-0x8(%rbp)
jmp    1145 <get_cia_sample_point+0x45>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cia_sample_point>:
cmp    $0x7a121,%edi
mov    $0x320,%eax
mov    $0x36b,%ecx
cmovge %eax,%ecx
cmp    $0xc3501,%edi
mov    $0x2ee,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_cia_sample_point(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 800000
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 750, i32* %3
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 500000
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 800, i32* %3
br label %12
11: ; preds = %7
store i32 875, i32* %3
br label %12
12: ; preds = %11, %10
br label %13
13: ; preds = %12, %6
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_cia_sample_point(i32 %0) {
%2 = icmp sgt i32 %0, 800000
%3 = icmp sgt i32 %0, 500000
%4 = select i1 %3, i32 800, i32 875
%5 = select i1 %2, i32 750, i32 %4
ret i32 %5
}
int comp(const void *lookfor, const void *v) {
  int key = *((int *)lookfor);
  int current = *((int *)v);
  if (key < current)
    return -1;
  if (key > current)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <comp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <comp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <comp+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <comp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int countRangeSum(int *, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main() {
  int32_t nums[] = {0, -3, -3, 1, 1, 2};
  printf("%d", countRangeSum(nums, 6, 3, 5));
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1050 <countRangeSum@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xed5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1050 <countRangeSum@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [6 x i32] [i32 0, i32 -3, i32 -3, i32 1, i32 1, i32 2]
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @countRangeSum(i32* %3, i32 6, i32 3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
void sd_xfer_block_hw() {
  (*(volatile uint8_t *)(void *)(0xfffee400)) = 0x40 | 7;
  do {
  } while (!(!(((*(volatile uint8_t *)(void *)(0xfffee400))) & (1U << (6)))));
}


x86 assembly (clang, -O0):
<sd_xfer_block_hw>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffee400,%eax
movl   $0x47,(%rax)
jmp    1114 <sd_xfer_block_hw+0x14>
mov    $0xfffee400,%eax
mov    (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
test   $0x1,%al
jne    110f <sd_xfer_block_hw+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_xfer_block_hw>:
mov    $0xfffee400,%eax
movl   $0x47,(%rax)
nopl   0x0(%rax,%rax,1)
testl  $0x40,(%rax)
jne    1110 <sd_xfer_block_hw+0x10>
ret

LLVM IR (-O0):
define void @sd_xfer_block_hw() {
store volatile i32 71, i32* inttoptr (i64 4294894592 to i32*)
br label %1
1: ; preds = %2, %0
br label %2
2: ; preds = %1
%3 = load volatile i32, i32* inttoptr (i64 4294894592 to i32*)
%4 = and i32 %3, 64
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
br i1 %7, label %1, label %8
8: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @sd_xfer_block_hw() {
store volatile i32 71, i32* inttoptr (i64 4294894592 to i32*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 4294894592 to i32*)
%3 = and i32 %2, 64
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
int main(void) {
  unsigned int a;
  unsigned long long b;
  a = b + a;
  return a;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = load i64, i64* %3
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = add i64 %4, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xmaprequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmaprequest_type(void *_p) {
  return (int)((XEvent *)_p)->xmaprequest.type;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xmaprequest_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xmaprequest_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xmaprequest_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void motd() {
  printf("gercomm v0.1 - CL manager for DFRobotShop Rover V2 control\nType "
         "help to view the documentation.\n");
}


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

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

LLVM IR (-O0):
@.str = [97 x i8] c"gercomm v0.1 - CL manager for DFRobotShop Rover V2 control\0AType help to view the documentation.\0A\00"
define void @motd() {
%1 = call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [96 x i8] c"gercomm v0.1 - CL manager for DFRobotShop Rover V2 control\0AType help to view the documentation.\00"
define void @motd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eset(int);
int strlen(char *);
int Mstrlen(int nargs, int *argsv) {
  if (nargs < 1) {
    eset(21);
    return -1;
  }
  char *s = (char *)argsv[0];
  return strlen(s);
}


x86 assembly (clang, -O0):
<Mstrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    114f <Mstrlen+0x2f>
mov    $0x15,%edi
call   1030 <eset@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <Mstrlen+0x46>
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mstrlen>:
push   %rax
test   %edi,%edi
jle    112e <Mstrlen+0xe>
movslq (%rsi),%rdi
pop    %rax
jmp    1040 <strlen@plt>
mov    $0x15,%edi
call   1030 <eset@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Mstrlen(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @eset(i32 21)
br label %11
6: ; preds = %2
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @strlen(i8* %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ -1, %4 ], [ %10, %6 ]
ret i32 %12
}
void dummy_function_for_xcode_to_create_a_library() {}


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

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

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

LLVM IR (-O2):
define void @dummy_function_for_xcode_to_create_a_library() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
void _exit_error(int line, char *msg) {
  fprintf(stderr, "[ERROR line %3d] %s\n", line, msg);
  _exit(1);
}


x86 assembly (clang, -O0):
<_exit_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_exit_error>:
push   %rax
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"[ERROR line %3d] %s\0A\00"
define void @_exit_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"[ERROR line %3d] %s\0A\00"
define void @_exit_error(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%5 = tail call i32 @_exit(i32 1)
unreachable
}
/* Type definitions */
struct position {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *net_attacks(struct position *);
int /*<<< orphan*/ print_squares(char *);
void print_net_attacks(struct position *pos) {
  char *squares = net_attacks(pos);
  print_squares(squares);
  free(squares);
}


x86 assembly (clang, -O0):
<print_net_attacks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <net_attacks@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <print_squares@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_net_attacks>:
push   %rbx
call   1040 <net_attacks@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <print_squares@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.position = type { i32 }
define void @print_net_attacks(%struct.position* %0) {
%2 = alloca %struct.position*
%3 = alloca i8*
store %struct.position* %0, %struct.position** %2
%4 = load %struct.position*, %struct.position** %2
%5 = call i8* @net_attacks(%struct.position* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @print_squares(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
%struct.position = type { i32 }
define void @print_net_attacks(%struct.position* %0) {
%2 = tail call i8* @net_attacks(%struct.position* %0)
%3 = tail call i32 @print_squares(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int strncpy(char *dest, char *src, int n) {
  while (n-- && (*dest++ = *src++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
je     1156 <strncpy+0x56>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1166 <strncpy+0x66>
jmp    116b <strncpy+0x6b>
jmp    110f <strncpy+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %edx,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %ecx,%eax
je     1123 <strncpy+0x23>
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rdi,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i32 @strncpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %13, %9 ]
%6 = phi i8* [ %1, %3 ], [ %11, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = add nsw i32 %7, -1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %6
%13 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %12, i8* %5
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %9
ret i32 undef
}
/* Variables and functions */
char *strchr(char *, char);
char *get_pointer_to_arg(char *start, int arg) {
  for (int i = 0; i < arg; ++i) {
    if (i != arg) {
      start = strchr(start, ' ') + 1;
    }
  }
  return start;
}


x86 assembly (clang, -O0):
<get_pointer_to_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <get_pointer_to_arg+0x57>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1154 <get_pointer_to_arg+0x44>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <get_pointer_to_arg+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <get_pointer_to_arg+0x16>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pointer_to_arg>:
push   %rbx
mov    %rdi,%rax
test   %esi,%esi
jle    1136 <get_pointer_to_arg+0x26>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
add    $0xffffffff,%ebx
jne    1120 <get_pointer_to_arg+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_pointer_to_arg(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
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 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = call i8* @strchr(i8* %15, i8 signext 32)
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8* %17, i8** %3
br label %18
18: ; preds = %14, %10
br label %19
19: ; preds = %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @get_pointer_to_arg(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = phi i8* [ %0, %2 ], [ %10, %6 ]
ret i8* %5
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ 0, %2 ]
%8 = phi i8* [ %10, %6 ], [ %0, %2 ]
%9 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 32)
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %4, label %6
}
/* Variables and functions */
int error(int, char *);
int b_hashstat(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<b_hashstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1142 <b_hashstat+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1149 <b_hashstat+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_hashstat>:
cmp    $0x2,%edi
jl     1122 <b_hashstat+0x12>
mov    (%rsi),%rsi
mov    $0x1,%edi
jmp    1030 <error@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @b_hashstat(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @error(i32 1, i8* %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int funcd80c() {
  printf("funcd80c is called!\n");
  return 0x283ab4dd;
}


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

x86 assembly (clang, -O2):
<funcd80c>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x283ab4dd,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"funcd80c is called!\0A\00"
define i32 @funcd80c() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 674936029
}

LLVM IR (-O2):
@str = [20 x i8] c"funcd80c is called!\00"
define i32 @funcd80c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 674936029
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
void *list_extract(struct list *, int /*<<< orphan*/);
void *list_pop(struct list *list) { return list_extract(list, 0); }


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

x86 assembly (clang, -O2):
<list_pop>:
xor    %esi,%esi
jmp    1030 <list_extract@plt>

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

LLVM IR (-O2):
%struct.list = type { i32 }
define i8* @list_pop(%struct.list* %0) {
%2 = tail call i8* @list_extract(%struct.list* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_private() {
  int i;
#pragma omp parallel sections private(
  { foo(); }
#pragma omp parallel sections private(,
  { foo(); }
#pragma omp parallel sections private(, )
  { foo(); }
#pragma omp parallel sections private()
  { foo(); }
#pragma omp parallel sections private(int)
  { foo(); }
#pragma omp parallel sections private(0)
  { foo(); }
  int x, y, z;
#pragma omp parallel sections private(x)
  { foo(); }
#pragma omp parallel sections private(x, y)
  { foo(); }
#pragma omp parallel sections private(x, y, z)
  { foo(); }
}


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

x86 assembly (clang, -O2):
<test_private>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test_private() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @foo()
%6 = call i32 (...) @foo()
%7 = call i32 (...) @foo()
%8 = call i32 (...) @foo()
%9 = call i32 (...) @foo()
%10 = call i32 (...) @foo()
%11 = call i32 (...) @foo()
%12 = call i32 (...) @foo()
%13 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @test_private() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @foo()
%8 = tail call i32 (...) @foo()
%9 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Content-Type: text/plain;charset=us-ascii\n\n");
  printf("Hello World");
  int i = 0;
  for (i = 0; i < 2000000000; i++) {
    printf("Hello World");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x77359400,-0x8(%rbp)
jge    116c <main+0x5c>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <main+0x35>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x77359400,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Content-Type: text/plain;charset=us-ascii\0A\0A\00"
@.str.1 = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
store i32 0, i32* %2
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 2000000000
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %5
13: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"Hello World\00"
@str = [43 x i8] c"Content-Type: text/plain;charset=us-ascii\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 2000000000
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
/* Type definitions */
struct bst_table {
  int dummy;
};

/* Variables and functions */
void **bst_probe(struct bst_table *, void *);
void *bst_insert(struct bst_table *table, void *item) {
  void **p = bst_probe(table, item);
  return p == NULL || *p == item ? NULL : *p;
}


x86 assembly (clang, -O0):
<bst_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <bst_probe@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114d <bst_insert+0x3d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    1158 <bst_insert+0x48>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1163 <bst_insert+0x53>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bst_insert>:
push   %rbx
mov    %rsi,%rbx
call   1030 <bst_probe@plt>
test   %rax,%rax
je     112c <bst_insert+0x1c>
mov    (%rax),%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
cmovne %rcx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.bst_table = type { i32 }
define i8* @bst_insert(%struct.bst_table* %0, i8* %1) {
%3 = alloca %struct.bst_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.bst_table* %0, %struct.bst_table** %3
store i8* %1, i8** %4
%6 = load %struct.bst_table*, %struct.bst_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @bst_probe(%struct.bst_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp eq i8** %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %11, %2
br label %20
17: ; preds = %11
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
br label %20
20: ; preds = %17, %16
%21 = phi i8* [ null, %16 ], [ %19, %17 ]
ret i8* %21
}

LLVM IR (-O2):
%struct.bst_table = type { i32 }
define i8* @bst_insert(%struct.bst_table* %0, i8* %1) {
%3 = tail call i8** @bst_probe(%struct.bst_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = select i1 %7, i8* null, i8* %6
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ null, %2 ], [ %8, %5 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void cm_error_log_warning(const char *function, const char *message) {
  fprintf(stderr, "%s %s", function, message);
}


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

x86 assembly (clang, -O2):
<cm_error_log_warning>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s %s\00"
define void @cm_error_log_warning(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int lookup_rec(struct node *heads[], char arr[]) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.node = type opaque
define i32 @lookup_rec(%struct.node** nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isgraph(char);
int is_word_end(char c) { return c == '\0' || !isgraph(c); }


x86 assembly (clang, -O0):
<is_word_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     1144 <is_word_end+0x34>
movsbl -0x1(%rbp),%edi
call   1030 <isgraph@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_word_end>:
test   %dil,%dil
je     112d <is_word_end+0x1d>
push   %rax
movsbl %dil,%edi
call   1030 <isgraph@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_word_end(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @isgraph(i8 signext %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_word_end(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @isgraph(i8 signext %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
float tanf(float);
float gb_tan(float radians) { return tanf(radians); }


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

x86 assembly (clang, -O2):
<gb_tan>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define float @gb_tan(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n, aux = 0, i = 0;
  scanf("%d", &n);
  do {
    aux = aux + i;
    i++;
  } while (i <= n);
  printf("%d", aux);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    114d <main+0x2d>
mov    -0xc(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
xor    %ecx,%ecx
test   %eax,%eax
cmovle %ecx,%eax
lea    -0x1(%rax),%esi
imul   %rax,%rsi
shr    %rsi
add    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @llvm.smax.i32(i32 %4, i32 0)
%6 = zext i32 %5 to i33
%7 = add nsw i32 %5, -1
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}
void *f3() {
  int *ptr = malloc(100 * sizeof(int));
  return ptr;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x190,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    $0x190,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @f3() {
%1 = alloca i32*
%2 = call i8* @malloc(i64 400)
%3 = bitcast i8* %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = bitcast i32* %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @f3() {
%1 = tail call dereferenceable_or_null(400) i8* @malloc(i64 400)
ret i8* %1
}