xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void assert(const char *what, int assertion) {
  if (assertion)
    return;
  perror(what);
  exit(1);
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113f <assert+0x1f>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<assert>:
test   %esi,%esi
je     1125 <assert+0x5>
ret
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @assert(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @perror(i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @assert(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
ret void
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exit_handler(int sig) { exit(0); }


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
long acrn_hypercall2(unsigned long hcall_id, unsigned long param1,
                     unsigned long param2) {
  long result;
  asm volatile("movl %1, %%r8d\n\t"
               "vmcall\n\t"
               : "=a"(result)
               : "g"(hcall_id), "D"(param1), "S"(param2)
               : "r8", "memory");
  return result;
}


x86 assembly (clang, -O0):
<acrn_hypercall2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%r8d
vmcall
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @acrn_hypercall2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "movl $1, %r8d\0A\09vmcall\0A\09", "={ax},imr,{di},{si},~{r8},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64 %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void SWTIM0_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @SWTIM0_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @SWTIM0_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log(int);
double log1p(double x) { log(1 + x); }


x86 assembly (clang, -O0):
<log1p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1p>:
addsd  0xee8(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @log1p(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fadd double 1.000000e+00, %4
%6 = fptosi double %5 to i32
%7 = call i32 @log(i32 %6)
%8 = load double, double* %2
ret double %8
}

LLVM IR (-O2):
define double @log1p(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fptosi double %2 to i32
%4 = tail call i32 @log(i32 %3)
ret double undef
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_regspace2_uniform_64k(struct flashrom_flashctx *);
int printlock_w39_common(struct flashrom_flashctx *, int);
int printlock_w39v040fc(struct flashrom_flashctx *flash) {
  int ret = 0;
  ret = printlock_w39_common(flash, 0x7fff2);
  ret |= printlock_regspace2_uniform_64k(flash);
  return ret;
}


x86 assembly (clang, -O0):
<printlock_w39v040fc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7fff2,%esi
call   1040 <printlock_w39_common@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printlock_regspace2_uniform_64k@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlock_w39v040fc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x7fff2,%esi
call   1040 <printlock_w39_common@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <printlock_regspace2_uniform_64k@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_w39v040fc(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
%3 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
store i32 0, i32* %3
%4 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%5 = call i32 @printlock_w39_common(%struct.flashrom_flashctx* %4, i32 524274)
store i32 %5, i32* %3
%6 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%7 = call i32 @printlock_regspace2_uniform_64k(%struct.flashrom_flashctx* %6)
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_w39v040fc(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @printlock_w39_common(%struct.flashrom_flashctx* %0, i32 524274)
%3 = tail call i32 @printlock_regspace2_uniform_64k(%struct.flashrom_flashctx* %0)
%4 = or i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, intptr_t);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void *hello(void *a) {
  printf("hello world! de %ld\n", (intptr_t)a);
  fflush(stdout);
  sleep(5);
  return 0;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"hello world! de %ld\0A\00"
@stdout = global i32 0
define i8* @hello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @sleep(i32 5)
ret i8* null
}

LLVM IR (-O2):
@.str = [21 x i8] c"hello world! de %ld\0A\00"
@stdout = global i32 0
define noalias i8* @hello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @sleep(i32 5)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ quicksort(int *, int, int);
void quicksortlib(int a[], int low, int high) { quicksort(a, low, high); }


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

x86 assembly (clang, -O2):
<quicksortlib>:
jmp    1030 <quicksort@plt>

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

LLVM IR (-O2):
define void @quicksortlib(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @quicksort(i32* %0, i32 %1, i32 %2)
ret void
}
double cephes_gdtrc(a, b, x)
double a, b, x;
{
  if (x < 0.0) {
    mtherr("gdtrc", 1);
    return (0.0);
  }
  return (cephes_igamc(b, a * x));
}


x86 assembly (clang, -O0):
<cephes_gdtrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1165 <cephes_gdtrc+0x45>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <cephes_gdtrc+0x64>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   1030 <cephes_igamc@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cephes_gdtrc>:
push   %rax
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jbe    1148 <cephes_gdtrc+0x28>
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret
mulsd  %xmm2,%xmm3
movaps %xmm1,%xmm0
movapd %xmm3,%xmm1
mov    $0x2,%al
call   1030 <cephes_igamc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"gdtrc\00"
define double @cephes_gdtrc(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %7
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
store double 0.000000e+00, double* %4
br label %19
12: ; preds = %3
%13 = load double, double* %6
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fmul double %14, %15
%17 = call i32 (double, double, ...) bitcast (i32 (...)* @cephes_igamc to i32 (double, double, ...)*)(double %13, double %16)
%18 = sitofp i32 %17 to double
store double %18, double* %4
br label %19
19: ; preds = %12, %10
%20 = load double, double* %4
ret double %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"gdtrc\00"
define double @cephes_gdtrc(double %0, double %1, double %2) {
%4 = fcmp olt double %2, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
br label %11
7: ; preds = %3
%8 = fmul double %0, %2
%9 = tail call i32 (double, double, ...) bitcast (i32 (...)* @cephes_igamc to i32 (double, double, ...)*)(double %1, double %8)
%10 = sitofp i32 %9 to double
br label %11
11: ; preds = %7, %5
%12 = phi double [ 0.000000e+00, %5 ], [ %10, %7 ]
ret double %12
}
void ASN1_GENERALIZEDTIME_set_string(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_GENERALIZEDTIME_set_string() {
ret void
}
void prefill_possible_map(void) {}


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

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

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

LLVM IR (-O2):
define void @prefill_possible_map() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aeron_free(void *);
void aeron_command_on_delete_cmd(void *clientd, void *cmd) { aeron_free(cmd); }


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

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

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

LLVM IR (-O2):
define void @aeron_command_on_delete_cmd(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @aeron_free(i8* %1)
ret void
}
int do_299() { return 299; }


x86 assembly (clang, -O0):
<do_299>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12b,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_299() {
ret i32 299
}

LLVM IR (-O2):
define i32 @do_299() {
ret i32 299
}
/* Type definitions */
struct Dwarf_Group_Map_Entry_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Dwarf_Group_Map_Entry_s *);
void _dwarf_grp_destroy_free_node(void *nodep) {
  struct Dwarf_Group_Map_Entry_s *enp = nodep;
  free(enp);
  return;
}


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

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

LLVM IR (-O0):
%struct.Dwarf_Group_Map_Entry_s = type { i32 }
define void @_dwarf_grp_destroy_free_node(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.Dwarf_Group_Map_Entry_s*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.Dwarf_Group_Map_Entry_s*
store %struct.Dwarf_Group_Map_Entry_s* %5, %struct.Dwarf_Group_Map_Entry_s** %3
%6 = load %struct.Dwarf_Group_Map_Entry_s*, %struct.Dwarf_Group_Map_Entry_s** %3
%7 = call i32 @free(%struct.Dwarf_Group_Map_Entry_s* %6)
ret void
}

LLVM IR (-O2):
%struct.Dwarf_Group_Map_Entry_s = type { i32 }
define void @_dwarf_grp_destroy_free_node(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.Dwarf_Group_Map_Entry_s*
%3 = tail call i32 @free(%struct.Dwarf_Group_Map_Entry_s* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("in main()\n");
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"in main()\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"in main()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ stderr;
void die_on_error(int code, const char *msg) {
  if (code == 0)
    return;
  fprintf(stderr, "die_on_error: got error %d: %s\n", code, msg);
  abort();
}


x86 assembly (clang, -O0):
<die_on_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113f <die_on_error+0x1f>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<die_on_error>:
test   %edi,%edi
jne    1125 <die_on_error+0x5>
ret
push   %rax
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"die_on_error: got error %d: %s\0A\00"
define void @die_on_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11)
%13 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"die_on_error: got error %d: %s\0A\00"
define void @die_on_error(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ tty_print_region(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void tty_print_screen(void) { tty_print_region(0, 0, 25, 80); }


x86 assembly (clang, -O0):
<tty_print_screen>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    $0x19,%edx
mov    $0x50,%ecx
mov    %esi,%edi
call   1030 <tty_print_region@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_print_screen>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x19,%edx
mov    $0x50,%ecx
jmp    1030 <tty_print_region@plt>

LLVM IR (-O0):
define void @tty_print_screen() {
%1 = call i32 @tty_print_region(i32 0, i32 0, i32 25, i32 80)
ret void
}

LLVM IR (-O2):
define void @tty_print_screen() {
%1 = tail call i32 @tty_print_region(i32 0, i32 0, i32 25, i32 80)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 3;
  while (i--) {
    int i = 100;
    i--;
    printf("%d..", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     115e <main+0x4e>
movl   $0x64,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x63,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d..\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 99)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 99)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 99)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t lo8(uint16_t val) { return val & 0xff; }


x86 assembly (clang, -O0):
<lo8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lo8>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @lo8(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
float rad_to_deg(float angle) {
  return ((float)(180.0 * (angle / 3.14159265358979323846)));
}


x86 assembly (clang, -O0):
<rad_to_deg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad_to_deg>:
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @rad_to_deg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 0x400921FB54442D18
%6 = fmul double 1.800000e+02, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @rad_to_deg(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 0x400921FB54442D18
%4 = fmul double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *pascal_to_PPPP(char *target, double P) {
  int ic;
  ic = (int)(P * 0.1);
  sprintf(target, "%04d", ic % 10000);
  return target;
}


x86 assembly (clang, -O0):
<pascal_to_PPPP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  0xed7(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pascal_to_PPPP>:
push   %rbx
mulsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %rdi,%rbx
movslq %eax,%rdx
imul   $0x68db8bad,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
imul   $0x2710,%eax,%eax
sub    %eax,%edx
lea    0xec2(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%04d\00"
define i8* @pascal_to_PPPP(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i32
store i8* %0, i8** %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fmul double %6, 1.000000e-01
%8 = fptosi double %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = srem i32 %10, 10000
%12 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"%04d\00"
define i8* @pascal_to_PPPP(i8* returned writeonly %0, double %1) {
%3 = fmul double %1, 1.000000e-01
%4 = fptosi double %3 to i32
%5 = srem i32 %4, 10000
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* %0
}
int getsize(char *str) { return sizeof(str); }


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

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

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

LLVM IR (-O2):
define i32 @getsize(i8* nocapture readnone %0) {
ret i32 8
}
/* Type definitions */
struct dthr_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ dthr_eventq_to_runq(struct dthr_event *, int /*<<< orphan*/);
void dthr_event_broadcast_no_yield(struct dthr_event *event) {
  ;
  ;
  dthr_eventq_to_runq(event, UINT_MAX);
  ;
  ;
}


x86 assembly (clang, -O0):
<dthr_event_broadcast_no_yield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <dthr_eventq_to_runq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dthr_event_broadcast_no_yield>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <dthr_eventq_to_runq@plt>

LLVM IR (-O0):
%struct.dthr_event = type { i32 }
@UINT_MAX = global i32 0
define void @dthr_event_broadcast_no_yield(%struct.dthr_event* %0) {
%2 = alloca %struct.dthr_event*
store %struct.dthr_event* %0, %struct.dthr_event** %2
%3 = load %struct.dthr_event*, %struct.dthr_event** %2
%4 = load i32, i32* @UINT_MAX
%5 = call i32 @dthr_eventq_to_runq(%struct.dthr_event* %3, i32 %4)
ret void
}

LLVM IR (-O2):
%struct.dthr_event = type { i32 }
@UINT_MAX = global i32 0
define void @dthr_event_broadcast_no_yield(%struct.dthr_event* %0) {
%2 = load i32, i32* @UINT_MAX
%3 = tail call i32 @dthr_eventq_to_runq(%struct.dthr_event* %0, i32 %2)
ret void
}
void handle_37(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_37(i32 %0) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int suma = 0, num = 1;
  while (num <= 33) {
    suma = suma + num * 3;
    num = num + 3;
  }
  printf("La suma val %d", suma);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x21,-0x18(%rbp)
jg     1158 <main+0x48>
mov    -0x14(%rbp),%eax
imul   $0x3,-0x18(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"La suma val %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %7
%10 = icmp sle i32 %9, 33
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = mul nsw i32 %13, 3
%15 = add nsw i32 %12, %14
store i32 %15, i32* %6
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 3
store i32 %17, i32* %7
br label %8
18: ; preds = %8
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [15 x i8] c"La suma val %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 528)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_count(int n) { printf("T minus %d and counting\n", n); }


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

x86 assembly (clang, -O2):
<print_count>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"T minus %d and counting\0A\00"
define void @print_count(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double __math_check_oflow(double);
double check_oflow(double x) { return 1 ? __math_check_oflow(x) : x; }


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

x86 assembly (clang, -O2):
<check_oflow>:
jmp    1030 <__math_check_oflow@plt>

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

LLVM IR (-O2):
define double @check_oflow(double %0) {
%2 = tail call double @__math_check_oflow(double %0)
ret double %2
}
void usb_select_setup_endpoint(void) {
  (*(volatile unsigned char *)((0x24100000) + 0x2c)) = 0x20;
}


x86 assembly (clang, -O0):
<usb_select_setup_endpoint>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2410002c,%eax
movb   $0x20,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_select_setup_endpoint>:
movb   $0x20,0x2410002c
20
ret

LLVM IR (-O0):
define void @usb_select_setup_endpoint() {
store volatile i8 32, i8* inttoptr (i64 605028396 to i8*)
ret void
}

LLVM IR (-O2):
define void @usb_select_setup_endpoint() {
store volatile i8 32, i8* inttoptr (i64 605028396 to i8*)
ret void
}
void srand(long seed) {
  if (seed == 0) {
    seed = 1;
  }
  *((long *)0x300000000) = seed;
  return;
}


x86 assembly (clang, -O0):
<srand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111b <srand+0x1b>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movabs $0x300000000,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<srand>:
test   %rdi,%rdi
mov    $0x1,%eax
cmovne %rdi,%rax
movabs $0x300000000,%rcx
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @srand(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i64 1, i64* %2
br label %6
6: ; preds = %5, %1
%7 = load i64, i64* %2
store i64 %7, i64* inttoptr (i64 12884901888 to i64*)
ret void
}

LLVM IR (-O2):
define void @srand(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
store i64 %3, i64* inttoptr (i64 12884901888 to i64*)
ret void
}
/* Variables and functions */
double div(int, int);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  int i = 3;
  printf("%f", div(i, ++i));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <div@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call double @div(i32 3, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
int main(int argc, char const *argv[]) {
  int a[256];
  int i = 0;
  int zPend = 0;
  int ll_i;
  int nblock;
  while (i < nblock) {
    if (a[0] == ll_i) {
      zPend++;
    } else {
      a[0] = 8;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x414(%rbp)
movl   $0x0,-0x418(%rbp)
mov    -0x414(%rbp),%eax
cmp    -0x420(%rbp),%eax
jge    1183 <main+0x83>
mov    -0x410(%rbp),%eax
cmp    -0x41c(%rbp),%eax
jne    1165 <main+0x65>
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
jmp    116f <main+0x6f>
movl   $0x8,-0x410(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    112d <main+0x2d>
xor    %eax,%eax
add    $0x3a0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
br label %11
11: ; preds = %25, %2
%12 = load i32, i32* %7
%13 = load i32, i32* %10
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%17 = load i32, i32* %16
%18 = load i32, i32* %9
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
br label %25
23: ; preds = %15
%24 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
store i32 8, i32* %24
br label %25
25: ; preds = %23, %20
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %11
28: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int cel(int m) {
  int k;
  k = 5 * (m - 32) / 9;
  return k;
}


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

x86 assembly (clang, -O2):
<cel>:
lea    (%rdi,%rdi,4),%eax
add    $0xffffff60,%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cel(i32 %0) {
%2 = mul i32 %0, 5
%3 = add i32 %2, -160
%4 = sdiv i32 %3, 9
ret i32 %4
}
/* Variables and functions */
int exported(int);
scalar_t__ exported_two(int);
int rpath_user(int par) {
  int local = exported(par);
  local += exported_two(par);
  return local;
}


x86 assembly (clang, -O0):
<rpath_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exported@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exported_two@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpath_user>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <exported@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <exported_two@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rpath_user(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @exported(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i64 @exported_two(i32 %6)
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @rpath_user(i32 %0) {
%2 = tail call i32 @exported(i32 %0)
%3 = tail call i64 @exported_two(i32 %0)
%4 = trunc i64 %3 to i32
%5 = add i32 %2, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
size_t my_fread(void *p, size_t size, size_t nmemb, FILE *stream) {
  size_t nread;
  if ((nread = fread(p, size, nmemb, stream)) != nmemb) {
    fprintf(stderr, "CUTE: error reading binary file \n");
    exit(1);
  }
  return nread;
}


x86 assembly (clang, -O0):
<my_fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
mov    %rax,-0x28(%rbp)
cmp    -0x18(%rbp),%rax
je     118a <my_fread+0x5a>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fread>:
push   %rbx
mov    %rdx,%rbx
call   1030 <fread@plt>
cmp    %rbx,%rax
jne    1143 <my_fread+0x13>
mov    %rbx,%rax
pop    %rbx
ret
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"CUTE: error reading binary file \0A\00"
define i64 @my_fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i32*, i32** %8
%14 = call i64 @fread(i8* %10, i64 %11, i64 %12, i32* %13)
store i64 %14, i64* %9
%15 = load i64, i64* %7
%16 = icmp ne i64 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %4
%22 = load i64, i64* %9
ret i64 %22
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"CUTE: error reading binary file \0A\00"
define i64 @my_fread(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
%6 = icmp eq i64 %5, %2
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %4
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void finishedState() { printf("Thank You! Have a nice day\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Thank You! Have a nice day\0A\00"
define void @finishedState() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Thank You! Have a nice day\00"
define void @finishedState() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tval {
  int dummy;
};
struct line {
  int dummy;
};

/* Variables and functions */
struct tval *line_nthRecentTval(struct line const *, int /*<<< orphan*/);
struct tval *line_mostRecentTval(const struct line *l) {
  return line_nthRecentTval(l, 0);
}


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

x86 assembly (clang, -O2):
<line_mostRecentTval>:
xor    %esi,%esi
jmp    1030 <line_nthRecentTval@plt>

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

LLVM IR (-O2):
%struct.tval = type { i32 }
%struct.line = type { i32 }
define %struct.tval* @line_mostRecentTval(%struct.line* %0) {
%2 = tail call %struct.tval* @line_nthRecentTval(%struct.line* %0, i32 0)
ret %struct.tval* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x9b() {
  Assert_real((isbdigit(155) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              780, ("isbdigit should be 0 for 0x9b"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x9b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9b,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x30c,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x9b>:
push   %rax
mov    $0x9b,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x30c,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x9b\00"
define void @t_isbdigit_0x9b() {
%1 = call i64 @isbdigit(i32 155)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x9b\00"
define void @t_isbdigit_0x9b() {
%1 = tail call i64 @isbdigit(i32 155)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void int_print(void *n) { printf("%d", *(int *)n); }


x86 assembly (clang, -O0):
<int_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_print>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @int_print(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int strnum(char *s) {
  while (*s) {
    if (!isdigit(*s))
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <strnum+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <strnum+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <strnum+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <strnum+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnum>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <strnum+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <strnum+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strnum+0x20>
jmp    114b <strnum+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @strnum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}