xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage: %s [-d device] [load/unload flag]\n", progname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"usage: %s [-d device] [load/unload flag]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"usage: %s [-d device] [load/unload flag]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int __u_char;

/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int cbmarch_listen(int f, __u_char dev, __u_char secadr) {
  return ioctl(f, _IO(0xcb, 1), (dev << 8) | secadr);
}


x86 assembly (clang, -O0):
<cbmarch_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xcb,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
shl    $0x8,%edx
or     -0xc(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_listen>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xcb,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
shl    $0x8,%ebp
or     %ebp,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbmarch_listen(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 = call i32 @_IO(i32 203, i32 1)
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = load i32, i32* %6
%12 = or i32 %10, %11
%13 = call i32 @ioctl(i32 %7, i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cbmarch_listen(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 203, i32 1)
%5 = shl i32 %1, 8
%6 = or i32 %5, %2
%7 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, char, int);
void initBuffer(void **buf, int *buflen) {
  *buflen = 10 * 1024;
  *buf = malloc(*buflen);
  memset(*buf, 'A', *buflen);
}


x86 assembly (clang, -O0):
<initBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2800,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    $0x41,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initBuffer>:
push   %rbx
mov    %rdi,%rbx
movl   $0x2800,(%rsi)
mov    $0x2800,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
mov    $0x41,%esi
mov    $0x2800,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @initBuffer(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 10240, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i8* @malloc(i32 %7)
%9 = load i8**, i8*** %3
store i8* %8, i8** %9
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = call i32 @memset(i8* %11, i8 signext 65, i32 %13)
ret void
}

LLVM IR (-O2):
define void @initBuffer(i8** nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 10240, i32* %1
%3 = tail call dereferenceable_or_null(10240) i8* @malloc(i32 10240)
store i8* %3, i8** %0
%4 = tail call i32 @memset(i8* %3, i8 signext 65, i32 10240)
ret void
}
/* Variables and functions */
scalar_t__ M_PI;
float cosf(float);
float hann(float n, float N, float a) {
  (void)a;
  return 0.5f * (1.0f - cosf(2.0f * (float)M_PI * n / (N - 1.0f)));
}


x86 assembly (clang, -O0):
<hann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    0x2eba(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movss  0xecd(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xeb3(%rip),%xmm2
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
call   1030 <cosf@plt>
movss  0xe9e(%rip),%xmm1
subss  %xmm0,%xmm1
movss  0xe8e(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hann>:
push   %rax
mov    0x2ed0(%rip),%rax
cvtsi2ssq (%rax),%xmm2
addss  %xmm2,%xmm2
mulss  %xmm2,%xmm0
addss  0xed3(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <cosf@plt>
movss  0xec6(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  0xebe(%rip),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @hann(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load i64, i64* @M_PI
%9 = sitofp i64 %8 to float
%10 = fmul float 2.000000e+00, %9
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = load float, float* %5
%14 = fsub float %13, 1.000000e+00
%15 = fdiv float %12, %14
%16 = call float @cosf(float %15)
%17 = fsub float 1.000000e+00, %16
%18 = fmul float 5.000000e-01, %17
ret float %18
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @hann(float %0, float %1, float %2) {
%4 = load i64, i64* @M_PI
%5 = sitofp i64 %4 to float
%6 = fmul float %5, 2.000000e+00
%7 = fmul float %6, %0
%8 = fadd float %1, -1.000000e+00
%9 = fdiv float %7, %8
%10 = tail call float @cosf(float %9)
%11 = fsub float 1.000000e+00, %10
%12 = fmul float %11, 5.000000e-01
ret float %12
}
void g$$1() { f$$1(); }


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

x86 assembly (clang, -O2):
<g$$1>:
xor    %eax,%eax
jmp    1030 <f$$1@plt>

LLVM IR (-O0):
define void @"g$$1"() {
%1 = call i32 (...) @"f$$1"()
ret void
}

LLVM IR (-O2):
define void @"g$$1"() {
%1 = tail call i32 (...) @"f$$1"()
ret void
}
void RTVfsIoStrmTell(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsIoStrmTell() {
ret void
}
void range(a, b) int a, b;
{ printf(((a == b) ? "%d" : "%d,%d"), a, b); }


x86 assembly (clang, -O0):
<range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
lea    0xed1(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range>:
mov    %esi,%edx
mov    %edi,%esi
cmp    %edx,%edi
lea    0xee6(%rip),%rax
lea    0xedc(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d,%d\00"
define void @range(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 eq i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 (i8*, ...) @printf(i8* %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d,%d\00"
define void @range(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %4, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d minutos\n", 2 * n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
add    %esi,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%d minutos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = shl nsw i32 %4, 1
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
char is_digit(int ch) { return ((ch >= '0') && (ch <= '9')); }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_digit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define signext i8 @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_indent(int indent) {
  printf(";; ");
  while (indent--) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     114c <print_indent+0x3c>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1127 <print_indent+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
test   %ebx,%ebx
je     114f <print_indent+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1140 <print_indent+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c";; \00"
define void @print_indent(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @putchar(i32 32)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ onion_decode_block(unsigned char *, unsigned char const *);
void onion_decode(unsigned char *dst, const unsigned char *src) {
  onion_decode_block(&dst[0], &src[0]);
  onion_decode_block(&dst[5], &src[8]);
}


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

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

LLVM IR (-O0):
define void @onion_decode(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 0
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = call i32 @onion_decode_block(i8* %6, i8* %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 5
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 8
%14 = call i32 @onion_decode_block(i8* %11, i8* %13)
ret void
}

LLVM IR (-O2):
define void @onion_decode(i8* %0, i8* %1) {
%3 = tail call i32 @onion_decode_block(i8* %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %0, i64 5
%5 = getelementptr inbounds i8, i8* %1, i64 8
%6 = tail call i32 @onion_decode_block(i8* %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prob1();
int main() { prob1(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @prob1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cl_flush(char *);
int /*<<< orphan*/ sb();
void mem_flush(void *p, size_t s) {
  char *cp = (char *)p;
  size_t i = 0;
  s = s / (64);
  for (i = 0; i < s; i++)
    cl_flush(&cp[i * (64)]);
  sb();
}


x86 assembly (clang, -O0):
<mem_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1187 <mem_flush+0x67>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x6,%rax
add    %rax,%rdi
call   1040 <cl_flush@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1154 <mem_flush+0x34>
mov    $0x0,%al
call   1030 <sb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_flush>:
push   %r14
push   %rbx
push   %rax
cmp    $0x40,%rsi
jb     1152 <mem_flush+0x32>
mov    %rsi,%r14
mov    %rdi,%rbx
shr    $0x6,%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <cl_flush@plt>
add    $0x40,%rbx
add    $0xffffffffffffffff,%r14
jne    1140 <mem_flush+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sb@plt>

LLVM IR (-O0):
define void @mem_flush(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i64 0, i64* %6
%8 = load i64, i64* %4
%9 = udiv i64 %8, 64
store i64 %9, i64* %4
store i64 0, i64* %6
br label %10
10: ; preds = %20, %2
%11 = load i64, i64* %6
%12 = load i64, i64* %4
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = mul i64 %16, 64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = call i32 @cl_flush(i8* %18)
br label %20
20: ; preds = %14
%21 = load i64, i64* %6
%22 = add i64 %21, 1
store i64 %22, i64* %6
br label %10
23: ; preds = %10
%24 = call i32 (...) @sb()
ret void
}

LLVM IR (-O2):
define void @mem_flush(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 64
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = lshr i64 %1, 6
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %11, %6 ], [ 0, %4 ]
%8 = shl i64 %7, 6
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i32 @cl_flush(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 (...) @sb()
ret void
}
/* Variables and functions */
int i2c_smbus_read_byte(int);
int odroidI2CRead(int fd) { return i2c_smbus_read_byte(fd); }


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

x86 assembly (clang, -O2):
<odroidI2CRead>:
jmp    1030 <i2c_smbus_read_byte@plt>

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

LLVM IR (-O2):
define i32 @odroidI2CRead(i32 %0) {
%2 = tail call i32 @i2c_smbus_read_byte(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ DMA2_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void DMA2_IRQHandler(void) {
  DMA2_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA2_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @DMA2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA2_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @DMA2_DriverIRQHandler()
ret void
}
/* Variables and functions */
int color(char const *, int);
int bg_color(const char *col) { return color(col, 40); }


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

x86 assembly (clang, -O2):
<bg_color>:
mov    $0x28,%esi
jmp    1030 <color@plt>

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

LLVM IR (-O2):
define i32 @bg_color(i8* %0) {
%2 = tail call i32 @color(i8* %0, i32 40)
ret i32 %2
}
void init_uart(void) {
  (*((volatile unsigned short *)0x7F008000)) &= ~0xff;
  (*((volatile unsigned short *)0x7F008000)) |= 0x22;
  (*((volatile unsigned long *)0x7F005000)) = 0x3;
  (*((volatile unsigned long *)0x7F005004)) = 0x5 | (1 << 9);
  (*((volatile unsigned long *)0x7F005008)) = 0x07 | (1 << 6);
  (*((volatile unsigned long *)0x7F00500C)) = 0;
  (*((volatile unsigned short *)0x7F005028)) = 35;
  (*((volatile unsigned short *)0x7F00502C)) = 0x1;
}


x86 assembly (clang, -O0):
<init_uart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008000,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0xffffff00,%eax
mov    %ax,%cx
mov    $0x7f008000,%eax
mov    %cx,(%rax)
mov    $0x7f008000,%eax
mov    (%rax),%ax
movzwl %ax,%eax
or     $0x22,%eax
mov    %ax,%cx
mov    $0x7f008000,%eax
mov    %cx,(%rax)
mov    $0x7f005000,%eax
movq   $0x3,(%rax)
mov    $0x7f005004,%eax
movq   $0x205,(%rax)
mov    $0x7f005008,%eax
movq   $0x47,(%rax)
mov    $0x7f00500c,%eax
movq   $0x0,(%rax)
mov    $0x7f005028,%eax
movw   $0x23,(%rax)
mov    $0x7f00502c,%eax
movw   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_uart>:
andw   $0xff00,0x7f008000
orw    $0x22,0x7f008000
7f 22
movq   $0x3,0x7f005000
movq   $0x205,0x7f005004
movq   $0x47,0x7f005008
movq   $0x0,0x7f00500c
movw   $0x23,0x7f005028
movw   $0x1,0x7f00502c
ret

LLVM IR (-O0):
define void @init_uart() {
%1 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%2 = zext i16 %1 to i32
%3 = and i32 %2, -256
%4 = trunc i32 %3 to i16
store volatile i16 %4, i16* inttoptr (i64 2130739200 to i16*)
%5 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%6 = zext i16 %5 to i32
%7 = or i32 %6, 34
%8 = trunc i32 %7 to i16
store volatile i16 %8, i16* inttoptr (i64 2130739200 to i16*)
store volatile i64 3, i64* inttoptr (i64 2130726912 to i64*)
store volatile i64 517, i64* inttoptr (i64 2130726916 to i64*)
store volatile i64 71, i64* inttoptr (i64 2130726920 to i64*)
store volatile i64 0, i64* inttoptr (i64 2130726924 to i64*)
store volatile i16 35, i16* inttoptr (i64 2130726952 to i16*)
store volatile i16 1, i16* inttoptr (i64 2130726956 to i16*)
ret void
}

LLVM IR (-O2):
define void @init_uart() {
%1 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%2 = and i16 %1, -256
store volatile i16 %2, i16* inttoptr (i64 2130739200 to i16*)
%3 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%4 = or i16 %3, 34
store volatile i16 %4, i16* inttoptr (i64 2130739200 to i16*)
store volatile i64 3, i64* inttoptr (i64 2130726912 to i64*)
store volatile i64 517, i64* inttoptr (i64 2130726916 to i64*)
store volatile i64 71, i64* inttoptr (i64 2130726920 to i64*)
store volatile i64 0, i64* inttoptr (i64 2130726924 to i64*)
store volatile i16 35, i16* inttoptr (i64 2130726952 to i16*)
store volatile i16 1, i16* inttoptr (i64 2130726956 to i16*)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, void *);
double t() {
  struct timeval tv;
  gettimeofday(&tv, ((void *)0));
  return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @t() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @t() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *const);
int /*<<< orphan*/ strcpy(char *, char *const);
void String_join(char *target, char *const str1, char *const str2) {
  strcpy(target, str1);
  strcat(target, str2);
}


x86 assembly (clang, -O0):
<String_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @String_join(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = call i32 @strcat(i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @String_join(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_data();
int /*<<< orphan*/ check_random();
void testmain(int argc, char *argv[]) {
  check_data();
  check_random();
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <check_data@plt>
mov    $0x0,%al
call   1040 <check_random@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
push   %rax
xor    %eax,%eax
call   1030 <check_data@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <check_random@plt>

LLVM IR (-O0):
define void @testmain(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @check_data()
%6 = call i32 (...) @check_random()
ret void
}

LLVM IR (-O2):
define void @testmain(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @check_data()
%4 = tail call i32 (...) @check_random()
ret void
}
/* Type definitions */
struct dict_iter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dict_iter *);
void dict_iter_free(struct dict_iter *iter) {
  if (iter != NULL)
    free(iter);
}


x86 assembly (clang, -O0):
<dict_iter_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <dict_iter_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_iter_free>:
test   %rdi,%rdi
je     111a <dict_iter_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.dict_iter = type { i32 }
define void @dict_iter_free(%struct.dict_iter* %0) {
%2 = alloca %struct.dict_iter*
store %struct.dict_iter* %0, %struct.dict_iter** %2
%3 = load %struct.dict_iter*, %struct.dict_iter** %2
%4 = icmp ne %struct.dict_iter* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.dict_iter*, %struct.dict_iter** %2
%7 = call i32 @free(%struct.dict_iter* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.dict_iter = type { i32 }
define void @dict_iter_free(%struct.dict_iter* %0) {
%2 = icmp eq %struct.dict_iter* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.dict_iter* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ isdelimeter(int /*<<< orphan*/);
int /*<<< orphan*/ peek(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void peek_isdelimeter(FILE *fin) {
  if (!isdelimeter(peek(fin))) {
    fprintf(stderr, "Expecting delimeter after symbol end");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<peek_isdelimeter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <peek@plt>
mov    %eax,%edi
call   1030 <isdelimeter@plt>
cmp    $0x0,%eax
jne    1184 <peek_isdelimeter+0x44>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek_isdelimeter>:
push   %rax
call   1040 <peek@plt>
mov    %eax,%edi
call   1030 <isdelimeter@plt>
test   %eax,%eax
je     1153 <peek_isdelimeter+0x13>
pop    %rax
ret
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Expecting delimeter after symbol end\00"
define void @peek_isdelimeter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @peek(i32* %3)
%5 = call i32 @isdelimeter(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Expecting delimeter after symbol end\00"
define void @peek_isdelimeter(i32* %0) {
%2 = tail call i32 @peek(i32* %0)
%3 = tail call i32 @isdelimeter(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret void
}
void gtk_menu_item_get_submenu() {}


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

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

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

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

/* Variables and functions */
uint64_t min(const uint64_t a, const uint64_t b) { return a <= b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sle i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_do();
int /*<<< orphan*/ test_for();
int /*<<< orphan*/ test_goto();
int /*<<< orphan*/ test_if();
int /*<<< orphan*/ test_label();
int /*<<< orphan*/ test_logor();
int /*<<< orphan*/ test_switch();
int /*<<< orphan*/ test_while();
int main() {
  test_if();
  test_for();
  test_while();
  test_do();
  test_switch();
  test_goto();
  test_label();
  test_logor();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_if@plt>
mov    $0x0,%al
call   1040 <test_for@plt>
mov    $0x0,%al
call   1070 <test_while@plt>
mov    $0x0,%al
call   10a0 <test_do@plt>
mov    $0x0,%al
call   1080 <test_switch@plt>
mov    $0x0,%al
call   1050 <test_goto@plt>
mov    $0x0,%al
call   1030 <test_label@plt>
mov    $0x0,%al
call   1090 <test_logor@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_if@plt>
xor    %eax,%eax
call   1040 <test_for@plt>
xor    %eax,%eax
call   1070 <test_while@plt>
xor    %eax,%eax
call   10a0 <test_do@plt>
xor    %eax,%eax
call   1080 <test_switch@plt>
xor    %eax,%eax
call   1050 <test_goto@plt>
xor    %eax,%eax
call   1030 <test_label@plt>
xor    %eax,%eax
call   1090 <test_logor@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_if()
%3 = call i32 (...) @test_for()
%4 = call i32 (...) @test_while()
%5 = call i32 (...) @test_do()
%6 = call i32 (...) @test_switch()
%7 = call i32 (...) @test_goto()
%8 = call i32 (...) @test_label()
%9 = call i32 (...) @test_logor()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_if()
%2 = tail call i32 (...) @test_for()
%3 = tail call i32 (...) @test_while()
%4 = tail call i32 (...) @test_do()
%5 = tail call i32 (...) @test_switch()
%6 = tail call i32 (...) @test_goto()
%7 = tail call i32 (...) @test_label()
%8 = tail call i32 (...) @test_logor()
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
double fromRep64(int);
double makeNaN64(uint64_t rand) {
  return fromRep64(0x7ff0000000000000UL | (rand & 0xfffffffffffffUL));
}


x86 assembly (clang, -O0):
<makeNaN64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xfffffffffffff,%rcx
and    %rcx,%rax
movabs $0x7ff0000000000000,%rcx
or     %rcx,%rax
mov    %eax,%edi
call   1030 <fromRep64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeNaN64>:
jmp    1030 <fromRep64@plt>

LLVM IR (-O0):
define double @makeNaN64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 4503599627370495
%6 = or i64 9218868437227405312, %5
%7 = trunc i64 %6 to i32
%8 = call double @fromRep64(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @makeNaN64(i32 %0) {
%2 = tail call double @fromRep64(i32 %0)
ret double %2
}
/* Variables and functions */
int sqrt(int);
float ANTweenTimingFunctionCircIn(float time, float begin, float change,
                                  float duration) {
  time /= duration;
  return -change * (sqrt(1 - time * time) - 1) + begin;
}


x86 assembly (clang, -O0):
<ANTweenTimingFunctionCircIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xe87(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
movss  -0x14(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenTimingFunctionCircIn>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
mulss  %xmm0,%xmm0
movss  0xed4(%rip),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <sqrt@plt>
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
mulss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ANTweenTimingFunctionCircIn(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %8
%10 = load float, float* %5
%11 = fdiv float %10, %9
store float %11, float* %5
%12 = load float, float* %7
%13 = fneg float %12
%14 = load float, float* %5
%15 = load float, float* %5
%16 = fneg float %14
%17 = call float @llvm.fmuladd.f32(float %16, float %15, float 1.000000e+00)
%18 = fptosi float %17 to i32
%19 = call i32 @sqrt(i32 %18)
%20 = sub nsw i32 %19, 1
%21 = sitofp i32 %20 to float
%22 = load float, float* %6
%23 = call float @llvm.fmuladd.f32(float %13, float %21, float %22)
ret float %23
}

LLVM IR (-O2):
define float @ANTweenTimingFunctionCircIn(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = fneg float %2
%7 = fneg float %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.000000e+00)
%9 = fptosi float %8 to i32
%10 = tail call i32 @sqrt(i32 %9)
%11 = add nsw i32 %10, -1
%12 = sitofp i32 %11 to float
%13 = tail call float @llvm.fmuladd.f32(float %6, float %12, float %1)
ret float %13
}
void test_safelen_simdlen() {
  int i;
#pragma omp for simd simdlen(6) safelen(5)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp for simd safelen(5) simdlen(6)
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_safelen_simdlen>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_safelen_simdlen+0x28>
jmp    111a <test_safelen_simdlen+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_safelen_simdlen+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_safelen_simdlen+0x4c>
jmp    113e <test_safelen_simdlen+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_safelen_simdlen+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_safelen_simdlen() {
ret void
}
void Comp_1_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Comp_1_SaveConfig() {
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char get_random_number(int, int);
int /*<<< orphan*/ printf(char *, char *, char);
int /*<<< orphan*/ sleep(char);
int /*<<< orphan*/ stdout;
void eat(uint8_t *name) {
  uint8_t random = get_random_number(2, 9);
  printf("%s eating for %u seconds.\n", name, random);
  fflush(stdout);
  sleep(random);
}


x86 assembly (clang, -O0):
<eat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x9,%esi
call   1050 <get_random_number@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe97(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
movsbl -0x9(%rbp),%edi
call   1060 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2,%edi
mov    $0x9,%esi
call   1050 <get_random_number@plt>
movsbl %al,%ebp
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s eating for %u seconds.\0A\00"
@stdout = global i32 0
define void @eat(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = call signext i8 @get_random_number(i32 2, i32 9)
store i8 %4, i8* %3
%5 = load i8*, i8** %2
%6 = load i8, i8* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %5, i8 signext %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = load i8, i8* %3
%11 = call i32 @sleep(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s eating for %u seconds.\0A\00"
@stdout = global i32 0
define void @eat(i8* %0) {
%2 = tail call signext i8 @get_random_number(i32 2, i32 9)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @sleep(i8 signext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _print_usage(void) {
  printf("Usage: print [ pfcs ] [ <shellcode file> ]\n"
         "Executes provided shellcode in a variety of manners, depending on "
         "the first option given. NOTE: For all options other than `p`, the "
         "shellcode must end with a syscall to `exit`.\n"
         "Options:\n"
         "\tp	Execute shellcode from parent thread\n"
         "\tf	Run fork() and execute shellcode from forked process\n"
         "\tc	Run glibc clone() and execute shellcode from child thread\n"
         "\ts	Use inline assembly to perform clone syscall and run shellcode "
         "from child thread\n");
}


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

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

LLVM IR (-O0):
@.str = [471 x i8] c"Usage: print [ pfcs ] [ <shellcode file> ]\0AExecutes provided shellcode in a variety of manners, depending on the first option given. NOTE: For all options other than `p`, the shellcode must end with a syscall to `exit`.\0AOptions:\0A\09p\09Execute shellcode from parent thread\0A\09f\09Run fork() and execute shellcode from forked process\0A\09c\09Run glibc clone() and execute shellcode from child thread\0A\09s\09Use inline assembly to perform clone syscall and run shellcode from child thread\0A\00"
define void @_print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [470 x i8] c"Usage: print [ pfcs ] [ <shellcode file> ]\0AExecutes provided shellcode in a variety of manners, depending on the first option given. NOTE: For all options other than `p`, the shellcode must end with a syscall to `exit`.\0AOptions:\0A\09p\09Execute shellcode from parent thread\0A\09f\09Run fork() and execute shellcode from forked process\0A\09c\09Run glibc clone() and execute shellcode from child thread\0A\09s\09Use inline assembly to perform clone syscall and run shellcode from child thread\00"
define void @_print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([470 x i8], [470 x i8]* @str, i64 0, i64 0))
ret void
}
void f(int a) { return; }


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ reportError(int);
int errorCodeGen(int fd) {
  char buf[100];
  int rc = read(fd, buf, 10);
  if (rc < 0) {
    reportError(fd);
    return -100;
  }
  return fd + 5;
}


x86 assembly (clang, -O0):
<errorCodeGen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0xa,%edx
call   1030 <read@plt>
mov    %eax,-0x74(%rbp)
cmpl   $0x0,-0x74(%rbp)
jge    1160 <errorCodeGen+0x40>
mov    -0x8(%rbp),%edi
call   1040 <reportError@plt>
movl   $0xffffff9c,-0x4(%rbp)
jmp    1169 <errorCodeGen+0x49>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorCodeGen>:
push   %rbx
sub    $0x70,%rsp
mov    %edi,%ebx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <read@plt>
test   %eax,%eax
js     113d <errorCodeGen+0x1d>
add    $0x5,%ebx
jmp    1149 <errorCodeGen+0x29>
mov    %ebx,%edi
call   1040 <reportError@plt>
mov    $0xffffff9c,%ebx
mov    %ebx,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @errorCodeGen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = call i32 @read(i32 %6, i8* %7, i32 10)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @reportError(i32 %12)
store i32 -100, i32* %2
br label %17
14: ; preds = %1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 5
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @errorCodeGen(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 10)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @reportError(i32 %0)
br label %10
8: ; preds = %1
%9 = add nsw i32 %0, 5
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ -100, %6 ], [ %9, %8 ]
ret i32 %11
}
int test_imm_5Cuint16_mem(unsigned short *val) {
  return ((*val) & (0x5C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Cuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x5c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_5Cuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 92
%7 = icmp ne i32 %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_5Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 92
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_SIZE16_swap(char *, int);
void U_WMREOF_swap(char *record, int torev) {
  U_WMRCORE_SIZE16_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMREOF_swap>:
jmp    1030 <U_WMRCORE_SIZE16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMREOF_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_SIZE16_swap(i8* %0, i32 %1)
ret void
}