xunge/DecIR huggingface dataset:
void testfunc_00(const char *ap, char *bp) {
  bp[100] = ap[15];
  bp[200] = ap[50];
  bp[900] = ap[71];
  bp[0] = ap[25];
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x64(%rax)
mov    -0x8(%rbp),%rax
mov    0x32(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0xc8(%rax)
mov    -0x8(%rbp),%rax
mov    0x47(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x384(%rax)
mov    -0x8(%rbp),%rax
mov    0x19(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    0xf(%rdi),%al
mov    %al,0x64(%rsi)
mov    0x32(%rdi),%al
mov    %al,0xc8(%rsi)
mov    0x47(%rdi),%al
mov    %al,0x384(%rsi)
mov    0x19(%rdi),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @testfunc_00(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 15
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 100
store i8 %7, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 50
%12 = load i8, i8* %11
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 200
store i8 %12, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 71
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 900
store i8 %17, i8* %19
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 25
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
define void @testfunc_00(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 15
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %1, i64 100
store i8 %4, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 50
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 200
store i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 71
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 900
store i8 %10, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 25
%13 = load i8, i8* %12
store i8 %13, i8* %1
ret void
}
/* Variables and functions */
int const STDIN_FILENO;
int /*<<< orphan*/ close(int const);
int dup2(int const, int const);
int /*<<< orphan*/ perror(char *);
void pipe_to_stdin(int const *pipe_fd) {
  close(pipe_fd[(1)]);
  close(STDIN_FILENO);
  if (dup2(pipe_fd[(0)], STDIN_FILENO) == -1)
    perror("dup2");
}


x86 assembly (clang, -O0):
<pipe_to_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <close@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
call   1030 <dup2@plt>
cmp    $0xffffffff,%eax
jne    117f <pipe_to_stdin+0x4f>
lea    0xe8a(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_to_stdin>:
push   %rbx
mov    %rdi,%rbx
mov    0x4(%rdi),%edi
call   1040 <close@plt>
xor    %edi,%edi
call   1040 <close@plt>
mov    (%rbx),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
cmp    $0xffffffff,%eax
je     1153 <pipe_to_stdin+0x23>
pop    %rbx
ret
lea    0xeaa(%rip),%rdi
pop    %rbx
jmp    1050 <perror@plt>

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

LLVM IR (-O2):
@STDIN_FILENO = constant i32 0
@.str = [5 x i8] c"dup2\00"
define void @pipe_to_stdin(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
%5 = tail call i32 @close(i32 0)
%6 = load i32, i32* %0
%7 = tail call i32 @dup2(i32 %6, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}
int menor_que(int a, int b) { return a < b; }


x86 assembly (clang, -O0):
<menor_que>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<menor_que>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @menor_que(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @menor_que(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ gluOrtho2D(double, double, double, double);
void init(void) {
  glClearColor(1.0, 1.0, 1.0, 0.0);
  glMatrixMode(GL_PROJECTION);
  gluOrtho2D(0.0, 400.0, 0.0, 300.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm2
xorps  %xmm3,%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glClearColor@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xorps  %xmm2,%xmm2
movsd  0xe9d(%rip),%xmm1
movsd  0xe9d(%rip),%xmm3
movaps %xmm2,%xmm0
call   1050 <gluOrtho2D@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
movsd  0xec7(%rip),%xmm0
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1040 <glClearColor@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
movsd  0xeab(%rip),%xmm1
movsd  0xeab(%rip),%xmm3
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
pop    %rax
jmp    1050 <gluOrtho2D@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = call i32 @glMatrixMode(i32 %2)
%4 = call i32 @gluOrtho2D(double 0.000000e+00, double 4.000000e+02, double 0.000000e+00, double 3.000000e+02)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 @gluOrtho2D(double 0.000000e+00, double 4.000000e+02, double 0.000000e+00, double 3.000000e+02)
ret void
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double rintl(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ helloer();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Calling helloer\n");
  helloer();
  printf("Helloer called\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <helloer@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"Calling helloer\0A\00"
@.str.1 = [16 x i8] c"Helloer called\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @helloer()
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Calling helloer\00"
@str.2 = [15 x i8] c"Helloer called\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @helloer()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *skip_wdvarname(char const *, int);
int is_wdvarassign(const char *s) {
  const char *p = skip_wdvarname(s, 1);
  return (p != s && p[0] == 1 && p[1] == '=');
}


x86 assembly (clang, -O0):
<is_wdvarassign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <skip_wdvarname@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x11(%rbp)
je     1167 <is_wdvarassign+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x11(%rbp)
jne    1167 <is_wdvarassign+0x57>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3d,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_wdvarassign>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <skip_wdvarname@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
je     1136 <is_wdvarassign+0x26>
cmpb   $0x1,(%rcx)
jne    1136 <is_wdvarassign+0x26>
xor    %eax,%eax
cmpb   $0x3d,0x1(%rcx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_wdvarassign(i8* %0) {
%2 = tail call i8* @skip_wdvarname(i8* %0, i32 1)
%3 = icmp eq i8* %2, %0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %2, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 61
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %4, %1
%13 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %11, %7 ]
ret i32 %13
}
int gemini_led_val(int led) {
  int val = 0;
  if (led >= 0 && led < 8)
    val = *(unsigned char *)((0xffeffe80) + (led << 3));
  return (val & 0x1);
}


x86 assembly (clang, -O0):
<gemini_led_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1135 <gemini_led_val+0x35>
cmpl   $0x8,-0x4(%rbp)
jge    1135 <gemini_led_val+0x35>
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0xffeffe80,%eax
mov    %eax,%eax
movzbl (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gemini_led_val>:
xor    %eax,%eax
cmp    $0x7,%edi
ja     1115 <gemini_led_val+0x15>
mov    %edi,%eax
mov    $0xffeffe80,%ecx
movzbl (%rcx,%rax,8),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @gemini_led_val(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %2
%11 = shl i32 %10, 3
%12 = add i32 -1048960, %11
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
store i32 %16, i32* %3
br label %17
17: ; preds = %9, %6, %1
%18 = load i32, i32* %3
%19 = and i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
define i32 @gemini_led_val(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = shl nuw nsw i32 %0, 3
%5 = add nuw nsw i32 %4, -1048960
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = load i8, i8* %7
%9 = and i8 %8, 1
%10 = zext i8 %9 to i32
br label %11
11: ; preds = %3, %1
%12 = phi i32 [ %10, %3 ], [ 0, %1 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xany;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xany_send_event(void *_p) {
  return (int)((XEvent *)_p)->xany.send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xany_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int do_127() { return 127; }


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

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

LLVM IR (-O0):
define i32 @do_127() {
ret i32 127
}

LLVM IR (-O2):
define i32 @do_127() {
ret i32 127
}
__attribute__((always_)) struct task_struct *__get_current(void) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define %struct.task_struct* @__get_current() {
%1 = alloca %struct.task_struct*
%2 = load %struct.task_struct*, %struct.task_struct** %1
ret %struct.task_struct* %2
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define noalias %struct.task_struct* @__get_current() {
ret %struct.task_struct* undef
}
int ok() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ok() {
ret i32 0
}
void walt_fixup_busy_time(struct task_struct *p, int new_cpu) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @walt_fixup_busy_time(%struct.task_struct* nocapture %0, i32 %1) {
ret void
}
int main() {
  int(*i[2][2])[][5];
  int j;
  int(*arr[4][2])[][3];
  int(*const(*const arr2)[4][2])[][3] = &arr;
  int k = arr2;
  f(arr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %eax,-0x7c(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x0,%al
call   1030 <f@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [2 x [2 x [0 x [5 x i32]]*]]
%2 = alloca i32
%3 = alloca [4 x [2 x [0 x [3 x i32]]*]]
%4 = alloca [4 x [2 x [0 x [3 x i32]]*]]*
%5 = alloca i32
store [4 x [2 x [0 x [3 x i32]]*]]* %3, [4 x [2 x [0 x [3 x i32]]*]]** %4
%6 = load [4 x [2 x [0 x [3 x i32]]*]]*, [4 x [2 x [0 x [3 x i32]]*]]** %4
%7 = ptrtoint [4 x [2 x [0 x [3 x i32]]*]]* %6 to i32
store i32 %7, i32* %5
%8 = getelementptr inbounds [4 x [2 x [0 x [3 x i32]]*]], [4 x [2 x [0 x [3 x i32]]*]]* %3, i64 0, i64 0
%9 = call i32 ([2 x [0 x [3 x i32]]*]*, ...) bitcast (i32 (...)* @f to i32 ([2 x [0 x [3 x i32]]*]*, ...)*)([2 x [0 x [3 x i32]]*]* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x [2 x [0 x [3 x i32]]*]]
%2 = bitcast [4 x [2 x [0 x [3 x i32]]*]]* %1 to i8*
%3 = getelementptr inbounds [4 x [2 x [0 x [3 x i32]]*]], [4 x [2 x [0 x [3 x i32]]*]]* %1, i64 0, i64 0
%4 = call i32 ([2 x [0 x [3 x i32]]*]*, ...) bitcast (i32 (...)* @f to i32 ([2 x [0 x [3 x i32]]*]*, ...)*)([2 x [0 x [3 x i32]]*]* %3)
ret i32 0
}
int bar() {}


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

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

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

LLVM IR (-O2):
define i32 @bar() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ putChar(int /*<<< orphan*/);
void putString(char *str) {
  while (*str != '\0')
    putChar(*str++);
}


x86 assembly (clang, -O0):
<putString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <putString+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putChar@plt>
jmp    111c <putString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <putString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <putString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @putString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @putChar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char *);
void bogus_irq(void) {
  serial_puts("Bogus IRQ, spinning ... \n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<bogus_irq>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <serial_puts@plt>
jmp    1120 <bogus_irq+0x10>

x86 assembly (clang, -O2):
<bogus_irq>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <serial_puts@plt>
nopl   (%rax)
jmp    1120 <bogus_irq+0x10>

LLVM IR (-O0):
@.str = [26 x i8] c"Bogus IRQ, spinning ... \0A\00"
define void @bogus_irq() {
%1 = call i32 @serial_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [26 x i8] c"Bogus IRQ, spinning ... \0A\00"
define void @bogus_irq() {
%1 = tail call i32 @serial_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
int test_imm_09int8_reg(signed char val) {
  return ((val) & (0x09 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_09int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_09int8_reg>:
test   $0x9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09int8_reg(i8 signext %0) {
%2 = and i8 %0, 9
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
scalar_t__ mktime(struct tm *);
int /*<<< orphan*/ printf(char *, int);
void timestamp_break_display(struct tm *current_time) {
  time_t time = mktime(current_time);
  printf("%i\n", (int)time);
}


x86 assembly (clang, -O0):
<timestamp_break_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mktime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp_break_display>:
push   %rax
call   1040 <mktime@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [4 x i8] c"%i\0A\00"
define void @timestamp_break_display(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca i64
store %struct.tm* %0, %struct.tm** %2
%4 = load %struct.tm*, %struct.tm** %2
%5 = call i64 @mktime(%struct.tm* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [4 x i8] c"%i\0A\00"
define void @timestamp_break_display(%struct.tm* nocapture %0) {
%2 = tail call i64 @mktime(%struct.tm* %0)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int snptoi(char snp) {
  if (snp == '3')
    return -1;
  return (int)(snp - 48);
}


x86 assembly (clang, -O0):
<snptoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x33,%eax
jne    1123 <snptoi+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    112d <snptoi+0x2d>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snptoi>:
lea    -0x30(%rdi),%ecx
cmp    $0x33,%dil
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @snptoi(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 51
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %12
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @snptoi(i8 signext %0) {
%2 = icmp eq i8 %0, 51
%3 = sext i8 %0 to i32
%4 = add nsw i32 %3, -48
%5 = select i1 %2, i32 -1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ xisinff(float);
int /*<<< orphan*/ xisnanf(float);
__attribute__((always_)) const int xisnumberf(float x) {
  return !xisinff(x) && !xisnanf(x);
}


x86 assembly (clang, -O0):
<xisnumberf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <xisinff@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    115c <xisnumberf+0x3c>
movss  -0x4(%rbp),%xmm0
call   1040 <xisnanf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisnumberf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <xisinff@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1136 <xisnumberf+0x16>
pop    %rcx
ret
movss  0x4(%rsp),%xmm0
call   1040 <xisnanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xisnumberf(float %0) {
%2 = tail call i32 @xisinff(float %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @xisnanf(float %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ND_Screen_ResetColor();
int /*<<< orphan*/ ND_Screen_SetColor(int /*<<< orphan*/, int);
int /*<<< orphan*/ ND_Screen_WriteString(char const *);
void ND_Error_WriteString(const char *msg) {
  ND_Screen_SetColor(0, 2);
  ND_Screen_WriteString(msg);
  ND_Screen_ResetColor();
}


x86 assembly (clang, -O0):
<ND_Error_WriteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <ND_Screen_SetColor@plt>
mov    -0x8(%rbp),%rdi
call   1050 <ND_Screen_WriteString@plt>
mov    $0x0,%al
call   1030 <ND_Screen_ResetColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ND_Error_WriteString>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <ND_Screen_SetColor@plt>
mov    %rbx,%rdi
call   1050 <ND_Screen_WriteString@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <ND_Screen_ResetColor@plt>

LLVM IR (-O0):
define void @ND_Error_WriteString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ND_Screen_SetColor(i32 0, i32 2)
%4 = load i8*, i8** %2
%5 = call i32 @ND_Screen_WriteString(i8* %4)
%6 = call i32 (...) @ND_Screen_ResetColor()
ret void
}

LLVM IR (-O2):
define void @ND_Error_WriteString(i8* %0) {
%2 = tail call i32 @ND_Screen_SetColor(i32 0, i32 2)
%3 = tail call i32 @ND_Screen_WriteString(i8* %0)
%4 = tail call i32 (...) @ND_Screen_ResetColor()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_DEBUG;
int __sapi_sock_reset_optint(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sapi_sock_reset_debug(int sock) {
  return __sapi_sock_reset_optint(sock, SOL_SOCKET, SO_DEBUG);
}


x86 assembly (clang, -O0):
<sapi_sock_reset_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
call   1030 <__sapi_sock_reset_optint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_sock_reset_debug>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <__sapi_sock_reset_optint@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_DEBUG = global i32 0
define i32 @sapi_sock_reset_debug(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_DEBUG
%6 = call i32 @__sapi_sock_reset_optint(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_DEBUG = global i32 0
define i32 @sapi_sock_reset_debug(i32 %0) {
%2 = load i32, i32* @SOL_SOCKET
%3 = load i32, i32* @SO_DEBUG
%4 = tail call i32 @__sapi_sock_reset_optint(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
riotboot_flashwrite_verify_sha256(digest, img_size, target_slot) {
  (void)digest;
  (void)img_size;
  (void)target_slot;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @riotboot_flashwrite_verify_sha256(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
ret i32 0
}

LLVM IR (-O2):
define i32 @riotboot_flashwrite_verify_sha256(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ COND_NE();
int /*<<< orphan*/ EA_AL_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sne_8_al(void) { m68ki_write_8(EA_AL_8(), COND_NE() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_sne_8_al>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AL_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_NE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sne_8_al>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AL_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_NE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sne_8_al() {
%1 = call i32 (...) @EA_AL_8()
%2 = call i64 (...) @COND_NE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sne_8_al() {
%1 = tail call i32 (...) @EA_AL_8()
%2 = tail call i64 (...) @COND_NE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void i(int a) {}


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

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

LLVM IR (-O0):
define void @i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @i(i32 %0) {
ret void
}
/* Variables and functions */
char *strchr(char *, int /*<<< orphan*/);
void append_char(char *s, char c) {
  char *a = strchr(s, 0);
  *a = c;
  a[1] = 0;
}


x86 assembly (clang, -O0):
<append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_char>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @append_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i32 0)
store i8* %7, i8** %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %5
store i8 %8, i8* %9
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 0, i8* %11
ret void
}

LLVM IR (-O2):
define void @append_char(i8* nocapture %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr i8, i8* %0, i64 %3
store i8 %1, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doIoctl();
int /*<<< orphan*/ doMalloc();
int main() {
  doMalloc();
  doIoctl();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @doMalloc()
%2 = tail call i32 (...) @doIoctl()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ menu();
void main() { menu(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @menu()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __warn(char const *, int, char const *, char const *);
int /*<<< orphan*/ exit(int);
void __fail(const char *file, int line, const char *func, const char *text) {
  __warn(file, line, func, text);
  exit(1);
}


x86 assembly (clang, -O0):
<__fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <__warn@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<__fail>:
push   %rax
call   1040 <__warn@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @__fail(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @__warn(i8* %9, i32 %10, i8* %11, i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @__fail(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @__warn(i8* %0, i32 %1, i8* %2, i8* %3)
%6 = tail call i32 @exit(i32 1)
unreachable
}
__float128 f128_div(__float128 a, __float128 b) { return a / b; }


x86 assembly (clang, -O0):
<f128_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
movaps %xmm1,-0x20(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   1130 <__divtf3>
add    $0x20,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)

x86 assembly (clang, -O2):
<f128_div>:
jmp    1110 <__divtf3>
cs nopw 0x0(%rax,%rax,1)
nop

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

LLVM IR (-O2):
define fp128 @f128_div(fp128 %0, fp128 %1) {
%3 = fdiv fp128 %0, %1
ret fp128 %3
}
/* Type definitions */
struct mbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ KASSERT(int);
int cpu_in_cksum(struct mbuf *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int in_cksum(struct mbuf *m, int len) {
  KASSERT(len >= 0);
  return cpu_in_cksum(m, len, 0, 0);
}


x86 assembly (clang, -O0):
<in_cksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <KASSERT@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <cpu_in_cksum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_cksum>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <KASSERT@plt>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cpu_in_cksum@plt>

LLVM IR (-O0):
%struct.mbuf = type { i32 }
define i32 @in_cksum(%struct.mbuf* %0, i32 %1) {
%3 = alloca %struct.mbuf*
%4 = alloca i32
store %struct.mbuf* %0, %struct.mbuf** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @KASSERT(i32 %7)
%9 = load %struct.mbuf*, %struct.mbuf** %3
%10 = load i32, i32* %4
%11 = call i32 @cpu_in_cksum(%struct.mbuf* %9, i32 %10, i32 0, i32 0)
ret i32 %11
}

LLVM IR (-O2):
%struct.mbuf = type { i32 }
define i32 @in_cksum(%struct.mbuf* %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @KASSERT(i32 %4)
%6 = tail call i32 @cpu_in_cksum(%struct.mbuf* %0, i32 %1, i32 0, i32 0)
ret i32 %6
}
/* Variables and functions */
scalar_t__ strtoull(char const *, char **, int);
long long strtoll(const char *nptr, char **endptr, int base) {
  return (long long)strtoull(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<strtoll>:
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
mov    -0x14(%rbp),%edx
call   1030 <strtoull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoll>:
jmp    1030 <strtoull@plt>

LLVM IR (-O0):
define i64 @strtoll(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 = call i64 @strtoull(i8* %7, i8** %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtoll(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double randnormalize(void) { return rand() / ((double)RAND_MAX + 1); }


x86 assembly (clang, -O0):
<randnormalize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xed1(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randnormalize>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randnormalize() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %1, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randnormalize() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %1, %4
ret double %5
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0)
    printf("%s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1167 <main+0x47>
lea    -0x3f0(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    116c <main+0x4c>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @getline(i8* %2, i32 1000)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int checker_read_double(int, char const *, int, double *);
int checker_read_out_double(const char *name, int eof_error_flag,
                            double *p_val) {
  return checker_read_double(1, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_out_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <checker_read_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_out_double>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <checker_read_double@plt>

LLVM IR (-O0):
define i32 @checker_read_out_double(i8* %0, i32 %1, double* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double*
store i8* %0, i8** %4
store i32 %1, i32* %5
store double* %2, double** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load double*, double** %6
%10 = call i32 @checker_read_double(i32 1, i8* %7, i32 %8, double* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @checker_read_out_double(i8* %0, i32 %1, double* %2) {
%4 = tail call i32 @checker_read_double(i32 1, i8* %0, i32 %1, double* %2)
ret i32 %4
}
int fp64a(void) { return 7; }


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

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

LLVM IR (-O0):
define i32 @fp64a() {
ret i32 7
}

LLVM IR (-O2):
define i32 @fp64a() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(int);
int /*<<< orphan*/ mymemcpy(void *, void *, int);
int main() {
  void *a, *b;
  char *aa, *bb;
  a = malloc((1024 * 1024 * 128));
  b = malloc((1024 * 1024 * 128));
  aa = (char *)a;
  aa[(1024 * 1024 * 128) - 1] = 'a';
  bb = (char *)b;
  mymemcpy(b, a, (1024 * 1024 * 128));
  assert(bb[(1024 * 1024 * 128) - 1] == 'a');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8000000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8000000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x61,0x7ffffff(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8000000,%edx
call   1050 <mymemcpy@plt>
mov    -0x28(%rbp),%rax
movsbl 0x7ffffff(%rax),%eax
cmp    $0x61,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x8000000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x8000000,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
movb   $0x61,0x7ffffff(%rbx)
mov    %rax,%rdi
mov    %rbx,%rsi
mov    $0x8000000,%edx
call   1050 <mymemcpy@plt>
xor    %edi,%edi
cmpb   $0x61,0x7ffffff(%r14)
61
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = call i8* @malloc(i32 134217728)
store i8* %6, i8** %2
%7 = call i8* @malloc(i32 134217728)
store i8* %7, i8** %3
%8 = load i8*, i8** %2
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 134217727
store i8 97, i8* %10
%11 = load i8*, i8** %3
store i8* %11, i8** %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @mymemcpy(i8* %12, i8* %13, i32 134217728)
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 134217727
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 97
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(134217728) i8* @malloc(i32 134217728)
%2 = tail call dereferenceable_or_null(134217728) i8* @malloc(i32 134217728)
%3 = getelementptr inbounds i8, i8* %1, i64 134217727
store i8 97, i8* %3
%4 = tail call i32 @mymemcpy(i8* %2, i8* %1, i32 134217728)
%5 = getelementptr inbounds i8, i8* %2, i64 134217727
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 97
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i32 0
}
float blargg_min(float x, float y) {
  if (y < x)
    x = y;
  return x;
}


x86 assembly (clang, -O0):
<blargg_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    112b <blargg_min+0x2b>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<blargg_min>:
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @blargg_min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %4
store float %9, float* %3
br label %10
10: ; preds = %8, %2
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @blargg_min(float %0, float %1) {
%3 = fcmp olt float %1, %0
%4 = select i1 %3, float %1, float %0
ret float %4
}
__attribute__((weak)) void fd_nrf8001_disconnect_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_disconnect_success() {
ret void
}