xunge/DecIR huggingface dataset:
/* Type definitions */
struct rt_rtmp_adapter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RTMP_MLME_RADIO_OFF(struct rt_rtmp_adapter *);
void MlmeRadioOff(struct rt_rtmp_adapter *pAd) { RTMP_MLME_RADIO_OFF(pAd); }


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

x86 assembly (clang, -O2):
<MlmeRadioOff>:
jmp    1030 <RTMP_MLME_RADIO_OFF@plt>

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

LLVM IR (-O2):
%struct.rt_rtmp_adapter = type { i32 }
define void @MlmeRadioOff(%struct.rt_rtmp_adapter* %0) {
%2 = tail call i32 @RTMP_MLME_RADIO_OFF(%struct.rt_rtmp_adapter* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int *, int);
int main(int argc, char *argv[]) {
  int seq[7] = {1, 2, 3, 4, 5, 6, 7};
  int *first = &seq[0];
  int *last = &seq[1];
  printf(" %p - %p = %ld\n", last, first, last - first + 1);
  return 0;
}


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)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
add    $0x1,%rax
mov    %eax,%ecx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x4(%rsp),%rsi
lea    0xee5(%rip),%rdi
mov    %rsp,%rdx
mov    $0x2,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.seq = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [16 x i8] c" %p - %p = %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i32]
%7 = alloca i32*
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [7 x i32]* %6 to i8*
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
store i32* %10, i32** %7
%11 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 1
store i32* %11, i32** %8
%12 = load i32*, i32** %8
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = load i32*, i32** %7
%16 = ptrtoint i32* %14 to i64
%17 = ptrtoint i32* %15 to i64
%18 = sub i64 %16, %17
%19 = sdiv exact i64 %18, 4
%20 = add nsw i64 %19, 1
%21 = trunc i64 %20 to i32
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %12, i32* %13, i32 %21)
ret i32 0
}

