xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void swap(int array[], int i, int j) {
  printf("swap %d %d\n", i, j);
  int tmp = array[i];
  array[i] = array[j];
  array[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movslq %ebp,%rax
mov    (%rbx,%rax,4),%ecx
movslq %r14d,%rdx
mov    (%rbx,%rdx,4),%esi
mov    %esi,(%rbx,%rax,4)
mov    %ecx,(%rbx,%rdx,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"swap %d %d\0A\00"
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = load i32*, i32** %4
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
store i32 %20, i32* %24
%25 = load i32, i32* %7
%26 = load i32*, i32** %4
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
store i32 %25, i32* %29
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"swap %d %d\0A\00"
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %6
store i32 %7, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, world! :)\n");
  printf(
      "If you're reading this, then you're running a C program on ExDOS! :)\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hello, world! :)\0A\00"
@.str.1 = [70 x i8] c"If you're reading this, then you're running a C program on ExDOS! :)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Hello, world! :)\00"
@str.2 = [69 x i8] c"If you're reading this, then you're running a C program on ExDOS! :)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
scalar_t__ tcgetattr(int, struct termios *);
int isatty(int fd) {
  struct termios dummy;
  return (tcgetattr(fd, &dummy) == 0);
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <tcgetattr@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
push   %rax
mov    %rsp,%rsi
call   1030 <tcgetattr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.termios
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @tcgetattr(i32 %4, %struct.termios* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = call i64 @tcgetattr(i32 %0, %struct.termios* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sync_primitive();
void mmio_writel(uint32_t val, void *addr) {
  *(volatile uint32_t *)addr = val;
  sync_primitive();
}


x86 assembly (clang, -O0):
<mmio_writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <sync_primitive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmio_writel>:
mov    %edi,(%rsi)
xor    %eax,%eax
jmp    1030 <sync_primitive@plt>

LLVM IR (-O0):
define void @mmio_writel(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
%8 = call i32 (...) @sync_primitive()
ret void
}

LLVM IR (-O2):
define void @mmio_writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
%4 = tail call i32 (...) @sync_primitive()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dist2(double, double, double, double, double, double);
double sqrt(int /*<<< orphan*/);
double dist(double x1, double y1, double z1, double x2, double y2, double z2) {
  return sqrt(dist2(x1, y1, z1, x2, y2, z2));
}


x86 assembly (clang, -O0):
<dist>:
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  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
call   1030 <dist2@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
push   %rax
call   1030 <dist2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @dist(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = call i32 @dist2(double %13, double %14, double %15, double %16, double %17, double %18)
%20 = call double @sqrt(i32 %19)
ret double %20
}

LLVM IR (-O2):
define double @dist(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @dist2(double %0, double %1, double %2, double %3, double %4, double %5)
%8 = tail call double @sqrt(i32 %7)
ret double %8
}
int foo1(value)
long long value;
{
  register const long long constant = 0xc000000080000000LL;
  if (value < constant)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0xc000000080000000,%rax
mov    %rax,-0x18(%rbp)
movabs $0xc000000080000000,%rax
cmp    %rax,-0x10(%rbp)
jge    1136 <foo1+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <foo1+0x3d>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
movabs $0xc000000080000000,%rax
xor    %ecx,%ecx
cmp    %rax,%rdi
setl   %cl
mov    $0x2,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo1(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 -4611686016279904256, i64* %4
%5 = load i64, i64* %3
%6 = icmp slt i64 %5, -4611686016279904256
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 2, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo1(i64 %0) {
%2 = icmp slt i64 %0, -4611686016279904256
%3 = select i1 %2, i32 1, i32 2
ret i32 %3
}
RX0I1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x21,(%rax,%rcx,4)
ja     1136 <RX0I1+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <RX0I1+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpl   $0x22,(%r8,%rcx,4)
setb   %al
ret

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

LLVM IR (-O2):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = icmp ult i32 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
struct timespec {
  double tv_sec;
  double tv_nsec;
};

/* Variables and functions */
double timespec_to_ms(struct timespec *ts) {
  return ts->tv_sec * 1000.0 + ts->tv_nsec / 1000000.0;
}


x86 assembly (clang, -O0):
<timespec_to_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  0xee7(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xed3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_ms>:
movsd  0x8(%rdi),%xmm1
divsd  0xef3(%rip),%xmm1
movsd  (%rdi),%xmm0
mulsd  0xeef(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, double }
define double @timespec_to_ms(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load double, double* %4
%6 = load %struct.timespec*, %struct.timespec** %2
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.timespec = type { double, double }
define double @timespec_to_ms(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load double, double* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%5 = load double, double* %4
%6 = fdiv double %5, 1.000000e+06
%7 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e+03, double %6)
ret double %7
}
float minFloat(float a, float b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<minFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <minFloat+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <minFloat+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minFloat>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @minFloat(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @minFloat(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ do_add_padding(char *);
int main(int argc, char *argv[]) {
  do_add_padding("u-boot.bin");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"u-boot.bin\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @do_add_padding(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"u-boot.bin\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @do_add_padding(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char *setlocale(int category, char const *locale) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @setlocale(i32 %0, i8* nocapture readnone %1) {
ret i8* null
}
int get_seq_num(int n) { return (n + 1000) % 1000; }


x86 assembly (clang, -O0):
<get_seq_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3e8,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_seq_num>:
add    $0x3e8,%edi
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_seq_num(i32 %0) {
%2 = add nsw i32 %0, 1000
%3 = srem i32 %2, 1000
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar2(unsigned char);
void printByte(unsigned char c) {
  putchar2((c / 10) + '0');
  putchar2((c % 10) + '0');
}


x86 assembly (clang, -O0):
<printByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movzbl %al,%edi
call   1030 <putchar2@plt>
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movzbl %al,%edi
call   1030 <putchar2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printByte>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
imul   $0xcd,%edi,%ebx
shr    $0xb,%ebx
lea    0x30(%rbx),%eax
movzbl %al,%edi
call   1030 <putchar2@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %al,%bpl
or     $0x30,%bpl
movzbl %bpl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar2@plt>

LLVM IR (-O0):
define void @printByte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 10
%6 = add nsw i32 %5, 48
%7 = trunc i32 %6 to i8
%8 = call i32 @putchar2(i8 zeroext %7)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = srem i32 %10, 10
%12 = add nsw i32 %11, 48
%13 = trunc i32 %12 to i8
%14 = call i32 @putchar2(i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @printByte(i8 zeroext %0) {
%2 = udiv i8 %0, 10
%3 = add nuw nsw i8 %2, 48
%4 = tail call i32 @putchar2(i8 zeroext %3)
%5 = urem i8 %0, 10
%6 = or i8 %5, 48
%7 = tail call i32 @putchar2(i8 zeroext %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
FILE *get_fp(char *filename, char *mode) {
  FILE *fp = fopen(filename, mode);
  if (fp == NULL) {
    printf("Cannot open file %s\n", filename);
    exit(EXIT_FAILURE);
  }
  return (fp);
}


x86 assembly (clang, -O0):
<get_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117a <get_fp+0x4a>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fp>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <get_fp+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Cannot open file %s\0A\00"
@EXIT_FAILURE = global i32 0
define i32* @get_fp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@.str = [21 x i8] c"Cannot open file %s\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i32* @get_fp(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_adc_enable() {
  pmu_reg_write(0x3B, ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |
                       (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) |
                       (1 << 10) | (1 << 11) | (0 << 12) | (0 << 13) |
                       (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) |
                       (1 << 18) | (1 << 19) | (1 << 20)));
}


x86 assembly (clang, -O0):
<pmu_adc_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
mov    $0x1fcfff,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_enable>:
mov    $0x3b,%edi
mov    $0x1fcfff,%esi
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_adc_enable() {
%1 = call i32 @pmu_reg_write(i32 59, i32 2084863)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_enable() {
%1 = tail call i32 @pmu_reg_write(i32 59, i32 2084863)
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_sockname(struct tcb *, int);
int sys_accept(struct tcb *tcp) {
  do_sockname(tcp, -1);
  return 010;
}


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

x86 assembly (clang, -O2):
<sys_accept>:
push   %rax
mov    $0xffffffff,%esi
call   1030 <do_sockname@plt>
mov    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_accept(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @do_sockname(%struct.tcb* %3, i32 -1)
ret i32 8
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_accept(%struct.tcb* %0) {
%2 = tail call i32 @do_sockname(%struct.tcb* %0, i32 -1)
ret i32 8
}
/* Variables and functions */
int f62(int *);
int f63(int *p) { return f62(p); }


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

x86 assembly (clang, -O2):
<f63>:
jmp    1030 <f62@plt>

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

LLVM IR (-O2):
define i32 @f63(i32* %0) {
%2 = tail call i32 @f62(i32* %0)
ret i32 %2
}
double B0(double t) {
  double tmp = 1.0 - t;
  return tmp * tmp * tmp;
}


x86 assembly (clang, -O0):
<B0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<B0>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @B0(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %3
%10 = fmul double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @B0(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, %2
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
unsigned char load_BLAS(int /*<<< orphan*/);
unsigned char unload_BLAS(void) { return (load_BLAS(0)); }


x86 assembly (clang, -O0):
<unload_BLAS>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <load_BLAS@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unload_BLAS>:
xor    %edi,%edi
jmp    1030 <load_BLAS@plt>

LLVM IR (-O0):
define zeroext i8 @unload_BLAS() {
%1 = call zeroext i8 @load_BLAS(i32 0)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @unload_BLAS() {
%1 = tail call zeroext i8 @load_BLAS(i32 0)
ret i8 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ start;

/* Variables and functions */
int /*<<< orphan*/ print_activities(int *, int *, int);
int main() {
  int start[] = {1, 3, 1, 5, 8, 6};
  int finish[] = {2, 6, 6, 7, 10, 8};
  int n = sizeof(start) / sizeof(start[0]);
  print_activities(start, finish, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x6,-0x44(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   1030 <print_activities@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xefd(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x6,%edx
call   1030 <print_activities@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.start = [6 x i32] [i32 1, i32 3, i32 1, i32 5, i32 8, i32 6]
@__const.main.finish = [6 x i32] [i32 2, i32 6, i32 6, i32 7, i32 10, i32 8]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [6 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
%6 = bitcast [6 x i32]* %3 to i8*
store i32 6, i32* %4
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @print_activities(i32* %7, i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.start = [6 x i32] [i32 1, i32 3, i32 1, i32 5, i32 8, i32 6]
@__const.main.finish = [6 x i32] [i32 2, i32 6, i32 6, i32 7, i32 10, i32 8]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32 @print_activities(i32* %5, i32* %6, i32 6)
ret i32 0
}
int cmp(const long *a, const long *b) { return *a - *b; }


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

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

LLVM IR (-O0):
define i32 @cmp(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = sub nsw i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @cmp(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = sub nsw i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void json_copy(void *dst, void *src, size_t size) {
  if (dst == NULL || src == NULL) {
    return;
  }
  memcpy(dst, src, size);
}


x86 assembly (clang, -O0):
<json_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <json_copy+0x2a>
cmpq   $0x0,-0x10(%rbp)
jne    113f <json_copy+0x2f>
jmp    1150 <json_copy+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_copy>:
test   %rdi,%rdi
je     111f <json_copy+0xf>
test   %rsi,%rsi
je     111f <json_copy+0xf>
jmp    1030 <memcpy@plt>
ret

LLVM IR (-O0):
define void @json_copy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %9, %3
br label %18
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @json_copy(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i8* %1, null
%6 = or i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
br label %9
9: ; preds = %3, %7
ret void
}
void main(void) {
  unsigned long i;
  unsigned char *P7 = (unsigned char *)0x03ed;
  unsigned char *PD7 = (unsigned char *)0x03ef;
  *P7 = 0xff;
  *PD7 = 0xff;
  while (1) {
    *P7 = 0xdf;
    i = 0x9ffff;
    while (1) {
      i--;
      if (i == 0)
        break;
    }
    *P7 = 0xef;
    i = 0x9ffff;
    while (1) {
      i--;
      if (i == 0)
        break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ed,%eax
mov    %rax,-0x10(%rbp)
mov    $0x3ef,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x18(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x10(%rbp),%rax
movb   $0xdf,(%rax)
movq   $0x9ffff,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114f <main+0x4f>
jmp    1154 <main+0x54>
jmp    1133 <main+0x33>
mov    -0x10(%rbp),%rax
movb   $0xef,(%rax)
movq   $0x9ffff,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117f <main+0x7f>
jmp    1184 <main+0x84>
jmp    1163 <main+0x63>
jmp    1124 <main+0x24>

x86 assembly (clang, -O2):
<main>:
movb   $0xff,0x3ed
ff
movb   $0xff,0x3ef
ff
jmp    1110 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = alloca i64
%2 = alloca i8*
%3 = alloca i8*
store i8* inttoptr (i64 1005 to i8*), i8** %2
store i8* inttoptr (i64 1007 to i8*), i8** %3
%4 = load i8*, i8** %2
store i8 -1, i8* %4
%5 = load i8*, i8** %3
store i8 -1, i8* %5
br label %6
6: ; preds = %0, %24
%7 = load i8*, i8** %2
store i8 -33, i8* %7
store i64 655359, i64* %1
br label %8
8: ; preds = %6, %14
%9 = load i64, i64* %1
%10 = add i64 %9, -1
store i64 %10, i64* %1
%11 = load i64, i64* %1
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
br label %15
14: ; preds = %8
br label %8
15: ; preds = %13
%16 = load i8*, i8** %2
store i8 -17, i8* %16
store i64 655359, i64* %1
br label %17
17: ; preds = %15, %23
%18 = load i64, i64* %1
%19 = add i64 %18, -1
store i64 %19, i64* %1
%20 = load i64, i64* %1
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
br label %24
23: ; preds = %17
br label %17
24: ; preds = %22
br label %6
}

LLVM IR (-O2):
define void @main() {
store i8 -1, i8* inttoptr (i64 1005 to i8*)
store i8 -1, i8* inttoptr (i64 1007 to i8*)
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_notequal_d(int *, double, double);
int xil_fpo_notequal_d(double a, double b) {
  int res_int;
  xip_fpo_notequal_d(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_notequal_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x14(%rbp),%rdi
call   1030 <xip_fpo_notequal_d@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_notequal_d>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_notequal_d@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xil_fpo_notequal_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call i32 @xip_fpo_notequal_d(i32* %5, double %6, double %7)
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @xil_fpo_notequal_d(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_notequal_d(i32* %3, double %0, double %1)
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA512_CTX;

/* Variables and functions */
int /*<<< orphan*/ sha512_block_data_order(int /*<<< orphan*/ *,
                                           unsigned char const *, int);
void SHA512_Transform(SHA512_CTX *c, const unsigned char *data) {
  sha512_block_data_order(c, data, 1);
}


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

x86 assembly (clang, -O2):
<SHA512_Transform>:
mov    $0x1,%edx
jmp    1030 <sha512_block_data_order@plt>

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

LLVM IR (-O2):
define void @SHA512_Transform(i32* %0, i8* %1) {
%3 = tail call i32 @sha512_block_data_order(i32* %0, i8* %1, i32 1)
ret void
}
void foo(char *p1, char **p2) {}


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

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

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

LLVM IR (-O2):
define void @foo(i8* nocapture %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t cblByteOrderSwap64LittleToHost(uint64_t swap) { return swap; }


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

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

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

LLVM IR (-O2):
define i32 @cblByteOrderSwap64LittleToHost(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int _digest_cmp(unsigned char *, unsigned char *, int);
extern int sha512cmp(unsigned char *digest1, unsigned char *digest2) {
  return (_digest_cmp(digest1, digest2, 64));
}


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

x86 assembly (clang, -O2):
<sha512cmp>:
mov    $0x40,%edx
jmp    1030 <_digest_cmp@plt>

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

LLVM IR (-O2):
define i32 @sha512cmp(i8* %0, i8* %1) {
%3 = tail call i32 @_digest_cmp(i8* %0, i8* %1, i32 64)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
uint64_t load64(const void *src) { return *(const uint64_t *)src; }


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

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

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

LLVM IR (-O2):
define i32 @load64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int f438(int *);
int f439(int *p) { return f438(p); }


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

x86 assembly (clang, -O2):
<f439>:
jmp    1030 <f438@plt>

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

LLVM IR (-O2):
define i32 @f439(i32* %0) {
%2 = tail call i32 @f438(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int asc(uint32_t a, uint32_t b) { return a < b; }


x86 assembly (clang, -O0):
<asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asc>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @asc(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int acl_size() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @acl_size() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help(void) {
  puts("\x1b[35m"
       "CPU: "
       "\x1b[32m"
       "Guess the secret code!!!"
       "\x1b[0m");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"\1B[35mCPU: \1B[32mGuess the secret code!!!\1B[0m\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"\1B[35mCPU: \1B[32mGuess the secret code!!!\1B[0m\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_SUBD(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xfa);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_SUBD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xfa,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_SUBD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xfa,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_SUBD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 250)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_SUBD(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 250)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Variables and functions */
double gammaln(double);
double factln(double x) { return gammaln(x + 1); }


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

x86 assembly (clang, -O2):
<factln>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <gammaln@plt>

LLVM IR (-O0):
define double @factln(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = call double @gammaln(double %4)
ret double %5
}

LLVM IR (-O2):
define double @factln(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = tail call double @gammaln(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fc8300_isr(void *);
void bbm_com_isr(void *handle) { fc8300_isr(handle); }


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

x86 assembly (clang, -O2):
<bbm_com_isr>:
jmp    1030 <fc8300_isr@plt>

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

LLVM IR (-O2):
define void @bbm_com_isr(i8* %0) {
%2 = tail call i32 @fc8300_isr(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ vector_rotate32();
int main() {
  vector_rotate32();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vector_rotate32()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int field_value(const struct sample *sample, unsigned field) {
  int *is = (int *)sample;
  return is[field];
}


x86 assembly (clang, -O0):
<field_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<field_value>:
mov    %esi,%eax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
%struct.sample = type opaque
define i32 @field_value(%struct.sample* %0, i32 %1) {
%3 = alloca %struct.sample*
%4 = alloca i32
%5 = alloca i32*
store %struct.sample* %0, %struct.sample** %3
store i32 %1, i32* %4
%6 = load %struct.sample*, %struct.sample** %3
%7 = bitcast %struct.sample* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
%struct.sample = type opaque
define i32 @field_value(%struct.sample* nocapture %0, i32 %1) {
%3 = bitcast %struct.sample* %0 to i32*
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int do_validate_cmd(int);
int validate_cmd(int cmd) {
  int ret = do_validate_cmd(cmd);
  return ret;
}


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

x86 assembly (clang, -O2):
<validate_cmd>:
jmp    1030 <do_validate_cmd@plt>

LLVM IR (-O0):
define i32 @validate_cmd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @do_validate_cmd(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @validate_cmd(i32 %0) {
%2 = tail call i32 @do_validate_cmd(i32 %0)
ret i32 %2
}
int slib_events(int wait_flag) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @slib_events(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPSSatellitesHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GPSSatellitesUpdated() { UAVObjUpdated(GPSSatellitesHandle()); }


x86 assembly (clang, -O0):
<GPSSatellitesUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GPSSatellitesHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSSatellitesUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <GPSSatellitesHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @GPSSatellitesUpdated() {
%1 = call i32 (...) @GPSSatellitesHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSSatellitesUpdated() {
%1 = tail call i32 (...) @GPSSatellitesHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int cap_style;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_cap_style(void *_p, int _v) {
  ((XGCValues *)_p)->cap_style = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGCValues_cap_style>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XGCValues_cap_style>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGCValues_cap_style(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGCValues_cap_style(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int xen_find_device_domain_owner(struct pci_dev *dev) { return -1; }


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @xen_find_device_domain_owner(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @xen_find_device_domain_owner(%struct.pci_dev* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ quote(char);
void op_quote() { quote('"'); }


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

x86 assembly (clang, -O2):
<op_quote>:
mov    $0x22,%edi
jmp    1030 <quote@plt>

LLVM IR (-O0):
define void @op_quote() {
%1 = call i32 @quote(i8 signext 34)
ret void
}

LLVM IR (-O2):
define void @op_quote() {
%1 = tail call i32 @quote(i8 signext 34)
ret void
}