xunge/DecIR huggingface dataset:
void swapString(char **x, char **y) {
  char *t = *y;
  *y = *x;
  *x = t;
}


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

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

LLVM IR (-O0):
define void @swapString(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %4
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swapString(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8*, i8** %0
store i8* %4, i8** %1
store i8* %3, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t();
int main() {
  int i;
  for (i = 0; i < 1000; i++)
    t();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0x0,%al
call   1030 <t@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <t@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @t()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_150() {
  Assert_real((isqrt(150) == 12),
              "/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/stdlib/isqrt.c",
              755, ("Integer square root of 150 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_150>:
push   %rbp
mov    %rsp,%rbp
mov    $0x96,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2f3,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_150>:
push   %rax
mov    $0x96,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2f3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 150 should be 12\00"
define void @t_sqrt_150() {
%1 = call i32 @isqrt(i32 150)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 755, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 150 should be 12\00"
define void @t_sqrt_150() {
%1 = tail call i32 @isqrt(i32 150)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 755, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endpage();
int /*<<< orphan*/ newpage();
int /*<<< orphan*/ reportf();
void report() {
  newpage();
  reportf();
  endpage();
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <newpage@plt>
mov    $0x0,%al
call   1030 <reportf@plt>
mov    $0x0,%al
call   1040 <endpage@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %rax
xor    %eax,%eax
call   1050 <newpage@plt>
xor    %eax,%eax
call   1030 <reportf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endpage@plt>

LLVM IR (-O0):
define void @report() {
%1 = call i32 (...) @newpage()
%2 = call i32 (...) @reportf()
%3 = call i32 (...) @endpage()
ret void
}

LLVM IR (-O2):
define void @report() {
%1 = tail call i32 (...) @newpage()
%2 = tail call i32 (...) @reportf()
%3 = tail call i32 (...) @endpage()
ret void
}
double dfac_intern(int n, double akk) {
  if (n <= 1) {
    return akk;
  } else {
    return dfac_intern(n - 1, akk * n);
  }
}


x86 assembly (clang, -O0):
<dfac_intern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1139 <dfac_intern+0x29>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1157 <dfac_intern+0x47>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <dfac_intern@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfac_intern>:
cmp    $0x2,%edi
jl     1125 <dfac_intern+0x25>
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
lea    -0x1(%rdi),%eax
mulsd  %xmm1,%xmm0
cmp    $0x2,%edi
mov    %eax,%edi
ja     1110 <dfac_intern+0x10>
ret

LLVM IR (-O0):
define double @dfac_intern(i32 %0, double %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %5
store double %9, double* %3
br label %18
10: ; preds = %2
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = load double, double* %5
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = fmul double %13, %15
%17 = call double @dfac_intern(i32 %12, double %16)
store double %17, double* %3
br label %18
18: ; preds = %10, %8
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @dfac_intern(i32 %0, double %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi double [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = sitofp i32 %6 to double
%9 = fmul double %5, %8
%10 = icmp ult i32 %6, 3
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi double [ %1, %2 ], [ %9, %4 ]
ret double %12
}
long long int lsrchllint(long long int *a, long long int n, long long int k) {
  long long int i;
  for (i = 0; i < n; i++) {
    if (*(a + i) == k)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<lsrchllint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    115f <lsrchllint+0x5f>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x20(%rbp),%rax
jne    1149 <lsrchllint+0x49>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <lsrchllint+0x67>
jmp    114e <lsrchllint+0x4e>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <lsrchllint+0x18>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsrchllint>:
mov    $0xffffffffffffffff,%rax
test   %rsi,%rsi
jle    111f <lsrchllint+0x1f>
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %rdx,(%rdi,%rcx,8)
je     1120 <lsrchllint+0x20>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <lsrchllint+0x10>
ret
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @lsrchllint(i64* nocapture %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %10
%6 = phi i64 [ %11, %10 ], [ 0, %3 ]
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, %2
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %10, %3
%14 = phi i64 [ -1, %3 ], [ -1, %10 ], [ %6, %5 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("O tamanho em bytes de um inteiro = %d\n", sizeof(int));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"O tamanho em bytes de um inteiro = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"O tamanho em bytes de um inteiro = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ jstp_tx_char(char);
int /*<<< orphan*/ jstp_tx_str(char const *);
void jstp_tx_obj_key(const char *key) {
  jstp_tx_str(key);
  jstp_tx_char(':');
}


x86 assembly (clang, -O0):
<jstp_tx_obj_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <jstp_tx_str@plt>
mov    $0x3a,%edi
call   1040 <jstp_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jstp_tx_obj_key>:
push   %rax
call   1030 <jstp_tx_str@plt>
mov    $0x3a,%edi
pop    %rax
jmp    1040 <jstp_tx_char@plt>

LLVM IR (-O0):
define void @jstp_tx_obj_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @jstp_tx_str(i8* %3)
%5 = call i32 @jstp_tx_char(i8 signext 58)
ret void
}

LLVM IR (-O2):
define void @jstp_tx_obj_key(i8* %0) {
%2 = tail call i32 @jstp_tx_str(i8* %0)
%3 = tail call i32 @jstp_tx_char(i8 signext 58)
ret void
}
__attribute__((no)) void trampoline_set_tcb(unsigned long n1) {
  long ret;
  __asm__ __volatile__("leaq 1f(%%rip), %%r11\n\t"
                       "movq %%r11, %%fs:0x20\n\t"
                       "jmpq *%%gs:0x10000+"
                       "0x70"
                       "\n\t"
                       "1:\n\t"
                       : "=a"(ret)
                       : "D"(n1)
                       : "memory");
}


x86 assembly (clang, -O0):
<trampoline_set_tcb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x10070
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_set_tcb>:
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x10070
ret

LLVM IR (-O0):
define void @trampoline_set_tcb(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0x70\0A\091:\0A\09", "={ax},{di},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %3
ret void
}

LLVM IR (-O2):
define void @trampoline_set_tcb(i64 %0) {
%2 = tail call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0x70\0A\091:\0A\09", "={ax},{di},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
void bitmap_clear_bit(unsigned long *bitmap, unsigned int bit) {
  bitmap[((bit) / (sizeof(long) * 8))] &=
      ~(0x1ul << ((bit) % (sizeof(long) * 8)));
}


x86 assembly (clang, -O0):
<bitmap_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x6,%rcx
and    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_clear_bit>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%eax
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
and    $0xfffffff8,%eax
and    %rdx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @bitmap_clear_bit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = zext i32 %5 to i64
%7 = urem i64 %6, 64
%8 = shl i64 1, %7
%9 = xor i64 %8, -1
%10 = load i64*, i64** %3
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = udiv i64 %12, 64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
%15 = load i64, i64* %14
%16 = and i64 %15, %9
store i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @bitmap_clear_bit(i64* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = xor i64 %5, -1
%7 = lshr i64 %3, 6
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = and i64 %9, %6
store i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_handler(char *);
int field_exist(const char *file, const char *name) {
  int ncid, varid, status;
  char msg[512];
  int existed = 0;
  error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
  return existed;
}


x86 assembly (clang, -O0):
<field_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x224(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <error_handler@plt>
mov    -0x224(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [50 x i8] c"read_mosaic: Add flag -Duse_netCDF when compiling\00"
define i32 @field_exist(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [512 x i8]
%9 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %9
%10 = call i32 @error_handler(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %9
ret i32 %11
}

LLVM IR (-O2):
@.str = [50 x i8] c"read_mosaic: Add flag -Duse_netCDF when compiling\00"
define i32 @field_exist(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @error_handler(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Atm128GpioInterruptC__2__Atm128Interrupt__fired();
void HplAtm128InterruptPinP__5__Irq__fired(void) {
  Atm128GpioInterruptC__2__Atm128Interrupt__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128InterruptPinP__5__Irq__fired() {
%1 = tail call i32 (...) @Atm128GpioInterruptC__2__Atm128Interrupt__fired()
ret void
}
int isValidPort(int port) { return (port > 1024) && (port < 65535); }


x86 assembly (clang, -O0):
<isValidPort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x400,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1126 <isValidPort+0x26>
cmpl   $0xffff,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidPort>:
add    $0xfffffbff,%edi
xor    %eax,%eax
cmp    $0xfbfe,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isValidPort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1024
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 65535
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isValidPort(i32 %0) {
%2 = add i32 %0, -1025
%3 = icmp ult i32 %2, 64510
%4 = zext i1 %3 to i32
ret i32 %4
}
void RTPoll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPoll() {
ret void
}
void perform(int elements) {}


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

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

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

LLVM IR (-O2):
define void @perform(i32 %0) {
ret void
}
/* Variables and functions */
int read_litteral(char *);
int parse_reg_operator() { return read_litteral(";"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c";\00"
define i32 @parse_reg_operator() {
%1 = call i32 @read_litteral(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
define i32 @parse_reg_operator() {
%1 = tail call i32 @read_litteral(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int errno;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int fd;
  if ((fd = open("/no/such/file", 0)) < 0) {
    printf("open error: ");
    printf("errno = %d\n", errno);
  }
  return 0;
}


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)
lea    0xec3(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1175 <main+0x55>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
test   %eax,%eax
jns    1158 <main+0x38>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"/no/such/file\00"
@.str.1 = [13 x i8] c"open error: \00"
@.str.2 = [12 x i8] c"errno = %d\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @errno
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %2
ret i32 0
}
int main(void) {
  return 0xa == 0xA && 0xb == 0xB && 0xc == 0xC && 0xd == 0xD && 0xe == 0xE &&
         0xf == 0xF;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
void ui_set_colourmap(void *map) {}


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

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

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

LLVM IR (-O2):
define void @ui_set_colourmap(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ lex_isident(int);
scalar_t__ lex_isnumber(int);
int lex_isnatrual(int ch) {
  return lex_isident(ch) || (unsigned char)ch >= 0x80 || lex_isnumber(ch) ||
         ch == '_';
}


x86 assembly (clang, -O0):
<lex_isnatrual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lex_isident@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1180 <lex_isnatrual+0x60>
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0x80,%ecx
mov    %al,-0x5(%rbp)
jge    1180 <lex_isnatrual+0x60>
mov    -0x4(%rbp),%edi
call   1030 <lex_isnumber@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1180 <lex_isnatrual+0x60>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lex_isnatrual>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <lex_isident@plt>
mov    $0x1,%ebx
test   $0x80,%bpl
jne    114e <lex_isnatrual+0x2e>
test   %rax,%rax
jne    114e <lex_isnatrual+0x2e>
mov    %ebp,%edi
call   1030 <lex_isnumber@plt>
test   %rax,%rax
jne    114e <lex_isnatrual+0x2e>
xor    %ebx,%ebx
cmp    $0x5f,%ebp
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lex_isnatrual(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @lex_isident(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i8
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 128
br i1 %10, label %18, label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = call i64 @lex_isnumber(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 95
br label %18
18: ; preds = %15, %11, %6, %1
%19 = phi i1 [ true, %11 ], [ true, %6 ], [ true, %1 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @lex_isnatrual(i32 %0) {
%2 = tail call i64 @lex_isident(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, 128
%5 = icmp eq i32 %4, 0
%6 = and i1 %5, %3
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = tail call i64 @lex_isnumber(i32 %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = icmp eq i32 %0, 95
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %7, %1
%14 = phi i32 [ 1, %7 ], [ 1, %1 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void dormir(int s) { sleep(s); }


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

x86 assembly (clang, -O2):
<dormir>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @dormir(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
void set_inode_unused(unsigned char *inode_bitmap, int inodenum) {
  unsigned char bm;
  bm = inode_bitmap[inodenum / 8];
  bm |= (0x80 >> (inodenum % 8));
  bm ^= (0x80 >> (inodenum % 8));
  inode_bitmap[inodenum / 8] = bm;
}


x86 assembly (clang, -O0):
<set_inode_unused>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x80,%eax
sar    %cl,%eax
mov    %eax,%ecx
movzbl -0xd(%rbp),%eax
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x80,%eax
sar    %cl,%eax
mov    %eax,%ecx
movzbl -0xd(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x19(%rbp),%dl
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_inode_unused>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
and    $0x7,%cl
mov    $0x80,%edx
shr    %cl,%edx
not    %dl
and    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @set_inode_unused(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = ashr i32 128, %13
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = or i32 %16, %14
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
%19 = load i32, i32* %4
%20 = srem i32 %19, 8
%21 = ashr i32 128, %20
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, %21
%25 = trunc i32 %24 to i8
store i8 %25, i8* %5
%26 = load i8, i8* %5
%27 = load i8*, i8** %3
%28 = load i32, i32* %4
%29 = sdiv i32 %28, 8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %27, i64 %30
store i8 %26, i8* %31
ret void
}

LLVM IR (-O2):
define void @set_inode_unused(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = and i32 %1, 7
%8 = lshr i32 128, %7
%9 = trunc i32 %8 to i8
%10 = xor i8 %9, -1
%11 = and i8 %6, %10
store i8 %11, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ stdout;
void version() {
  printf(""
         "stmp version %d.%d.%d\n"
         "Copyright (c) 2017 Sidhin S Thomas.\n"
         "All rights reserverd.\n"
         "Author holds no liability regarding usage.\n"
         "Free to use and alter :)\n",
         1, 0, 3);
  fflush(stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [149 x i8] c"stmp version %d.%d.%d\0ACopyright (c) 2017 Sidhin S Thomas.\0AAll rights reserverd.\0AAuthor holds no liability regarding usage.\0AFree to use and alter :)\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 3)
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [149 x i8] c"stmp version %d.%d.%d\0ACopyright (c) 2017 Sidhin S Thomas.\0AAll rights reserverd.\0AAuthor holds no liability regarding usage.\0AFree to use and alter :)\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 3)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int HighByte(int i) { return ((i >> 8) & 0xff); }


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

x86 assembly (clang, -O2):
<HighByte>:
mov    %edi,%eax
movzbl %ah,%eax
ret

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

LLVM IR (-O2):
define i32 @HighByte(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ BSP_DisableInt();
int SpinLock(int);
int BSP_GetSpinlockIrqSaved(int id) {
  BSP_DisableInt();
  return SpinLock(id);
}


x86 assembly (clang, -O0):
<BSP_GetSpinlockIrqSaved>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <BSP_DisableInt@plt>
mov    -0x4(%rbp),%edi
call   1030 <SpinLock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_GetSpinlockIrqSaved>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <BSP_DisableInt@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <SpinLock@plt>

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

LLVM IR (-O2):
define i32 @BSP_GetSpinlockIrqSaved(i32 %0) {
%2 = tail call i32 (...) @BSP_DisableInt()
%3 = tail call i32 @SpinLock(i32 %0)
ret i32 %3
}
unsigned int scan_8ulong(const char *s, unsigned long *u) {
  unsigned int pos;
  unsigned long result, c;
  pos = 0;
  result = 0;
  while ((c = (unsigned long)(unsigned char)(s[pos] - '0')) < 8) {
    result = result * 8 + c;
    ++pos;
  }
  *u = result;
  return pos;
}


x86 assembly (clang, -O0):
<scan_8ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
movzbl %al,%eax
mov    %rax,-0x28(%rbp)
cmp    $0x8,%rax
jae    1158 <scan_8ulong+0x58>
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <scan_8ulong+0x1b>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_8ulong>:
mov    (%rdi),%dl
add    $0xd0,%dl
cmp    $0x7,%dl
ja     112a <scan_8ulong+0x2a>
xor    %eax,%eax
xor    %ecx,%ecx
xchg   %ax,%ax
movzbl %dl,%edx
lea    (%rdx,%rcx,8),%rcx
add    $0x1,%eax
movzbl (%rdi,%rax,1),%edx
add    $0xd0,%dl
cmp    $0x8,%dl
jb     1110 <scan_8ulong+0x10>
mov    %rcx,(%rsi)
ret
xor    %ecx,%ecx
xor    %eax,%eax
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @scan_8ulong(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 8
br i1 %5, label %6, label %19
6: ; preds = %2, %6
%7 = phi i8 [ %17, %6 ], [ %4, %2 ]
%8 = phi i32 [ %13, %6 ], [ 0, %2 ]
%9 = phi i64 [ %12, %6 ], [ 0, %2 ]
%10 = zext i8 %7 to i64
%11 = shl i64 %9, 3
%12 = add nuw i64 %11, %10
%13 = add i32 %8, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = add i8 %16, -48
%18 = icmp ult i8 %17, 8
br i1 %18, label %6, label %19
19: ; preds = %6, %2
%20 = phi i64 [ 0, %2 ], [ %12, %6 ]
%21 = phi i32 [ 0, %2 ], [ %13, %6 ]
store i64 %20, i64* %1
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
long sysconf(int /*<<< orphan*/);
long findMemTickSize(long totalTime, long size) {
  long ticksPerSecond;
  long kbSize;
  ticksPerSecond = sysconf(_SC_CLK_TCK);
  kbSize = size / ticksPerSecond / totalTime;
  return kbSize;
}


x86 assembly (clang, -O0):
<findMemTickSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cqto
idivq  -0x8(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findMemTickSize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     113e <findMemTickSize+0x2e>
mov    %rbx,%rax
cqto
idiv   %rcx
jmp    1144 <findMemTickSize+0x34>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %rax,%rcx
or     %r14,%rcx
shr    $0x20,%rcx
je     1157 <findMemTickSize+0x47>
cqto
idiv   %r14
jmp    115c <findMemTickSize+0x4c>
xor    %edx,%edx
div    %r14d
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@_SC_CLK_TCK = global i32 0
define i64 @findMemTickSize(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i32, i32* @_SC_CLK_TCK
%8 = call i64 @sysconf(i32 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = sdiv i64 %9, %10
%12 = load i64, i64* %3
%13 = sdiv i64 %11, %12
store i64 %13, i64* %6
%14 = load i64, i64* %6
ret i64 %14
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
define i64 @findMemTickSize(i64 %0, i64 %1) {
%3 = load i32, i32* @_SC_CLK_TCK
%4 = tail call i64 @sysconf(i32 %3)
%5 = sdiv i64 %1, %4
%6 = sdiv i64 %5, %0
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo1() { printf("foo1\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"foo1\00"
define void @foo1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CrestCall(int, int);
int /*<<< orphan*/ __CrestReturn(int);
void createCDG(void) {
  {
    __CrestCall(1, 1);
    {
      __CrestReturn(2);
      return;
    }
  }
}


x86 assembly (clang, -O0):
<createCDG>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <__CrestCall@plt>
mov    $0x2,%edi
call   1030 <__CrestReturn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createCDG>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <__CrestCall@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <__CrestReturn@plt>

LLVM IR (-O0):
define void @createCDG() {
%1 = call i32 @__CrestCall(i32 1, i32 1)
%2 = call i32 @__CrestReturn(i32 2)
ret void
}

LLVM IR (-O2):
define void @createCDG() {
%1 = tail call i32 @__CrestCall(i32 1, i32 1)
%2 = tail call i32 @__CrestReturn(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "vdir", message); }


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

x86 assembly (clang, -O2):
<g_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [5 x i8] c"vdir\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ pthread_self();
void echomsg(void *t) {
  printf("destrutor excutor in thread"
         " %d, param = %d\n",
         (int)pthread_self(), (int)t);
}


x86 assembly (clang, -O0):
<echomsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echomsg>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"destrutor excutor in thread %d, param = %d\0A\00"
define void @echomsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"destrutor excutor in thread %d, param = %d\0A\00"
define void @echomsg(i8* %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret void
}
int foo4(int a, int b) { return (a == b); }


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @foo4(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int foo1(int, int, int, int);
int main() { return foo1(2, 3, 4, 5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x5,%ecx
call   1030 <foo1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x5,%ecx
jmp    1030 <foo1@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo1(i32 2, i32 3, i32 4, i32 5)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(int, unsigned int);
void print_spew_hex32(unsigned int value) { __console_tx_hex32(8, value); }


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

x86 assembly (clang, -O2):
<print_spew_hex32>:
mov    %edi,%esi
mov    $0x8,%edi
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_spew_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 8, i32 %0)
ret void
}
int length(char s[]) {
  int i;
  for (i = 0; s[i] != '\0'; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <length+0x37>
jmp    1129 <length+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length+0x10>
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int process_ioexit(int sock) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @process_ioexit(i32 %0) {
ret i32 -1
}
int rightChild(int *array, int i, int n) {
  if (2 * i + 2 < n) {
    return 2 * i + 2;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<rightChild>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
cmp    -0x18(%rbp),%eax
jge    1131 <rightChild+0x31>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <rightChild+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightChild>:
lea    (%rsi,%rsi,1),%ecx
add    $0x2,%ecx
cmp    %edx,%ecx
mov    $0xffffffff,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @rightChild(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 1
%5 = add nsw i32 %4, 2
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}