xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foobar(int, int, int, int, int, int, int, int, int, int, int,
                          int, int, int, int, int, int, int, int, int, int, int,
                          int, int, int, int, int, int, int, int, int, int);
test_exit_ignore_stack() {
  foobar(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1);
}


x86 assembly (clang, -O0):
<test_exit_ignore_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    $0x1,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x1,(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x1,0x10(%rsp)
movl   $0x1,0x18(%rsp)
movl   $0x1,0x20(%rsp)
movl   $0x1,0x28(%rsp)
movl   $0x1,0x30(%rsp)
movl   $0x1,0x38(%rsp)
movl   $0x1,0x40(%rsp)
movl   $0x1,0x48(%rsp)
movl   $0x1,0x50(%rsp)
movl   $0x1,0x58(%rsp)
movl   $0x1,0x60(%rsp)
movl   $0x1,0x68(%rsp)
movl   $0x1,0x70(%rsp)
movl   $0x1,0x78(%rsp)
movl   $0x1,0x80(%rsp)
movl   $0x1,0x88(%rsp)
movl   $0x1,0x90(%rsp)
movl   $0x1,0x98(%rsp)
movl   $0x1,0xa0(%rsp)
movl   $0x1,0xa8(%rsp)
movl   $0x1,0xb0(%rsp)
movl   $0x1,0xb8(%rsp)
movl   $0x1,0xc0(%rsp)
movl   $0x1,0xc8(%rsp)
call   1030 <foobar@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_exit_ignore_stack>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   $0x1
call   1030 <foobar@plt>
add    $0xd0,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_exit_ignore_stack() {
%1 = tail call i32 @foobar(i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void fmt_convert_double_to_double(void *dest_v, void *src_v, int n) {
  memcpy(dest_v, src_v, n * sizeof(double));
}


x86 assembly (clang, -O0):
<fmt_convert_double_to_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_convert_double_to_double>:
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @fmt_convert_double_to_double(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i8* %7, i8* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @fmt_convert_double_to_double(i8* %0, i8* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
long long int expo(int base, int exponent) {
  long long int out = 1;
  int i;
  for (i = 0; i < exponent; i++) {
    out *= base;
  }
  return out;
}


x86 assembly (clang, -O0):
<expo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1140 <expo+0x40>
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <expo+0x19>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<expo>:
test   %esi,%esi
jle    111b <expo+0x1b>
movslq %edi,%rcx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1121 <expo+0x21>
mov    $0x1,%eax
jmp    1155 <expo+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <expo+0x30>
test   %edx,%edx
je     1169 <expo+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <expo+0x60>
ret

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

LLVM IR (-O2):
define i64 @expo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %34
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul nsw i64 %12, %5
%15 = mul nsw i64 %14, %5
%16 = mul nsw i64 %15, %5
%17 = mul nsw i64 %16, %5
%18 = mul nsw i64 %17, %5
%19 = mul nsw i64 %18, %5
%20 = mul nsw i64 %19, %5
%21 = mul nsw i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul nsw i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
void c(double *y, double *x, double *u) {
  static int i;
  for (i = 0; i < 2; i++)
    y[i] = x[i];
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,0x2f0a(%rip)
cmpl   $0x2,0x2f03(%rip)
jge    115b <c+0x5b>
mov    -0x10(%rbp),%rax
movslq 0x2ef2(%rip),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq 0x2ee2(%rip),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2ed7(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ece(%rip)
jmp    111a <c+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @c(double* nocapture writeonly %0, double* nocapture %1, double* nocapture readnone %2) {
%4 = load double, double* %1
store double %4, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 1
store double %6, double* %7
ret void
}
int calc_center(int slen) { return (80 / 2) - (slen / 2); }


x86 assembly (clang, -O0):
<calc_center>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x28,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_center>:
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    $0x28,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calc_center(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = sub nsw i32 40, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @calc_center(i32 %0) {
%2 = sdiv i32 %0, -2
%3 = add nsw i32 %2, 40
ret i32 %3
}
void lint_to_binary(long number, int *binary) {
  int i;
  long quotient;
  quotient = number;
  for (i = 0; i < 32; i++) {
    binary[i] = 0;
    binary[i] = quotient % 2;
    quotient = quotient / 2;
  }
  return;
}


x86 assembly (clang, -O0):
<lint_to_binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    116d <lint_to_binary+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <lint_to_binary+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lint_to_binary>:
xor    %r8d,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
mov    %ecx,%edx
and    $0xfffffffe,%edx
mov    %edi,%eax
sub    %edx,%eax
mov    %eax,(%rsi,%r8,4)
mov    %rcx,%rax
shr    %rax
shr    $0x3f,%rcx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
lea    0x3(%rdi),%rcx
test   %rdi,%rdi
cmovns %rdi,%rcx
mov    %eax,0x4(%rsi,%r8,4)
sar    $0x2,%rcx
add    $0x2,%r8
mov    %rcx,%rdi
cmp    $0x20,%r8
jne    1110 <lint_to_binary+0x10>
ret

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

LLVM IR (-O2):
define void @lint_to_binary(i64 %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %15, %3 ]
%5 = phi i64 [ %0, %2 ], [ %14, %3 ]
%6 = getelementptr inbounds i32, i32* %1, i64 %4
%7 = srem i64 %5, 2
%8 = trunc i64 %7 to i32
store i32 %8, i32* %6
%9 = sdiv i64 %5, 2
%10 = or i64 %4, 1
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = srem i64 %9, 2
%13 = trunc i64 %12 to i32
store i32 %13, i32* %11
%14 = sdiv i64 %5, 4
%15 = add nuw nsw i64 %4, 2
%16 = icmp eq i64 %15, 32
br i1 %16, label %17, label %3
17: ; preds = %3
ret void
}
/* Variables and functions */
char **getDeviceParameters(char const *const *, char const *);
char **bthGetConnectionParameters(const char *identifier) {
  static const char *const names[] = {"address", "timeout", "channel",
                                      "discover", NULL};
  if (!identifier)
    identifier = "";
  return getDeviceParameters(names, identifier);
}


x86 assembly (clang, -O0):
<bthGetConnectionParameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <bthGetConnectionParameters+0x22>
lea    0xee9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2cb3(%rip),%rdi
call   1030 <getDeviceParameters@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bthGetConnectionParameters>:
test   %rdi,%rdi
lea    0xefd(%rip),%rsi
cmovne %rdi,%rsi
lea    0x2ccb(%rip),%rdi
jmp    1030 <getDeviceParameters@plt>

LLVM IR (-O0):
@bthGetConnectionParameters.names = internal constant [5 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* null]
@.str = [8 x i8] c"address\00"
@.str.1 = [8 x i8] c"timeout\00"
@.str.2 = [8 x i8] c"channel\00"
@.str.3 = [9 x i8] c"discover\00"
@.str.4 = [1 x i8] zeroinitializer
define i8** @bthGetConnectionParameters(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i8** @getDeviceParameters(i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @bthGetConnectionParameters.names, i64 0, i64 0), i8* %7)
ret i8** %8
}

LLVM IR (-O2):
@bthGetConnectionParameters.names = internal constant [5 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* null]
@.str = [8 x i8] c"address\00"
@.str.1 = [8 x i8] c"timeout\00"
@.str.2 = [8 x i8] c"channel\00"
@.str.3 = [9 x i8] c"discover\00"
@.str.4 = [1 x i8] zeroinitializer
define i8** @bthGetConnectionParameters(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* %0
%4 = tail call i8** @getDeviceParameters(i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @bthGetConnectionParameters.names, i64 0, i64 0), i8* %3)
ret i8** %4
}
/* Variables and functions */
int main_main();
int main() { return main_main(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_main()
ret i32 %1
}
long long __complex__ r(long long __complex__ a, long long __complex__ b) {}


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

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

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

LLVM IR (-O2):
define { i64, i64 } @r(i64 %0, i64 %1, i64 %2, i64 %3) {
ret { i64, i64 } undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uart_getc();
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_putc(int /*<<< orphan*/);
int /*<<< orphan*/ uart_puts(char *);
void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) {
  (void)r0;
  (void)r1;
  (void)atags;
  uart_init();
  uart_puts("Userspace is overrated.\r\n");
  while (true)
    uart_putc(uart_getc());
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <uart_init@plt>
lea    0xea1(%rip),%rdi
call   1060 <uart_puts@plt>
mov    $0x0,%al
call   1050 <uart_getc@plt>
mov    %eax,%edi
call   1030 <uart_putc@plt>
jmp    1164 <kernel_main+0x24>

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1040 <uart_init@plt>
lea    0xeb1(%rip),%rdi
call   1060 <uart_puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <uart_getc@plt>
mov    %eax,%edi
call   1030 <uart_putc@plt>
jmp    1160 <kernel_main+0x20>

LLVM IR (-O0):
@.str = [26 x i8] c"Userspace is overrated.\0D\0A\00"
define void @kernel_main(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 (...) @uart_init()
%11 = call i32 @uart_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %3, %12
%13 = call i32 (...) @uart_getc()
%14 = call i32 @uart_putc(i32 %13)
br label %12
}

LLVM IR (-O2):
@.str = [26 x i8] c"Userspace is overrated.\0D\0A\00"
define void @kernel_main(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @uart_init()
%5 = tail call i32 @uart_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %6
%7 = tail call i32 (...) @uart_getc()
%8 = tail call i32 @uart_putc(i32 %7)
br label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *tlvh_get_tlv(uint8_t *p_tlv) { return p_tlv + 1; }


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

x86 assembly (clang, -O2):
<tlvh_get_tlv>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @tlvh_get_tlv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
ret i32* %4
}

LLVM IR (-O2):
define i32* @tlvh_get_tlv(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
ret i32* %2
}
/* Variables and functions */
float exp(int);
int log(float);
float cubic_root(float x) {
  return x < 0 ? -exp(log(-x) / 3) : exp(log(x) / 3);
}


x86 assembly (clang, -O0):
<cubic_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1177 <cubic_root+0x57>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1040 <log@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <exp@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1195 <cubic_root+0x75>
movss  -0x4(%rbp),%xmm0
call   1040 <log@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <exp@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_root>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1159 <cubic_root+0x39>
xorps  0xed0(%rip),%xmm0
call   1040 <log@plt>
cltq
imul   $0x55555556,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
shr    $0x20,%rdi
add    %eax,%edi
call   1030 <exp@plt>
xorps  0xea9(%rip),%xmm0
pop    %rax
ret
call   1040 <log@plt>
cltq
imul   $0x55555556,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
shr    $0x20,%rdi
add    %eax,%edi
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define float @cubic_root(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
%8 = call i32 @log(float %7)
%9 = sdiv i32 %8, 3
%10 = call float @exp(i32 %9)
%11 = fneg float %10
br label %17
12: ; preds = %1
%13 = load float, float* %2
%14 = call i32 @log(float %13)
%15 = sdiv i32 %14, 3
%16 = call float @exp(i32 %15)
br label %17
17: ; preds = %12, %5
%18 = phi float [ %11, %5 ], [ %16, %12 ]
ret float %18
}

LLVM IR (-O2):
define float @cubic_root(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fneg float %0
%5 = tail call i32 @log(float %4)
%6 = sdiv i32 %5, 3
%7 = tail call float @exp(i32 %6)
%8 = fneg float %7
br label %13
9: ; preds = %1
%10 = tail call i32 @log(float %0)
%11 = sdiv i32 %10, 3
%12 = tail call float @exp(i32 %11)
br label %13
13: ; preds = %9, %3
%14 = phi float [ %8, %3 ], [ %12, %9 ]
ret float %14
}
int test_imm_6Fint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x6F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Fint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x6f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Fint64_midword_mem>:
testb  $0x6f,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Fint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 111
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_6Fint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7274496
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned char blendcolor(unsigned char *table, unsigned char color1,
                         unsigned char color2) {
  if (!table)
    return color1;
  return table[color1 << 8 | color2];
}


x86 assembly (clang, -O0):
<blendcolor>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1129 <blendcolor+0x29>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1143 <blendcolor+0x43>
mov    -0x10(%rbp),%rax
movzbl -0x11(%rbp),%ecx
shl    $0x8,%ecx
movzbl -0x12(%rbp),%edx
or     %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendcolor>:
mov    %esi,%eax
test   %rdi,%rdi
je     1117 <blendcolor+0x17>
movzbl %al,%eax
shl    $0x8,%rax
movzbl %dl,%ecx
or     %rax,%rcx
mov    (%rdi,%rcx,1),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @blendcolor(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = zext i8 %1 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = zext i8 %2 to i64
%9 = or i64 %7, %8
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
br label %12
12: ; preds = %3, %5
%13 = phi i8 [ %11, %5 ], [ %1, %3 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ clear_pages(void *, int /*<<< orphan*/);
void clear_page(void *page) { clear_pages(page, 0); }


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

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

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

LLVM IR (-O2):
define void @clear_page(i8* %0) {
%2 = tail call i32 @clear_pages(i8* %0, i32 0)
ret void
}
int test_03(short x, short y) { return x & y ? -40 : 60; }


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%edx
movswl -0x4(%rbp),%eax
and    %eax,%edx
mov    $0x3c,%eax
mov    $0xffffffd8,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
test   %di,%si
mov    $0x3c,%ecx
mov    $0xffffffd8,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_03(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 -40, i32 60
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_03(i16 signext %0, i16 signext %1) {
%3 = and i16 %1, %0
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 60, i32 -40
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_usage(FILE *output) {
  fprintf(output, "Usage: tcptty "
                  "[-h|--help]|"
                  "[[-i|--input][=]input-path] "
                  "[[-o|--output][=]output-path]"
                  "[[-p|--port][=]port-number]"
                  "[[-m|--max-clients][=]number]"
                  "\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x8c,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [141 x i8] c"Usage: tcptty [-h|--help]|[[-i|--input][=]input-path] [[-o|--output][=]output-path][[-p|--port][=]port-number][[-m|--max-clients][=]number]\0A\00"
define void @print_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [141 x i8] c"Usage: tcptty [-h|--help]|[[-i|--input][=]input-path] [[-o|--output][=]output-path][[-p|--port][=]port-number][[-m|--max-clients][=]number]\0A\00"
define void @print_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i64 140, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "hic-console [-d][-i ifname][-l] [command]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"hic-console [-d][-i ifname][-l] [command]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"hic-console [-d][-i ifname][-l] [command]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ preempt_count();
bool preemptible(void) { return !preempt_count(); }


x86 assembly (clang, -O0):
<preemptible>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <preempt_count@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<preemptible>:
push   %rax
xor    %eax,%eax
call   1030 <preempt_count@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @preemptible() {
%1 = call i32 (...) @preempt_count()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @preemptible() {
%1 = tail call i32 (...) @preempt_count()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add_sentence(int *, int /*<<< orphan*/ *, int *, int);
void gen_st_water_temp_23(uint8_t *b, uint32_t *buflen) {
  uint8_t sentence[] = {0x23, 0x01, 0x1F, 0x00};
  add_sentence(b, buflen, sentence, 4);
}


x86 assembly (clang, -O0):
<gen_st_water_temp_23>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <add_sentence@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_st_water_temp_23>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1030 <add_sentence@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.gen_st_water_temp_23.sentence = [4 x i32] [i32 35, i32 1, i32 31, i32 0]
define void @gen_st_water_temp_23(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [4 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = bitcast [4 x i32]* %5 to i8*
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%10 = call i32 @add_sentence(i32* %7, i32* %8, i32* %9, i32 4)
ret void
}

LLVM IR (-O2):
@__const.gen_st_water_temp_23.sentence = [4 x i32] [i32 35, i32 1, i32 31, i32 0]
define void @gen_st_water_temp_23(i32* %0, i32* %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @add_sentence(i32* %0, i32* %1, i32* %5, i32 4)
ret void
}
/* Variables and functions */
double exp(double);
__attribute__((__weak__, __always___)) double softboundmpx_exp(double x) {
  return exp(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_exp>:
jmp    1030 <exp@plt>

LLVM IR (-O0):
define weak double @softboundmpx_exp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundmpx_exp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
int min(int, int);
int rk_blocks(int n, int threads) {
  return min(64, (n + (threads * 2 - 1)) / (threads * 2));
}


x86 assembly (clang, -O0):
<rk_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    $0x40,%edi
call   1030 <min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rk_blocks>:
lea    (%rdi,%rsi,2),%eax
add    $0xffffffff,%eax
mov    %esi,%ecx
add    %esi,%ecx
cltd
idiv   %ecx
mov    $0x40,%edi
mov    %eax,%esi
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @rk_blocks(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 %6, 2
%8 = sub nsw i32 %7, 1
%9 = add nsw i32 %5, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 2
%12 = sdiv i32 %9, %11
%13 = call i32 @min(i32 64, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @rk_blocks(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = add i32 %0, -1
%5 = add i32 %4, %3
%6 = sdiv i32 %5, %3
%7 = tail call i32 @min(i32 64, i32 %6)
ret i32 %7
}
int vdoa_wait_for_completion(struct vdoa_ctx *ctx) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.vdoa_ctx = type opaque
define i32 @vdoa_wait_for_completion(%struct.vdoa_ctx* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *jv_mem_alloc(size_t);
void *jq_yyalloc(size_t sz, void *extra) { return jv_mem_alloc(sz); }


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

x86 assembly (clang, -O2):
<jq_yyalloc>:
jmp    1030 <jv_mem_alloc@plt>

LLVM IR (-O0):
define i8* @jq_yyalloc(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = call i8* @jv_mem_alloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @jq_yyalloc(i64 %0, i8* nocapture readnone %1) {
%3 = tail call i8* @jv_mem_alloc(i64 %0)
ret i8* %3
}
short is_bludger(char b) {
  if (b == 'B' || b == 'R' || b == 'C' || b == 'M' || b == 'G' || b == 'Y' ||
      b == 'L') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_bludger>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x42,%eax
je     1165 <is_bludger+0x65>
movsbl -0x3(%rbp),%eax
cmp    $0x52,%eax
je     1165 <is_bludger+0x65>
movsbl -0x3(%rbp),%eax
cmp    $0x43,%eax
je     1165 <is_bludger+0x65>
movsbl -0x3(%rbp),%eax
cmp    $0x4d,%eax
je     1165 <is_bludger+0x65>
movsbl -0x3(%rbp),%eax
cmp    $0x47,%eax
je     1165 <is_bludger+0x65>
movsbl -0x3(%rbp),%eax
cmp    $0x59,%eax
je     1165 <is_bludger+0x65>
movsbl -0x3(%rbp),%eax
cmp    $0x4c,%eax
jne    1170 <is_bludger+0x70>
movw   $0x1,-0x2(%rbp)
jmp    1176 <is_bludger+0x76>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bludger>:
add    $0xbe,%dil
cmp    $0x17,%dil
ja     111e <is_bludger+0x1e>
mov    $0x1,%ax
movzbl %dil,%ecx
mov    $0x810c23,%edx
bt     %rcx,%rdx
jae    111e <is_bludger+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i16 @is_bludger(i8 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 66
br i1 %6, label %31, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 82
br i1 %10, label %31, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 67
br i1 %14, label %31, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 77
br i1 %18, label %31, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 71
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 89
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 76
br i1 %30, label %31, label %32
31: ; preds = %27, %23, %19, %15, %11, %7, %1
store i16 1, i16* %2
br label %33
32: ; preds = %27
store i16 0, i16* %2
br label %33
33: ; preds = %32, %31
%34 = load i16, i16* %2
ret i16 %34
}

LLVM IR (-O2):
define signext i16 @is_bludger(i8 signext %0) {
switch i8 %0, label %2 [
i8 89, label %3
i8 82, label %3
i8 77, label %3
i8 76, label %3
i8 71, label %3
i8 67, label %3
i8 66, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i16 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i16 %4
}
void AO_nop(void) {}


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

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

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

LLVM IR (-O2):
define void @AO_nop() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __nop();
void uDelay(uint32_t i) {
  for (; i > 0; i--) {
    __nop();
    __nop();
    __nop();
    __nop();
  }
}


x86 assembly (clang, -O0):
<uDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1154 <uDelay+0x44>
mov    $0x0,%al
call   1030 <__nop@plt>
mov    $0x0,%al
call   1030 <__nop@plt>
mov    $0x0,%al
call   1030 <__nop@plt>
mov    $0x0,%al
call   1030 <__nop@plt>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uDelay+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDelay>:
push   %rbx
test   %rdi,%rdi
jle    1146 <uDelay+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   (%rax)
xor    %eax,%eax
call   1030 <__nop@plt>
xor    %eax,%eax
call   1030 <__nop@plt>
xor    %eax,%eax
call   1030 <__nop@plt>
xor    %eax,%eax
call   1030 <__nop@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1120 <uDelay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @uDelay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %11, %1
%4 = load i64, i64* %2
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = call i32 (...) @__nop()
%8 = call i32 (...) @__nop()
%9 = call i32 (...) @__nop()
%10 = call i32 (...) @__nop()
br label %11
11: ; preds = %6
%12 = load i64, i64* %2
%13 = add nsw i64 %12, -1
store i64 %13, i64* %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @uDelay(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i64 [ %9, %3 ], [ %0, %1 ]
%5 = tail call i32 (...) @__nop()
%6 = tail call i32 (...) @__nop()
%7 = tail call i32 (...) @__nop()
%8 = tail call i32 (...) @__nop()
%9 = add nsw i64 %4, -1
%10 = icmp ugt i64 %4, 1
br i1 %10, label %3, label %11
11: ; preds = %3, %1
ret void
}
/* Type definitions */
struct readTaskData {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct readTaskData *);
void clean_task(void *data) {
  struct readTaskData *info = (struct readTaskData *)data;
  free(info);
}


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

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

LLVM IR (-O0):
%struct.readTaskData = type { i32 }
define void @clean_task(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.readTaskData*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.readTaskData*
store %struct.readTaskData* %5, %struct.readTaskData** %3
%6 = load %struct.readTaskData*, %struct.readTaskData** %3
%7 = call i32 @free(%struct.readTaskData* %6)
ret void
}

LLVM IR (-O2):
%struct.readTaskData = type { i32 }
define void @clean_task(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.readTaskData*
%3 = tail call i32 @free(%struct.readTaskData* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
__attribute__((visibility("hidden"))) void
read_file(uint16_t address, uint8_t *data, uint32_t lenght) {}


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

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

LLVM IR (-O0):
define hidden void @read_file(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
ret void
}

LLVM IR (-O2):
define hidden void @read_file(i32 %0, i32* nocapture %1, i32 %2) {
ret void
}
int get_intlen() {
  int intlen = 0;
  unsigned all_ones = ~0;
  while (all_ones > 0) {
    all_ones >>= 1;
    intlen++;
  }
  return intlen;
}


x86 assembly (clang, -O0):
<get_intlen>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1133 <get_intlen+0x33>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <get_intlen+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_intlen() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %2
%8 = lshr i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_intlen() {
ret i32 32
}
/* Variables and functions */
float INFINITY;
float scanative_libc_infinity() { return INFINITY; }


x86 assembly (clang, -O0):
<scanative_libc_infinity>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanative_libc_infinity>:
mov    0x2ee1(%rip),%rax
movss  (%rax),%xmm0
ret

LLVM IR (-O0):
@INFINITY = global float 0.000000e+00
define float @scanative_libc_infinity() {
%1 = load float, float* @INFINITY
ret float %1
}

LLVM IR (-O2):
@INFINITY = global float 0.000000e+00
define float @scanative_libc_infinity() {
%1 = load float, float* @INFINITY
ret float %1
}
long long unmask_addr(long long *addr) {
  long long raddr, mask;
  raddr = *addr;
  return raddr;
}


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

x86 assembly (clang, -O2):
<unmask_addr>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @unmask_addr(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
%5 = load i64*, i64** %2
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @unmask_addr(i64* nocapture %0) {
%2 = load i64, i64* %0
ret i64 %2
}
int main() {
  int arr[2];
  arr[0] = 1;
  arr[1] = 2;
  return arr[0] + arr[1] - 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 1, i32* %3
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 2, i32* %4
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sub nsw i32 %9, 3
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int set_o_direct(int fd) {
  int ret = -1;
  return ret;
}


x86 assembly (clang, -O0):
<set_o_direct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @set_o_direct(i32 %0) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fputsn(int, char *, int);
int print_to_base(int /*<<< orphan*/, char *, int);
int print_dec(int fd, uint64_t n) {
  int count;
  char buffer[128] = {0};
  count = print_to_base(n, buffer, 10);
  fputsn(fd, buffer, count);
  return count;
}


x86 assembly (clang, -O0):
<print_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0xa,%edx
call   1050 <print_to_base@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <fputsn@plt>
mov    -0xc(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dec>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %esi,%edi
mov    %r14,%rsi
mov    $0xa,%edx
call   1040 <print_to_base@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <fputsn@plt>
mov    %ebp,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @print_dec(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [128 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = bitcast [128 x i8]* %6 to i8*
%8 = load i32, i32* %4
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%10 = call i32 @print_to_base(i32 %8, i8* %9, i32 10)
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* %5
%14 = call i32 @fputsn(i32 %11, i8* %12, i32 %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @print_dec(i32 %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @print_to_base(i32 %1, i8* %4, i32 10)
%6 = call i32 @fputsn(i32 %0, i8* %4, i32 %5)
ret i32 %5
}