xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ bla();
int /*<<< orphan*/ foo();
void dont_thread_1(void) {
  int i = 0;
  int first = 1;
  do {
    if (first)
      foo();
    else
      bar();
    first = 0;
    bla();
  } while (i++ < 100);
}


x86 assembly (clang, -O0):
<dont_thread_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115c <dont_thread_1+0x2c>
mov    $0x0,%al
call   1050 <foo@plt>
jmp    1163 <dont_thread_1+0x33>
mov    $0x0,%al
call   1030 <bar@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <bla@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x64,%eax
jl     1146 <dont_thread_1+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dont_thread_1>:
push   %rbx
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1040 <bla@plt>
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1040 <bla@plt>
add    $0xffffffff,%ebx
jne    1150 <dont_thread_1+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @dont_thread_1() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bla()
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 1, %0 ], [ %7, %3 ]
%5 = tail call i32 (...) @bar()
%6 = tail call i32 (...) @bla()
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 101
br i1 %8, label %9, label %3
9: ; preds = %3
ret void
}
void led_init() { (*(volatile unsigned long *)0x7F008800) = 0x11110000; }


x86 assembly (clang, -O0):
<led_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008800,%eax
movq   $0x11110000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_init>:
movq   $0x11110000,0x7f008800
ret

LLVM IR (-O0):
define void @led_init() {
store volatile i64 286326784, i64* inttoptr (i64 2130741248 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_init() {
store volatile i64 286326784, i64* inttoptr (i64 2130741248 to i64*)
ret void
}
void dmabuf_sync_profile_collect(struct dmabuf_sync *sync, unsigned int type) {}


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

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

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

LLVM IR (-O2):
%struct.dmabuf_sync = type opaque
define void @dmabuf_sync_profile_collect(%struct.dmabuf_sync* nocapture %0, i32 %1) {
ret void
}
void default_environment_path_set(char *path) {}


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

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

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

LLVM IR (-O2):
define void @default_environment_path_set(i8* nocapture %0) {
ret void
}
char *numeric_hex_to_oct(char value[]) { return ""; }


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

x86 assembly (clang, -O2):
<numeric_hex_to_oct>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @numeric_hex_to_oct(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @numeric_hex_to_oct(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void problem_inloop() {}


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

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

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

LLVM IR (-O2):
define void @problem_inloop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void help(const char *progname) {
  printf("USAGE: %s [args]\n", progname);
  printf("-h\tShow help and exit\n");
  printf("-l\tLog to file\n");
  printf("-p port\tListen on port\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"USAGE: %s [args]\0A\00"
@.str.1 = [23 x i8] c"-h\09Show help and exit\0A\00"
@.str.2 = [16 x i8] c"-l\09Log to file\0A\00"
@.str.3 = [24 x i8] c"-p port\09Listen on port\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"USAGE: %s [args]\0A\00"
@str = [22 x i8] c"-h\09Show help and exit\00"
@str.4 = [15 x i8] c"-l\09Log to file\00"
@str.5 = [23 x i8] c"-p port\09Listen on port\00"
define void @help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.5, i64 0, i64 0))
ret void
}
void XDisplayMotionBufferSize() {}


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

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

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

LLVM IR (-O2):
define void @XDisplayMotionBufferSize() {
ret void
}
float tempF(short int tmp) {
  short int tmpd;
  float f;
  tmpd = tmp & 0x7F;
  tmp >>= 7;
  f = (float)tmp + (float)tmpd / 128;
  f = 9.0 / 5.0 * f + 32;
  return f;
}


x86 assembly (clang, -O0):
<tempF>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x7f,%eax
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
shr    $0x7,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2ss %eax,%xmm0
movswl -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
movss  0xed7(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempF>:
mov    %edi,%eax
sar    $0x7,%eax
cvtsi2ss %eax,%xmm0
and    $0x7f,%edi
cvtsi2ss %edi,%xmm1
mulss  0xee8(%rip),%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xedd(%rip),%xmm0
addsd  0xedd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tempF(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca float
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = and i32 %6, 127
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = ashr i32 %10, 7
%12 = trunc i32 %11 to i16
store i16 %12, i16* %2
%13 = load i16, i16* %2
%14 = sitofp i16 %13 to float
%15 = load i16, i16* %3
%16 = sitofp i16 %15 to float
%17 = fdiv float %16, 1.280000e+02
%18 = fadd float %14, %17
store float %18, float* %4
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %20, double 3.200000e+01)
%22 = fptrunc double %21 to float
store float %22, float* %4
%23 = load float, float* %4
ret float %23
}

LLVM IR (-O2):
define float @tempF(i16 signext %0) {
%2 = and i16 %0, 127
%3 = ashr i16 %0, 7
%4 = sitofp i16 %3 to float
%5 = sitofp i16 %2 to float
%6 = fmul float %5, 7.812500e-03
%7 = fadd float %6, %4
%8 = fpext float %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 1.800000e+00, double 3.200000e+01)
%10 = fptrunc double %9 to float
ret float %10
}
void log_enterexit_func(const char *inout, const char *type, const char *func) {
}


x86 assembly (clang, -O0):
<log_enterexit_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @log_enterexit_func(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
void *s_malloc(size_t);
void *sds_malloc(size_t size) { return s_malloc(size); }


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

x86 assembly (clang, -O2):
<sds_malloc>:
jmp    1030 <s_malloc@plt>

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

LLVM IR (-O2):
define i8* @sds_malloc(i64 %0) {
%2 = tail call i8* @s_malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stdout;
void padchar(char c, unsigned repeat) {
  unsigned i;
  for (i = 0; i < repeat; ++i)
    fprintf(stdout, "%c", c);
}


x86 assembly (clang, -O0):
<padchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    115b <padchar+0x4b>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <padchar+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padchar>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1142 <padchar+0x32>
mov    %esi,%ebx
mov    0x2ebc(%rip),%r15
movsbl %dil,%ebp
lea    0xed1(%rip),%r14
nop
mov    (%r15),%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <fprintf@plt>
add    $0xffffffff,%ebx
jne    1130 <padchar+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%c\00"
define void @padchar(i8 signext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = load i32, i32* @stdout
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%8 = add nuw i32 %5, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
__attribute__((always_, unused)) void ips_wmb() {
  asm volatile("sfence" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @ips_wmb() {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void wf(char *mr, int tc) {
  while (tc-- > 0)
    *mr++ = 0;
}


x86 assembly (clang, -O0):
<wf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1136 <wf+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    110b <wf+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wf>:
test   %esi,%esi
jle    1122 <wf+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @wf(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ buf_free(struct buf *);
int buf_len(struct buf *);
struct buf *buf_new(char *);
void case_buf_len() {
  struct buf *buf = buf_new("abcdef");
  assert(buf_len(buf) == 6);
  buf_free(buf);
}


x86 assembly (clang, -O0):
<case_buf_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <buf_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <buf_len@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1060 <buf_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<case_buf_len>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <buf_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <buf_len@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <buf_free@plt>

LLVM IR (-O0):
%struct.buf = type { i32 }
@.str = [7 x i8] c"abcdef\00"
define void @case_buf_len() {
%1 = alloca %struct.buf*
%2 = call %struct.buf* @buf_new(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store %struct.buf* %2, %struct.buf** %1
%3 = load %struct.buf*, %struct.buf** %1
%4 = call i32 @buf_len(%struct.buf* %3)
%5 = icmp eq i32 %4, 6
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load %struct.buf*, %struct.buf** %1
%9 = call i32 @buf_free(%struct.buf* %8)
ret void
}

LLVM IR (-O2):
%struct.buf = type { i32 }
@.str = [7 x i8] c"abcdef\00"
define void @case_buf_len() {
%1 = tail call %struct.buf* @buf_new(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @buf_len(%struct.buf* %1)
%3 = icmp eq i32 %2, 6
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @buf_free(%struct.buf* %1)
ret void
}
void dummy_function(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_function() {
ret void
}
int dpl_nchoose2(int n) {
  int ret = (n * n - n) / 2;
  return ret;
}


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

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

LLVM IR (-O0):
define i32 @dpl_nchoose2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = sdiv i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @dpl_nchoose2(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sub nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
int g_DUMMY_popup_radiobox(int win_id, char *title, char *subtitle,
                           int item_count, char *items[], int select_pos) {
  win_id = win_id;
  title = title;
  subtitle = subtitle;
  item_count = item_count;
  items = items;
  select_pos = select_pos;
  return 0;
}


x86 assembly (clang, -O0):
<g_DUMMY_popup_radiobox>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_popup_radiobox(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8** nocapture readnone %4, i32 %5) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
uid_t geteuid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @geteuid() {
ret i32 0
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_log_mc_on(struct sip_msg *);
int is_mc_on(struct sip_msg *rq) {
  if (is_log_mc_on(rq))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_mc_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_log_mc_on@plt>
cmp    $0x0,%rax
je     113b <is_mc_on+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <is_mc_on+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sip_msg = type { i32 }
define i32 @is_mc_on(%struct.sip_msg* %0) {
%2 = alloca i32
%3 = alloca %struct.sip_msg*
store %struct.sip_msg* %0, %struct.sip_msg** %3
%4 = load %struct.sip_msg*, %struct.sip_msg** %3
%5 = call i64 @is_log_mc_on(%struct.sip_msg* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @is_mc_on(%struct.sip_msg* %0) {
%2 = tail call i64 @is_log_mc_on(%struct.sip_msg* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void close_syslog(void) {}


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

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

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

LLVM IR (-O2):
define void @close_syslog() {
ret void
}
/* Variables and functions */
double RL_standard_uniform(double, int);
int /*<<< orphan*/ assert(int);
double log(double);
double RandomExp(double mean) {
  double x = 0.;
  assert(mean >= 0.);
  x = RL_standard_uniform(x, 1);
  x = -mean * log(x);
  assert(x >= 0.);
  return x;
}


x86 assembly (clang, -O0):
<RandomExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%edi
call   1040 <RL_standard_uniform@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomExp>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
setae  %dil
call   1030 <assert@plt>
xorpd  %xmm0,%xmm0
mov    $0x1,%edi
call   1040 <RL_standard_uniform@plt>
movaps (%rsp),%xmm1
xorps  0xe9b(%rip),%xmm1
movaps %xmm1,(%rsp)
call   1050 <log@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
xor    %edi,%edi
ucomisd 0xe8e(%rip),%xmm0
setae  %dil
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @RandomExp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fcmp oge double %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load double, double* %3
%9 = call double @RL_standard_uniform(double %8, i32 1)
store double %9, double* %3
%10 = load double, double* %2
%11 = fneg double %10
%12 = load double, double* %3
%13 = call double @log(double %12)
%14 = fmul double %11, %13
store double %14, double* %3
%15 = load double, double* %3
%16 = fcmp oge double %15, 0.000000e+00
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @RandomExp(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call double @RL_standard_uniform(double 0.000000e+00, i32 1)
%6 = fneg double %0
%7 = tail call double @log(double %5)
%8 = fmul double %7, %6
%9 = fcmp oge double %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
ret double %8
}
void tegra20_init_fuse_early(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra20_init_fuse_early() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void stick_open(int stick) {
  fprintf(
      stderr,
      "Joystick support was disabled at compile-time. To enable it, make sure\n"
      "you are running a recent version of the Linux kernel with the joystick\n"
      "driver enabled, and install the header file <linux/joystick.h>.\n");
}


x86 assembly (clang, -O0):
<stick_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stick_open>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [207 x i8] c"Joystick support was disabled at compile-time. To enable it, make sure\0Ayou are running a recent version of the Linux kernel with the joystick\0Adriver enabled, and install the header file <linux/joystick.h>.\0A\00"
define void @stick_open(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [207 x i8] c"Joystick support was disabled at compile-time. To enable it, make sure\0Ayou are running a recent version of the Linux kernel with the joystick\0Adriver enabled, and install the header file <linux/joystick.h>.\0A\00"
define void @stick_open(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trainer_dp_2(int /*<<< orphan*/);
void trainer_dp_2_launcher(void) { trainer_dp_2(0); }


x86 assembly (clang, -O0):
<trainer_dp_2_launcher>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <trainer_dp_2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trainer_dp_2_launcher>:
xor    %edi,%edi
jmp    1030 <trainer_dp_2@plt>

LLVM IR (-O0):
define void @trainer_dp_2_launcher() {
%1 = call i32 @trainer_dp_2(i32 0)
ret void
}

LLVM IR (-O2):
define void @trainer_dp_2_launcher() {
%1 = tail call i32 @trainer_dp_2(i32 0)
ret void
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
int32_t string_array_size(char *const *array) {
  int32_t size = -1;
  if (!array)
    return size;
  for (size = 0; array[size]; ++size)
    ;
  return size;
}


x86 assembly (clang, -O0):
<string_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
cmpq   $0x0,-0x10(%rbp)
jne    1128 <string_array_size+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <string_array_size+0x61>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1159 <string_array_size+0x59>
jmp    1148 <string_array_size+0x48>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <string_array_size+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_size>:
test   %rdi,%rdi
je     1120 <string_array_size+0x20>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <string_array_size+0x10>
ret
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @string_array_size(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ -1, %1 ], [ %4, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ etp_set_max_poll_reqs(unsigned int);
void eio_set_max_poll_reqs(unsigned int maxreqs) {
  etp_set_max_poll_reqs(maxreqs);
}


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

x86 assembly (clang, -O2):
<eio_set_max_poll_reqs>:
jmp    1030 <etp_set_max_poll_reqs@plt>

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

LLVM IR (-O2):
define void @eio_set_max_poll_reqs(i32 %0) {
%2 = tail call i32 @etp_set_max_poll_reqs(i32 %0)
ret void
}
/* Variables and functions */
int atan2(double, double);
int /*<<< orphan*/ printf(char *, double, double, double);
int main() {
  double x, y, result;
  x = -10.0;
  y = 10.0;
  result = atan2(y, x) * 180 / 3.14159265;
  printf("The arc tangent for (x=%f, y=%f) is %.3f degrees\n", x, y, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe96(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <atan2@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm2
divsd  0xec8(%rip),%xmm2
lea    0xec9(%rip),%rdi
movsd  0xeb1(%rip),%xmm0
movsd  0xea1(%rip),%xmm1
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"The arc tangent for (x=%f, y=%f) is %.3f degrees\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double -1.000000e+01, double* %2
store double 1.000000e+01, double* %3
%5 = load double, double* %3
%6 = load double, double* %2
%7 = call i32 @atan2(double %5, double %6)
%8 = mul nsw i32 %7, 180
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 0x400921FB53C8D4F1
store double %10, double* %4
%11 = load double, double* %2
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), double %11, double %12, double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [50 x i8] c"The arc tangent for (x=%f, y=%f) is %.3f degrees\0A\00"
define i32 @main() {
%1 = tail call i32 @atan2(double 1.000000e+01, double -1.000000e+01)
%2 = mul nsw i32 %1, 180
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 0x400921FB53C8D4F1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), double -1.000000e+01, double 1.000000e+01, double %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_unknown(void) { printf("Unknown third party contents\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Unknown third party contents\0A\00"
define void @display_unknown() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Unknown third party contents\00"
define void @display_unknown() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ num_to_be(long, int, char *);
void int_to_be(long int val, char *buf) { num_to_be(val, 4, buf); }


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

x86 assembly (clang, -O2):
<int_to_be>:
mov    %rsi,%rdx
mov    $0x4,%esi
jmp    1030 <num_to_be@plt>

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

LLVM IR (-O2):
define void @int_to_be(i64 %0, i8* %1) {
%3 = tail call i32 @num_to_be(i64 %0, i32 4, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void openFile(FILE **file, char *filename, char *type) {
  if ((*file = fopen(filename, type)) == NULL) {
    fprintf(stderr, "[DonorSim_openFile] ERROR: Could not open %s.\n",
            filename);
    exit(1);
  }
  return;
}


x86 assembly (clang, -O0):
<openFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fopen@plt>
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1185 <openFile+0x55>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <fopen@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1155 <openFile+0x25>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"[DonorSim_openFile] ERROR: Could not open %s.\0A\00"
define void @openFile(i32** %0, i8* %1, i8* %2) {
%4 = alloca i32**
%5 = alloca i8*
%6 = alloca i8*
store i32** %0, i32*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = call i32* @fopen(i8* %7, i8* %8)
%10 = load i32**, i32*** %4
store i32* %9, i32** %10
%11 = icmp eq i32* %9, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %5
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"[DonorSim_openFile] ERROR: Could not open %s.\0A\00"
define void @openFile(i32** nocapture writeonly %0, i8* %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %1, i8* %2)
store i32* %4, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret void
}
extern int mdp_ppp_cfg_edge_cond(struct mdp_blit_req *req,
                                 struct ppp_regs *regs) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.mdp_blit_req = type opaque
%struct.ppp_regs = type opaque
define i32 @mdp_ppp_cfg_edge_cond(%struct.mdp_blit_req* nocapture readnone %0, %struct.ppp_regs* nocapture readnone %1) {
ret i32 0
}
void v2add(float *restrict a, const float *b, const float *c) {
  a[0] = b[0] + c[0];
  a[1] = b[1] + c[1];
}


x86 assembly (clang, -O0):
<v2add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2add>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @v2add(float* noalias %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** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @v2add(float* noalias nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret void
}
int CallFunctionRec(int (*fun)(int depth), int depth) {
  if (!fun(depth)) {
    return 0;
  }
  if (depth < 10) {
    CallFunctionRec(fun, depth + 1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<CallFunctionRec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
call   *%rax
cmp    $0x0,%eax
jne    113d <CallFunctionRec+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    115d <CallFunctionRec+0x4d>
cmpl   $0xa,-0x14(%rbp)
jge    1156 <CallFunctionRec+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1030 <CallFunctionRec@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CallFunctionRec>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   *%r14
test   %eax,%eax
je     1147 <CallFunctionRec+0x47>
cmp    $0xb,%ebx
mov    $0xa,%r15d
cmovge %ebx,%r15d
neg    %r15d
add    $0x1,%ebx
mov    $0x1,%ebp
nopl   (%rax)
lea    (%r15,%rbx,1),%eax
cmp    $0x1,%eax
je     1149 <CallFunctionRec+0x49>
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
test   %eax,%eax
jne    1130 <CallFunctionRec+0x30>
jmp    1149 <CallFunctionRec+0x49>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @CallFunctionRec(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = call i32 @llvm.smax.i32(i32 %1, i32 10)
br label %7
7: ; preds = %5, %10
%8 = phi i32 [ %11, %10 ], [ %1, %5 ]
%9 = icmp eq i32 %8, %6
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = add i32 %8, 1
%12 = tail call i32 %0(i32 %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %10, %2
%15 = phi i32 [ 0, %2 ], [ 1, %10 ], [ 1, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ fctl_sagtoBias(void *, unsigned char);
void ctl_sagtoBias(void *d, unsigned char uc) { fctl_sagtoBias(d, uc / 127.0); }


x86 assembly (clang, -O0):
<ctl_sagtoBias>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
call   1030 <fctl_sagtoBias@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctl_sagtoBias>:
cvtsi2sd %esi,%xmm0
divsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
jmp    1030 <fctl_sagtoBias@plt>

LLVM IR (-O0):
define void @ctl_sagtoBias(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.270000e+02
%10 = fptoui double %9 to i8
%11 = call i32 @fctl_sagtoBias(i8* %5, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @ctl_sagtoBias(i8* %0, i8 zeroext %1) {
%3 = uitofp i8 %1 to double
%4 = fdiv double %3, 1.270000e+02
%5 = fptoui double %4 to i8
%6 = tail call i32 @fctl_sagtoBias(i8* %0, i8 zeroext %5)
ret void
}
void acknowledge_irq() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ solo5_abort();
int solo5_app_main(const struct solo5_start_info *si __attribute__((unused))) {
  puts("\n**** Solo5 standalone test_dumpcore ****\n\n");
  solo5_abort();
  return 0;
}


x86 assembly (clang, -O0):
<solo5_app_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <solo5_abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.solo5_start_info = type { i32 }
@.str = [44 x i8] c"\0A**** Solo5 standalone test_dumpcore ****\0A\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* %0) {
%2 = alloca %struct.solo5_start_info*
store %struct.solo5_start_info* %0, %struct.solo5_start_info** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @solo5_abort()
ret i32 0
}

LLVM IR (-O2):
%struct.solo5_start_info = type { i32 }
@.str = [44 x i8] c"\0A**** Solo5 standalone test_dumpcore ****\0A\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @solo5_abort()
ret i32 0
}
void simtec_heartbeat_timer_start() {}


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

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

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

LLVM IR (-O2):
define void @simtec_heartbeat_timer_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_char(int /*<<< orphan*/);
void serial_terminate(void) {
  const char *text_reset = "\033[0m";
  while (*text_reset) {
    write_char(*text_reset++);
  }
}


x86 assembly (clang, -O0):
<serial_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <serial_terminate+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <write_char@plt>
jmp    1123 <serial_terminate+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_terminate>:
push   %rax
mov    $0x1b,%edi
call   1030 <write_char@plt>
mov    $0x5b,%edi
call   1030 <write_char@plt>
mov    $0x30,%edi
call   1030 <write_char@plt>
mov    $0x6d,%edi
pop    %rax
jmp    1030 <write_char@plt>

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

LLVM IR (-O2):
define void @serial_terminate() {
%1 = tail call i32 @write_char(i32 27)
%2 = tail call i32 @write_char(i32 91)
%3 = tail call i32 @write_char(i32 48)
%4 = tail call i32 @write_char(i32 109)
ret void
}