xunge/DecIR huggingface dataset:
/* Variables and functions */
int binarySearch(int *, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {1, 4, 5, 6, 8, 10, 12};
  printf("%d\n", binarySearch(arr, 6, 0, 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1040 <binarySearch@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
xor    %edx,%edx
mov    $0x6,%ecx
call   1040 <binarySearch@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [7 x i32] [i32 1, i32 4, i32 5, i32 6, i32 8, i32 10, i32 12]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
store i32 0, i32* %1
%3 = bitcast [7 x i32]* %2 to i8*
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%5 = call i32 @binarySearch(i32* %4, i32 6, i32 0, i32 6)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [7 x i32] [i32 1, i32 4, i32 5, i32 6, i32 8, i32 10, i32 12]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @binarySearch(i32* %3, i32 6, i32 0, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int nchars;
};
typedef TYPE_1__ XwcTextItem;

/* Variables and functions */
void set_XwcTextItem_nchars(void *_p, int _v) {
  ((XwcTextItem *)_p)->nchars = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XwcTextItem_nchars>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XwcTextItem_nchars(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
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XwcTextItem_nchars(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct ehca_shca {
  int dummy;
};

/* Variables and functions */
int ehca_get_max_hwpage_size(struct ehca_shca *);
int x(struct ehca_shca *shca) { return ehca_get_max_hwpage_size(shca); }


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

x86 assembly (clang, -O2):
<x>:
jmp    1030 <ehca_get_max_hwpage_size@plt>

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

LLVM IR (-O2):
%struct.ehca_shca = type { i32 }
define i32 @x(%struct.ehca_shca* %0) {
%2 = tail call i32 @ehca_get_max_hwpage_size(%struct.ehca_shca* %0)
ret i32 %2
}
/* Type definitions */
struct xdr_stream {
  int dummy;
};
typedef enum auth_flavor { ____Placeholder_auth_flavor } auth_flavor;

/* Variables and functions */
int xdr_uint(struct xdr_stream *, int *);
int xdr_auth_flavor(struct xdr_stream *stream, enum auth_flavor *value) {
  return xdr_uint(stream, value);
}


x86 assembly (clang, -O0):
<xdr_auth_flavor>:
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 <xdr_uint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_auth_flavor>:
jmp    1030 <xdr_uint@plt>

LLVM IR (-O0):
%struct.xdr_stream = type { i32 }
define i32 @xdr_auth_flavor(%struct.xdr_stream* %0, i32* %1) {
%3 = alloca %struct.xdr_stream*
%4 = alloca i32*
store %struct.xdr_stream* %0, %struct.xdr_stream** %3
store i32* %1, i32** %4
%5 = load %struct.xdr_stream*, %struct.xdr_stream** %3
%6 = load i32*, i32** %4
%7 = call i32 @xdr_uint(%struct.xdr_stream* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.xdr_stream = type { i32 }
define i32 @xdr_auth_flavor(%struct.xdr_stream* %0, i32* %1) {
%3 = tail call i32 @xdr_uint(%struct.xdr_stream* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ e_plp();
int /*<<< orphan*/ e_pop_pc();
void e_rti() {
  e_plp();
  e_pop_pc();
}


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

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

LLVM IR (-O0):
define void @e_rti() {
%1 = call i32 (...) @e_plp()
%2 = call i32 (...) @e_pop_pc()
ret void
}

LLVM IR (-O2):
define void @e_rti() {
%1 = tail call i32 (...) @e_plp()
%2 = tail call i32 (...) @e_pop_pc()
ret void
}
/* Type definitions */
struct mountinfo_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mountinfo_entry *);
void free_mountinfo_entry(struct mountinfo_entry *entry) { free(entry); }


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

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

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

LLVM IR (-O2):
%struct.mountinfo_entry = type { i32 }
define void @free_mountinfo_entry(%struct.mountinfo_entry* nocapture %0) {
%2 = tail call i32 @free(%struct.mountinfo_entry* %0)
ret void
}
void debug_malloc_verify(const char *file, int line) {
  file = file;
  line = line;
}


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

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

LLVM IR (-O0):
define void @debug_malloc_verify(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
store i8* %5, i8** %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @debug_malloc_verify(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void doerror(int code, const char *msg) {
  printf("Status: %d %s\r\n", code, msg);
  printf("Content-Type: text/plain\r\n");
  printf("\r\n");
  printf("%d: %s\n", code, msg);
}


x86 assembly (clang, -O0):
<doerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doerror>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Status: %d %s\0D\0A\00"
@.str.1 = [27 x i8] c"Content-Type: text/plain\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [8 x i8] c"%d: %s\0A\00"
define void @doerror(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Status: %d %s\0D\0A\00"
@.str.3 = [8 x i8] c"%d: %s\0A\00"
@str = [26 x i8] c"Content-Type: text/plain\0D\00"
@str.4 = [2 x i8] c"\0D\00"
define void @doerror(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(double, double, double, double);
void glWindowPos4d(double x, double y, double z, double w) {
  glWindowPos4f(x, y, z, w);
}


x86 assembly (clang, -O0):
<glWindowPos4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <glWindowPos4f@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos4d>:
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos4d(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call i32 @glWindowPos4f(double %9, double %10, double %11, double %12)
ret void
}

LLVM IR (-O2):
define void @glWindowPos4d(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @glWindowPos4f(double %0, double %1, double %2, double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%5.2s\n", "hello");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%5.2s\0A\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%5.2s\0A\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ADC0_InitSWTriggerSeq3(int);
void TermostatoInit(void) { ADC0_InitSWTriggerSeq3(7); }


x86 assembly (clang, -O0):
<TermostatoInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <ADC0_InitSWTriggerSeq3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TermostatoInit>:
mov    $0x7,%edi
jmp    1030 <ADC0_InitSWTriggerSeq3@plt>

LLVM IR (-O0):
define void @TermostatoInit() {
%1 = call i32 @ADC0_InitSWTriggerSeq3(i32 7)
ret void
}

LLVM IR (-O2):
define void @TermostatoInit() {
%1 = tail call i32 @ADC0_InitSWTriggerSeq3(i32 7)
ret void
}
/* Variables and functions */
int round(float f) {
  if (f < 0) {
    return (int)(f - 0.5);
  } else {
    return (int)(f + 0.5);
  }
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1137 <round+0x37>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed9(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <round+0x53>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
cvtss2sd %xmm0,%xmm0
lea    0xeea(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @round(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fsub double %8, 5.000000e-01
%10 = fptosi double %9 to i32
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fadd double %13, 5.000000e-01
%15 = fptosi double %14 to i32
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @round(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fpext float %0 to double
%4 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%5 = fadd double %4, %3
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Variables and functions */
int FP_Cmp(float, float);
int __ltsf2(float a, float b) { return FP_Cmp(a, b); }


x86 assembly (clang, -O0):
<__ltsf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <FP_Cmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltsf2>:
jmp    1030 <FP_Cmp@plt>

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

LLVM IR (-O2):
define i32 @__ltsf2(float %0, float %1) {
%3 = tail call i32 @FP_Cmp(float %0, float %1)
ret i32 %3
}
void nand_init(void) {
  (*((volatile unsigned long *)0x4E000000)) = (0 << 12) | (1 << 8) | (0 << 4);
  (*((volatile unsigned long *)0x4E000004)) = (1 << 4) | (1 << 1) | (1 << 0);
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000000,%eax
movq   $0x100,(%rax)
mov    $0x4e000004,%eax
movq   $0x13,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
movq   $0x100,0x4e000000
movq   $0x13,0x4e000004
ret

LLVM IR (-O0):
define void @nand_init() {
store volatile i64 256, i64* inttoptr (i64 1308622848 to i64*)
store volatile i64 19, i64* inttoptr (i64 1308622852 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_init() {
store volatile i64 256, i64* inttoptr (i64 1308622848 to i64*)
store volatile i64 19, i64* inttoptr (i64 1308622852 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si64(void *);
__m128i foo(unsigned char *p) { return _mm_loadu_si64((void *)p); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <_mm_loadu_si64@plt>

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

LLVM IR (-O2):
define i32 @foo(i8* %0) {
%2 = tail call i32 @_mm_loadu_si64(i8* %0)
ret i32 %2
}
int Operand_ar12_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0x3f) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_ar12_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xffffffc0,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_ar12_encode>:
xor    %eax,%eax
cmpl   $0x40,(%rdi)
setae  %al
ret

LLVM IR (-O0):
define i32 @Operand_ar12_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -64
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @Operand_ar12_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 63
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f9(void (*)());
void f5(void) { f9(f5); }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <f9@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <f9@plt>

LLVM IR (-O0):
define void @f5() {
%1 = call i32 @f9(void (...)* bitcast (void ()* @f5 to void (...)*))
ret void
}

LLVM IR (-O2):
define void @f5() {
%1 = tail call i32 @f9(void (...)* bitcast (void ()* @f5 to void (...)*))
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int ary_cb_strcmp(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<ary_cb_strcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @ary_cb_strcmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @ary_cb_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGRTMIN;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int timer_block(void) {
  sigset_t mask;
  sigemptyset(&mask);
  sigaddset(&mask, SIGRTMIN);
  return sigprocmask(SIG_BLOCK, &mask, NULL);
}


x86 assembly (clang, -O0):
<timer_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_block>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGRTMIN = global i32 0
@SIG_BLOCK = global i32 0
define i32 @timer_block() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGRTMIN
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIG_BLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* %1, i32* null)
ret i32 %6
}

LLVM IR (-O2):
@SIGRTMIN = global i32 0
@SIG_BLOCK = global i32 0
define i32 @timer_block() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGRTMIN
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %1, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ dump_stdout_buffer();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("cat");
  dump_stdout_buffer();
  printf("dog");
  dump_stdout_buffer();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <dump_stdout_buffer@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <dump_stdout_buffer@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <dump_stdout_buffer@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <dump_stdout_buffer@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cat\00"
@.str.1 = [4 x i8] c"dog\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @dump_stdout_buffer()
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @dump_stdout_buffer()
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cat\00"
@.str.1 = [4 x i8] c"dog\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @dump_stdout_buffer()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @dump_stdout_buffer()
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ qmi_cleanup();
void qmi_signal_handler(int signum) {
  qmi_cleanup();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<qmi_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <qmi_cleanup@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<qmi_signal_handler>:
push   %rax
xor    %eax,%eax
call   1030 <qmi_cleanup@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @qmi_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @qmi_cleanup()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @qmi_signal_handler(i32 %0) {
%2 = tail call i32 (...) @qmi_cleanup()
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int asus_bat_report_phone_status(int phone_bat_status) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @asus_bat_report_phone_status(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_diagonal(int);
int main(void) {
  print_diagonal(0);
  print_diagonal(2);
  print_diagonal(10);
  print_diagonal(-4);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <print_diagonal@plt>
mov    $0x2,%edi
call   1030 <print_diagonal@plt>
mov    $0xa,%edi
call   1030 <print_diagonal@plt>
mov    $0xfffffffc,%edi
call   1030 <print_diagonal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print_diagonal(i32 0)
%3 = call i32 @print_diagonal(i32 2)
%4 = call i32 @print_diagonal(i32 10)
%5 = call i32 @print_diagonal(i32 -4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_diagonal(i32 0)
%2 = tail call i32 @print_diagonal(i32 2)
%3 = tail call i32 @print_diagonal(i32 10)
%4 = tail call i32 @print_diagonal(i32 -4)
ret i32 0
}
int main(void) {
  void *handle = my_dlopen("003-f.wasm");
  int (*f)(void) = __thinthin_dlsym((long)handle, "f");
  printf("f: %d\n", f());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1050 <my_dlopen@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1040 <__thinthin_dlsym@plt>
cltq
mov    %rax,-0x18(%rbp)
call   *-0x18(%rbp)
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1050 <my_dlopen@plt>
movslq %eax,%rdi
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1040 <__thinthin_dlsym@plt>
cltq
call   *%rax
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"003-f.wasm\00"
@.str.1 = [2 x i8] c"f\00"
@.str.2 = [7 x i8] c"f: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32 ()*
store i32 0, i32* %1
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @my_dlopen to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i64
%9 = call i32 (i64, i8*, ...) bitcast (i32 (...)* @__thinthin_dlsym to i32 (i64, i8*, ...)*)(i64 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32 ()*
store i32 ()* %11, i32 ()** %3
%12 = load i32 ()*, i32 ()** %3
%13 = call i32 %12()
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"003-f.wasm\00"
@.str.1 = [2 x i8] c"f\00"
@.str.2 = [7 x i8] c"f: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @my_dlopen to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = tail call i32 (i64, i8*, ...) bitcast (i32 (...)* @__thinthin_dlsym to i32 (i64, i8*, ...)*)(i64 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32 ()*
%6 = tail call i32 %5()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
struct cirListDeque {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(struct cirListDeque *);
int /*<<< orphan*/ freeCirListDeque(struct cirListDeque *);
void deleteCirListDeque(struct cirListDeque *q) {
  assert(q != 0);
  freeCirListDeque(q);
  free(q);
}


x86 assembly (clang, -O0):
<deleteCirListDeque>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <freeCirListDeque@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteCirListDeque>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <freeCirListDeque@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.cirListDeque = type { i32 }
define void @deleteCirListDeque(%struct.cirListDeque* %0) {
%2 = alloca %struct.cirListDeque*
store %struct.cirListDeque* %0, %struct.cirListDeque** %2
%3 = load %struct.cirListDeque*, %struct.cirListDeque** %2
%4 = icmp ne %struct.cirListDeque* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.cirListDeque*, %struct.cirListDeque** %2
%8 = call i32 @freeCirListDeque(%struct.cirListDeque* %7)
%9 = load %struct.cirListDeque*, %struct.cirListDeque** %2
%10 = call i32 @free(%struct.cirListDeque* %9)
ret void
}

LLVM IR (-O2):
%struct.cirListDeque = type { i32 }
define void @deleteCirListDeque(%struct.cirListDeque* %0) {
%2 = icmp ne %struct.cirListDeque* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @freeCirListDeque(%struct.cirListDeque* %0)
%6 = tail call i32 @free(%struct.cirListDeque* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ memcpy(double *, double *, int);
double *rec_merge_sort(double *, size_t);
void merge_sort(double *array, size_t size) {
  double *tmp = rec_merge_sort(array, size);
  memcpy(array, tmp, sizeof(*array) * size);
  free(tmp);
}


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

x86 assembly (clang, -O2):
<merge_sort>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1050 <rec_merge_sort@plt>
mov    %rax,%r15
shl    $0x3,%ebx
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @merge_sort(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca double*
store double* %0, double** %3
store i64 %1, i64* %4
%6 = load double*, double** %3
%7 = load i64, i64* %4
%8 = call double* @rec_merge_sort(double* %6, i64 %7)
store double* %8, double** %5
%9 = load double*, double** %3
%10 = load double*, double** %5
%11 = load i64, i64* %4
%12 = mul i64 8, %11
%13 = trunc i64 %12 to i32
%14 = call i32 @memcpy(double* %9, double* %10, i32 %13)
%15 = load double*, double** %5
%16 = call i32 @free(double* %15)
ret void
}

LLVM IR (-O2):
define void @merge_sort(double* %0, i64 %1) {
%3 = tail call double* @rec_merge_sort(double* %0, i64 %1)
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 3
%6 = tail call i32 @memcpy(double* %0, double* %3, i32 %5)
%7 = tail call i32 @free(double* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putstr(char *str) {
  int i;
  i = 0;
  while (str[i]) {
    write(2, &str[i], 1);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <ft_putstr+0x4d>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @write(i32 2, i8* %6, i32 1)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_DrawOldTourneyScoreboard();
void CG_DrawTourneyScoreboard() { CG_DrawOldTourneyScoreboard(); }


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

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

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

LLVM IR (-O2):
define void @CG_DrawTourneyScoreboard() {
%1 = tail call i32 (...) @CG_DrawOldTourneyScoreboard()
ret void
}
/* Variables and functions */
scalar_t__ __builtin_llceill(long double);
int /*<<< orphan*/ link_failure_builtin_llceill();
void test_builtin_llceill(long double ld) {
  if (__builtin_llceill(ld) != __builtin_llceill(ld))
    link_failure_builtin_llceill();
}


x86 assembly (clang, -O0):
<test_builtin_llceill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_llceill@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_llceill@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_llceill+0x43>
mov    $0x0,%al
call   1030 <link_failure_builtin_llceill@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_llceill>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_llceill@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_llceill@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_llceill+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_llceill@plt>

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

LLVM IR (-O2):
define void @test_builtin_llceill(x86_fp80 %0) {
%2 = tail call i64 @__builtin_llceill(x86_fp80 %0)
%3 = tail call i64 @__builtin_llceill(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_llceill()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
short ioperm(short, short, short);
short inpout32_enable(short PortAddress, short range, short enable) {
  return ioperm(PortAddress, range, enable);
}


x86 assembly (clang, -O0):
<inpout32_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movswl -0x6(%rbp),%edx
call   1030 <ioperm@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inpout32_enable>:
jmp    1030 <ioperm@plt>

LLVM IR (-O0):
define signext i16 @inpout32_enable(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = load i16, i16* %6
%10 = call signext i16 @ioperm(i16 signext %7, i16 signext %8, i16 signext %9)
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @inpout32_enable(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = tail call signext i16 @ioperm(i16 signext %0, i16 signext %1, i16 signext %2)
ret i16 %4
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
void *list_end(struct list *list) { return NULL; }


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

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

LLVM IR (-O0):
%struct.list = type { i32 }
define i8* @list_end(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
ret i8* null
}

LLVM IR (-O2):
%struct.list = type { i32 }
define noalias i8* @list_end(%struct.list* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void o(int x) { fprintf(stderr, "%c%d\n", 'o', x); }


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

x86 assembly (clang, -O2):
<o>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x6f,%edx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @o(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 111, i32 %0)
ret void
}
void free_buffers(char **ptr, int nr_segs) {
  int i;
  for (i = 0; i < nr_segs; i++) {
    if (ptr[i])
      free(ptr[i]);
  }
  free(ptr);
}


x86 assembly (clang, -O0):
<free_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <free_buffers+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <free_buffers+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    115b <free_buffers+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_buffers+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_buffers>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1149 <free_buffers+0x39>
mov    %esi,%r15d
xor    %ebx,%ebx
jmp    1139 <free_buffers+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     1149 <free_buffers+0x39>
mov    (%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <free_buffers+0x20>
call   1030 <free@plt>
jmp    1130 <free_buffers+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_buffers(i8** %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 = %24, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %27
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %23
17: ; preds = %10
%18 = load i8**, i8*** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
br label %23
23: ; preds = %17, %10
br label %24
24: ; preds = %23
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %6
27: ; preds = %6
%28 = load i8**, i8*** %3
%29 = bitcast i8** %28 to i8*
ret void
}

LLVM IR (-O2):
define void @free_buffers(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ 0, %4 ], [ %13, %12 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %6
tail call void @free(i8* %9)
br label %12
12: ; preds = %6, %11
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %12, %2
%16 = bitcast i8** %0 to i8*
tail call void @free(i8* %16)
ret void
}
void c_stick_setting() {}


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

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

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

LLVM IR (-O2):
define void @c_stick_setting() {
ret void
}
void EVP_CIPHER_CTX_rand_key(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_rand_key() {
ret void
}
int main() {
  int i = 0;
  int c = 0;
  while (1) {
    if (i > 10)
      break;
    i++;
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    1128 <main+0x28>
jmp    113f <main+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 11
}