xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void test(int num, ...) {
  int i;
  for (i = 0; i < num; i++)
    printf("%f ", *((double *)(&num + 1) + i));
  printf("\n");
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <test+0x44>
movslq -0x8(%rbp),%rax
movsd  0x0(%rbp,%rax,8),%xmm0
lea    0xec1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <test+0x12>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @test(i32 %0, ...) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %19
8: ; preds = %4
%9 = getelementptr inbounds i32, i32* %2, i64 1
%10 = bitcast i32* %9 to double*
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %14)
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @test(i32 %0, ...) {
%2 = icmp slt i32 %0, 1
%3 = tail call i32 @putchar(i32 10)
ret void
}
void ARGBToUVJRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToUVJRow_C() {
ret void
}
void *nofree(void *a) {
  return a;
  __builtin_unreachable();
}


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

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

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

LLVM IR (-O2):
define i8* @nofree(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int gprc_dynamic_instruction_set(int *);
int gprcm_dynamic_instruction_set(int *instruction_set) {
  return gprc_dynamic_instruction_set(instruction_set);
}


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

x86 assembly (clang, -O2):
<gprcm_dynamic_instruction_set>:
jmp    1030 <gprc_dynamic_instruction_set@plt>

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

LLVM IR (-O2):
define i32 @gprcm_dynamic_instruction_set(i32* %0) {
%2 = tail call i32 @gprc_dynamic_instruction_set(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ KDGETMODE;
long KD_GRAPHICS;
scalar_t__ ioctl(int, int /*<<< orphan*/, long *);
int is_on_X(int ttyFd) {
  long mode;
  if (ioctl(ttyFd, KDGETMODE, &mode))
    return 1;
  return (mode & KD_GRAPHICS);
}


x86 assembly (clang, -O0):
<is_on_X>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ecb(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1146 <is_on_X+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1157 <is_on_X+0x47>
mov    -0x10(%rbp),%rax
mov    0x2e7f(%rip),%rcx
and    (%rcx),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_on_X>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    0x2ea7(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
test   %rax,%rax
mov    $0x1,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@KDGETMODE = global i32 0
@KD_GRAPHICS = global i64 0
define i32 @is_on_X(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @KDGETMODE
%7 = call i64 @ioctl(i32 %5, i32 %6, i64* %4)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %15
10: ; preds = %1
%11 = load i64, i64* %4
%12 = load i64, i64* @KD_GRAPHICS
%13 = and i64 %11, %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@KDGETMODE = global i32 0
@KD_GRAPHICS = global i64 0
define i32 @is_on_X(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i32, i32* @KDGETMODE
%5 = call i64 @ioctl(i32 %0, i32 %4, i64* %2)
%6 = icmp eq i64 %5, 0
%7 = load i64, i64* %2
%8 = load i64, i64* @KD_GRAPHICS
%9 = and i64 %8, %7
%10 = trunc i64 %9 to i32
%11 = select i1 %6, i32 %10, i32 1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *strdup(char const *);
char *xstrdup(const char *string) {
  char *result;
  if (!(result = strdup(string)))
    die("strdup failed");
  return (result);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <xstrdup+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"strdup failed\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"strdup failed\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
double funcAngCor_alpha0_0plus_0plus_15097_L0(double *, double *);
double sin(double);
double fitAngDist_alpha0_0plus_0plus_15097_L0(double *x, double *par) {
  double result;
  result = funcAngCor_alpha0_0plus_0plus_15097_L0(x, &par[0]) *
           sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_alpha0_0plus_0plus_15097_L0>:
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 <funcAngCor_alpha0_0plus_0plus_15097_L0@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitAngDist_alpha0_0plus_0plus_15097_L0>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <funcAngCor_alpha0_0plus_0plus_15097_L0@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_alpha0_0plus_0plus_15097_L0(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = call double @funcAngCor_alpha0_0plus_0plus_15097_L0(double* %6, double* %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.745330e-02
%14 = call double @sin(double %13)
%15 = fmul double %9, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @fitAngDist_alpha0_0plus_0plus_15097_L0(double* %0, double* %1) {
%3 = tail call double @funcAngCor_alpha0_0plus_0plus_15097_L0(double* %0, double* %1)
%4 = load double, double* %0
%5 = fmul double %4, 1.745330e-02
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
/* Type definitions */
struct stat {
  int dummy;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
scalar_t__ remove(char const *);
int unlink_func(const char *path, const struct stat *sb, int type_flag,
                struct FTW *ftw) {
  if (remove(path) != 0) {
    perror(path);
  }
  return 0;
}


x86 assembly (clang, -O0):
<unlink_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
je     1153 <unlink_func+0x33>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_func>:
push   %rbx
mov    %rdi,%rbx
call   1030 <remove@plt>
test   %rax,%rax
jne    1132 <unlink_func+0x12>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
jmp    112e <unlink_func+0xe>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @unlink_func(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
%9 = load i8*, i8** %5
%10 = call i64 @remove(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = call i32 @perror(i8* %13)
br label %15
15: ; preds = %12, %4
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @unlink_func(i8* nocapture %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = tail call i64 @remove(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @perror(i8* %0)
br label %9
9: ; preds = %7, %4
ret i32 0
}
/* Variables and functions */
double M_SQRT1_2;
double erf(double);
double zscore2pvalue(double z) { return (1.0 + erf(-z * M_SQRT1_2)); }


x86 assembly (clang, -O0):
<zscore2pvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x2ea0(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <erf@plt>
movaps %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zscore2pvalue>:
push   %rax
xorpd  0xee7(%rip),%xmm0
mov    0x2ec0(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <erf@plt>
addsd  0xedf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_SQRT1_2 = global double 0.000000e+00
define double @zscore2pvalue(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* @M_SQRT1_2
%6 = fmul double %4, %5
%7 = call double @erf(double %6)
%8 = fadd double 1.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
@M_SQRT1_2 = global double 0.000000e+00
define double @zscore2pvalue(double %0) {
%2 = fneg double %0
%3 = load double, double* @M_SQRT1_2
%4 = fmul double %3, %2
%5 = tail call double @erf(double %4)
%6 = fadd double %5, 1.000000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_bad3() {
  int arr1[10];
  int arr2[20];
  memcpy(arr1, arr2, -1);
}


x86 assembly (clang, -O0):
<memcpy_bad3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0xffffffff,%edx
call   1030 <memcpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_bad3>:
sub    $0x88,%rsp
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
mov    $0xffffffff,%edx
call   1030 <memcpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @memcpy_bad3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 -1)
ret void
}

LLVM IR (-O2):
define void @memcpy_bad3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_imatrix(int **m, long nrl, long ncl) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_imatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rdx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_imatrix(i32** %0, i64 %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i64
%6 = alloca i64
store i32** %0, i32*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i32*, i32** %7, i64 %8
%10 = load i32*, i32** %9
%11 = load i64, i64* %6
%12 = getelementptr inbounds i32, i32* %10, i64 %11
%13 = getelementptr inbounds i32, i32* %12, i64 -1
%14 = bitcast i32* %13 to i8*
%15 = call i32 @free(i8* %14)
%16 = load i32**, i32*** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i32*, i32** %16, i64 %17
%19 = getelementptr inbounds i32*, i32** %18, i64 -1
%20 = bitcast i32** %19 to i8*
%21 = call i32 @free(i8* %20)
ret void
}

LLVM IR (-O2):
define void @free_imatrix(i32** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32*, i32** %0, i64 %1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 %2
%7 = getelementptr inbounds i32, i32* %6, i64 -1
%8 = bitcast i32* %7 to i8*
%9 = tail call i32 @free(i8* %8)
%10 = getelementptr inbounds i32*, i32** %4, i64 -1
%11 = bitcast i32** %10 to i8*
%12 = tail call i32 @free(i8* %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allocmem3();
int /*<<< orphan*/ free(char *);
char *malloc(int);
int main(int argc, const char **argv) {
  char *memleak1 = malloc(5 * sizeof(char));
  char *memfreed = malloc(5 * sizeof(char));
  int i = 0;
  for (i = 0; i < 100; i++) {
    allocmem3();
  }
  free(memfreed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x5,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jge    118f <main+0x5f>
mov    $0x0,%al
call   1040 <allocmem3@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1170 <main+0x40>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x5,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x64,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <allocmem3@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %7, %4 ]
%6 = tail call i32 (...) @allocmem3()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 100
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
char *strdup(char const *);
char *getenv_copy(const char *name) {
  const char *value = getenv(name);
  return value ? strdup(value) : 0;
}


x86 assembly (clang, -O0):
<getenv_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <getenv_copy+0x36>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    1161 <getenv_copy+0x41>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1161 <getenv_copy+0x41>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_copy>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     1134 <getenv_copy+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @getenv_copy(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @strdup(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
int f(const int x) {
  int y = 0;
  y = x ? y : -y;
  { const int *p = &x; }
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1123 <f+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112b <f+0x2b>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ time(int);
__attribute__((visibility("hidden"))) void func_0x00() { time(1); }


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

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

LLVM IR (-O0):
define hidden void @func_0x00() {
%1 = call i32 @time(i32 1)
ret void
}

LLVM IR (-O2):
define hidden void @func_0x00() {
%1 = tail call i32 @time(i32 1)
ret void
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct rbnode {
  int dummy;
};

/* Variables and functions */
struct rbnode *z_rb_get_minmax(struct rbtree *, unsigned int);
struct rbnode *rb_get_max(struct rbtree *tree) {
  return z_rb_get_minmax(tree, 1U);
}


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

x86 assembly (clang, -O2):
<rb_get_max>:
mov    $0x1,%esi
jmp    1030 <z_rb_get_minmax@plt>

LLVM IR (-O0):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_max(%struct.rbtree* %0) {
%2 = alloca %struct.rbtree*
store %struct.rbtree* %0, %struct.rbtree** %2
%3 = load %struct.rbtree*, %struct.rbtree** %2
%4 = call %struct.rbnode* @z_rb_get_minmax(%struct.rbtree* %3, i32 1)
ret %struct.rbnode* %4
}

LLVM IR (-O2):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_max(%struct.rbtree* %0) {
%2 = tail call %struct.rbnode* @z_rb_get_minmax(%struct.rbtree* %0, i32 1)
ret %struct.rbnode* %2
}
/* Variables and functions */
int syscall(unsigned long, unsigned long, unsigned long, unsigned long,
            unsigned long *, unsigned long *, unsigned long *, unsigned long *);
int syscall0(unsigned long rcv, unsigned long flags, unsigned long msg0,
             unsigned long msg1) {
  unsigned long nil[4];
  return syscall(rcv, flags, msg0, msg1, nil + 0, nil + 1, nil + 2, nil + 3);
}


x86 assembly (clang, -O0):
<syscall0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x40(%rbp),%r8
lea    -0x40(%rbp),%r9
add    $0x8,%r9
lea    -0x40(%rbp),%r10
add    $0x10,%r10
lea    -0x40(%rbp),%rax
add    $0x18,%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <syscall@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall0>:
sub    $0x28,%rsp
lea    0x8(%rsp),%r9
lea    0x10(%rsp),%r10
lea    0x18(%rsp),%rax
mov    %rsp,%r8
push   %rax
push   %r10
call   1030 <syscall@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @syscall0(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca [4 x i64]
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 0
%15 = getelementptr inbounds i64, i64* %14, i64 0
%16 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 0
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 0
%19 = getelementptr inbounds i64, i64* %18, i64 2
%20 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 0
%21 = getelementptr inbounds i64, i64* %20, i64 3
%22 = call i32 @syscall(i64 %10, i64 %11, i64 %12, i64 %13, i64* %15, i64* %17, i64* %19, i64* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @syscall0(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca [4 x i64]
%6 = bitcast [4 x i64]* %5 to i8*
%7 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 0
%8 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 1
%9 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 2
%10 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 3
%11 = call i32 @syscall(i64 %0, i64 %1, i64 %2, i64 %3, i64* %7, i64* %8, i64* %9, i64* %10)
ret i32 %11
}
__attribute__((always_)) struct mempolicy *mpol_dup(struct mempolicy *old) {
  return ((void *)0);
}


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

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

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

LLVM IR (-O2):
%struct.mempolicy = type opaque
define noalias %struct.mempolicy* @mpol_dup(%struct.mempolicy* nocapture readnone %0) {
ret %struct.mempolicy* null
}
void initcol(q) int q[][64];
{
  scaleidctqtab(q[1], ((int)((1.77200) * (1 << 11) + .5)));
  scaleidctqtab(q[2], ((int)((1.40200) * (1 << 11) + .5)));
}


x86 assembly (clang, -O0):
<initcol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x100,%rdi
mov    $0xe2d,%esi
mov    $0x0,%al
call   1030 <scaleidctqtab@plt>
mov    -0x8(%rbp),%rdi
add    $0x200,%rdi
mov    $0xb37,%esi
mov    $0x0,%al
call   1030 <scaleidctqtab@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initcol>:
push   %rbx
mov    %rdi,%rbx
add    $0x100,%rdi
mov    $0xe2d,%esi
xor    %eax,%eax
call   1030 <scaleidctqtab@plt>
add    $0x200,%rbx
mov    %rbx,%rdi
mov    $0xb37,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <scaleidctqtab@plt>

LLVM IR (-O0):
define void @initcol([64 x i32]* %0) {
%2 = alloca [64 x i32]*
store [64 x i32]* %0, [64 x i32]** %2
%3 = load [64 x i32]*, [64 x i32]** %2
%4 = getelementptr inbounds [64 x i32], [64 x i32]* %3, i64 1
%5 = getelementptr inbounds [64 x i32], [64 x i32]* %4, i64 0, i64 0
%6 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @scaleidctqtab to i32 (i32*, i32, ...)*)(i32* %5, i32 3629)
%7 = load [64 x i32]*, [64 x i32]** %2
%8 = getelementptr inbounds [64 x i32], [64 x i32]* %7, i64 2
%9 = getelementptr inbounds [64 x i32], [64 x i32]* %8, i64 0, i64 0
%10 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @scaleidctqtab to i32 (i32*, i32, ...)*)(i32* %9, i32 2871)
ret void
}

LLVM IR (-O2):
define void @initcol([64 x i32]* %0) {
%2 = getelementptr inbounds [64 x i32], [64 x i32]* %0, i64 1, i64 0
%3 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @scaleidctqtab to i32 (i32*, i32, ...)*)(i32* %2, i32 3629)
%4 = getelementptr inbounds [64 x i32], [64 x i32]* %0, i64 2, i64 0
%5 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @scaleidctqtab to i32 (i32*, i32, ...)*)(i32* %4, i32 2871)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void disable_utf8() { fputs("\033%@", stdout); }


x86 assembly (clang, -O0):
<disable_utf8>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_utf8>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B%@\00"
@stdout = global i32 0
define void @disable_utf8() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B%@\00"
@stdout = global i32 0
define void @disable_utf8() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
long double asinl(long double x) {
  long double res = 0.0L;
  asm volatile("fld	%%st\n\t"
               "fmul	%%st(0)\n\t"
               "fld1\n\t"
               "fsubp\n\t"
               "fsqrt\n\t"
               "fpatan"
               : "=t"(res)
               : "0"(x)
               : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<asinl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldz
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fmul   %st(0),%st
fld1
fsubp  %st,%st(1)
fsqrt
fpatan
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinl>:
fldt   0x8(%rsp)
fld    %st(0)
fmul   %st(0),%st
fld1
fsubp  %st,%st(1)
fsqrt
fpatan
ret

LLVM IR (-O0):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm sideeffect "fld\09%st\0A\09fmul\09%st(0)\0A\09fld1\0A\09fsubp\0A\09fsqrt\0A\09fpatan", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm sideeffect "fld\09%st\0A\09fmul\09%st(0)\0A\09fld1\0A\09fsubp\0A\09fsqrt\0A\09fpatan", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
void foo_1_2_2_2_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_2_2_1_2_1() {
ret void
}
void good2(int a[]) { (void)a; }


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

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

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

LLVM IR (-O2):
define void @good2(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_ca_mode;
int /*<<< orphan*/ putp(int /*<<< orphan*/);
int /*<<< orphan*/ reset_shell_mode();
int /*<<< orphan*/ sleep(int);
void terminfo_reset_on_exit() {
  sleep(1);
  putp(exit_ca_mode);
  reset_shell_mode();
}


x86 assembly (clang, -O0):
<terminfo_reset_on_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1030 <putp@plt>
mov    $0x0,%al
call   1050 <reset_shell_mode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminfo_reset_on_exit>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <putp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <reset_shell_mode@plt>

LLVM IR (-O0):
@exit_ca_mode = global i32 0
define void @terminfo_reset_on_exit() {
%1 = call i32 @sleep(i32 1)
%2 = load i32, i32* @exit_ca_mode
%3 = call i32 @putp(i32 %2)
%4 = call i32 (...) @reset_shell_mode()
ret void
}

LLVM IR (-O2):
@exit_ca_mode = global i32 0
define void @terminfo_reset_on_exit() {
%1 = tail call i32 @sleep(i32 1)
%2 = load i32, i32* @exit_ca_mode
%3 = tail call i32 @putp(i32 %2)
%4 = tail call i32 (...) @reset_shell_mode()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int xos_get_ccount();
uint64_t xos_get_system_cycles(void) {
  extern uint64_t xos_system_cycles;
  return ((xos_system_cycles >> 32) << 32) | xos_get_ccount();
}


x86 assembly (clang, -O0):
<xos_get_system_cycles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <xos_get_ccount@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@xos_system_cycles = external global i32
define i32 @xos_get_system_cycles() {
%1 = load i32, i32* @xos_system_cycles
%2 = ashr i32 %1, 32
%3 = shl i32 %2, 32
%4 = call i32 (...) @xos_get_ccount()
%5 = or i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @xos_get_system_cycles() {
%1 = tail call i32 (...) @xos_get_ccount()
ret i32 poison
}
/* Variables and functions */
int get32(int);
int uart_lsr();
unsigned int uart_recv(void) {
  while (1) {
    if (uart_lsr() & 0x01) {
      break;
    }
  }
  return (get32((0xFFFFFF0000000000uL + 0x3F200000uL + 0x00015040)) & 0xFF);
}


x86 assembly (clang, -O0):
<uart_recv>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <uart_recv+0x9>
mov    $0x0,%al
call   1040 <uart_lsr@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     1141 <uart_recv+0x21>
jmp    1146 <uart_recv+0x26>
jmp    1129 <uart_recv+0x9>
mov    $0x3f215040,%edi
call   1030 <get32@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_recv>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <uart_lsr@plt>
test   $0x1,%al
je     1130 <uart_recv+0x10>
mov    $0x3f215040,%edi
call   1030 <get32@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uart_recv() {
br label %1
1: ; preds = %0, %6
%2 = call i32 (...) @uart_lsr()
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
%8 = call i32 @get32(i32 1059147840)
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @uart_recv() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @uart_lsr()
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call i32 @get32(i32 1059147840)
%7 = and i32 %6, 255
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct riku_devfs_node {
  int dummy;
};

/* Variables and functions */
int null_write(struct riku_devfs_node *self, const char *buf, uint32_t count) {
  return 0;
}


x86 assembly (clang, -O0):
<null_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.riku_devfs_node = type { i32 }
define i32 @null_write(%struct.riku_devfs_node* %0, i8* %1, i32 %2) {
%4 = alloca %struct.riku_devfs_node*
%5 = alloca i8*
%6 = alloca i32
store %struct.riku_devfs_node* %0, %struct.riku_devfs_node** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.riku_devfs_node = type { i32 }
define i32 @null_write(%struct.riku_devfs_node* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_put_u16(unsigned char volatile);
int /*<<< orphan*/ uart_puts(char *);
void debug_irq() {
  uart_puts("\r\nSCR: ");
  uart_put_u16((*(volatile unsigned char *)(0xffff8a)));
  uart_puts("\r\nSSR: ");
  uart_put_u16((*(volatile unsigned char *)(0xffff8c)));
}


x86 assembly (clang, -O0):
<debug_irq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <uart_puts@plt>
mov    $0xffff8a,%eax
mov    (%rax),%al
movzbl %al,%edi
call   1030 <uart_put_u16@plt>
lea    0xec2(%rip),%rdi
call   1040 <uart_puts@plt>
mov    $0xffff8c,%eax
mov    (%rax),%al
movzbl %al,%edi
call   1030 <uart_put_u16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_irq>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <uart_puts@plt>
movzbl 0xffff8a,%edi
call   1030 <uart_put_u16@plt>
lea    0xec7(%rip),%rdi
call   1040 <uart_puts@plt>
movzbl 0xffff8c,%edi
pop    %rax
jmp    1030 <uart_put_u16@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0D\0ASCR: \00"
@.str.1 = [8 x i8] c"\0D\0ASSR: \00"
define void @debug_irq() {
%1 = call i32 @uart_puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = load volatile i8, i8* inttoptr (i64 16777098 to i8*)
%3 = call i32 @uart_put_u16(i8 zeroext %2)
%4 = call i32 @uart_puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = load volatile i8, i8* inttoptr (i64 16777100 to i8*)
%6 = call i32 @uart_put_u16(i8 zeroext %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0D\0ASCR: \00"
@.str.1 = [8 x i8] c"\0D\0ASSR: \00"
define void @debug_irq() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = load volatile i8, i8* inttoptr (i64 16777098 to i8*)
%3 = tail call i32 @uart_put_u16(i8 zeroext %2)
%4 = tail call i32 @uart_puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = load volatile i8, i8* inttoptr (i64 16777100 to i8*)
%6 = tail call i32 @uart_put_u16(i8 zeroext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AL_RegisterTimbreBank(unsigned char *);
void MUSIC_RegisterTimbreBank(unsigned char *timbres) {
  AL_RegisterTimbreBank(timbres);
}


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

x86 assembly (clang, -O2):
<MUSIC_RegisterTimbreBank>:
jmp    1030 <AL_RegisterTimbreBank@plt>

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

LLVM IR (-O2):
define void @MUSIC_RegisterTimbreBank(i8* %0) {
%2 = tail call i32 @AL_RegisterTimbreBank(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void y(int x) { abort(); }


x86 assembly (clang, -O0):
<y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<y>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @y(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @y(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strrchr(char *, char);
void linux_find_path(char *filename, char *path) {
  char *path_p = strrchr(filename, '/');
  int path_length = path_p - filename + 1;
  strncpy(path, filename, path_length);
}


x86 assembly (clang, -O0):
<linux_find_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linux_find_path>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
sub    %ebx,%eax
lea    0x1(%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define void @linux_find_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @strrchr(i8* %7, i8 signext 47)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = add nsw i64 %13, 1
%15 = trunc i64 %14 to i32
store i32 %15, i32* %6
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = load i32, i32* %6
%19 = call i32 @strncpy(i8* %16, i8* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @linux_find_path(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%4 = ptrtoint i8* %3 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = add i32 %7, 1
%9 = tail call i32 @strncpy(i8* %1, i8* %0, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *mpfq_malloc_check(size_t s) {
  void *r = malloc(s);
  if (!r) {
    fprintf(stderr, "malloc(%zu) failed\n", s);
    abort();
  }
  return r;
}


x86 assembly (clang, -O0):
<mpfq_malloc_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <mpfq_malloc_check+0x44>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfq_malloc_check>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1140 <mpfq_malloc_check+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"malloc(%zu) failed\0A\00"
define i8* @mpfq_malloc_check(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"malloc(%zu) failed\0A\00"
define noalias i8* @mpfq_malloc_check(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
void ff_hevc_put_hevc_uni_w_qpel_hv4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv4_8_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a_ulabel;

/* Variables and functions */
scalar_t__ ossl_a2ulabel(char const *, char *, size_t *);
scalar_t__ strcmp(char *, char const *);
int ossl_a2ucompare(const char *a, const char *u) {
  char a_ulabel[512];
  size_t a_size = sizeof(a_ulabel);
  if (ossl_a2ulabel(a, a_ulabel, &a_size) <= 0) {
    return -1;
  }
  return (strcmp(a_ulabel, u) == 0) ? 0 : 1;
}


x86 assembly (clang, -O0):
<ossl_a2ucompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x200,-0x228(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x220(%rbp),%rsi
lea    -0x228(%rbp),%rdx
call   1030 <ossl_a2ulabel@plt>
cmp    $0x0,%rax
jg     116b <ossl_a2ucompare+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    118f <ossl_a2ucompare+0x6f>
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ossl_a2ucompare>:
push   %rbx
sub    $0x210,%rsp
mov    %rsi,%rbx
movq   $0x200,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <ossl_a2ulabel@plt>
test   %rax,%rax
jle    1162 <ossl_a2ucompare+0x42>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1167 <ossl_a2ucompare+0x47>
mov    $0xffffffff,%eax
add    $0x210,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ossl_a2ucompare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [512 x i8]
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 512, i64* %7
%8 = load i8*, i8** %4
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%10 = call i64 @ossl_a2ulabel(i8* %8, i8* %9, i64* %7)
%11 = icmp sle i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%15 = load i8*, i8** %5
%16 = call i64 @strcmp(i8* %14, i8* %15)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 0, i32 1
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @ossl_a2ucompare(i8* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = alloca i64
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = bitcast i64* %4 to i8*
store i64 512, i64* %4
%7 = call i64 @ossl_a2ulabel(i8* %0, i8* %5, i64* %4)
%8 = icmp slt i64 %7, 1
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = call i64 @strcmp(i8* %5, i8* %1)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %9
%14 = phi i32 [ %12, %9 ], [ -1, %2 ]
ret i32 %14
}
/* Variables and functions */
void *evaluator_derivative(void *, char *);
void *evaluator_derivative_z(void *evaluator) {
  return evaluator_derivative(evaluator, "z");
}


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

x86 assembly (clang, -O2):
<evaluator_derivative_z>:
lea    0xee9(%rip),%rsi
jmp    1030 <evaluator_derivative@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"z\00"
define i8* @evaluator_derivative_z(i8* %0) {
%2 = tail call i8* @evaluator_derivative(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ height;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xconfigure_height(void *_p) {
  return (int)((XEvent *)_p)->xconfigure.height;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xconfigure_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xconfigure_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}