xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putch(int /*<<< orphan*/);
void myputs(char *s) {
  while (*s)
    putch(*s++);
}


x86 assembly (clang, -O0):
<myputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <myputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putch@plt>
jmp    111c <myputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @myputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putch(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int isinfl(long double x) { return __builtin_isinf(x); }


x86 assembly (clang, -O0):
<isinfl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fabs
flds   0xeeb(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinfl>:
fldt   0x8(%rsp)
fabs
flds   0xef4(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @isinfl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %3)
%5 = fcmp oeq x86_fp80 %4, 0xK7FFF8000000000000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isinfl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %0)
%3 = fcmp oeq x86_fp80 %2, 0xK7FFF8000000000000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float exp(float);
float futhark_exp32(float x) { return exp(x); }


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

x86 assembly (clang, -O2):
<futhark_exp32>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define float @futhark_exp32(float %0) {
%2 = tail call float @exp(float %0)
ret float %2
}
/* Variables and functions */
float __nv_fast_logf(float);
float __logf(float __a) { return __nv_fast_logf(__a); }


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

x86 assembly (clang, -O2):
<__logf>:
jmp    1030 <__nv_fast_logf@plt>

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

LLVM IR (-O2):
define float @__logf(float %0) {
%2 = tail call float @__nv_fast_logf(float %0)
ret float %2
}
int isalnum(int ch) {
  if (((ch >= '0') && (ch <= '9')) || ((ch >= 'A') && (ch <= 'Z')) ||
      ((ch >= 'a') && (ch <= 'z')))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     111b <isalnum+0x1b>
cmpl   $0x39,-0x8(%rbp)
jle    1143 <isalnum+0x43>
cmpl   $0x41,-0x8(%rbp)
jl     112f <isalnum+0x2f>
cmpl   $0x5a,-0x8(%rbp)
jle    1143 <isalnum+0x43>
cmpl   $0x61,-0x8(%rbp)
jl     114f <isalnum+0x4f>
cmpl   $0x7a,-0x8(%rbp)
jg     114f <isalnum+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isalnum+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %21, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 90
br i1 %14, label %21, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 122
br i1 %20, label %21, label %22
21: ; preds = %18, %12, %6
store i32 1, i32* %2
br label %23
22: ; preds = %18, %15
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void signalKeyAsReady(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               126, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<signalKeyAsReady>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x7e,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalKeyAsReady>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x7e,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.signalKeyAsReady = [17 x i8] c"signalKeyAsReady\00"
define void @signalKeyAsReady() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 126, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.signalKeyAsReady, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.signalKeyAsReady = [17 x i8] c"signalKeyAsReady\00"
define void @signalKeyAsReady() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 126, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.signalKeyAsReady, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test();
int main(int argc, char **argv) {
  test();
  return EXIT_SUCCESS;
}


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)
mov    $0x0,%al
call   1030 <test@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @test()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ d86f_format_track(int, int, int /*<<< orphan*/);
void d86f_format_track_nop(int drive, int side) {
  d86f_format_track(drive, side, 0);
}


x86 assembly (clang, -O0):
<d86f_format_track_nop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <d86f_format_track@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d86f_format_track_nop>:
xor    %edx,%edx
jmp    1030 <d86f_format_track@plt>

LLVM IR (-O0):
define void @d86f_format_track_nop(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 = call i32 @d86f_format_track(i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @d86f_format_track_nop(i32 %0, i32 %1) {
%3 = tail call i32 @d86f_format_track(i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
int tuner_i2c_read(void *, unsigned char, int, unsigned char *, int);
int fc8151_read(void *hDevice, unsigned char addr, unsigned char *data) {
  int res;
  res = tuner_i2c_read(hDevice, addr, 1, data, 1);
  return res;
}


x86 assembly (clang, -O0):
<fc8151_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
movzbl %al,%esi
mov    %r8d,%edx
call   1030 <tuner_i2c_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8151_read>:
mov    %rdx,%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
jmp    1030 <tuner_i2c_read@plt>

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

LLVM IR (-O2):
define i32 @fc8151_read(i8* %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @tuner_i2c_read(i8* %0, i8 zeroext %1, i32 1, i8* %2, i32 1)
ret i32 %4
}
/* Type definitions */
struct parameter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pxysend_file(int, int);
int com_shownote(int p0, struct parameter *param) {
  (void)(param);
  pxysend_file(p0, 54);
  return 0;
}


x86 assembly (clang, -O0):
<com_shownote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x36,%esi
call   1030 <pxysend_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_shownote>:
push   %rax
mov    $0x36,%esi
call   1030 <pxysend_file@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.parameter = type { i32 }
define i32 @com_shownote(i32 %0, %struct.parameter* nocapture readnone %1) {
%3 = tail call i32 @pxysend_file(i32 %0, i32 54)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void argError() {
  fprintf(stderr, "Run the program with the following command: nflratings [-i "
                  "inputfile] [-o outputfile]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<argError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<argError>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"Run the program with the following command: nflratings [-i inputfile] [-o outputfile]\0A\00"
define void @argError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"Run the program with the following command: nflratings [-i inputfile] [-o outputfile]\0A\00"
define void @argError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_ftosizd(int s, int d) {
  assem_debug("ftosizd s%d,d%d", d, s);
  output_w32(0xeebd0bc0 | ((d & 14) << 11) | ((d & 1) << 22) | (s & 7));
}


x86 assembly (clang, -O0):
<emit_ftosizd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeebd0bc0,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_ftosizd>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xed0(%rip),%rdi
mov    %r14d,%edx
call   1030 <assem_debug@plt>
mov    %ebx,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebx
shl    $0x16,%ebx
and    $0x7,%r14d
or     %ebx,%r14d
lea    (%rax,%r14,1),%edi
add    $0xeebd0bc0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"ftosizd s%d,d%d\00"
define void @emit_ftosizd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -289600576, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 7
%18 = or i32 %15, %17
%19 = call i32 @output_w32(i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"ftosizd s%d,d%d\00"
define void @emit_ftosizd(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = and i32 %0, 7
%9 = or i32 %8, %7
%10 = or i32 %9, %5
%11 = or i32 %10, -289600576
%12 = tail call i32 @output_w32(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int countLetters(char *);
void main() {
  assert(countLetters(" 1234   Hello world    how are you   ") == 19);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <countLetters@plt>
cmp    $0x13,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <countLetters@plt>
xor    %edi,%edi
cmp    $0x13,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [38 x i8] c" 1234 Hello world how are you \00"
define void @main() {
%1 = call i32 @countLetters(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 19
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c" 1234 Hello world how are you \00"
define void @main() {
%1 = tail call i32 @countLetters(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 19
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
float M_PI;
float toDegrees(float radians) { return (float)(radians * (180.0f / M_PI)); }


x86 assembly (clang, -O0):
<toDegrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mov    0x2ecb(%rip),%rax
divss  (%rax),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toDegrees>:
mov    0x2ee1(%rip),%rax
movss  0xef1(%rip),%xmm1
divss  (%rax),%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @toDegrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI
%5 = fdiv float 1.800000e+02, %4
%6 = fmul float %3, %5
ret float %6
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @toDegrees(float %0) {
%2 = load float, float* @M_PI
%3 = fdiv float 1.800000e+02, %2
%4 = fmul float %3, %0
ret float %4
}
unsigned long proc_get_freq_hardware(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @proc_get_freq_hardware(i32 %0) {
ret i64 0
}
/* Variables and functions */
int rand();
int randInt(int n) { return rand() % n; }


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

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

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

LLVM IR (-O2):
define i32 @randInt(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
float sqrt(float);
float _sqrt(float s) { return sqrt(s); }


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

x86 assembly (clang, -O2):
<_sqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <_sqrt+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define float @_sqrt(float %0) {
%2 = tail call float @sqrt(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ menu();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int op = 1;
  do {
    menu();
    printf("\nTecle:\n- 0 (Zero) para FINALIZAR;\n- qualquer digito (1-9) para "
           "Continuar:\n");
    scanf("%d", &op);
  } while (op != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <menu@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
lea    0xebb(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <menu@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [76 x i8] c"\0ATecle:\0A- 0 (Zero) para FINALIZAR;\0A- qualquer digito (1-9) para Continuar:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @menu()
%5 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %7
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %3, label %10
10: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [75 x i8] c"\0ATecle:\0A- 0 (Zero) para FINALIZAR;\0A- qualquer digito (1-9) para Continuar:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @menu()
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
int callee_deep_s(int bla) { return callee_deep_s(bla + 1); }


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

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

LLVM IR (-O0):
define i32 @callee_deep_s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @callee_deep_s(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @callee_deep_s(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct skiplist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ skiplist_len(struct skiplist *);
int /*<<< orphan*/ skiplist_popfirst(struct skiplist *);
void skiplist_clear(struct skiplist *skiplist) {
  assert(skiplist != NULL);
  while (skiplist_len(skiplist) != 0)
    skiplist_popfirst(skiplist);
}


x86 assembly (clang, -O0):
<skiplist_clear>:
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 <skiplist_len@plt>
cmp    $0x0,%rax
je     116f <skiplist_clear+0x3f>
mov    -0x8(%rbp),%rdi
call   1030 <skiplist_popfirst@plt>
jmp    114e <skiplist_clear+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skiplist_clear>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <skiplist_len@plt>
test   %rax,%rax
je     1167 <skiplist_clear+0x37>
mov    %rbx,%rdi
call   1030 <skiplist_popfirst@plt>
jmp    1150 <skiplist_clear+0x20>
pop    %rbx
ret

LLVM IR (-O0):
%struct.skiplist = type { i32 }
define void @skiplist_clear(%struct.skiplist* %0) {
%2 = alloca %struct.skiplist*
store %struct.skiplist* %0, %struct.skiplist** %2
%3 = load %struct.skiplist*, %struct.skiplist** %2
%4 = icmp ne %struct.skiplist* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
br label %7
7: ; preds = %11, %1
%8 = load %struct.skiplist*, %struct.skiplist** %2
%9 = call i64 @skiplist_len(%struct.skiplist* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load %struct.skiplist*, %struct.skiplist** %2
%13 = call i32 @skiplist_popfirst(%struct.skiplist* %12)
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.skiplist = type { i32 }
define void @skiplist_clear(%struct.skiplist* %0) {
%2 = icmp ne %struct.skiplist* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @skiplist_len(%struct.skiplist* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1, %7
%8 = tail call i32 @skiplist_popfirst(%struct.skiplist* %0)
%9 = tail call i64 @skiplist_len(%struct.skiplist* %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7, %1
ret void
}
/* Variables and functions */
int script_init();
int module_script_init(void) { return script_init(); }


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

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

LLVM IR (-O0):
define i32 @module_script_init() {
%1 = call i32 (...) @script_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @module_script_init() {
%1 = tail call i32 (...) @script_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *, char *, int /*<<< orphan*/);
void int_05(void) { panic("BOUND Range Exceeded", "#BR", 0); }


x86 assembly (clang, -O0):
<int_05>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_05>:
lea    0xee9(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %edx,%edx
jmp    1030 <panic@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"BOUND Range Exceeded\00"
@.str.1 = [4 x i8] c"#BR\00"
define void @int_05() {
%1 = call i32 @panic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"BOUND Range Exceeded\00"
@.str.1 = [4 x i8] c"#BR\00"
define void @int_05() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
int GreaterEven(int i) { return ((i)&1) ? i + 1 : i + 2; }


x86 assembly (clang, -O0):
<GreaterEven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1124 <GreaterEven+0x24>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <GreaterEven+0x2d>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GreaterEven>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x1,%eax
adc    $0x0,%edi
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @GreaterEven(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 2, i32 1
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
void dummy_test_entrypoint() {}


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

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

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

LLVM IR (-O2):
define void @dummy_test_entrypoint() {
ret void
}
void OCSP_CERTSTATUS_new(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_CERTSTATUS_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adc16(int /*<<< orphan*/);
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ stack();
void adcSp16(void) { adc16(readmemw65816(stack())); }


x86 assembly (clang, -O0):
<adcSp16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <stack@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1040 <adc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcSp16>:
push   %rax
xor    %eax,%eax
call   1050 <stack@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <adc16@plt>

LLVM IR (-O0):
define void @adcSp16() {
%1 = call i32 (...) @stack()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @adc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcSp16() {
%1 = tail call i32 (...) @stack()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @adc16(i32 %2)
ret void
}
/* Variables and functions */
int test_fault_setup();
int setup(int num_threads, long long length, int test_argc,
          const void **test_argv) {
  return test_fault_setup();
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <test_fault_setup@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setup(i32 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
store i32 %0, i32* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = call i32 (...) @test_fault_setup()
ret i32 %9
}

LLVM IR (-O2):
define i32 @setup(i32 %0, i64 %1, i32 %2, i8** nocapture readnone %3) {
%5 = tail call i32 (...) @test_fault_setup()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_dashes(int n) {
  printf("\n");
  for (int i = 0; i < n; i++) {
    printf("_");
  }
}


x86 assembly (clang, -O0):
<print_dashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <print_dashes+0x44>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <print_dashes+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dashes>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    113f <print_dashes+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x5f,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <print_dashes+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_dashes(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @putchar(i32 95)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ aztSendCmd(int);
int /*<<< orphan*/ sten_low();
void aztUnlockDoor(void) {
  {
    aztSendCmd(114);
    sten_low();
    return;
  }
}


x86 assembly (clang, -O0):
<aztUnlockDoor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
call   1030 <aztSendCmd@plt>
mov    $0x0,%al
call   1040 <sten_low@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aztUnlockDoor>:
push   %rax
mov    $0x72,%edi
call   1030 <aztSendCmd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sten_low@plt>

LLVM IR (-O0):
define void @aztUnlockDoor() {
%1 = call i32 @aztSendCmd(i32 114)
%2 = call i32 (...) @sten_low()
ret void
}

LLVM IR (-O2):
define void @aztUnlockDoor() {
%1 = tail call i32 @aztSendCmd(i32 114)
%2 = tail call i32 (...) @sten_low()
ret void
}
void boot_SectorFixRom(void) {}


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

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

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

LLVM IR (-O2):
define void @boot_SectorFixRom() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int trivial_add(int, int);
int main(int argc, char **argv) {
  int a = 1;
  int b = 2;
  int result = 0;
  result = trivial_add(a, b);
  printf("a %d\n", a);
  printf("b %d\n", b);
  printf("result %d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <trivial_add@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <trivial_add@plt>
mov    %eax,%ebx
lea    0xec7(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"a %d\0A\00"
@.str.1 = [6 x i8] c"b %d\0A\00"
@.str.2 = [11 x i8] c"result %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
store i32 2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @trivial_add(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %7
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a %d\0A\00"
@.str.1 = [6 x i8] c"b %d\0A\00"
@.str.2 = [11 x i8] c"result %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @trivial_add(i32 1, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ strtold(char const *, char **);
double strtod(const char *str, char **endptr) {
  return (double)strtold(str, endptr);
}


x86 assembly (clang, -O0):
<strtod>:
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 <strtold@plt>
cvtsi2sd %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtod>:
push   %rax
call   1030 <strtold@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @strtod(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 = load i8**, i8*** %4
%7 = call i64 @strtold(i8* %5, i8** %6)
%8 = sitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @strtod(i8* %0, i8** nocapture %1) {
%3 = tail call i64 @strtold(i8* %0, i8** %1)
%4 = sitofp i64 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world!");
  printf("hello git!");
  for (int i = 0; i < 5; i++)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    115b <main+0x4b>
jmp    114d <main+0x3d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x2e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
@.str.1 = [11 x i8] c"hello git!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int32_t addi(int32_t reg, int16_t kte) {
  int32_t buffer;
  buffer = reg + kte;
  return buffer;
}


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

x86 assembly (clang, -O2):
<addi>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @addi(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add nsw i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @addi(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_map_intint();
int /*<<< orphan*/ test_set_int();
int /*<<< orphan*/ test_vector_int();
void main() {
  test_vector_int();
  test_set_int();
  test_map_intint();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_vector_int@plt>
xor    %eax,%eax
call   1040 <test_set_int@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_map_intint@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @test_vector_int()
%2 = call i32 (...) @test_set_int()
%3 = call i32 (...) @test_map_intint()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test_vector_int()
%2 = tail call i32 (...) @test_set_int()
%3 = tail call i32 (...) @test_map_intint()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void putline(FILE *f, char *l) {
  int x;
  for (x = 0; l[x]; x++)
    fputc(l[x], f);
  fputc('\n', f);
}


x86 assembly (clang, -O0):
<putline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115e <putline+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <putline+0x17>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%al
test   %al,%al
je     1146 <putline+0x36>
mov    %rsi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <putline+0x20>
mov    $0xa,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @putline(i32* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = tail call i32 @fputc(i8 signext %7, i32* %0)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = tail call i32 @fputc(i8 signext 10, i32* %0)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_recvfrom;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, void *, size_t, int,
                           struct sockaddr *, int /*<<< orphan*/ *);
__attribute__((always_)) ssize_t _syscall_recvfrom(int socket, void *buffer,
                                                   size_t length, int flags,
                                                   struct sockaddr *address,
                                                   socklen_t *address_len) {
  return syscall(__NR_recvfrom, socket, buffer, length, flags, address,
                 address_len);
}


x86 assembly (clang, -O0):
<_syscall_recvfrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_recvfrom>:
push   %rax
mov    %r8,%rax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec2(%rip),%rdi
mov    (%rdi),%edi
mov    %r9,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@__NR_recvfrom = global i32 0
define i32 @_syscall_recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32*
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32* %5, i32** %12
%13 = load i32, i32* @__NR_recvfrom
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = load i32, i32* %10
%18 = load %struct.sockaddr*, %struct.sockaddr** %11
%19 = load i32*, i32** %12
%20 = call i32 @syscall(i32 %13, i32 %14, i8* %15, i64 %16, i32 %17, %struct.sockaddr* %18, i32* %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@__NR_recvfrom = global i32 0
define i32 @_syscall_recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5) {
%7 = load i32, i32* @__NR_recvfrom
%8 = tail call i32 @syscall(i32 %7, i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5)
ret i32 %8
}
int decisionFunc(double x) { return x > 0.5 ? 1 : 0; }


x86 assembly (clang, -O0):
<decisionFunc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decisionFunc>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @decisionFunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 5.000000e-01
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @decisionFunc(double %0) {
%2 = fcmp ogt double %0, 5.000000e-01
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ attemptRestartSend();
void sendInitTimer(int tick) {
  if (tick == 150)
    attemptRestartSend();
}


x86 assembly (clang, -O0):
<sendInitTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x96,-0x4(%rbp)
jne    112f <sendInitTimer+0x1f>
mov    $0x0,%al
call   1030 <attemptRestartSend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendInitTimer>:
cmp    $0x96,%edi
jne    111f <sendInitTimer+0xf>
xor    %eax,%eax
jmp    1030 <attemptRestartSend@plt>
ret

LLVM IR (-O0):
define void @sendInitTimer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 150
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @attemptRestartSend()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @sendInitTimer(i32 %0) {
%2 = icmp eq i32 %0, 150
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @attemptRestartSend()
br label %5
5: ; preds = %3, %1
ret void
}