xunge/DecIR huggingface dataset:
int main(int argc, char **argv) {
  int a[8];
  for (int i = 0; i < 8; i++)
    a[i] = 2 * i + 1;
  int *p = &a[0];
  __builtin_printf("%d\n", a[argc]);
  return *(++p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    1156 <main+0x46>
mov    -0x34(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    112d <main+0x1d>
lea    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x40(%rbp)
mov    0x4(%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movslq %edi,%rax
mov    (%rsp,%rax,4),%esi
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = bitcast [8 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 1, i32 3, i32 5, i32 7>, <4 x i32>* %5
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 9, i32 11, i32 13, i32 15>, <4 x i32>* %7
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ _response(char const *);
void _stat_success_150(void) {
  const char msg[] = "150 File status okay; about to open data connection.\r\n";
  _response(msg);
}


x86 assembly (clang, -O0):
<_stat_success_150>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x37,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <_response@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stat_success_150>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa0d2e6e6f6974,%rax
mov    %rax,0x2f(%rsp)
mov    %rsp,%rdi
call   1030 <_response@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const._stat_success_150.msg = [55 x i8] c"150 File status okay; about to open data connection.\0D\0A\00"
define void @_stat_success_150() {
%1 = alloca [55 x i8]
%2 = bitcast [55 x i8]* %1 to i8*
%3 = getelementptr inbounds [55 x i8], [55 x i8]* %1, i64 0, i64 0
%4 = call i32 @_response(i8* %3)
ret void
}

LLVM IR (-O2):
@__const._stat_success_150.msg = [55 x i8] c"150 File status okay; about to open data connection.\0D\0A\00"
define void @_stat_success_150() {
%1 = alloca [55 x i8]
%2 = getelementptr inbounds [55 x i8], [55 x i8]* %1, i64 0, i64 0
%3 = call i32 @_response(i8* %2)
ret void
}
/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_unsigned_short(unsigned short const k1,
                                                unsigned short const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_LESS_THAN_unsigned_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_unsigned_short>:
xor    %eax,%eax
cmp    %si,%di
setb   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_unsigned_short(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_unsigned_short(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp ult i16 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int fitsBits(int number, int word) {
  const int temp = sizeof(int) * 8 + 1 + ~word;
  int ans = !(((number << temp) >> temp) ^ number);
  return ans;
}


x86 assembly (clang, -O0):
<fitsBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
cltq
add    $0x21,%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitsBits>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%edx
shl    %cl,%edx
sar    %cl,%edx
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %4, %3
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
short f1_wh(short x) {
  while (--x)
    if (x <= 0)
      return 100;
  return 200;
}


x86 assembly (clang, -O0):
<f1_wh>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x4(%rbp)
cmp    $0x0,%ax
je     113e <f1_wh+0x3e>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jg     1139 <f1_wh+0x39>
movw   $0x64,-0x2(%rbp)
jmp    1144 <f1_wh+0x44>
jmp    110b <f1_wh+0xb>
movw   $0xc8,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1_wh>:
lea    -0x1(%rdi),%eax
xor    %ecx,%ecx
test   %ax,%ax
cmovs  %eax,%ecx
neg    %ecx
add    %edi,%ecx
add    $0xffffffff,%ecx
cmp    %ax,%cx
cmovb  %ecx,%eax
cmp    $0x20,%ax
jb     1150 <f1_wh+0x50>
movzwl %ax,%eax
lea    0x1(%rax),%ecx
mov    %ecx,%edx
and    $0x1f,%edx
mov    $0x20,%esi
cmovne %edx,%esi
not    %eax
add    %esi,%eax
sub    %ecx,%esi
add    %edi,%esi
mov    %esi,%edi
nopl   0x0(%rax,%rax,1)
add    $0x20,%eax
jne    1140 <f1_wh+0x40>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x1,%di
je     1163 <f1_wh+0x63>
add    $0xffffffff,%edi
test   %di,%di
jg     1150 <f1_wh+0x50>
mov    $0x64,%ax
ret
mov    $0xc8,%ax
ret

LLVM IR (-O0):
define signext i16 @f1_wh(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
br label %4
4: ; preds = %13, %1
%5 = load i16, i16* %3
%6 = add i16 %5, -1
store i16 %6, i16* %3
%7 = icmp ne i16 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i16 100, i16* %2
br label %15
13: ; preds = %8
br label %4
14: ; preds = %4
store i16 200, i16* %2
br label %15
15: ; preds = %14, %12
%16 = load i16, i16* %2
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @f1_wh(i16 signext %0) {
%2 = add i16 %0, -1
%3 = call i16 @llvm.smin.i16(i16 %2, i16 0)
%4 = sub i16 %2, %3
%5 = call i16 @llvm.umin.i16(i16 %4, i16 %2)
%6 = zext i16 %5 to i32
%7 = add nuw nsw i32 %6, 1
%8 = icmp ult i16 %5, 32
br i1 %8, label %20, label %9
9: ; preds = %1
%10 = and i32 %7, 31
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 32, i32 %10
%13 = sub nsw i32 %7, %12
%14 = trunc i32 %13 to i16
%15 = sub i16 %0, %14
br label %16
16: ; preds = %16, %9
%17 = phi i32 [ 0, %9 ], [ %18, %16 ]
%18 = add nuw i32 %17, 32
%19 = icmp eq i32 %18, %13
br i1 %19, label %20, label %16
20: ; preds = %16, %1
%21 = phi i16 [ %0, %1 ], [ %15, %16 ]
br label %22
22: ; preds = %20, %26
%23 = phi i16 [ %24, %26 ], [ %21, %20 ]
%24 = add i16 %23, -1
%25 = icmp eq i16 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = icmp slt i16 %24, 1
br i1 %27, label %28, label %22
28: ; preds = %22, %26
%29 = phi i16 [ 100, %26 ], [ 200, %22 ]
ret i16 %29
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo4(unsigned char c) {
  if (c & 0x80)
    bar();
}


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1137 <foo4+0x27>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
test   %dil,%dil
js     1116 <foo4+0x6>
ret
xor    %eax,%eax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo4(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @bar()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @foo4(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void EndFunction(void) { fputs("@end defop\n\n", stdout); }


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

x86 assembly (clang, -O2):
<EndFunction>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"@end defop\0A\0A\00"
@stdout = global i32 0
define void @EndFunction() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"@end defop\0A\0A\00"
@stdout = global i32 0
define void @EndFunction() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int get_time() {
  int val;
  struct timeval t;
  gettimeofday(&t, 0);
  val = t.tv_sec;
  return val;
}


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

x86 assembly (clang, -O2):
<get_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @get_time() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
int virtual_machine_object_environment_entrance_print(
    const struct virtual_machine_object *object) {
  (void)object;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.virtual_machine_object = type opaque
define i32 @virtual_machine_object_environment_entrance_print(%struct.virtual_machine_object* %0) {
%2 = alloca %struct.virtual_machine_object*
store %struct.virtual_machine_object* %0, %struct.virtual_machine_object** %2
%3 = load %struct.virtual_machine_object*, %struct.virtual_machine_object** %2
ret i32 0
}

LLVM IR (-O2):
%struct.virtual_machine_object = type opaque
define i32 @virtual_machine_object_environment_entrance_print(%struct.virtual_machine_object* nocapture readnone %0) {
ret i32 0
}
void init_starts(double step, double *starts) {
  int i;
  for (i = 0; i < 8; i++) {
    starts[i] = step * i;
  }
}


x86 assembly (clang, -O0):
<init_starts>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1147 <init_starts+0x47>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <init_starts+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_starts>:
xorpd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,0x8(%rdi)
unpcklpd %xmm0,%xmm0
movapd 0xee3(%rip),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x10(%rdi)
movapd 0xee2(%rip),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x20(%rdi)
mulpd  0xee1(%rip),%xmm0
movupd %xmm0,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @init_starts(double %0, double* nocapture writeonly %1) {
%3 = fmul double %0, 0.000000e+00
store double %3, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
store double %0, double* %4
%5 = getelementptr inbounds double, double* %1, i64 2
%6 = insertelement <2 x double> poison, double %0, i64 0
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
%8 = fmul <2 x double> %7, <double 2.000000e+00, double 3.000000e+00>
%9 = bitcast double* %5 to <2 x double>*
store <2 x double> %8, <2 x double>* %9
%10 = getelementptr inbounds double, double* %1, i64 4
%11 = fmul <2 x double> %7, <double 4.000000e+00, double 5.000000e+00>
%12 = bitcast double* %10 to <2 x double>*
store <2 x double> %11, <2 x double>* %12
%13 = getelementptr inbounds double, double* %1, i64 6
%14 = fmul <2 x double> %7, <double 6.000000e+00, double 7.000000e+00>
%15 = bitcast double* %13 to <2 x double>*
store <2 x double> %14, <2 x double>* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_delete();
int /*<<< orphan*/ test_random();
int /*<<< orphan*/ test_tail();
int main(int argc, char *argv[]) {
  test_tail();
  test_random();
  test_delete();
  printf("-----------------\n");
  printf("All Tests Passed!\n");
  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   1040 <test_tail@plt>
mov    $0x0,%al
call   1030 <test_random@plt>
mov    $0x0,%al
call   1060 <test_delete@plt>
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_tail@plt>
xor    %eax,%eax
call   1030 <test_random@plt>
xor    %eax,%eax
call   1060 <test_delete@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"-----------------\0A\00"
@.str.1 = [19 x i8] c"All Tests Passed!\0A\00"
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_tail()
%7 = call i32 (...) @test_random()
%8 = call i32 (...) @test_delete()
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"-----------------\00"
@str.2 = [18 x i8] c"All Tests Passed!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_tail()
%4 = tail call i32 (...) @test_random()
%5 = tail call i32 (...) @test_delete()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_setrobust(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ pthread_mutexattr_settype(int /*<<< orphan*/ *, int);
int mutex_init(pthread_mutex_t *mutex, int flags, int robust) {
  pthread_mutexattr_t mattr;
  pthread_mutexattr_init(&mattr);
  pthread_mutexattr_settype(&mattr, flags);
  pthread_mutexattr_setrobust(&mattr, robust);
  return pthread_mutex_init(mutex, &mattr);
}


x86 assembly (clang, -O0):
<mutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <pthread_mutexattr_init@plt>
mov    -0xc(%rbp),%esi
lea    -0x14(%rbp),%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    -0x10(%rbp),%esi
lea    -0x14(%rbp),%rdi
call   1040 <pthread_mutexattr_setrobust@plt>
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <pthread_mutex_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_init>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <pthread_mutexattr_init@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <pthread_mutexattr_settype@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <pthread_mutexattr_setrobust@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <pthread_mutex_init@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mutex_init(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 = call i32 @pthread_mutexattr_init(i32* %7)
%9 = load i32, i32* %5
%10 = call i32 @pthread_mutexattr_settype(i32* %7, i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @pthread_mutexattr_setrobust(i32* %7, i32 %11)
%13 = load i32*, i32** %4
%14 = call i32 @pthread_mutex_init(i32* %13, i32* %7)
ret i32 %14
}

LLVM IR (-O2):
define i32 @mutex_init(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @pthread_mutexattr_init(i32* %4)
%7 = call i32 @pthread_mutexattr_settype(i32* %4, i32 %1)
%8 = call i32 @pthread_mutexattr_setrobust(i32* %4, i32 %2)
%9 = call i32 @pthread_mutex_init(i32* %0, i32* %4)
ret i32 %9
}
_Bool QuietEqual(double f1, double f2) { return f1 == f2; }


x86 assembly (clang, -O0):
<QuietEqual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuietEqual>:
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define zeroext i1 @QuietEqual(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
%7 = fcmp oeq double %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @QuietEqual(double %0, double %1) {
%3 = fcmp oeq double %0, %1
ret i1 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ stdout;
void reads(char *buffer) {
  fflush(stdout);
  gets(buffer);
}


x86 assembly (clang, -O0):
<reads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <gets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reads>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <gets@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @reads(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i8*, i8** %2
%6 = call i32 @gets(i8* %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @reads(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @gets(i8* %0)
ret void
}
/* Variables and functions */
bool nrf51_errata_26(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf51_errata_26() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf51_errata_26() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int read(int fd, void *buf, int n) {
  printk("Write read()\n");
  return 0;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Write read()\0A\00"
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @printk(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Write read()\0A\00"
define i32 @read(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @printk(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned short VirtToPhysOff(void *ptr) { return ((unsigned long)ptr) & 0x0f; }


x86 assembly (clang, -O0):
<VirtToPhysOff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf,%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VirtToPhysOff>:
mov    %rdi,%rax
and    $0xf,%eax
ret

LLVM IR (-O0):
define zeroext i16 @VirtToPhysOff(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 15
%6 = trunc i64 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @VirtToPhysOff(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i16
%4 = and i16 %3, 15
ret i16 %4
}
void sub2(void) {}


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

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

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

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

/* Variables and functions */
int do_write(struct sdcore *, unsigned int, struct sdiov *, int);
int sdwritev(struct sdcore *sd, unsigned int sector, struct sdiov *iov,
             int niov) {
  return do_write(sd, sector, iov, niov);
}


x86 assembly (clang, -O0):
<sdwritev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <do_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdwritev>:
jmp    1030 <do_write@plt>

LLVM IR (-O0):
%struct.sdcore = type { i32 }
%struct.sdiov = type { i32 }
define i32 @sdwritev(%struct.sdcore* %0, i32 %1, %struct.sdiov* %2, i32 %3) {
%5 = alloca %struct.sdcore*
%6 = alloca i32
%7 = alloca %struct.sdiov*
%8 = alloca i32
store %struct.sdcore* %0, %struct.sdcore** %5
store i32 %1, i32* %6
store %struct.sdiov* %2, %struct.sdiov** %7
store i32 %3, i32* %8
%9 = load %struct.sdcore*, %struct.sdcore** %5
%10 = load i32, i32* %6
%11 = load %struct.sdiov*, %struct.sdiov** %7
%12 = load i32, i32* %8
%13 = call i32 @do_write(%struct.sdcore* %9, i32 %10, %struct.sdiov* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.sdcore = type { i32 }
%struct.sdiov = type { i32 }
define i32 @sdwritev(%struct.sdcore* %0, i32 %1, %struct.sdiov* %2, i32 %3) {
%5 = tail call i32 @do_write(%struct.sdcore* %0, i32 %1, %struct.sdiov* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_time() {
  time_t ltime;
  time(&ltime);
  return ctime(&ltime);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_time() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call i8* @ctime(i32* %1)
ret i8* %3
}

LLVM IR (-O2):
define i8* @get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i8* @ctime(i32* %1)
ret i8* %4
}
void rop3_235_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_235_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_235_1_1>:
mov    %esi,%eax
xor    %dl,%al
not    %al
mov    (%rdi),%cl
or     %cl,%al
or     %sil,%dl
not    %dl
and    %al,%dl
or     %cl,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_235_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_235_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, %2
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = or i8 %2, %1
%9 = xor i8 %8, -1
%10 = and i8 %7, %9
%11 = or i8 %6, %10
store i8 %11, i8* %0
ret void
}
char *parse_bencode_integer(char *be_str) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @parse_bencode_integer(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
bool nrf52_errata_107(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_107() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_107() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ sum_from_fileptr(int /*<<< orphan*/ *);
int64_t sum_from_filename(char *filename) {
  FILE *fp = fopen(filename, "r");
  int64_t sum = sum_from_fileptr(fp);
  fclose(fp);
  return sum;
}


x86 assembly (clang, -O0):
<sum_from_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sum_from_fileptr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_from_filename>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <sum_from_fileptr@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @sum_from_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @sum_from_fileptr(i32* %7)
store i32 %8, i32* %4
%9 = load i32*, i32** %3
%10 = call i32 @fclose(i32* %9)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @sum_from_filename(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sum_from_fileptr(i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret i32 %3
}
int security_msg_queue_msgrcv(struct msg_queue *msq, struct msg_msg *msg,
                              struct task_struct *target, long type, int mode) {
  return 0;
}


x86 assembly (clang, -O0):
<security_msg_queue_msgrcv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.msg_queue = type opaque
%struct.msg_msg = type opaque
%struct.task_struct = type opaque
define i32 @security_msg_queue_msgrcv(%struct.msg_queue* %0, %struct.msg_msg* %1, %struct.task_struct* %2, i64 %3, i32 %4) {
%6 = alloca %struct.msg_queue*
%7 = alloca %struct.msg_msg*
%8 = alloca %struct.task_struct*
%9 = alloca i64
%10 = alloca i32
store %struct.msg_queue* %0, %struct.msg_queue** %6
store %struct.msg_msg* %1, %struct.msg_msg** %7
store %struct.task_struct* %2, %struct.task_struct** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.msg_queue = type opaque
%struct.msg_msg = type opaque
%struct.task_struct = type opaque
define i32 @security_msg_queue_msgrcv(%struct.msg_queue* nocapture readnone %0, %struct.msg_msg* nocapture readnone %1, %struct.task_struct* nocapture readnone %2, i64 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int __builtin_arm_mrc2(int, int /*<<< orphan*/, int, int /*<<< orphan*/, int);
unsigned mrc2() { return __builtin_arm_mrc2(15, 0, 13, 0, 3); }


x86 assembly (clang, -O0):
<mrc2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
xor    %ecx,%ecx
mov    $0xd,%edx
mov    $0x3,%r8d
mov    %ecx,%esi
call   1030 <__builtin_arm_mrc2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrc2>:
mov    $0xf,%edi
xor    %esi,%esi
mov    $0xd,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
jmp    1030 <__builtin_arm_mrc2@plt>

LLVM IR (-O0):
define i32 @mrc2() {
%1 = call i32 @__builtin_arm_mrc2(i32 15, i32 0, i32 13, i32 0, i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mrc2() {
%1 = tail call i32 @__builtin_arm_mrc2(i32 15, i32 0, i32 13, i32 0, i32 3)
ret i32 %1
}
int main() {
  int i = 2;
  printf("%d\n", (int *)i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movslq -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
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
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* inttoptr (i64 2 to i32*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dirinit(char *);
int opt(int, char **);
int /*<<< orphan*/ show_usage();
int main(int argc, char **argv) {
  dirinit(".xe");
  if (argc < 2) {
    show_usage();
    return 0x80000001;
  }
  return opt(argc, argv);
}


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)
lea    0xeb3(%rip),%rdi
call   1040 <dirinit@plt>
cmpl   $0x2,-0x8(%rbp)
jge    116f <main+0x3f>
mov    $0x0,%al
call   1030 <show_usage@plt>
movl   $0x80000001,-0x4(%rbp)
jmp    117e <main+0x4e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <opt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1040 <dirinit@plt>
cmp    $0x1,%ebp
jg     115c <main+0x2c>
xor    %eax,%eax
call   1030 <show_usage@plt>
mov    $0x80000001,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <opt@plt>

LLVM IR (-O0):
@.str = [4 x i8] c".xe\00"
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 @dirinit(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @show_usage()
store i32 -2147483647, i32* %3
br label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @opt(i32 %12, i8** %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c".xe\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @dirinit(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @show_usage()
br label %9
7: ; preds = %2
%8 = tail call i32 @opt(i32 %0, i8** %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -2147483647, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int strncmp(char *, char *, int);
int stringComp(char *a1, char *a2) { return strncmp(a1, a2, 26); }


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

x86 assembly (clang, -O2):
<stringComp>:
mov    $0x1a,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @stringComp(i8* %0, i8* %1) {
%3 = tail call i32 @strncmp(i8* %0, i8* %1, i32 26)
ret i32 %3
}
__attribute__((no)) void g(unsigned long long a, unsigned long long b) {
  asm("");
  if (a != b)
    abort();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1133 <g+0x23>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cmp    %rsi,%rdi
jne    1116 <g+0x6>
ret
push   %rax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @g(i64 %0, i64 %1) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i64 %0, %1
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void @abort()
unreachable
5: ; preds = %2
ret void
}
int su_platform_init() { return 0; }


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

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

LLVM IR (-O0):
define i32 @su_platform_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @su_platform_init() {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int PrintHelloC() {
  printf("Hello, C!\n");
  return (EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Hello, C!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @PrintHelloC() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [10 x i8] c"Hello, C!\00"
define i32 @PrintHelloC() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void NetLogWriteHeader(int sockfd, int flags) {
  static const char ulm_hdr[] = "ULM\0    ";
  write(sockfd, ulm_hdr, 8);
}


x86 assembly (clang, -O0):
<NetLogWriteHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    0xed8(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NetLogWriteHeader>:
lea    0xee9(%rip),%rsi
mov    $0x8,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@NetLogWriteHeader.ulm_hdr = internal constant [9 x i8] c"ULM\00 \00"
define void @NetLogWriteHeader(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 = call i32 @write(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @NetLogWriteHeader.ulm_hdr, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@NetLogWriteHeader.ulm_hdr = internal constant [9 x i8] c"ULM\00 \00"
define void @NetLogWriteHeader(i32 %0, i32 %1) {
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @NetLogWriteHeader.ulm_hdr, i64 0, i64 0), i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skipComments(FILE *fp) {
  int c;
  while ((c = fgetc(fp)) == '#')
    while ((c = fgetc(fp)) != '\n')
      ;
  ungetc(c, fp);
}


x86 assembly (clang, -O0):
<skipComments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x23,%eax
jne    1165 <skipComments+0x45>
jmp    1146 <skipComments+0x26>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1160 <skipComments+0x40>
jmp    1146 <skipComments+0x26>
jmp    112c <skipComments+0xc>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipComments>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <fgetc@plt>
cmp    $0x23,%eax
jne    114c <skipComments+0x2c>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
jne    113a <skipComments+0x1a>
mov    %rbx,%rdi
jmp    1130 <skipComments+0x10>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ungetc@plt>

LLVM IR (-O0):
define void @skipComments(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, 35
br i1 %7, label %8, label %15
8: ; preds = %4
br label %9
9: ; preds = %13, %8
%10 = load i32*, i32** %2
%11 = call i32 @fgetc(i32* %10)
store i32 %11, i32* %3
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
%17 = load i32*, i32** %2
%18 = call i32 @ungetc(i32 %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @skipComments(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = icmp eq i32 %2, 35
br i1 %3, label %7, label %11
4: ; preds = %7
%5 = tail call i32 @fgetc(i32* %0)
%6 = icmp eq i32 %5, 35
br i1 %6, label %10, label %11
7: ; preds = %1, %10
%8 = tail call i32 @fgetc(i32* %0)
%9 = icmp eq i32 %8, 10
br i1 %9, label %4, label %10
10: ; preds = %7, %4
br label %7
11: ; preds = %4, %1
%12 = phi i32 [ %2, %1 ], [ %5, %4 ]
%13 = tail call i32 @ungetc(i32 %12, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test8();
void prime8(void) { test8(); }


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

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

LLVM IR (-O0):
define void @prime8() {
%1 = call i32 (...) @test8()
ret void
}

LLVM IR (-O2):
define void @prime8() {
%1 = tail call i32 (...) @test8()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DoubleLinkedList_test();
int /*<<< orphan*/ LinkedList_test();
int main(void) {
  LinkedList_test();
  DoubleLinkedList_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @LinkedList_test()
%2 = tail call i32 (...) @DoubleLinkedList_test()
ret i32 0
}