xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, int, double, double, double, double);
int /*<<< orphan*/ pxf2geo(double, double, double *, double *);
int kap_fprint_ref(FILE *f, int ref, double x, double y) {
  double lat, lon;
  pxf2geo(x, y, &lon, &lat);
  return fprintf(f, "REF/%d,%.0f,%.0f,%.8f,%.8f\r\n", ref, x, y, lat, lon);
}


x86 assembly (clang, -O0):
<kap_fprint_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    -0x30(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <pxf2geo@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    0xe8e(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kap_fprint_ref>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x18(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   1030 <pxf2geo@plt>
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <fprintf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"REF/%d,%.0f,%.0f,%.8f,%.8f\0D\0A\00"
define i32 @kap_fprint_ref(i32* %0, i32 %1, double %2, double %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32* %0, i32** %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call i32 @pxf2geo(double %11, double %12, double* %10, double* %9)
%14 = load i32*, i32** %5
%15 = load i32, i32* %6
%16 = load double, double* %7
%17 = load double, double* %8
%18 = load double, double* %9
%19 = load double, double* %10
%20 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %15, double %16, double %17, double %18, double %19)
ret i32 %20
}

LLVM IR (-O2):
@.str = [29 x i8] c"REF/%d,%.0f,%.0f,%.8f,%.8f\0D\0A\00"
define i32 @kap_fprint_ref(i32* nocapture %0, i32 %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %5 to i8*
%8 = bitcast double* %6 to i8*
%9 = call i32 @pxf2geo(double %2, double %3, double* %6, double* %5)
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1, double %2, double %3, double %10, double %11)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ rul___emit_eos_and_newline();
int /*<<< orphan*/ rul___emit_string(char *);
int /*<<< orphan*/ rul___emit_verify_newline();
void rul__emit_return(void) {
  rul___emit_verify_newline();
  rul___emit_string("return");
  rul___emit_eos_and_newline();
}


x86 assembly (clang, -O0):
<rul__emit_return>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rul___emit_verify_newline@plt>
lea    0xebe(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    $0x0,%al
call   1050 <rul___emit_eos_and_newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rul__emit_return>:
push   %rax
xor    %eax,%eax
call   1040 <rul___emit_verify_newline@plt>
lea    0xec1(%rip),%rdi
call   1030 <rul___emit_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rul___emit_eos_and_newline@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"return\00"
define void @rul__emit_return() {
%1 = call i32 (...) @rul___emit_verify_newline()
%2 = call i32 @rul___emit_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @rul___emit_eos_and_newline()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"return\00"
define void @rul__emit_return() {
%1 = tail call i32 (...) @rul___emit_verify_newline()
%2 = tail call i32 @rul___emit_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @rul___emit_eos_and_newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ espcomm_delay_ms(int);
int /*<<< orphan*/ serialport_set_dtr(int /*<<< orphan*/);
int /*<<< orphan*/ serialport_set_rts(int);
void board_ck_ra() {
  serialport_set_dtr(0);
  serialport_set_rts(1);
  espcomm_delay_ms(5);
  serialport_set_rts(0);
}


x86 assembly (clang, -O0):
<board_ck_ra>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x1,%edi
call   1050 <serialport_set_rts@plt>
mov    $0x5,%edi
call   1030 <espcomm_delay_ms@plt>
xor    %edi,%edi
call   1050 <serialport_set_rts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_ck_ra>:
push   %rax
xor    %edi,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x1,%edi
call   1050 <serialport_set_rts@plt>
mov    $0x5,%edi
call   1030 <espcomm_delay_ms@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <serialport_set_rts@plt>

LLVM IR (-O0):
define void @board_ck_ra() {
%1 = call i32 @serialport_set_dtr(i32 0)
%2 = call i32 @serialport_set_rts(i32 1)
%3 = call i32 @espcomm_delay_ms(i32 5)
%4 = call i32 @serialport_set_rts(i32 0)
ret void
}

LLVM IR (-O2):
define void @board_ck_ra() {
%1 = tail call i32 @serialport_set_dtr(i32 0)
%2 = tail call i32 @serialport_set_rts(i32 1)
%3 = tail call i32 @espcomm_delay_ms(i32 5)
%4 = tail call i32 @serialport_set_rts(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CL_Shutdown();
int FNDELAY;
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ Qcommon_Shutdown();
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int fcntl(int /*<<< orphan*/, int /*<<< orphan*/, int);
void Sys_Quit(void) {
  CL_Shutdown();
  Qcommon_Shutdown();
  fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) & ~FNDELAY);
  _exit(0);
}


x86 assembly (clang, -O0):
<Sys_Quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <CL_Shutdown@plt>
mov    $0x0,%al
call   1060 <Qcommon_Shutdown@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
mov    %edx,%edi
call   1040 <fcntl@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
mov    0x2e50(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
xor    %edi,%edi
call   1040 <fcntl@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<Sys_Quit>:
push   %rbx
xor    %eax,%eax
call   1050 <CL_Shutdown@plt>
xor    %eax,%eax
call   1060 <Qcommon_Shutdown@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%ebx
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
xor    %edx,%edx
call   1040 <fcntl@plt>
mov    0x2e5f(%rip),%rcx
mov    (%rcx),%edx
not    %edx
and    %eax,%edx
xor    %edi,%edi
mov    %ebx,%esi
call   1040 <fcntl@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@FNDELAY = global i32 0
define void @Sys_Quit() {
%1 = call i32 (...) @CL_Shutdown()
%2 = call i32 (...) @Qcommon_Shutdown()
%3 = load i32, i32* @F_SETFL
%4 = load i32, i32* @F_GETFL
%5 = call i32 @fcntl(i32 0, i32 %4, i32 0)
%6 = load i32, i32* @FNDELAY
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
%9 = call i32 @fcntl(i32 0, i32 %3, i32 %8)
%10 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@FNDELAY = global i32 0
define void @Sys_Quit() {
%1 = tail call i32 (...) @CL_Shutdown()
%2 = tail call i32 (...) @Qcommon_Shutdown()
%3 = load i32, i32* @F_SETFL
%4 = load i32, i32* @F_GETFL
%5 = tail call i32 @fcntl(i32 0, i32 %4, i32 0)
%6 = load i32, i32* @FNDELAY
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
%9 = tail call i32 @fcntl(i32 0, i32 %3, i32 %8)
%10 = tail call i32 @_exit(i32 0)
unreachable
}
int main() {
  if (sizeof(0) != 2)
    return 1;
  if (sizeof(char) != 1)
    return 2;
  if (sizeof(int) != 2)
    return 3;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char const *, int, int /*<<< orphan*/);
extern int _swift_Platform_open(const char *path, int oflag, mode_t mode) {
  return open(path, oflag, mode);
}


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

x86 assembly (clang, -O2):
<_swift_Platform_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @_swift_Platform_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CloseGraphics();
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int nice_end(int junk) {
  CloseGraphics();
  putchar('\n');
  exit(EXIT_SUCCESS);
  return 0;
}


x86 assembly (clang, -O0):
<nice_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <CloseGraphics@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<nice_end>:
push   %rax
xor    %eax,%eax
call   1040 <CloseGraphics@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @nice_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @CloseGraphics()
%4 = call i32 @putchar(i8 signext 10)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @nice_end(i32 %0) {
%2 = tail call i32 (...) @CloseGraphics()
%3 = tail call i32 @putchar(i8 signext 10)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ create_local_human(int);
void init_local_players(int n, int *ids) {
  int i;
  for (i = 0; i < n; i++)
    create_local_human(ids[i]);
}


x86 assembly (clang, -O0):
<init_local_players>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <init_local_players+0x40>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <create_local_human@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <init_local_players+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_local_players>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1142 <init_local_players+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <create_local_human@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <init_local_players+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @init_local_players(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @create_local_human(i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int llvm_fcmp_olt(double X, double Y) { return X < Y; }


x86 assembly (clang, -O0):
<llvm_fcmp_olt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_fcmp_olt>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @llvm_fcmp_olt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @llvm_fcmp_olt(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fnv_64a_64(int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t sd_hash_64(uint64_t oid) {
  uint64_t hval = fnv_64a_64(oid, ((uint64_t)0xcbf29ce484222325ULL));
  return fnv_64a_64(hval, hval);
}


x86 assembly (clang, -O0):
<sd_hash_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x84222325,%esi
call   1030 <fnv_64a_64@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <fnv_64a_64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_hash_64>:
push   %rax
mov    $0x84222325,%esi
call   1030 <fnv_64a_64@plt>
mov    %eax,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <fnv_64a_64@plt>

LLVM IR (-O0):
define i32 @sd_hash_64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fnv_64a_64(i32 %4, i32 -2078137563)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @fnv_64a_64(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @sd_hash_64(i32 %0) {
%2 = tail call i32 @fnv_64a_64(i32 %0, i32 -2078137563)
%3 = tail call i32 @fnv_64a_64(i32 %2, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
usage() {
  fputs("usage: cmp [-ls] file1 file2 [skip1] [skip2]\n", stderr);
  exit(2);
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"usage: cmp [-ls] file1 file2 [skip1] [skip2]\0A\00"
@stderr = global i32 0
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"usage: cmp [-ls] file1 file2 [skip1] [skip2]\0A\00"
@stderr = global i32 0
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ normvideo();
void normal() { normvideo(); }


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

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

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

LLVM IR (-O2):
define void @normal() {
%1 = tail call i32 (...) @normvideo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, int);
void serial_configure_modem(unsigned short com) { outb((com + 4), 0x0B); }


x86 assembly (clang, -O0):
<serial_configure_modem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x4,%eax
mov    $0xb,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_configure_modem>:
add    $0x4,%edi
movzwl %di,%edi
mov    $0xb,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_configure_modem(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 4
%6 = trunc i32 %5 to i16
%7 = call i32 @outb(i16 zeroext %6, i32 11)
ret void
}

LLVM IR (-O2):
define void @serial_configure_modem(i16 zeroext %0) {
%2 = add i16 %0, 4
%3 = tail call i32 @outb(i16 zeroext %2, i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *self) {
  fprintf(stderr, "Usage: %s port\n", self);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s port\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s port\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mexit0();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
void mexit1() {
  move(23, 0);
  mexit0();
}


x86 assembly (clang, -O0):
<mexit1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
xor    %esi,%esi
call   1040 <move@plt>
mov    $0x0,%al
call   1030 <mexit0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mexit1>:
push   %rax
mov    $0x17,%edi
xor    %esi,%esi
call   1040 <move@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mexit0@plt>

LLVM IR (-O0):
define void @mexit1() {
%1 = call i32 @move(i32 23, i32 0)
%2 = call i32 (...) @mexit0()
ret void
}

LLVM IR (-O2):
define void @mexit1() {
%1 = tail call i32 @move(i32 23, i32 0)
%2 = tail call i32 (...) @mexit0()
ret void
}
/* Variables and functions */
double HUGE_VAL;
bool is_positive_zero(double x) { return (1.0 / x == HUGE_VAL); }


x86 assembly (clang, -O0):
<is_positive_zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
ucomisd (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_positive_zero>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    0x2ed5(%rip),%rax
cmpeqsd (%rax),%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define i32 @is_positive_zero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = load double, double* @HUGE_VAL
%6 = fcmp oeq double %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define i32 @is_positive_zero(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = load double, double* @HUGE_VAL
%4 = fcmp oeq double %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int incr(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  foo();
  int i = incr(0);
  printf("0+1=%d\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
xor    %edi,%edi
call   1050 <incr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
xor    %edi,%edi
call   1050 <incr@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"0+1=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = tail call i32 @incr(i32 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ musclient_exit();
int /*<<< orphan*/ musserv_exit();
int mus_exit() {
  musclient_exit();
  musserv_exit();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @mus_exit() {
%1 = call i32 (...) @musclient_exit()
%2 = call i32 (...) @musserv_exit()
ret i32 0
}

LLVM IR (-O2):
define i32 @mus_exit() {
%1 = tail call i32 (...) @musclient_exit()
%2 = tail call i32 (...) @musserv_exit()
ret i32 0
}
char isBigEndian() {
  unsigned int x = 0x12345678;
  unsigned char *xp;
  xp = (unsigned char *)&x;
  if (*xp == 0x78) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isBigEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x12345678,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x78,%eax
jne    112c <isBigEndian+0x2c>
movb   $0x0,-0x1(%rbp)
jmp    1130 <isBigEndian+0x30>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @isBigEndian() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i8*
store i32 305419896, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 120
br i1 %8, label %9, label %10
9: ; preds = %0
store i8 0, i8* %1
br label %11
10: ; preds = %0
store i8 1, i8* %1
br label %11
11: ; preds = %10, %9
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @isBigEndian() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *xmalloc(scalar_t__);
char *Strdup(char *s) {
  char *tmp = xmalloc(strlen(s) + 1);
  strcpy(tmp, s);
  return tmp;
}


x86 assembly (clang, -O0):
<Strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @Strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int winopen(char *);
int glutCreateWindow(char *title) { return winopen(title); }


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

x86 assembly (clang, -O2):
<glutCreateWindow>:
jmp    1030 <winopen@plt>

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

LLVM IR (-O2):
define i32 @glutCreateWindow(i8* %0) {
%2 = tail call i32 @winopen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ IntMasterIRQDisable();
int IntMasterStatusGet();
unsigned char IntDisable(void) {
  unsigned char status;
  status = (IntMasterStatusGet() & 0xFF);
  IntMasterIRQDisable();
  return status;
}


x86 assembly (clang, -O0):
<IntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <IntMasterStatusGet@plt>
and    $0xff,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <IntMasterIRQDisable@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntDisable>:
push   %rbx
xor    %eax,%eax
call   1040 <IntMasterStatusGet@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <IntMasterIRQDisable@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @IntDisable() {
%1 = alloca i8
%2 = call i32 (...) @IntMasterStatusGet()
%3 = and i32 %2, 255
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = call i32 (...) @IntMasterIRQDisable()
%6 = load i8, i8* %1
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @IntDisable() {
%1 = tail call i32 (...) @IntMasterStatusGet()
%2 = trunc i32 %1 to i8
%3 = tail call i32 (...) @IntMasterIRQDisable()
ret i8 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t __double_encoded_array_size(const double *p, uint32_t elements) {
  (void)p;
  return (8) * elements;
}


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

x86 assembly (clang, -O2):
<__double_encoded_array_size>:
lea    0x0(,%rsi,8),%eax
ret

LLVM IR (-O0):
define i32 @__double_encoded_array_size(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 8, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @__double_encoded_array_size(double* nocapture readnone %0, i32 %1) {
%3 = shl nsw i32 %1, 3
ret i32 %3
}
int test1(int cond) {
  asm volatile goto("testl %0, %0; jne %l1;" ::"r"(cond)::label_true, loop);
  asm volatile goto("testl %0, %0; jne %l2;" ::"r"(cond)::label_true, loop);
  return 0;
loop:
  return 0;
label_true:
  return 1;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    113f <test1+0x3f>
jmp    1117 <test1+0x17>
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1133 <test1+0x33>
jmp    1127 <test1+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1146 <test1+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1146 <test1+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   %edi,%edi
jne    110b <test1+0xb>
xor    %eax,%eax
test   %edi,%edi
jne    1111 <test1+0x11>
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
to label %5 [label %9, label %8]
5: ; preds = %1
%6 = load i32, i32* %3
to label %7 [label %9, label %8]
7: ; preds = %5
store i32 0, i32* %2
br label %10
8: ; preds = %5, %1
store i32 0, i32* %2
br label %10
9: ; preds = %5, %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
to label %2 [label %4, label %3]
2: ; preds = %1
to label %5 [label %4, label %3]
3: ; preds = %2, %1
br label %5
4: ; preds = %2, %1
br label %5
5: ; preds = %2, %4, %3
%6 = phi i32 [ 0, %3 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %6
}
/* Type definitions */
struct huffman_node {
  int dummy;
};

/* Variables and functions */
void heap_insert(struct huffman_node **heap, struct huffman_node *node,
                 size_t *heap_size) {
  heap[*heap_size++] = node;
}


x86 assembly (clang, -O0):
<heap_insert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsi
add    $0x8,%rsi
mov    %rsi,-0x18(%rbp)
mov    (%rcx),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_insert>:
mov    (%rdx),%rax
mov    %rsi,(%rdi,%rax,8)
ret

LLVM IR (-O0):
%struct.huffman_node = type { i32 }
define void @heap_insert(%struct.huffman_node** %0, %struct.huffman_node* %1, i64* %2) {
%4 = alloca %struct.huffman_node**
%5 = alloca %struct.huffman_node*
%6 = alloca i64*
store %struct.huffman_node** %0, %struct.huffman_node*** %4
store %struct.huffman_node* %1, %struct.huffman_node** %5
store i64* %2, i64** %6
%7 = load %struct.huffman_node*, %struct.huffman_node** %5
%8 = load %struct.huffman_node**, %struct.huffman_node*** %4
%9 = load i64*, i64** %6
%10 = getelementptr inbounds i64, i64* %9, i32 1
store i64* %10, i64** %6
%11 = load i64, i64* %9
%12 = getelementptr inbounds %struct.huffman_node*, %struct.huffman_node** %8, i64 %11
store %struct.huffman_node* %7, %struct.huffman_node** %12
ret void
}

LLVM IR (-O2):
%struct.huffman_node = type { i32 }
define void @heap_insert(%struct.huffman_node** nocapture writeonly %0, %struct.huffman_node* %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = getelementptr inbounds %struct.huffman_node*, %struct.huffman_node** %0, i64 %4
store %struct.huffman_node* %1, %struct.huffman_node** %5
ret void
}
int compare(int left, int right) {
  return left > right ? 1 : (left < right ? -1 : 0);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1123 <compare+0x23>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <compare+0x38>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
xor    %ecx,%ecx
cmp    %esi,%edi
setl   %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 -1, i32 0
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ 1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
void pthread_setconcurrency() {}


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

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

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

LLVM IR (-O2):
define void @pthread_setconcurrency() {
ret void
}
int(foo)(c) int c;
{}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void usage(void) {
  errx(1, "Usage: lguest [--verbose] "
          "[--tunnet=(<ipaddr>:<macaddr>|bridge:<bridgename>:<macaddr>)\n"
          "|--block=<filename>|--initrd=<filename>]...\n"
          "<mem-in-mb> vmlinux [args...]");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [161 x i8] c"Usage: lguest [--verbose] [--tunnet=(<ipaddr>:<macaddr>|bridge:<bridgename>:<macaddr>)\0A|--block=<filename>|--initrd=<filename>]...\0A<mem-in-mb> vmlinux [args...]\00"
define void @usage() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [161 x i8] c"Usage: lguest [--verbose] [--tunnet=(<ipaddr>:<macaddr>|bridge:<bridgename>:<macaddr>)\0A|--block=<filename>|--initrd=<filename>]...\0A<mem-in-mb> vmlinux [args...]\00"
define void @usage() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int lrand48();
int lo3r(int max) {
  int res1, res2, res3;
  return lrand48() % max;
  res1 = lrand48() % max;
  res2 = lrand48() % max;
  res3 = lrand48() % max;
  if (res1 < res2 && res1 < res3)
    return res1;
  if (res2 < res3)
    return res2;
  return res3;
}


x86 assembly (clang, -O0):
<lo3r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lo3r>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <lrand48@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lo3r(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 (...) @lrand48()
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @lo3r(i32 %0) {
%2 = tail call i32 (...) @lrand48()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
char *last_word_string(char *);
int /*<<< orphan*/ printf(char *, char *);
void test_last_word() {
  char *s = "DATE         G1111";
  printf("test_last_word should b G1111 = (%s)\n", last_word_string(s));
}


x86 assembly (clang, -O0):
<test_last_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <last_word_string@plt>
mov    %rax,%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_last_word>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <last_word_string@plt>
lea    0xedf(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"DATE G1111\00"
@.str.1 = [38 x i8] c"test_last_word should b G1111 = (%s)\0A\00"
define void @test_last_word() {
%1 = alloca i8*
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i8* @last_word_string(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"DATE G1111\00"
@.str.1 = [38 x i8] c"test_last_word should b G1111 = (%s)\0A\00"
define void @test_last_word() {
%1 = tail call i8* @last_word_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
int strcmp(const char *s1, const char *s2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void pdc_check_scope_core(void) {}


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

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

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

LLVM IR (-O2):
define void @pdc_check_scope_core() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pd_add(double const *, double *, double *);
int /*<<< orphan*/ pd_copy(double const *, double *);
int /*<<< orphan*/ pd_minus(double *);
void pd_sub(const double *a, const double *b, double *c) {
  double minb[5];
  pd_copy(b, minb);
  pd_minus(minb);
  pd_add(a, minb, c);
}


x86 assembly (clang, -O0):
<pd_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <pd_copy@plt>
lea    -0x40(%rbp),%rdi
call   1050 <pd_minus@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pd_add@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_sub>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1040 <pd_copy@plt>
mov    %rbx,%rdi
call   1050 <pd_minus@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <pd_add@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pd_sub(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [5 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %5
%9 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%10 = call i32 @pd_copy(double* %8, double* %9)
%11 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%12 = call i32 @pd_minus(double* %11)
%13 = load double*, double** %4
%14 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%15 = load double*, double** %6
%16 = call i32 @pd_add(double* %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @pd_sub(double* %0, double* %1, double* %2) {
%4 = alloca [5 x double]
%5 = bitcast [5 x double]* %4 to i8*
%6 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 0
%7 = call i32 @pd_copy(double* %1, double* %6)
%8 = call i32 @pd_minus(double* %6)
%9 = call i32 @pd_add(double* %0, double* %6, double* %2)
ret void
}
float obdConvert_24_2B(unsigned int A, unsigned int B, unsigned int C,
                       unsigned int D) {
  return ((float)A * 256.0f + (float)B) * 0.0000305f;
}


x86 assembly (clang, -O0):
<obdConvert_24_2B>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
movss  0xedc(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xec8(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_24_2B>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
mulss  0xeea(%rip),%xmm0
addss  %xmm1,%xmm0
mulss  0xee2(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_24_2B(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = load i32, i32* %6
%12 = uitofp i32 %11 to float
%13 = call float @llvm.fmuladd.f32(float %10, float 2.560000e+02, float %12)
%14 = fmul float %13, 0x3EFFFB4800000000
ret float %14
}

LLVM IR (-O2):
define float @obdConvert_24_2B(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = uitofp i32 %1 to float
%7 = tail call float @llvm.fmuladd.f32(float %5, float 2.560000e+02, float %6)
%8 = fmul float %7, 0x3EFFFB4800000000
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
uint64_t unaligned_read_be64(const void *_u) {
  const struct __attribute__((__packed__, __may_alias__)) {
    uint64_t x;
  } *u = _u;
  return be64toh(u->x);
}


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

x86 assembly (clang, -O2):
<unaligned_read_be64>:
mov    (%rdi),%edi
jmp    1030 <be64toh@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @unaligned_read_be64(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @be64toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @unaligned_read_be64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @be64toh(i32 %3)
ret i32 %4
}
int main() {
  int x$1;
  if (0)
    goto inner$$1;
  else
    goto outer$$1;
  {
    __label__ loop$1;
  loop$1:;
    {
      __label__ loop$2;
    inner$$1:;
      {
        (x$1 = 20);
        goto loop$2;
      }
    loop$2:;
      (x$1 = 15);
    }
    goto loop$1;
  }
outer$$1:;
  (x$1 = 30);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1e,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
br label %5
2: ; preds = %4
br label %3
3: ; preds = %2
store i32 20, i32* %1
br label %4
4: ; preds = %3
store i32 15, i32* %1
br label %2
5: ; preds = %0
store i32 30, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int condexp(int x, int y) { return x ? y : y + 1; }


x86 assembly (clang, -O0):
<condexp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <condexp+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <condexp+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condexp>:
mov    %esi,%eax
cmp    $0x1,%edi
adc    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @condexp(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %1
ret i32 %5
}
void getAHRS() {}


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

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

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

LLVM IR (-O2):
define void @getAHRS() {
ret void
}
void f_empty_while_loop() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f_empty_while_loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f_empty_while_loop+0x9>
jmp    1109 <f_empty_while_loop+0x9>

x86 assembly (clang, -O2):
<f_empty_while_loop>:
jmp    1100 <f_empty_while_loop>

LLVM IR (-O0):
define void @f_empty_while_loop() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @f_empty_while_loop() {
br label %1
1: ; preds = %0, %1
br label %1
}
void papi_end_() {}


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

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

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

LLVM IR (-O2):
define void @papi_end_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int print_int(int val) {
  printf("%d", val);
  return val;
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @print_int(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}