xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AddLeft(int *, int *, int);
void AddVecLeft(int *dst, int *length_dst, int *src, int length_src) {
  int i;
  ;
  ;
  ;
  ;
  for (i = length_src - 1; i >= 0; i--) {
    ;
    AddLeft(dst, length_dst, src[i]);
  };
}


x86 assembly (clang, -O0):
<AddVecLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     1160 <AddVecLeft+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1030 <AddLeft@plt>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1130 <AddVecLeft+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddVecLeft>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
jle    114c <AddVecLeft+0x3c>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %ecx,%ebx
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,4),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <AddLeft@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <AddVecLeft+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @AddVecLeft(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** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %9
br label %12
12: ; preds = %24, %4
%13 = load i32, i32* %9
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i32*, i32** %5
%17 = load i32*, i32** %6
%18 = load i32*, i32** %7
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = call i32 @AddLeft(i32* %16, i32* %17, i32 %22)
br label %24
24: ; preds = %15
%25 = load i32, i32* %9
%26 = add nsw i32 %25, -1
store i32 %26, i32* %9
br label %12
27: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @AddVecLeft(i32* %0, i32* %1, i32* nocapture %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %16
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %7, %6 ], [ %10, %8 ]
%10 = add nsw i64 %9, -1
%11 = and i64 %10, 4294967295
%12 = getelementptr inbounds i32, i32* %2, i64 %11
%13 = load i32, i32* %12
%14 = tail call i32 @AddLeft(i32* %0, i32* %1, i32 %13)
%15 = icmp ugt i64 %9, 1
br i1 %15, label %8, label %16
16: ; preds = %8, %4
ret void
}
/* Variables and functions */
double sqrt(double);
double lbl(double x1, double y1, double x2, double y2) {
  double u1 = x2 - x1;
  double u2 = y2 - y1;
  return sqrt((u1 * u1) + (u2 * u2));
}


x86 assembly (clang, -O0):
<lbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbl>:
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm3
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1136 <lbl+0x26>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
ret
movapd %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @lbl(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %7
%12 = load double, double* %5
%13 = fsub double %11, %12
store double %13, double* %9
%14 = load double, double* %8
%15 = load double, double* %6
%16 = fsub double %14, %15
store double %16, double* %10
%17 = load double, double* %9
%18 = load double, double* %9
%19 = load double, double* %10
%20 = load double, double* %10
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %17, double %18, double %21)
%23 = call double @sqrt(double %22)
ret double %23
}

