xunge/DecIR huggingface dataset:
int reverse(int byte) {
  int a, ret;
  ret = 0;
  for (a = 0; a < 8; a++) {
    ret <<= 1;
    ret |= byte & 1;
    byte >>= 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    114b <reverse+0x4b>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <reverse+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
void stack_overflow() {
  int foo[1000];
  (void)foo;
  stack_overflow();
}


x86 assembly (clang, -O0):
<stack_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfa0,%rsp
call   1030 <stack_overflow@plt>
add    $0xfa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_overflow>:
jmp    1100 <stack_overflow>

LLVM IR (-O0):
define void @stack_overflow() {
%1 = alloca [1000 x i32]
%2 = getelementptr inbounds [1000 x i32], [1000 x i32]* %1, i64 0, i64 0
ret void
}

LLVM IR (-O2):
define void @stack_overflow() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
double M_PI;
double cos(double);
double du_dx(double L, double a_ux, double u_x, double x) {
  return M_PI * a_ux * u_x * cos(M_PI * a_ux * x / L) / L;
}


x86 assembly (clang, -O0):
<du_dx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e9b(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<du_dx>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mulsd  (%rax),%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <cos@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @du_dx(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* @M_PI
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = load double, double* @M_PI
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = load double, double* %8
%18 = fmul double %16, %17
%19 = load double, double* %5
%20 = fdiv double %18, %19
%21 = call double @cos(double %20)
%22 = fmul double %13, %21
%23 = load double, double* %5
%24 = fdiv double %22, %23
ret double %24
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @du_dx(double %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fmul double %5, %1
%7 = fmul double %6, %2
%8 = fmul double %6, %3
%9 = fdiv double %8, %0
%10 = tail call double @cos(double %9)
%11 = fmul double %10, %7
%12 = fdiv double %11, %0
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
scalar_t__ INT_MAX;
unsigned char *malloc(unsigned int);
int main(void) {
  if (sizeof(ptrdiff_t) == sizeof(int)) {
    unsigned char *ptr0 = malloc(((unsigned)INT_MAX) + 1);
    unsigned char *ptr1 = ptr0 + (unsigned)INT_MAX + 1;
    ptr1 - ptr0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edi
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ea6(%rip),%rcx
mov    (%rcx),%rcx
mov    %ecx,%ecx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@INT_MAX = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = load i64, i64* @INT_MAX
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = load i64, i64* @INT_MAX
%10 = trunc i64 %9 to i32
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int A, B, SOMA;
  scanf("%i", &A);
  scanf("%i", &B);
  SOMA = A + B;
  printf("SOMA = %i\n", SOMA);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [11 x i8] c"SOMA = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int M_PI;
double exp(double);
double pow(double, double);
double gaussian(double offset_2, double cutoff_2) {
  return pow((2 * M_PI), (-3.0 / 2.0)) * pow(cutoff_2, (-3.0 / 2.0)) *
         exp(-0.5 * (offset_2 / cutoff_2));
}


x86 assembly (clang, -O0):
<gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xebe(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
movsd  0xe77(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussian>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xeb6(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0xe9e(%rip),%xmm1
call   1040 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
mulsd  0xe83(%rip),%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @gaussian(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @M_PI
%6 = mul nsw i32 2, %5
%7 = sitofp i32 %6 to double
%8 = call double @pow(double %7, double -1.500000e+00)
%9 = load double, double* %4
%10 = call double @pow(double %9, double -1.500000e+00)
%11 = fmul double %8, %10
%12 = load double, double* %3
%13 = load double, double* %4
%14 = fdiv double %12, %13
%15 = fmul double -5.000000e-01, %14
%16 = call double @exp(double %15)
%17 = fmul double %11, %16
ret double %17
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @gaussian(double %0, double %1) {
%3 = load i32, i32* @M_PI
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to double
%6 = tail call double @pow(double %5, double -1.500000e+00)
%7 = tail call double @pow(double %1, double -1.500000e+00)
%8 = fmul double %6, %7
%9 = fdiv double %0, %1
%10 = fmul double %9, -5.000000e-01
%11 = tail call double @exp(double %10)
%12 = fmul double %8, %11
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *h265hvcc_nalu_get_nalu(const uint8_t *p) { return (uint8_t *)p + 2; }


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

x86 assembly (clang, -O2):
<h265hvcc_nalu_get_nalu>:
lea    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @h265hvcc_nalu_get_nalu(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int);
__attribute__((__weak__, __always___)) off_t
softboundcets_lseek(int fildes, off_t offset, int whence) {
  return lseek(fildes, offset, whence);
}


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

x86 assembly (clang, -O2):
<softboundcets_lseek>:
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
size_t UserProcessCurrent();
size_t SyscallGetpid() { return UserProcessCurrent(); }


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

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

LLVM IR (-O0):
define i64 @SyscallGetpid() {
%1 = call i64 (...) @UserProcessCurrent()
ret i64 %1
}

LLVM IR (-O2):
define i64 @SyscallGetpid() {
%1 = tail call i64 (...) @UserProcessCurrent()
ret i64 %1
}
double fmin(a, b)
double a, b;
{
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmin+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <fmin+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmin>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
__if_not_exists(Type_not) { int var244; }


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

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

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

LLVM IR (-O2):
define i32 @__if_not_exists(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _ts_q(char *, unsigned char *, int);
void ts_srv(char *host, unsigned char *q) { _ts_q(host, q, 33); }


x86 assembly (clang, -O0):
<ts_srv>:
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    $0x21,%edx
call   1030 <_ts_q@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_srv>:
mov    $0x21,%edx
jmp    1030 <_ts_q@plt>

LLVM IR (-O0):
define void @ts_srv(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 @_ts_q(i8* %5, i8* %6, i32 33)
ret void
}

LLVM IR (-O2):
define void @ts_srv(i8* %0, i8* %1) {
%3 = tail call i32 @_ts_q(i8* %0, i8* %1, i32 33)
ret void
}
int qsort_cmp__SVEC_VAL2(const void *x, const void *y) {
  if (*((double *)x) > *((double *)y))
    return (-1);
  else
    return (*((double *)x) < *((double *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp__SVEC_VAL2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112e <qsort_cmp__SVEC_VAL2+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <qsort_cmp__SVEC_VAL2+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp__SVEC_VAL2>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp__SVEC_VAL2(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp ogt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp olt double %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qsort_cmp__SVEC_VAL2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int __attribute__((no)) compare(uint64_t state, uint32_t *last, uint8_t buf) {
  if (*last == ((state | buf) & 0xFFFFFFFF)) {
    foo(state, *last);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
or     -0x14(%rbp),%ecx
and    $0xffffffff,%ecx
cmp    %ecx,%eax
jne    1153 <compare+0x43>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <foo@plt>
movl   $0x0,-0x4(%rbp)
jmp    115a <compare+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %rax
mov    (%rsi),%esi
or     %edi,%edx
mov    $0x1,%eax
cmp    %edx,%esi
jne    1125 <compare+0x15>
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @compare(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %7
%12 = or i32 %10, %11
%13 = and i32 %12, -1
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = call i32 @foo(i32 %16, i32 %18)
store i32 0, i32* %4
br label %21
20: ; preds = %3
store i32 1, i32* %4
br label %21
21: ; preds = %20, %15
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @compare(i32 %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = or i32 %2, %0
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @foo(i32 %0, i32 %4)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %10
}
long long zig_addw_longlong(long long lhs, long long rhs, long long min,
                            long long max) {
  return (long long)(((unsigned long long)lhs) + ((unsigned long long)rhs));
}


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

x86 assembly (clang, -O2):
<zig_addw_longlong>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @zig_addw_longlong(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = add i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @zig_addw_longlong(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %1, %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
yyerror(char *s) { fprintf(stderr, "%s\n", s); }


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %3
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sgetri_(int *, float *, int *, int *, float *, int *, int *);
int aa_cla_sgetri(int n, float *A, int lda, int *ipiv, float *work, int lwork) {
  int info = 0;
  sgetri_(&n, A, &lda, ipiv, work, &lwork, &info);
  return info;
}


x86 assembly (clang, -O0):
<aa_cla_sgetri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x2c(%rbp),%r9
lea    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <sgetri_@plt>
mov    -0x30(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_sgetri>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r9d,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rax
mov    %rax,(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r9
call   1030 <sgetri_@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @aa_cla_sgetri(i32 %0, float* %1, i32 %2, i32* %3, float* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %7
store i32 %2, i32* %8
store i32 %5, i32* %9
%11 = bitcast i32* %10 to i8*
store i32 0, i32* %10
%12 = call i32 @sgetri_(i32* %7, float* %1, i32* %8, i32* %3, float* %4, i32* %9, i32* %10)
%13 = load i32, i32* %10
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func() { printf("This is function func.\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"This is function func.\0A\00"
define i32 @func() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [23 x i8] c"This is function func.\00"
define i32 @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void sca3000_startup(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @sca3000_startup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sim_manager_view_hide();
void phoneui_backend_sim_manager_hide() { sim_manager_view_hide(); }


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

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

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

LLVM IR (-O2):
define void @phoneui_backend_sim_manager_hide() {
%1 = tail call i32 (...) @sim_manager_view_hide()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
void carp(char *condition, char *file, int line) {
  fprintf(stderr, "Non-fatal error: %s at line %d of file %s\n", condition,
          line, file);
}


x86 assembly (clang, -O0):
<carp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carp>:
mov    %edx,%ecx
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Non-fatal error: %s at line %d of file %s\0A\00"
define void @carp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Non-fatal error: %s at line %d of file %s\0A\00"
define void @carp(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i8* %1)
ret void
}
/* Type definitions */
struct at_dma {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ atc_setup_irq(struct at_dma *, int, int);
void atc_enable_chan_irq(struct at_dma *atdma, int chan_id) {
  atc_setup_irq(atdma, chan_id, 1);
}


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

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

LLVM IR (-O0):
%struct.at_dma = type { i32 }
define void @atc_enable_chan_irq(%struct.at_dma* %0, i32 %1) {
%3 = alloca %struct.at_dma*
%4 = alloca i32
store %struct.at_dma* %0, %struct.at_dma** %3
store i32 %1, i32* %4
%5 = load %struct.at_dma*, %struct.at_dma** %3
%6 = load i32, i32* %4
%7 = call i32 @atc_setup_irq(%struct.at_dma* %5, i32 %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.at_dma = type { i32 }
define void @atc_enable_chan_irq(%struct.at_dma* %0, i32 %1) {
%3 = tail call i32 @atc_setup_irq(%struct.at_dma* %0, i32 %1, i32 1)
ret void
}
int sqrtn(int num) {
  int i = 0;
  if (num == 1)
    return 1;
  for (; i <= num / 2; i++) {
    if (i * i == num)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sqrtn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1124 <sqrtn+0x24>
movl   $0x1,-0x4(%rbp)
jmp    117d <sqrtn+0x7d>
jmp    1129 <sqrtn+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1176 <sqrtn+0x76>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1163 <sqrtn+0x63>
movl   $0x1,-0x4(%rbp)
jmp    117d <sqrtn+0x7d>
jmp    1168 <sqrtn+0x68>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <sqrtn+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtn>:
cmp    $0x1,%edi
jne    110c <sqrtn+0xc>
mov    $0x1,%eax
jmp    1113 <sqrtn+0x13>
xor    %eax,%eax
cmp    $0xffffffff,%edi
jge    1114 <sqrtn+0x14>
ret
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
add    $0x1,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1105 <sqrtn+0x5>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1130 <sqrtn+0x30>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sqrtn(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, -1
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = sdiv i32 %0, 2
br label %10
7: ; preds = %10
%8 = add nuw nsw i32 %11, 1
%9 = icmp eq i32 %11, %6
br i1 %9, label %14, label %10
10: ; preds = %5, %7
%11 = phi i32 [ %8, %7 ], [ 0, %5 ]
%12 = mul nsw i32 %11, %11
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %7
14: ; preds = %10, %7, %3, %1
%15 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %10 ], [ 0, %7 ]
ret i32 %15
}
int foo(int a, int b, int c, int d, int e, int f) {
  if (a == 5) {
    if (e == 5) {
      return 0;
    }
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    113d <foo+0x3d>
cmpl   $0x5,-0x18(%rbp)
jne    1138 <foo+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1144 <foo+0x44>
jmp    1144 <foo+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x5,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @foo(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* %8
%15 = icmp eq i32 %14, 5
br i1 %15, label %16, label %21
16: ; preds = %6
%17 = load i32, i32* %12
%18 = icmp eq i32 %17, 5
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 0, i32* %7
br label %22
20: ; preds = %16
br label %22
21: ; preds = %6
store i32 1, i32* %7
br label %22
22: ; preds = %19, %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp ne i32 %0, 5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Accessing invalid pointer...\n");
  *((volatile unsigned char *)0xa0000000) = 0;
  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>
mov    $0xa0000000,%eax
movb   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"Accessing invalid pointer...\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store volatile i8 0, i8* inttoptr (i64 2684354560 to i8*)
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Accessing invalid pointer...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
store volatile i8 0, i8* inttoptr (i64 2684354560 to i8*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET6;
int /*<<< orphan*/ SOCK_DGRAM;
int reflect_6(int /*<<< orphan*/, int /*<<< orphan*/);
int reflect_udp6(void) { return (reflect_6(PF_INET6, SOCK_DGRAM)); }


x86 assembly (clang, -O0):
<reflect_udp6>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1030 <reflect_6@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reflect_udp6>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
jmp    1030 <reflect_6@plt>

LLVM IR (-O0):
@PF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @reflect_udp6() {
%1 = load i32, i32* @PF_INET6
%2 = load i32, i32* @SOCK_DGRAM
%3 = call i32 @reflect_6(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
@PF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @reflect_udp6() {
%1 = load i32, i32* @PF_INET6
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @reflect_6(i32 %1, i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
char **ft_taballoc(int nbword) {
  char **new;
  if (!(new = (char **)malloc((nbword + 1) * sizeof(*new))))
    return (NULL);
  new[0] = NULL;
  return (new);
}


x86 assembly (clang, -O0):
<ft_taballoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1149 <ft_taballoc+0x39>
movq   $0x0,-0x8(%rbp)
jmp    115c <ft_taballoc+0x4c>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_taballoc>:
push   %rax
lea    0x8(,%rdi,8),%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     112b <ft_taballoc+0x1b>
movq   $0x0,(%rax)
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8** @ft_taballoc(i32 %0) {
%2 = shl i32 %0, 3
%3 = add i32 %2, 8
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8**
%6 = icmp eq i64 %4, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %5
br label %8
8: ; preds = %1, %7
%9 = phi i8** [ %5, %7 ], [ null, %1 ]
ret i8** %9
}
void kol_paint_image_pal(unsigned x, unsigned y, unsigned w, unsigned h,
                         char *d, unsigned *palette) {
  asm volatile("int $0x40" ::"a"(65), "b"(d), "c"(w * 65536 + h),
               "d"(x * 65536 + y), "D"(palette), "S"(8));
}


x86 assembly (clang, -O0):
<kol_paint_image_pal>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rbx
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
add    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%edx
shl    $0x10,%edx
add    -0x10(%rbp),%edx
mov    -0x28(%rbp),%rdi
mov    $0x41,%eax
mov    $0x8,%esi
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_paint_image_pal>:
push   %rbx
mov    %r8,%rbx
shl    $0x10,%edx
add    %edx,%ecx
shl    $0x10,%edi
lea    (%rdi,%rsi,1),%edx
mov    $0x41,%eax
mov    %r9,%rdi
mov    $0x8,%esi
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define void @kol_paint_image_pal(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %11
%14 = load i32, i32* %9
%15 = mul i32 %14, 65536
%16 = load i32, i32* %10
%17 = add i32 %15, %16
%18 = load i32, i32* %7
%19 = mul i32 %18, 65536
%20 = load i32, i32* %8
%21 = add i32 %19, %20
%22 = load i32*, i32** %12
ret void
}

LLVM IR (-O2):
define void @kol_paint_image_pal(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32* %5) {
%7 = shl i32 %2, 16
%8 = add i32 %7, %3
%9 = shl i32 %0, 16
%10 = add i32 %9, %1
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},{dx},{di},{si},~{dirflag},~{fpsr},~{flags}"(i32 65, i8* %4, i32 %8, i32 %10, i32* %5, i32 8)
ret void
}
int do_186() { return 186; }


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

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

LLVM IR (-O0):
define i32 @do_186() {
ret i32 186
}

LLVM IR (-O2):
define i32 @do_186() {
ret i32 186
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
unsigned int getwlh(FILE *in) {
  unsigned int result;
  result = getc(in);
  result += getc(in) << 8;
  return result;
}


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

x86 assembly (clang, -O2):
<getwlh>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getwlh(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @getc(i32* %6)
%8 = shl i32 %7, 8
%9 = load i32, i32* %3
%10 = add i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @getwlh(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %3, 8
%5 = add i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(void) { system("./monitor.sh"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"./monitor.sh\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"./monitor.sh\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *progname) { printf("Usage: %s rom-file\n", progname); }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"Usage: %s rom-file\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ di_ent_equal(void *, void *);
int main() {
  if (di_ent_equal((void *)0x80143c4d, (void *)0x80173851) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80143c4d,%edi
mov    $0x80173851,%esi
call   1040 <di_ent_equal@plt>
cmp    $0x0,%rax
je     114f <main+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80143c4d,%eax
lea    0x2fc04(%rax),%rsi
mov    $0x80143c4d,%edi
call   1040 <di_ent_equal@plt>
test   %rax,%rax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @di_ent_equal(i8* inttoptr (i64 2148809805 to i8*), i8* inttoptr (i64 2149005393 to i8*))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @di_ent_equal(i8* inttoptr (i64 2148809805 to i8*), i8* inttoptr (i64 2149005393 to i8*))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void dup_userfaultfd_complete(struct list_head *l) {}


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

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

LLVM IR (-O0):
%struct.list_head = type opaque
define void @dup_userfaultfd_complete(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
ret void
}

LLVM IR (-O2):
%struct.list_head = type opaque
define void @dup_userfaultfd_complete(%struct.list_head* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core();
int /*<<< orphan*/ mem();
int /*<<< orphan*/ task();
int main(void) {
  core();
  mem();
  task();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <core@plt>
xor    %eax,%eax
call   1040 <mem@plt>
xor    %eax,%eax
call   1050 <task@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @core()
%2 = tail call i32 (...) @mem()
%3 = tail call i32 (...) @task()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_time_now_string(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char now_str[256] = {0};
  get_time_now_string(now_str, 256);
  printf("now_str = %s\n", now_str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1030 <get_time_now_string@plt>
lea    -0x110(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <get_time_now_string@plt>
lea    0xe57(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"now_str = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = bitcast [256 x i8]* %2 to i8*
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @get_time_now_string(i8* %4, i32 256)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"now_str = %s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_time_now_string(i8* %2, i32 256)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int get_in_nr(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_in_nr() {
ret i32 0
}
cbuf8(f, n) int f, n;
{ cbuf(f, n, 8); }


x86 assembly (clang, -O0):
<cbuf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf8>:
mov    $0x8,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf8(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 8)
ret i32 undef
}