xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ inl(unsigned long);
void insl(unsigned long port, void *dst, unsigned long count) {
  unsigned long *p = dst;
  while (count--)
    *p++ = inl(port);
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1168 <insl+0x58>
mov    -0x8(%rbp),%rdi
call   1030 <inl@plt>
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
jmp    112c <insl+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1147 <insl+0x37>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <inl@plt>
cltq
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <insl+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @insl(i64 %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i64*
br label %7
7: ; preds = %5, %7
%8 = phi i64* [ %13, %7 ], [ %6, %5 ]
%9 = phi i64 [ %10, %7 ], [ %2, %5 ]
%10 = add i64 %9, -1
%11 = tail call i32 @inl(i64 %0)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %8, i64 1
store i64 %12, i64* %8
%14 = icmp eq i64 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
int glp_term_out(int flag) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @glp_term_out(i32 %0) {
ret i32 0
}
enqueue(int *a, int val, int *rear, int *front) {
  if (*front == -1)
    (*front)++;
  (*rear)++;
  *(a + (*rear)) = val;
}


x86 assembly (clang, -O0):
<enqueue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    112b <enqueue+0x2b>
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enqueue>:
cmpl   $0xffffffff,(%rcx)
jne    110b <enqueue+0xb>
movl   $0x0,(%rcx)
movslq (%rdx),%rax
lea    0x1(%rax),%rcx
mov    %ecx,(%rdx)
mov    %esi,0x4(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define i32 @enqueue(i32* nocapture writeonly %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 %1, i32* %12
ret i32 undef
}
char CHR(int x) {
  char buf[2] = {0};
  buf[0] = (char)x;
  return buf;
}


x86 assembly (clang, -O0):
<CHR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %al,-0x6(%rbp)
lea    -0x6(%rbp),%rax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHR>:
lea    -0x2(%rsp),%rax
ret

LLVM IR (-O0):
define signext i8 @CHR(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 %0, i32* %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = ptrtoint i8* %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @CHR(i32 %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = ptrtoint i16* %2 to i64
%5 = trunc i64 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage: fraycut <filename> <prefix>\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"usage: fraycut <filename> <prefix>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"usage: fraycut <filename> <prefix>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int bsearch_seq(unsigned int, unsigned int *, unsigned int, int,
                         unsigned int);
int /*<<< orphan*/ region_to_hi_lo(unsigned int, unsigned int, unsigned int,
                                   int *, int *);
unsigned int isearch_seq(unsigned int key, unsigned int *I, unsigned int I_size,
                         unsigned int D_size, int *D_hi, int *D_lo) {
  unsigned int region = bsearch_seq(key, I, I_size, -1, I_size);
  region_to_hi_lo(region, I_size + 1, D_size, D_hi, D_lo);
  return region;
}


x86 assembly (clang, -O0):
<isearch_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%r8d
mov    $0xffffffff,%ecx
call   1040 <bsearch_seq@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <region_to_hi_lo@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isearch_seq>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %ecx,%r12d
mov    %edx,%ebx
mov    $0xffffffff,%ecx
mov    %edx,%r8d
call   1040 <bsearch_seq@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    %eax,%edi
mov    %ebx,%esi
mov    %r12d,%edx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <region_to_hi_lo@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isearch_seq(i32 %0, i32* %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
store i32 %0, i32* %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%14 = load i32, i32* %7
%15 = load i32*, i32** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %9
%18 = call i32 @bsearch_seq(i32 %14, i32* %15, i32 %16, i32 -1, i32 %17)
store i32 %18, i32* %13
%19 = load i32, i32* %13
%20 = load i32, i32* %9
%21 = add i32 %20, 1
%22 = load i32, i32* %10
%23 = load i32*, i32** %11
%24 = load i32*, i32** %12
%25 = call i32 @region_to_hi_lo(i32 %19, i32 %21, i32 %22, i32* %23, i32* %24)
%26 = load i32, i32* %13
ret i32 %26
}

LLVM IR (-O2):
define i32 @isearch_seq(i32 %0, i32* %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = tail call i32 @bsearch_seq(i32 %0, i32* %1, i32 %2, i32 -1, i32 %2)
%8 = add i32 %2, 1
%9 = tail call i32 @region_to_hi_lo(i32 %7, i32 %8, i32 %3, i32* %4, i32* %5)
ret i32 %7
}
/* Variables and functions */
int DE_Manipulate(char);
int DE_Sub() { return (DE_Manipulate('s')); }


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

x86 assembly (clang, -O2):
<DE_Sub>:
mov    $0x73,%edi
jmp    1030 <DE_Manipulate@plt>

LLVM IR (-O0):
define i32 @DE_Sub() {
%1 = call i32 @DE_Manipulate(i8 signext 115)
ret i32 %1
}

LLVM IR (-O2):
define i32 @DE_Sub() {
%1 = tail call i32 @DE_Manipulate(i8 signext 115)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sys_process(char const *, int, double, int, void *);
void compat_syscall_entry_process(const char *modname, int pass, double clock,
                                  int cpu, void *args) {
  sys_process(modname + 17, pass, clock, cpu, args);
}


x86 assembly (clang, -O0):
<compat_syscall_entry_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x11,%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <sys_process@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_syscall_entry_process>:
add    $0x11,%rdi
jmp    1030 <sys_process@plt>

LLVM IR (-O0):
define void @compat_syscall_entry_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store double %2, double* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 17
%13 = load i32, i32* %7
%14 = load double, double* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = call i32 @sys_process(i8* %12, i32 %13, double %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @compat_syscall_entry_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = getelementptr inbounds i8, i8* %0, i64 17
%7 = tail call i32 @sys_process(i8* %6, i32 %1, double %2, i32 %3, i8* %4)
ret void
}
double CalculateMAP(double systolicPressure, double diastolicPressure) {
  return (2.0 * diastolicPressure + systolicPressure) / 3.0;
}


x86 assembly (clang, -O0):
<CalculateMAP>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateMAP>:
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
divsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @CalculateMAP(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %5, double %6)
%8 = fdiv double %7, 3.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @CalculateMAP(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double %0)
%4 = fdiv double %3, 3.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ stats_update_term_state(int, int);
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ update_term_size();
void ui_update_term_state(void) {
  int screen_x, screen_y;
  update_term_size();
  getmaxyx(stdscr, screen_y, screen_x);
  (void)stats_update_term_state(screen_x, screen_y);
}


x86 assembly (clang, -O0):
<ui_update_term_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <update_term_size@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1040 <getmaxyx@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <stats_update_term_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_update_term_state>:
push   %rax
xor    %eax,%eax
call   1030 <update_term_size@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <getmaxyx@plt>
pop    %rax
jmp    1050 <stats_update_term_state@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @ui_update_term_state() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @update_term_size()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = call i32 @getmaxyx(i32 %4, i32 %5, i32 %6)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @stats_update_term_state(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @ui_update_term_state() {
%1 = tail call i32 (...) @update_term_size()
%2 = load i32, i32* @stdscr
%3 = tail call i32 @getmaxyx(i32 %2, i32 undef, i32 undef)
%4 = tail call i32 @stats_update_term_state(i32 undef, i32 undef)
ret void
}
double power(double base, int n) {
  double p = 1.0;
  for (int i = 0; i < n; i++) {
    p *= base;
  }
  return p;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <power+0x49>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <power+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %edi,%edi
jle    111b <power+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <power+0x24>
movsd  0xee7(%rip),%xmm1
jmp    1155 <power+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm1
nop
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <power+0x30>
test   %eax,%eax
je     1169 <power+0x69>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <power+0x60>
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %22
10: ; preds = %22, %4
%11 = phi double [ undef, %4 ], [ %32, %22 ]
%12 = phi double [ 1.000000e+00, %4 ], [ %32, %22 ]
%13 = icmp eq i32 %6, 0
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi double [ %17, %14 ], [ %12, %10 ]
%16 = phi i32 [ %18, %14 ], [ 0, %10 ]
%17 = fmul double %15, %0
%18 = add i32 %16, 1
%19 = icmp eq i32 %18, %6
br i1 %19, label %20, label %14
20: ; preds = %10, %14, %2
%21 = phi double [ 1.000000e+00, %2 ], [ %11, %10 ], [ %17, %14 ]
ret double %21
22: ; preds = %22, %8
%23 = phi double [ 1.000000e+00, %8 ], [ %32, %22 ]
%24 = phi i32 [ 0, %8 ], [ %33, %22 ]
%25 = fmul double %23, %0
%26 = fmul double %25, %0
%27 = fmul double %26, %0
%28 = fmul double %27, %0
%29 = fmul double %28, %0
%30 = fmul double %29, %0
%31 = fmul double %30, %0
%32 = fmul double %31, %0
%33 = add i32 %24, 8
%34 = icmp eq i32 %33, %9
br i1 %34, label %10, label %22
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _cat_error(char const *message, int ret) {
  fputs("cat"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_cat_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cat_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"cat: \00"
@stderr = global i32 0
define i32 @_cat_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"cat: \00"
@stderr = global i32 0
define i32 @_cat_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getFirstSector(uint32_t clusterNumber, uint32_t sectorPerCluster,
                        uint32_t firstDataSector) {
  return (((clusterNumber - 2) * sectorPerCluster) + firstDataSector);
}


x86 assembly (clang, -O0):
<getFirstSector>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFirstSector>:
lea    -0x2(%rdi),%eax
imul   %esi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @getFirstSector(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 = sub nsw i32 %7, 2
%9 = load i32, i32* %5
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getFirstSector(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, -2
%5 = mul nsw i32 %4, %1
%6 = add nsw i32 %5, %2
ret i32 %6
}
void diament(int szerokosc, int wysokosc) {}


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

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

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

LLVM IR (-O2):
define void @diament(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M559_f(char *s) {
  debug("M559_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M559_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M559_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M559_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M559_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M559_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M559_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
char i2c_read8(char);
int /*<<< orphan*/ i2c_write(char, int);
int /*<<< orphan*/ usleep(int);
int mag3110_readz(char addr) {
  char m, l;
  int r;
  i2c_write(addr, 0x05);
  usleep(2);
  m = i2c_read8(addr);
  usleep(2);
  i2c_write(addr, 0x06);
  usleep(2);
  l = i2c_read8(addr);
  r = (l | (m << 8));
  return r;
}


x86 assembly (clang, -O0):
<mag3110_readz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x5,%esi
movsbl -0x1(%rbp),%edi
call   1030 <i2c_write@plt>
mov    $0x2,%edi
call   1050 <usleep@plt>
movsbl -0x1(%rbp),%edi
call   1040 <i2c_read8@plt>
mov    %al,-0x2(%rbp)
mov    $0x2,%edi
call   1050 <usleep@plt>
mov    $0x6,%esi
movsbl -0x1(%rbp),%edi
call   1030 <i2c_write@plt>
mov    $0x2,%edi
call   1050 <usleep@plt>
movsbl -0x1(%rbp),%edi
call   1040 <i2c_read8@plt>
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
movsbl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mag3110_readz>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x5,%esi
call   1030 <i2c_write@plt>
mov    $0x2,%edi
call   1050 <usleep@plt>
mov    %ebx,%edi
call   1040 <i2c_read8@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1050 <usleep@plt>
mov    %ebx,%edi
mov    $0x6,%esi
call   1030 <i2c_write@plt>
mov    $0x2,%edi
call   1050 <usleep@plt>
mov    %ebx,%edi
call   1040 <i2c_read8@plt>
movsbl %al,%ecx
movsbl %bpl,%eax
shl    $0x8,%eax
or     %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mag3110_readz(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %2
%6 = load i8, i8* %2
%7 = call i32 @i2c_write(i8 signext %6, i32 5)
%8 = call i32 @usleep(i32 2)
%9 = load i8, i8* %2
%10 = call signext i8 @i2c_read8(i8 signext %9)
store i8 %10, i8* %3
%11 = call i32 @usleep(i32 2)
%12 = load i8, i8* %2
%13 = call i32 @i2c_write(i8 signext %12, i32 6)
%14 = call i32 @usleep(i32 2)
%15 = load i8, i8* %2
%16 = call signext i8 @i2c_read8(i8 signext %15)
store i8 %16, i8* %4
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = shl i32 %20, 8
%22 = or i32 %18, %21
store i32 %22, i32* %5
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @mag3110_readz(i8 signext %0) {
%2 = tail call i32 @i2c_write(i8 signext %0, i32 5)
%3 = tail call i32 @usleep(i32 2)
%4 = tail call signext i8 @i2c_read8(i8 signext %0)
%5 = tail call i32 @usleep(i32 2)
%6 = tail call i32 @i2c_write(i8 signext %0, i32 6)
%7 = tail call i32 @usleep(i32 2)
%8 = tail call signext i8 @i2c_read8(i8 signext %0)
%9 = sext i8 %8 to i32
%10 = sext i8 %4 to i32
%11 = shl nsw i32 %10, 8
%12 = or i32 %11, %9
ret i32 %12
}
/* Variables and functions */
long evalwhere();
scalar_t__ test(char *);
long evaltable() {
  long val;
  for (val = evalwhere(); test("&&");) {
    if (!evalwhere() != 0)
      val = 0;
  }
  return (val);
}


x86 assembly (clang, -O0):
<evaltable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <evalwhere@plt>
mov    %rax,-0x8(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <test@plt>
cmp    $0x0,%rax
je     1174 <evaltable+0x54>
mov    $0x0,%al
call   1030 <evalwhere@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     116f <evaltable+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    1133 <evaltable+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaltable>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <evalwhere@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
call   1040 <test@plt>
test   %rax,%rax
je     116b <evaltable+0x4b>
lea    0xeba(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <evalwhere@plt>
test   %rax,%rax
cmove  %rax,%rbx
mov    %r14,%rdi
call   1040 <test@plt>
test   %rax,%rax
jne    1150 <evaltable+0x30>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"&&\00"
define i64 @evaltable() {
%1 = alloca i64
%2 = call i64 (...) @evalwhere()
store i64 %2, i64* %1
br label %3
3: ; preds = %13, %0
%4 = call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = call i64 (...) @evalwhere()
%8 = icmp ne i64 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
store i64 0, i64* %1
br label %13
13: ; preds = %12, %6
br label %3
14: ; preds = %3
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"&&\00"
define i64 @evaltable() {
%1 = tail call i64 (...) @evalwhere()
%2 = tail call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i64 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i64 (...) @evalwhere()
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i64 0, i64 %5
%9 = tail call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %0
%12 = phi i64 [ %1, %0 ], [ %8, %4 ]
ret i64 %12
}
long concat(int a, int b) {
  int n = 10;
  for (; b >= n; n *= 10)
    ;
  return (long)a * (long)n + (long)b;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     112e <concat+0x2e>
jmp    1122 <concat+0x22>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <concat+0x11>
movslq -0x4(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
mov    $0xa,%eax
cmp    $0xa,%esi
jl     111b <concat+0x1b>
mov    $0xa,%eax
nop
add    %eax,%eax
lea    (%rax,%rax,4),%eax
cmp    %esi,%eax
jle    1110 <concat+0x10>
mov    %eax,%eax
movslq %edi,%rcx
imul   %rax,%rcx
movslq %esi,%rax
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @concat(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 10
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ 10, %2 ]
%6 = mul nsw i32 %5, 10
%7 = icmp sgt i32 %6, %1
br i1 %7, label %8, label %4
8: ; preds = %4
%9 = zext i32 %6 to i64
br label %10
10: ; preds = %8, %2
%11 = phi i64 [ 10, %2 ], [ %9, %8 ]
%12 = sext i32 %0 to i64
%13 = mul nsw i64 %11, %12
%14 = sext i32 %1 to i64
%15 = add nsw i64 %13, %14
ret i64 %15
}
/* Variables and functions */
float asin(float);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(float);
int main() {
  float a = 2, b = 0.3;
  a = asin(b);
  print("a 0.304693");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xebd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeac(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <asin@plt>
movss  %xmm0,-0x8(%rbp)
lea    0xe99(%rip),%rdi
call   1030 <print@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <print@plt>
movss  0xecb(%rip),%xmm0
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a 0.304693\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 2.000000e+00, float* %2
store float 0x3FD3333340000000, float* %3
%4 = load float, float* %3
%5 = call float @asin(float %4)
store float %5, float* %2
%6 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load float, float* %2
%8 = call i32 @printid(float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"a 0.304693\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(float 0x3FD38015A0000000)
ret i32 0
}
unsigned long diffULong(unsigned long x, unsigned long y) {
  long long lx = x, ly = y, lresult;
  lresult = lx - ly;
  if (lresult < 0) {
    return (unsigned long)(lresult + ((unsigned long)-1L) + 1);
  } else {
    return (unsigned long)(lresult);
  }
}


x86 assembly (clang, -O0):
<diffULong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jge    1148 <diffULong+0x48>
mov    -0x30(%rbp),%rax
add    $0xffffffffffffffff,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <diffULong+0x50>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffULong>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @diffULong(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "%s\n%s\n",
          "usage: truncate [-c] -s [+|-]size[K|k|M|m|G|g] file ...",
          "       truncate [-c] -r rfile file ...");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xefd(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xf00(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [56 x i8] c"usage: truncate [-c] -s [+|-]size[K|k|M|m|G|g] file ...\00"
@.str.2 = [39 x i8] c" truncate [-c] -r rfile file ...\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [56 x i8] c"usage: truncate [-c] -s [+|-]size[K|k|M|m|G|g] file ...\00"
@.str.2 = [39 x i8] c" truncate [-c] -r rfile file ...\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bdos_c_read(void) { fprintf(stderr, "BDOS C_READ not yet implemented\n"); }


x86 assembly (clang, -O0):
<bdos_c_read>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"BDOS C_READ not yet implemented\0A\00"
define void @bdos_c_read() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"BDOS C_READ not yet implemented\0A\00"
define void @bdos_c_read() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
char toupper(char);
int isalphanum(char c) {
  c = toupper(c);
  return isdigit(c) || ('A' <= c && c <= 'Z') || c == '_';
}


x86 assembly (clang, -O0):
<isalphanum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1185 <isalphanum+0x65>
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1178 <isalphanum+0x58>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1185 <isalphanum+0x65>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalphanum>:
push   %rbx
call   1040 <toupper@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
lea    -0x41(%rbx),%ecx
cmp    $0x1a,%cl
setb   %cl
cmp    $0x5f,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalphanum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @toupper(i8 signext %3)
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = call i64 @isdigit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %20, label %8
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 65, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 90
br i1 %15, label %20, label %16
16: ; preds = %12, %8
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 95
br label %20
20: ; preds = %16, %12, %1
%21 = phi i1 [ true, %12 ], [ true, %1 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isalphanum(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 signext %0)
%3 = tail call i64 @isdigit(i8 signext %2)
%4 = icmp ne i64 %3, 0
%5 = add i8 %2, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %4, %6
%8 = icmp eq i8 %2, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
unsigned short be2short(const uint8_t *be) {
  return ((unsigned short)be[0] << 8) | (unsigned short)be[1];
}


x86 assembly (clang, -O0):
<be2short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
movzwl %cx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be2short>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @be2short(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i16
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = load i64*, i64** %2
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i16
%13 = zext i16 %12 to i32
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @be2short(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i16
%4 = shl i16 %3, 8
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ write_to_log(char *, char const *);
void name_already_exists(const char *name) {
  write_to_log("Error: name '%s' already exists in table.\n", name);
}


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

x86 assembly (clang, -O2):
<name_already_exists>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <write_to_log@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Error: name '%s' already exists in table.\0A\00"
define void @name_already_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write_to_log(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Error: name '%s' already exists in table.\0A\00"
define void @name_already_exists(i8* %0) {
%2 = tail call i32 @write_to_log(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *ldrstdrealloc(void *mem, void *ptr, size_t ob, size_t nb) {
  (void)mem;
  (void)ob;
  return realloc(ptr, nb);
}


x86 assembly (clang, -O0):
<ldrstdrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldrstdrealloc>:
mov    %rsi,%rdi
mov    %rcx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @ldrstdrealloc(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %7
%11 = load i8*, i8** %6
%12 = load i64, i64* %8
%13 = call i8* @realloc(i8* %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @ldrstdrealloc(i8* nocapture readnone %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = tail call i8* @realloc(i8* %1, i64 %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ lflush();
int /*<<< orphan*/ lprcat(char *);
int /*<<< orphan*/ nap(int);
void outofstock() {
  lprcat("\nSorry, but we are out of that item.");
  lflush();
  nap(2200);
}


x86 assembly (clang, -O0):
<outofstock>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <lprcat@plt>
mov    $0x0,%al
call   1040 <lflush@plt>
mov    $0x898,%edi
call   1030 <nap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outofstock>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <lprcat@plt>
xor    %eax,%eax
call   1040 <lflush@plt>
mov    $0x898,%edi
pop    %rax
jmp    1030 <nap@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0ASorry, but we are out of that item.\00"
define void @outofstock() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @lflush()
%3 = call i32 @nap(i32 2200)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0ASorry, but we are out of that item.\00"
define void @outofstock() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @lflush()
%3 = tail call i32 @nap(i32 2200)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlUSBPLLDisable(void) {
  (*((volatile uint32_t *)(0x400FE070))) |= 0x00004000;
}


x86 assembly (clang, -O0):
<SysCtlUSBPLLDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe070,%eax
mov    (%rax),%ecx
or     $0x4000,%ecx
mov    $0x400fe070,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlUSBPLLDisable>:
orl    $0x4000,0x400fe070
ret

LLVM IR (-O0):
define void @SysCtlUSBPLLDisable() {
%1 = load volatile i32, i32* inttoptr (i64 1074782320 to i32*)
%2 = or i32 %1, 16384
store volatile i32 %2, i32* inttoptr (i64 1074782320 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlUSBPLLDisable() {
%1 = load volatile i32, i32* inttoptr (i64 1074782320 to i32*)
%2 = or i32 %1, 16384
store volatile i32 %2, i32* inttoptr (i64 1074782320 to i32*)
ret void
}
int mswin_minorver() { return (21); }


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

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

LLVM IR (-O0):
define i32 @mswin_minorver() {
ret i32 21
}

LLVM IR (-O2):
define i32 @mswin_minorver() {
ret i32 21
}
/* Variables and functions */
int start_deamon();
int main() { return start_deamon(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <start_deamon@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start_deamon()
ret i32 %1
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec ct_get_time() {
  struct timespec ret_val;
  clock_gettime(CLOCK_MONOTONIC, &ret_val);
  return ret_val;
}


x86 assembly (clang, -O0):
<ct_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_get_time>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @ct_get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @ct_get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
void setval_381(unsigned *p) { *p = 3281047945U; }


x86 assembly (clang, -O0):
<setval_381>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc390d189,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_381>:
movl   $0xc390d189,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_381(i32* nocapture writeonly %0) {
store i32 -1013919351, i32* %0
ret void
}
long min(long a, long b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}