LLVM IR (-O2):
define double @lbl(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = fsub double %3, %1
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
ret double %9
}
unsigned long long rdtsc() {
  unsigned long long r;
  do {
    unsigned int eax, edx;
    __asm__ __volatile__("cpuid" ::: "eax", "ebx", "ecx", "edx");
    __asm__ __volatile__("rdtsc" : "=a"(eax), "=d"(edx));
    r = ((unsigned long long)edx << 32) | eax;
  } while (0);
  ;
  return r;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
cpuid
rdtsc
mov    %eax,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x20,%rax
mov    -0x14(%rbp),%ecx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
push   %rbx
cpuid
rdtsc
shl    $0x20,%rdx
mov    %eax,%eax
or     %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0
%5 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%6 = extractvalue { i32, i32 } %5, 0
%7 = extractvalue { i32, i32 } %5, 1
store i32 %6, i32* %2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = or i64 %10, %12
store i64 %13, i64* %1
br label %14
14: ; preds = %4
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
define i64 @rdtsc() {
tail call void asm sideeffect "cpuid", "~{eax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 %4, 32
%6 = zext i32 %2 to i64
%7 = or i64 %5, %6
ret i64 %7
}
int do_final_unit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @do_final_unit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @do_final_unit() {
ret i32 0
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_del(struct list_head *);
__attribute__((always_)) void list_del_init(struct list_head *entry) {
  list_del(entry);
  INIT_LIST_HEAD(entry);
}


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

x86 assembly (clang, -O2):
<list_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <list_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @list_del(%struct.list_head* %3)
%5 = load %struct.list_head*, %struct.list_head** %2
%6 = call i32 @INIT_LIST_HEAD(%struct.list_head* %5)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = tail call i32 @list_del(%struct.list_head* %0)
%3 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adjustParallel();
int /*<<< orphan*/ adjustSide();
int /*<<< orphan*/ checkWallAhead();
int /*<<< orphan*/ connect_to_robot();
int /*<<< orphan*/ initialize_robot();
int /*<<< orphan*/ lookForEnd();
int /*<<< orphan*/ lookForFront();
int /*<<< orphan*/ setSensors();
int /*<<< orphan*/ straight();
int main() {
  connect_to_robot();
  initialize_robot();
  setSensors();
  while (1) {
    adjustParallel();
    lookForFront();
    lookForEnd();
    straight();
    adjustSide();
    checkWallAhead();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <connect_to_robot@plt>
mov    $0x0,%al
call   10a0 <initialize_robot@plt>
mov    $0x0,%al
call   1060 <setSensors@plt>
mov    $0x0,%al
call   1080 <adjustParallel@plt>
mov    $0x0,%al
call   1040 <lookForFront@plt>
mov    $0x0,%al
call   1030 <lookForEnd@plt>
mov    $0x0,%al
call   1050 <straight@plt>
mov    $0x0,%al
call   10b0 <adjustSide@plt>
mov    $0x0,%al
call   1070 <checkWallAhead@plt>
jmp    11b4 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <connect_to_robot@plt>
xor    %eax,%eax
call   10a0 <initialize_robot@plt>
xor    %eax,%eax
call   1060 <setSensors@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <adjustParallel@plt>
xor    %eax,%eax
call   1040 <lookForFront@plt>
xor    %eax,%eax
call   1030 <lookForEnd@plt>
xor    %eax,%eax
call   1050 <straight@plt>
xor    %eax,%eax
call   10b0 <adjustSide@plt>
xor    %eax,%eax
call   1070 <checkWallAhead@plt>
jmp    11b0 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @connect_to_robot()
%3 = call i32 (...) @initialize_robot()
%4 = call i32 (...) @setSensors()
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @adjustParallel()
%7 = call i32 (...) @lookForFront()
%8 = call i32 (...) @lookForEnd()
%9 = call i32 (...) @straight()
%10 = call i32 (...) @adjustSide()
%11 = call i32 (...) @checkWallAhead()
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @connect_to_robot()
%2 = tail call i32 (...) @initialize_robot()
%3 = tail call i32 (...) @setSensors()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @adjustParallel()
%6 = tail call i32 (...) @lookForFront()
%7 = tail call i32 (...) @lookForEnd()
%8 = tail call i32 (...) @straight()
%9 = tail call i32 (...) @adjustSide()
%10 = tail call i32 (...) @checkWallAhead()
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ back_stop();
void front_stop(void) { back_stop(); }


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

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

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

LLVM IR (-O2):
define void @front_stop() {
%1 = tail call i32 (...) @back_stop()
ret void
}
unsigned int Multiply(unsigned int a, unsigned int b) {
  unsigned int i;
  unsigned int result = 0;
  for (i = 0; i < b; i++) {
    result += a;
  }
  return result;
}


x86 assembly (clang, -O0):
<Multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    113b <Multiply+0x3b>
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <Multiply+0x18>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Multiply>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @Multiply(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int printKernelVersion() {
  printf("\n\n-- Kernel version:\n");
  system("uname -a");
  return 0;
}


x86 assembly (clang, -O0):
<printKernelVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"\0A\0A-- Kernel version:\0A\00"
@.str.1 = [9 x i8] c"uname -a\00"
define i32 @printKernelVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"uname -a\00"
@str = [21 x i8] c"\0A\0A-- Kernel version:\00"
define i32 @printKernelVersion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void strcmp(void) {}


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

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

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

LLVM IR (-O2):
define void @strcmp() {
ret void
}
/* Variables and functions */
bool nrf52_errata_111(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_111() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_111() {
ret i32 0
}
void seq_puts(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<seq_puts>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_puts>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.seq_puts = [9 x i8] c"seq_puts\00"
define void @seq_puts() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.seq_puts, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.seq_puts = [9 x i8] c"seq_puts\00"
define void @seq_puts() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.seq_puts, i64 0, i64 0))
ret void
}
char Chop(string)
register char *string;
{
  register char c;
  register char *ptr;
  c = '\0';
  for (ptr = string; *ptr; ptr++)
    ;
  if (ptr != string) {
    c = *(--ptr);
    *ptr = '\0';
  }
  return (c);
}


x86 assembly (clang, -O0):
<Chop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1137 <Chop+0x37>
jmp    1126 <Chop+0x26>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <Chop+0x14>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1161 <Chop+0x61>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
mov    -0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Chop>:
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1110 <Chop+0x10>
test   %rcx,%rcx
je     112a <Chop+0x2a>
mov    -0x1(%rdi,%rcx,1),%al
movb   $0x0,-0x1(%rdi,%rcx,1)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @Chop(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = icmp eq i8* %3, %0
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = getelementptr inbounds i8, i8* %3, i64 -1
%11 = load i8, i8* %10
store i8 0, i8* %10
br label %12
12: ; preds = %9, %7
%13 = phi i8 [ %11, %9 ], [ 0, %7 ]
ret i8 %13
}
/* Variables and functions */
char *aux(long long, int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(long long);
char *decompose(long long n) { return aux(n * n, (sqrt(n * n - 1))); }


x86 assembly (clang, -O0):
<decompose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <sqrt@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decompose>:
push   %rbx
mov    %rdi,%rbx
imul   %rdi,%rbx
lea    -0x1(%rbx),%rdi
call   1030 <sqrt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <aux@plt>

LLVM IR (-O0):
define i8* @decompose(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = mul nsw i64 %3, %4
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = mul nsw i64 %6, %7
%9 = sub nsw i64 %8, 1
%10 = call i32 @sqrt(i64 %9)
%11 = call i8* @aux(i64 %5, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @decompose(i64 %0) {
%2 = mul nsw i64 %0, %0
%3 = add nsw i64 %2, -1
%4 = tail call i32 @sqrt(i64 %3)
%5 = tail call i8* @aux(i64 %2, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bomb() {
  fprintf(stderr, "Usage: roff [+00] [-00] [-s] [-h] file ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: roff [+00] [-00] [-s] [-h] file ...\0A\00"
define void @bomb() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: roff [+00] [-00] [-s] [-h] file ...\0A\00"
define void @bomb() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void dohelp(const int exitCode) {
  fprintf(stdout, "dohelp\n");
  exit(exitCode);
}


x86 assembly (clang, -O0):
<dohelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dohelp>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"dohelp\0A\00"
define void @dohelp(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char const *);
void do_output_word(FILE *out, const char *word, int type) {
  fprintf(out, "0x%x\t%s\n", type, word);
}


x86 assembly (clang, -O0):
<do_output_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_output_word>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"0x%x\09%s\0A\00"
define void @do_output_word(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = load i8*, i8** %5
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"0x%x\09%s\0A\00"
define void @do_output_word(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1)
ret void
}
void gzwrite(void) {}


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

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

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

LLVM IR (-O2):
define void @gzwrite() {
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t minipack_unpack_neg_fixnum(void *ptr, size_t *sz) {
  *sz = 1;
  int8_t value = *((int8_t *)ptr) & 0x1F;
  return (32 - value) * -1;
}


x86 assembly (clang, -O0):
<minipack_unpack_neg_fixnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    $0x20,%eax
sub    -0x14(%rbp),%eax
imul   $0xffffffff,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_neg_fixnum>:
movq   $0x1,(%rsi)
mov    (%rdi),%eax
or     $0xffffffe0,%eax
ret

LLVM IR (-O0):
define i32 @minipack_unpack_neg_fixnum(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i32
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
store i64 1, i64* %6
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = and i32 %9, 31
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sub nsw i32 32, %11
%13 = mul nsw i32 %12, -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @minipack_unpack_neg_fixnum(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 1, i64* %1
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = or i32 %4, -32
ret i32 %5
}
/* Variables and functions */
long factor(int);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  long result;
  scanf("%d", &n);
  result = factor(n);
  printf("Sum = %ld\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <factor@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <factor@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @factor(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void wait_child(__attribute__((unused)) int signal) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<wait_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <wait_child+0x31>
jmp    111b <wait_child+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_child>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <wait_child+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @wait_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @wait_child(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
int unregister_vbat_check_cb(const char *name) {}


x86 assembly (clang, -O0):
<unregister_vbat_check_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unregister_vbat_check_cb(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_destroy_val_fn(void *v) { free(v); }


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

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

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

LLVM IR (-O2):
define void @default_destroy_val_fn(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteData(int);
void createDisruption_Three() {
  LCD_WriteData(0x0);
  LCD_WriteData(0xe);
  LCD_WriteData(0xe);
  LCD_WriteData(0x0);
  LCD_WriteData(0x0);
  LCD_WriteData(0xe);
  LCD_WriteData(0xe);
  LCD_WriteData(0x0);
}


x86 assembly (clang, -O0):
<createDisruption_Three>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createDisruption_Three>:
push   %rax
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <LCD_WriteData@plt>

LLVM IR (-O0):
define void @createDisruption_Three() {
%1 = call i32 @LCD_WriteData(i32 0)
%2 = call i32 @LCD_WriteData(i32 14)
%3 = call i32 @LCD_WriteData(i32 14)
%4 = call i32 @LCD_WriteData(i32 0)
%5 = call i32 @LCD_WriteData(i32 0)
%6 = call i32 @LCD_WriteData(i32 14)
%7 = call i32 @LCD_WriteData(i32 14)
%8 = call i32 @LCD_WriteData(i32 0)
ret void
}

LLVM IR (-O2):
define void @createDisruption_Three() {
%1 = tail call i32 @LCD_WriteData(i32 0)
%2 = tail call i32 @LCD_WriteData(i32 14)
%3 = tail call i32 @LCD_WriteData(i32 14)
%4 = tail call i32 @LCD_WriteData(i32 0)
%5 = tail call i32 @LCD_WriteData(i32 0)
%6 = tail call i32 @LCD_WriteData(i32 14)
%7 = tail call i32 @LCD_WriteData(i32 14)
%8 = tail call i32 @LCD_WriteData(i32 0)
ret void
}
void egueb_dom_value_interpolate_float(float a, float b, double m, float *r) {
  *r = ((1 - m) * a) + (m * b);
}


x86 assembly (clang, -O0):
<egueb_dom_value_interpolate_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movsd  %xmm2,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  0xee1(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<egueb_dom_value_interpolate_float>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm2,%xmm3
cvtss2sd %xmm0,%xmm0
mulsd  %xmm3,%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @egueb_dom_value_interpolate_float(float %0, float %1, double %2, float* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca double
%8 = alloca float*
store float %0, float* %5
store float %1, float* %6
store double %2, double* %7
store float* %3, float** %8
%9 = load double, double* %7
%10 = fsub double 1.000000e+00, %9
%11 = load float, float* %5
%12 = fpext float %11 to double
%13 = load double, double* %7
%14 = load float, float* %6
%15 = fpext float %14 to double
%16 = fmul double %13, %15
%17 = call double @llvm.fmuladd.f64(double %10, double %12, double %16)
%18 = fptrunc double %17 to float
%19 = load float*, float** %8
store float %18, float* %19
ret void
}

LLVM IR (-O2):
define void @egueb_dom_value_interpolate_float(float %0, float %1, double %2, float* nocapture writeonly %3) {
%5 = fsub double 1.000000e+00, %2
%6 = fpext float %0 to double
%7 = fpext float %1 to double
%8 = fmul double %7, %2
%9 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %8)
%10 = fptrunc double %9 to float
store float %10, float* %3
ret void
}
void del(void *d) { return; }


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

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

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

LLVM IR (-O2):
define void @del(i8* nocapture %0) {
ret void
}
int calculate1(int n) {
  int sum, sum3, sum5, sum15 = 0;
  for (int i = 0; i <= n; i = i + 3) {
    sum3 += i;
  }
  for (int j = 0; j <= n; j = j + 5) {
    sum5 += j;
  }
  for (int i = 0; i <= n; i += 15) {
    sum15 += i;
  }
  sum = sum3 + sum5 - sum15;
  return sum;
}


x86 assembly (clang, -O0):
<calculate1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <calculate1+0x38>
mov    -0x18(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <calculate1+0x15>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1162 <calculate1+0x62>
mov    -0x1c(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <calculate1+0x3f>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     118c <calculate1+0x8c>
mov    -0x20(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
add    $0xf,%eax
mov    %eax,-0x20(%rbp)
jmp    1169 <calculate1+0x69>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @calculate1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %6
store i32 0, i32* %7
br label %10
10: ; preds = %18, %1
%11 = load i32, i32* %7
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %21
14: ; preds = %10
%15 = load i32, i32* %7
%16 = load i32, i32* %4
%17 = add nsw i32 %16, %15
store i32 %17, i32* %4
br label %18
18: ; preds = %14
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 3
store i32 %20, i32* %7
br label %10
21: ; preds = %10
store i32 0, i32* %8
br label %22
22: ; preds = %30, %21
%23 = load i32, i32* %8
%24 = load i32, i32* %2
%25 = icmp sle i32 %23, %24
br i1 %25, label %26, label %33
26: ; preds = %22
%27 = load i32, i32* %8
%28 = load i32, i32* %5
%29 = add nsw i32 %28, %27
store i32 %29, i32* %5
br label %30
30: ; preds = %26
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 5
store i32 %32, i32* %8
br label %22
33: ; preds = %22
store i32 0, i32* %9
br label %34
34: ; preds = %42, %33
%35 = load i32, i32* %9
%36 = load i32, i32* %2
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %45
38: ; preds = %34
%39 = load i32, i32* %9
%40 = load i32, i32* %6
%41 = add nsw i32 %40, %39
store i32 %41, i32* %6
br label %42
42: ; preds = %38
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 15
store i32 %44, i32* %9
br label %34
45: ; preds = %34
%46 = load i32, i32* %4
%47 = load i32, i32* %5
%48 = add nsw i32 %46, %47
%49 = load i32, i32* %6
%50 = sub nsw i32 %48, %49
store i32 %50, i32* %3
%51 = load i32, i32* %3
ret i32 %51
}

LLVM IR (-O2):
define i32 @calculate1(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int hal_gpio_read(int);
int /*<<< orphan*/ hal_gpio_write(int, int);
int hal_gpio_toggle(int pin) {
  int pin_state = (hal_gpio_read(pin) != 1);
  hal_gpio_write(pin, pin_state);
  return pin_state;
}


x86 assembly (clang, -O0):
<hal_gpio_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hal_gpio_read@plt>
cmp    $0x1,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <hal_gpio_write@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hal_gpio_toggle>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <hal_gpio_read@plt>
xor    %ebp,%ebp
cmp    $0x1,%eax
setne  %bpl
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <hal_gpio_write@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hal_gpio_toggle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @hal_gpio_read(i32 %4)
%6 = icmp ne i32 %5, 1
%7 = zext i1 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @hal_gpio_write(i32 %8, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @hal_gpio_toggle(i32 %0) {
%2 = tail call i32 @hal_gpio_read(i32 %0)
%3 = icmp ne i32 %2, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @hal_gpio_write(i32 %0, i32 %4)
ret i32 %4
}
void _Jv_NewPrimArray() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_NewPrimArray() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  int i;
  int k;
  for (i = 0; i < 3; i++) {
    k = 3;
    continue;
    k = 4;
  }
  assert(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1145 <main+0x35>
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
int errno;
int syscall(int, char const *, struct label_struct *);
int set_file_label(const char *path, struct label_struct *ulabel) {
  int rv = syscall(333, path, ulabel);
  return rv ? -errno : 0;
}


x86 assembly (clang, -O0):
<set_file_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x14d,%edi
call   1030 <syscall@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1152 <set_file_label+0x42>
xor    %eax,%eax
mov    0x2e98(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x18(%rbp)
jmp    115c <set_file_label+0x4c>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    115c <set_file_label+0x4c>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_file_label>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x14d,%edi
call   1030 <syscall@plt>
mov    0x2eb8(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.label_struct = type { i32 }
@errno = global i32 0
define i32 @set_file_label(i8* %0, %struct.label_struct* %1) {
%3 = alloca i8*
%4 = alloca %struct.label_struct*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.label_struct* %1, %struct.label_struct** %4
%6 = load i8*, i8** %3
%7 = load %struct.label_struct*, %struct.label_struct** %4
%8 = call i32 @syscall(i32 333, i8* %6, %struct.label_struct* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = sub nsw i32 0, %12
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %11
%16 = phi i32 [ %13, %11 ], [ 0, %14 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.label_struct = type { i32 }
@errno = global i32 0
define i32 @set_file_label(i8* %0, %struct.label_struct* %1) {
%3 = tail call i32 @syscall(i32 333, i8* %0, %struct.label_struct* %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = select i1 %4, i32 0, i32 %6
ret i32 %7
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("watość zwrócona przez foo: %i\n", foo());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"wato\C5\9B\C4\87 zwr\C3\B3cona przez foo: %i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"wato\C5\9B\C4\87 zwr\C3\B3cona przez foo: %i\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int foo(char *);
main() {
  char *c = "-1";
  return foo(c);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"-1\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void convert_to_log(void *data) {}


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

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

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

LLVM IR (-O2):
define void @convert_to_log(i8* nocapture %0) {
ret void
}
int f(const int *restrict x, int *y) {
  (*y)++;
  int z = *x;
  (*y)--;
  return z;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f(i32* noalias %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = add nsw i32 %12, -1
store i32 %13, i32* %11
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i32* noalias nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ _U_Qfcmp(long double, long double, int);
int _U_Qfgt(long double a, long double b) { return (_U_Qfcmp(a, b, 17) != 0); }


x86 assembly (clang, -O0):
<_U_Qfgt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x11,%edi
call   1030 <_U_Qfcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_U_Qfgt>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
mov    $0x11,%edi
call   1030 <_U_Qfcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @_U_Qfgt(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @_U_Qfcmp(x86_fp80 %5, x86_fp80 %6, i32 17)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_U_Qfgt(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @_U_Qfcmp(x86_fp80 %0, x86_fp80 %1, i32 17)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned ROLc(unsigned word, const int i) {
  asm("roll %%cl,%0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


x86 assembly (clang, -O0):
<ROLc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
rol    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROLc>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ROLc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 asm "roll %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ROLc(i32 %0, i32 %1) {
%3 = tail call i32 asm "roll %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}