LLVM IR (-O2):
@__const.main.seq = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [16 x i8] c" %p - %p = %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i32]
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %5, i32 2)
ret i32 0
}
long unsigned min(long unsigned x, long unsigned y, long unsigned z) {
  return (x < y ? (x < z ? x : z) : (y < z ? y : z));
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114e <min+0x4e>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1139 <min+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1141 <min+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1179 <min+0x79>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1169 <min+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1171 <min+0x71>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovb  %rdi,%rax
cmp    %rsi,%rax
cmovae %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %6
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i64, i64* %4
br label %18
16: ; preds = %10
%17 = load i64, i64* %6
br label %18
18: ; preds = %16, %14
%19 = phi i64 [ %15, %14 ], [ %17, %16 ]
br label %30
20: ; preds = %3
%21 = load i64, i64* %5
%22 = load i64, i64* %6
%23 = icmp ult i64 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i64, i64* %5
br label %28
26: ; preds = %20
%27 = load i64, i64* %6
br label %28
28: ; preds = %26, %24
%29 = phi i64 [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %18
%31 = phi i64 [ %19, %18 ], [ %29, %28 ]
ret i64 %31
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %0, %2
%5 = select i1 %4, i64 %0, i64 %2
%6 = icmp ult i64 %5, %1
%7 = select i1 %6, i64 %5, i64 %1
ret i64 %7
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_rt_sigtimedwait;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ const *,
            int /*<<< orphan*/ *, struct timespec const *, long);
int __rt_sigtimedwait(const sigset_t *set, siginfo_t *info,
                      const struct timespec *ts, long nr) {
  return syscall(__NR_rt_sigtimedwait, set, info, ts, nr);
}


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

x86 assembly (clang, -O2):
<__rt_sigtimedwait>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@__NR_rt_sigtimedwait = global i32 0
define i32 @__rt_sigtimedwait(i32* %0, i32* %1, %struct.timespec* %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca %struct.timespec*
%8 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store %struct.timespec* %2, %struct.timespec** %7
store i64 %3, i64* %8
%9 = load i32, i32* @__NR_rt_sigtimedwait
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load %struct.timespec*, %struct.timespec** %7
%13 = load i64, i64* %8
%14 = call i32 @syscall(i32 %9, i32* %10, i32* %11, %struct.timespec* %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@__NR_rt_sigtimedwait = global i32 0
define i32 @__rt_sigtimedwait(i32* %0, i32* %1, %struct.timespec* %2, i64 %3) {
%5 = load i32, i32* @__NR_rt_sigtimedwait
%6 = tail call i32 @syscall(i32 %5, i32* %0, i32* %1, %struct.timespec* %2, i64 %3)
ret i32 %6
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_delete(struct list_head *);
int /*<<< orphan*/ list_insert_back(struct list_head *, struct list_head *);
void list_move_back(struct list_head *head, struct list_head *elem) {
  __list_delete(elem);
  list_insert_back(head, elem);
}


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

x86 assembly (clang, -O2):
<list_move_back>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <__list_delete@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_insert_back@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move_back(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %4
%6 = call i32 @__list_delete(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_insert_back(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move_back(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_delete(%struct.list_head* %1)
%4 = tail call i32 @list_insert_back(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Type definitions */
struct ADrawTag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gdoTextR(struct ADrawTag *, unsigned int, unsigned int,
                            char const *);
int gdoTextWidth(struct ADrawTag *, char const *);
void gdoTextC(struct ADrawTag *ctx, unsigned int x, unsigned int y,
              const char *string) {
  gdoTextR(ctx, x - (gdoTextWidth(ctx, string) / 2), y, string);
}


x86 assembly (clang, -O0):
<gdoTextC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <gdoTextWidth@plt>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdi
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    %eax,%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <gdoTextR@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdoTextC>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rcx,%rsi
call   1030 <gdoTextWidth@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
sub    %ecx,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <gdoTextR@plt>

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
define void @gdoTextC(%struct.ADrawTag* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.ADrawTag*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.ADrawTag* %0, %struct.ADrawTag** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.ADrawTag*, %struct.ADrawTag** %5
%10 = load i32, i32* %6
%11 = load %struct.ADrawTag*, %struct.ADrawTag** %5
%12 = load i8*, i8** %8
%13 = call i32 @gdoTextWidth(%struct.ADrawTag* %11, i8* %12)
%14 = sdiv i32 %13, 2
%15 = sub i32 %10, %14
%16 = load i32, i32* %7
%17 = load i8*, i8** %8
%18 = call i32 @gdoTextR(%struct.ADrawTag* %9, i32 %15, i32 %16, i8* %17)
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
define void @gdoTextC(%struct.ADrawTag* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @gdoTextWidth(%struct.ADrawTag* %0, i8* %3)
%6 = sdiv i32 %5, -2
%7 = add i32 %6, %1
%8 = tail call i32 @gdoTextR(%struct.ADrawTag* %0, i32 %7, i32 %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x21() {
  Assert_real((isgraph(33)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              170, ("isgraph should be 1 for !"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x21>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xaa,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x21>:
push   %rax
mov    $0x21,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xaa,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for !\00"
define void @t_isgraph_0x21() {
%1 = call i32 @isgraph(i32 33)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for !\00"
define void @t_isgraph_0x21() {
%1 = tail call i32 @isgraph(i32 33)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int do_mul(int av1, int av3) { return (av1 * av3); }


x86 assembly (clang, -O0):
<do_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @do_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void testmain() { print("_Generic"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"_Generic\00"
define void @testmain() {
%1 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"_Generic\00"
define void @testmain() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
extern int SizeofInt() { return sizeof(int); }


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

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

LLVM IR (-O0):
define i32 @SizeofInt() {
ret i32 4
}

LLVM IR (-O2):
define i32 @SizeofInt() {
ret i32 4
}
/* Variables and functions */
double asin(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double x, ret, val;
  x = 0.9;
  val = 180.0 / 3.14159265;
  ret = asin(x) * val;
  printf("The arc sine of %lf is %lf degrees\n", x, ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <asin@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"The arc sine of %lf is %lf degrees\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 9.000000e-01, double* %2
store double 0x404CA5DC1AF05A77, double* %4
%5 = load double, double* %2
%6 = call double @asin(double %5)
%7 = load double, double* %4
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %9, double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The arc sine of %lf is %lf degrees\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double 9.000000e-01, double 0x40500A1DC659E8B1)
ret i32 0
}
int *foo() { return 0; }


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

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

LLVM IR (-O0):
define i32* @foo() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @foo() {
ret i32* null
}
/* Variables and functions */
int close(int);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
char do_listen(int sockfd) {
  if (listen(sockfd, 42) == -1) {
    if ((close(sockfd)) == -1) {
      perror("close");
      return (1);
    }
    perror("listen");
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<do_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2a,%esi
call   1040 <listen@plt>
cmp    $0xffffffff,%eax
jne    118c <do_listen+0x5c>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1177 <do_listen+0x47>
lea    0xe97(%rip),%rdi
call   1050 <perror@plt>
movb   $0x1,-0x1(%rbp)
jmp    1190 <do_listen+0x60>
lea    0xe88(%rip),%rdi
call   1050 <perror@plt>
movb   $0x1,-0x1(%rbp)
jmp    1190 <do_listen+0x60>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_listen>:
push   %rbx
mov    %edi,%ebx
mov    $0x2a,%esi
call   1040 <listen@plt>
cmp    $0xffffffff,%eax
je     1146 <do_listen+0x16>
xor    %eax,%eax
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
lea    0xea9(%rip),%rax
lea    0xea8(%rip),%rdi
cmove  %rax,%rdi
call   1050 <perror@plt>
mov    $0x1,%al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"close\00"
@.str.1 = [7 x i8] c"listen\00"
define signext i8 @do_listen(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @listen(i32 %4, i32 42)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @close(i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8 1, i8* %2
br label %16
13: ; preds = %7
%14 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8 1, i8* %2
br label %16
15: ; preds = %1
store i8 0, i8* %2
br label %16
16: ; preds = %15, %13, %11
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
@.str.1 = [7 x i8] c"listen\00"
define signext i8 @do_listen(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 42)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @close(i32 %0)
%6 = icmp eq i32 %5, -1
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @perror(i8* %7)
br label %9
9: ; preds = %4, %1
%10 = phi i8 [ 0, %1 ], [ 1, %4 ]
ret i8 %10
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int wprintf(char *);
int my_function(wchar_t *a) { return wprintf(a); }


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

x86 assembly (clang, -O2):
<my_function>:
jmp    1030 <wprintf@plt>

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

LLVM IR (-O2):
define i32 @my_function(i8* %0) {
%2 = tail call i32 @wprintf(i8* %0)
ret i32 %2
}
read_image_array(file_name, array) char *file_name;
short **array;
{}


x86 assembly (clang, -O0):
<read_image_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_image_array(i8* nocapture readnone %0, i16** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void resetColor(void) { fputs("\033[0m", stdout); }


x86 assembly (clang, -O0):
<resetColor>:
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):
<resetColor>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @resetColor() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef void uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sg_put_unaligned_be16(int, void *);
void sg_put_unaligned_be32(uint32_t val, void *p) {
  sg_put_unaligned_be16(val >> 16, p);
  sg_put_unaligned_be16(val, (uint8_t *)p + 2);
}


x86 assembly (clang, -O0):
<sg_put_unaligned_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
mov    -0x10(%rbp),%rsi
call   1030 <sg_put_unaligned_be16@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x2,%rsi
call   1030 <sg_put_unaligned_be16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_put_unaligned_be32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
call   1030 <sg_put_unaligned_be16@plt>
add    $0x2,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sg_put_unaligned_be16@plt>

LLVM IR (-O0):
define void @sg_put_unaligned_be32(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 16
%7 = load i8*, i8** %4
%8 = call i32 @sg_put_unaligned_be16(i32 %6, i8* %7)
%9 = load i32, i32* %3
%10 = load i8*, i8** %4
%11 = getelementptr i8, i8* %10, i64 2
%12 = call i32 @sg_put_unaligned_be16(i32 %9, i8* %11)
ret void
}

LLVM IR (-O2):
define void @sg_put_unaligned_be32(i32 %0, i8* %1) {
%3 = ashr i32 %0, 16
%4 = tail call i32 @sg_put_unaligned_be16(i32 %3, i8* %1)
%5 = getelementptr i8, i8* %1, i64 2
%6 = tail call i32 @sg_put_unaligned_be16(i32 %0, i8* %5)
ret void
}
/* Variables and functions */
int StatMomentInt(int *, int, int, int);
double StatVarnInt(int a[], int n, int s) {
  return StatMomentInt(a, n, s, 2) / n;
}


x86 assembly (clang, -O0):
<StatVarnInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x2,%ecx
call   1030 <StatMomentInt@plt>
cltd
idivl  -0xc(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatVarnInt>:
push   %rbx
mov    %esi,%ebx
mov    $0x2,%ecx
call   1030 <StatMomentInt@plt>
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatVarnInt(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @StatMomentInt(i32* %7, i32 %8, i32 %9, i32 2)
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @StatVarnInt(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @StatMomentInt(i32* %0, i32 %1, i32 %2, i32 2)
%5 = sdiv i32 %4, %1
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
scalar_t__ realloc(int *, int);
void add_to_1D_array(int *array, int new_array_size) {
  const int INIT_VALUE = 0;
  array = (int *)realloc(array, new_array_size * sizeof(int *));
  array[new_array_size - 1] = INIT_VALUE;
}


x86 assembly (clang, -O0):
<add_to_1D_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_to_1D_array>:
push   %rbx
mov    %esi,%ebx
lea    0x0(,%rbx,8),%esi
call   1030 <realloc@plt>
movslq %ebx,%rcx
movl   $0x0,-0x4(%rax,%rcx,4)
pop    %rbx
ret

LLVM IR (-O0):
define void @add_to_1D_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 8
%10 = trunc i64 %9 to i32
%11 = call i64 @realloc(i32* %6, i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
store i32 0, i32* %17
ret void
}

LLVM IR (-O2):
define void @add_to_1D_array(i32* %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = tail call i64 @realloc(i32* %0, i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = add nsw i32 %1, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
store i32 0, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int node_del(void *elem) {
  free(elem);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @node_del(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Type definitions */
struct gbuf {
  int dummy;
};
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int gbuf_move_to(struct gbuf *, scalar_t__);
scalar_t__ gbuf_offset(struct gbuf *);
int gbuf_move_by(struct gbuf *buf, ptrdiff_t rel) {
  assert(buf != NULL);
  return gbuf_move_to(buf, gbuf_offset(buf) + rel);
}


x86 assembly (clang, -O0):
<gbuf_move_by>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gbuf_offset@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
call   1050 <gbuf_move_to@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbuf_move_by>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <gbuf_offset@plt>
movslq %ebp,%rsi
add    %rax,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <gbuf_move_to@plt>

LLVM IR (-O0):
%struct.gbuf = type { i32 }
define i32 @gbuf_move_by(%struct.gbuf* %0, i32 %1) {
%3 = alloca %struct.gbuf*
%4 = alloca i32
store %struct.gbuf* %0, %struct.gbuf** %3
store i32 %1, i32* %4
%5 = load %struct.gbuf*, %struct.gbuf** %3
%6 = icmp ne %struct.gbuf* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.gbuf*, %struct.gbuf** %3
%10 = load %struct.gbuf*, %struct.gbuf** %3
%11 = call i64 @gbuf_offset(%struct.gbuf* %10)
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = add nsw i64 %11, %13
%15 = call i32 @gbuf_move_to(%struct.gbuf* %9, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.gbuf = type { i32 }
define i32 @gbuf_move_by(%struct.gbuf* %0, i32 %1) {
%3 = icmp ne %struct.gbuf* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i64 @gbuf_offset(%struct.gbuf* %0)
%7 = sext i32 %1 to i64
%8 = add nsw i64 %6, %7
%9 = tail call i32 @gbuf_move_to(%struct.gbuf* %0, i64 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void Usage(char prog_name[]) {
  fprintf(stderr, "usage: %s ", prog_name);
  fprintf(stderr, "<bin_count> <min_meas> <max_meas> <data_count>\n");
  exit(0);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s \00"
@.str.1 = [48 x i8] c"<bin_count> <min_meas> <max_meas> <data_count>\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s \00"
@.str.1 = [48 x i8] c"<bin_count> <min_meas> <max_meas> <data_count>\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
int kernelAtaCommandIsAtapi(unsigned char ataCommand) {
  switch (ataCommand) {
  case 0x08:
  case 0xA0:
  case 0xA2:
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<kernelAtaCommandIsAtapi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x8,%eax
je     1145 <kernelAtaCommandIsAtapi+0x45>
jmp    111f <kernelAtaCommandIsAtapi+0x1f>
mov    -0xc(%rbp),%eax
sub    $0xa0,%eax
je     1145 <kernelAtaCommandIsAtapi+0x45>
jmp    1132 <kernelAtaCommandIsAtapi+0x32>
mov    -0xc(%rbp),%eax
sub    $0xa2,%eax
jne    1151 <kernelAtaCommandIsAtapi+0x51>
jmp    1145 <kernelAtaCommandIsAtapi+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1158 <kernelAtaCommandIsAtapi+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernelAtaCommandIsAtapi>:
mov    $0x1,%eax
cmp    $0xa0,%dil
je     1119 <kernelAtaCommandIsAtapi+0x19>
cmp    $0xa2,%dil
je     1119 <kernelAtaCommandIsAtapi+0x19>
cmp    $0x8,%dil
je     1119 <kernelAtaCommandIsAtapi+0x19>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @kernelAtaCommandIsAtapi(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %7 [
i32 8, label %6
i32 160, label %6
i32 162, label %6
]
6: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @kernelAtaCommandIsAtapi(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 8, label %3
i8 -96, label %3
i8 -94, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Running!");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Running!\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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Running!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int hxd_v_rel(void) { return 0x20160408; }


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

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

LLVM IR (-O0):
define i32 @hxd_v_rel() {
ret i32 538313736
}

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, void *, void *,
                           unsigned long long, unsigned long long);
int /*<<< orphan*/ get_heap_bounds(uintptr_t *, uintptr_t *);
void emit_heap_bounds(FILE *fp) {
  uintptr_t st, en;
  get_heap_bounds(&st, &en);
  fprintf(fp, "# Heap Bounds [%p-%p] (%llu %llu)\n", (void *)st, (void *)en,
          (unsigned long long)st, (unsigned long long)en);
}


x86 assembly (clang, -O0):
<emit_heap_bounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <get_heap_bounds@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_heap_bounds>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <get_heap_bounds@plt>
mov    0x8(%rsp),%rdx
mov    (%rsp),%rcx
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
mov    %rdx,%r8
mov    %rcx,%r9
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"# Heap Bounds [%p-%p] (%llu %llu)\0A\00"
define void @emit_heap_bounds(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = call i32 @get_heap_bounds(i64* %3, i64* %4)
%6 = load i32*, i32** %2
%7 = load i64, i64* %3
%8 = inttoptr i64 %7 to i8*
%9 = load i64, i64* %4
%10 = inttoptr i64 %9 to i8*
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %10, i64 %11, i64 %12)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"# Heap Bounds [%p-%p] (%llu %llu)\0A\00"
define void @emit_heap_bounds(i32* nocapture %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32 @get_heap_bounds(i64* %2, i64* %3)
%7 = load i64, i64* %2
%8 = inttoptr i64 %7 to i8*
%9 = load i64, i64* %3
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %10, i64 %7, i64 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ pthread_exit(void *);
scalar_t__ pthread_self();
void *threadFunc2(void *arg) {
  printf("thread 2: ID is %u\n", (unsigned int)pthread_self());
  pthread_exit((void *)0);
}


x86 assembly (clang, -O0):
<threadFunc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadFunc2>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"thread 2: ID is %u\0A\00"
define i8* @threadFunc2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @pthread_exit(i8* null)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [20 x i8] c"thread 2: ID is %u\0A\00"
define noalias i8* @threadFunc2(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i8* null)
ret i8* undef
}
void XGetPointerMapping() {}


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

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

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

LLVM IR (-O2):
define void @XGetPointerMapping() {
ret void
}
int get14(const unsigned char *p) {
  int r = (p[0] + p[1] * 256) & 0x3fff;
  if (r & 0x2000)
    r -= 0x4000;
  return r;
}


x86 assembly (clang, -O0):
<get14>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
and    $0x3fff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     1140 <get14+0x40>
mov    -0xc(%rbp),%eax
sub    $0x4000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get14>:
movzbl (%rdi),%eax
movzbl 0x1(%rdi),%ecx
mov    %ecx,%edx
and    $0x3f,%edx
shl    $0x8,%edx
lea    (%rdx,%rax,1),%esi
test   $0x20,%cl
lea    -0x4000(%rdx,%rax,1),%eax
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @get14(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, 256
%13 = add nsw i32 %7, %12
%14 = and i32 %13, 16383
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = and i32 %15, 8192
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %1
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 16384
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %1
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @get14(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = and i32 %7, 16128
%9 = or i32 %8, %3
%10 = and i32 %6, 32
%11 = icmp eq i32 %10, 0
%12 = or i32 %9, -16384
%13 = select i1 %11, i32 %9, i32 %12
ret i32 %13
}
unsigned long deflateBound(unsigned long s) {
  return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
}


x86 assembly (clang, -O0):
<deflateBound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x7,%rcx
shr    $0x3,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
add    $0x3f,%rcx
shr    $0x6,%rcx
add    %rcx,%rax
add    $0xb,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deflateBound>:
lea    0x7(%rdi),%rax
shr    $0x3,%rax
lea    0x3f(%rdi),%rcx
shr    $0x6,%rcx
add    %rdi,%rax
add    %rcx,%rax
add    $0xb,%rax
ret

LLVM IR (-O0):
define i64 @deflateBound(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 7
%6 = lshr i64 %5, 3
%7 = add i64 %3, %6
%8 = load i64, i64* %2
%9 = add i64 %8, 63
%10 = lshr i64 %9, 6
%11 = add i64 %7, %10
%12 = add i64 %11, 11
ret i64 %12
}

LLVM IR (-O2):
define i64 @deflateBound(i64 %0) {
%2 = add i64 %0, 7
%3 = lshr i64 %2, 3
%4 = add i64 %0, 63
%5 = lshr i64 %4, 6
%6 = add i64 %0, 11
%7 = add i64 %6, %3
%8 = add i64 %7, %5
ret i64 %8
}
/* Variables and functions */
int syscall(int, int, char const *, int, char const *, unsigned int);
int move_mount(int from_dfd, const char *from_pathname, int to_dfd,
               const char *to_pathname, unsigned int flags) {
  return syscall(-1, from_dfd, from_pathname, to_dfd, to_pathname, flags);
}


x86 assembly (clang, -O0):
<move_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0xffffffff,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_mount>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @move_mount(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @syscall(i32 -1, i32 %11, i8* %12, i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @move_mount(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @syscall(i32 -1, i32 %0, i8* %1, i32 %2, i8* %3, i32 %4)
ret i32 %6
}
void nothing() {}


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

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

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

LLVM IR (-O2):
define void @nothing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int);
main() {
  f(10);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 10)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 10)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ shm_kill();
int main() {
  shm_kill();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @shm_kill()
ret i32 0
}
double tu_timer_cpu(void) { return -1; }


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

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

LLVM IR (-O0):
define double @tu_timer_cpu() {
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @tu_timer_cpu() {
ret double -1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ log_msg(char *);
void log_frameError() { log_msg("DAT: frame received in error"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"DAT: frame received in error\00"
define void @log_frameError() {
%1 = call i32 @log_msg(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"DAT: frame received in error\00"
define void @log_frameError() {
%1 = tail call i32 @log_msg(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}