xunge/DecIR huggingface dataset:
void gx_g_to_rgb(float *g, float *rgb) {
  rgb[0] = (*g);
  rgb[1] = (*g);
  rgb[2] = (*g);
}


x86 assembly (clang, -O0):
<gx_g_to_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gx_g_to_rgb>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  (%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  (%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @gx_g_to_rgb(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %3
%10 = load float, float* %9
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
store float %10, float* %12
%13 = load float*, float** %3
%14 = load float, float* %13
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
store float %14, float* %16
ret void
}

LLVM IR (-O2):
define void @gx_g_to_rgb(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = load float, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
store float %4, float* %5
%6 = load float, float* %0
%7 = getelementptr inbounds float, float* %1, i64 2
store float %6, float* %7
ret void
}
int test_imm_19int64_highword_reg(long long val) {
  return ((val >> 32) & (0x19 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_19int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x19,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_19int64_highword_reg>:
movabs $0x1900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_19int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 25
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_19int64_highword_reg(i64 %0) {
%2 = and i64 %0, 107374182400
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int sqrt(double);
double ms20_filter_shape_gain(double x) {
  return 1 / sqrt(1.0 + 0.66 * x + x * x);
}


x86 assembly (clang, -O0):
<ms20_filter_shape_gain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms20_filter_shape_gain>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ms20_filter_shape_gain(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 6.600000e-01, double %3, double 1.000000e+00)
%5 = load double, double* %2
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double %5, double %6, double %4)
%8 = call i32 @sqrt(double %7)
%9 = sdiv i32 1, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @ms20_filter_shape_gain(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 6.600000e-01, double 1.000000e+00)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %2)
%4 = tail call i32 @sqrt(double %3)
%5 = add i32 %4, 1
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to double
ret double %8
}
int load(char *p) {
  int a = 0;
  a += *(int *)(p + 17);
  a += *(int *)(p + 21);
  a += *(int *)(p + 25);
  a += *(int *)(p + 29);
  return a;
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x11(%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x15(%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x19(%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1d(%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
movdqu 0x11(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @load(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 17
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 21
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 25
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, %19
store i32 %21, i32* %3
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 29
%24 = bitcast i8* %23 to i32*
%25 = load i32, i32* %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, %25
store i32 %27, i32* %3
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @load(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 17
%3 = bitcast i8* %2 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
void scl_high(void) { PUT32(0x2020001C, 1 << 3); }


x86 assembly (clang, -O0):
<scl_high>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2020001c,%edi
mov    $0x8,%esi
call   1030 <PUT32@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @scl_high() {
%1 = call i32 @PUT32(i32 538968092, i32 8)
ret void
}

LLVM IR (-O2):
define void @scl_high() {
%1 = tail call i32 @PUT32(i32 538968092, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int *mk_dangle(void) {
  int *x = malloc(400);
  free(x);
  return x;
}


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

x86 assembly (clang, -O2):
<mk_dangle>:
push   %rbx
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @mk_dangle() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 400)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
%5 = load i32*, i32** %1
ret i32* %5
}

LLVM IR (-O2):
define noalias i32* @mk_dangle() {
%1 = tail call i32* @malloc(i32 400)
%2 = tail call i32 @free(i32* %1)
ret i32* %1
}
int try_direction(unsigned int dir) {
  int tmp = dir + 1;
  if (tmp > 7)
    return 0;
  else
    return tmp;
}


x86 assembly (clang, -O0):
<try_direction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jle    1126 <try_direction+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112c <try_direction+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_direction>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x8,%ecx
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @try_direction(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp sgt i32 %2, 7
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
int main() {
  static int i = 0;
  int as;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void XFetchBytes() {}


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

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

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

LLVM IR (-O2):
define void @XFetchBytes() {
ret void
}
/* Variables and functions */
char *xml_serialize_(char *, int);
char *xml_serialize_inplace(char **str) {
  char *s = xml_serialize_(*str, 1);
  *str = s;
  return s;
}


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

x86 assembly (clang, -O2):
<xml_serialize_inplace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%esi
call   1030 <xml_serialize_@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xml_serialize_inplace(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @xml_serialize_(i8* %2, i32 1)
store i8* %3, i8** %0
ret i8* %3
}
int divides_cmp(void *i1, void *i2) {
  int j1 = *(int *)i1;
  int j2 = *(int *)i2;
  return (j1 % j2);
}


x86 assembly (clang, -O0):
<divides_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divides_cmp>:
mov    (%rdi),%eax
cltd
idivl  (%rsi)
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @divides_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = srem i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @divides_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = srem i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char **);
int main(void) {
  char name[256];
  scanf("%[^\n]\n", &name);
  printf("Hey %s\n", name);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]\0A\00"
@.str.1 = [8 x i8] c"Hey %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 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]\0A\00"
@.str.1 = [8 x i8] c"Hey %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 = bitcast [256 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
__attribute__((hot)) int sr_compare_u64(const char *a, const char *b) {
  uint64_t av = *(const uint64_t *)a;
  uint64_t bv = *(const uint64_t *)b;
  if (av == bv)
    return 0;
  return (av > bv) ? 1 : -1;
}


x86 assembly (clang, -O0):
<sr_compare_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <sr_compare_u64+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1157 <sr_compare_u64+0x57>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_compare_u64>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setg   %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret
cs nopw 0x0(%rax,%rax,1)
nop

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

LLVM IR (-O2):
define i32 @sr_compare_u64(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_divide(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3i *
psvec3i_divide(struct vec3i *result, struct vec3i *a, struct vec3i *b) {
  vec3i_divide((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


x86 assembly (clang, -O0):
<psvec3i_divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <vec3i_divide@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3i_divide>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3i_divide@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_divide(%struct.vec3i* %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = alloca %struct.vec3i*
%5 = alloca %struct.vec3i*
%6 = alloca %struct.vec3i*
store %struct.vec3i* %0, %struct.vec3i** %4
store %struct.vec3i* %1, %struct.vec3i** %5
store %struct.vec3i* %2, %struct.vec3i** %6
%7 = load %struct.vec3i*, %struct.vec3i** %4
%8 = bitcast %struct.vec3i* %7 to i32*
%9 = load %struct.vec3i*, %struct.vec3i** %5
%10 = bitcast %struct.vec3i* %9 to i32*
%11 = load %struct.vec3i*, %struct.vec3i** %6
%12 = bitcast %struct.vec3i* %11 to i32*
%13 = call i32 @vec3i_divide(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec3i*, %struct.vec3i** %4
ret %struct.vec3i* %14
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_divide(%struct.vec3i* returned %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec3i, %struct.vec3i* %2, i64 0, i32 0
%7 = tail call i32 @vec3i_divide(i32* %4, i32* %5, i32* %6)
ret %struct.vec3i* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void print_back(long int arr[], int len) {
  if (len == -1)
    return;
  printf("%ld", arr[len]);
  print_back(arr, --len);
}


x86 assembly (clang, -O0):
<print_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    113e <print_back+0x1e>
jmp    1168 <print_back+0x48>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0xc(%rbp)
call   1040 <print_back@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_back>:
push   %r15
push   %r14
push   %rbx
cmp    $0xffffffff,%esi
je     1142 <print_back+0x32>
mov    %rdi,%r15
movslq %esi,%rbx
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1130 <print_back+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @print_back(i64* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = add nsw i64 %7, -1
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int assign_string(char **, char const *);
char *get_value_if_matches(char const *, char const *);
int assign_string_if_matches(char const *line, char const *argument,
                             char **target) {
  char const *value = get_value_if_matches(line, argument);
  return (value ? (assign_string(target, value), 1) : 0);
}


x86 assembly (clang, -O0):
<assign_string_if_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <get_value_if_matches@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116a <assign_string_if_matches+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <assign_string@plt>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1174 <assign_string_if_matches+0x54>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1174 <assign_string_if_matches+0x54>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_string_if_matches>:
push   %rbx
mov    %rdx,%rbx
call   1040 <get_value_if_matches@plt>
test   %rax,%rax
je     1140 <assign_string_if_matches+0x20>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <assign_string@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @assign_string_if_matches(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i8* @get_value_if_matches(i8* %8, i8* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %7
%16 = call i32 @assign_string(i8** %14, i8* %15)
br label %18
17: ; preds = %3
br label %18
18: ; preds = %17, %13
%19 = phi i32 [ 1, %13 ], [ 0, %17 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @assign_string_if_matches(i8* %0, i8* %1, i8** %2) {
%4 = tail call i8* @get_value_if_matches(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @assign_string(i8** %2, i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int arg_v(void) {
  printf("Ghost Bird File System Reader"
         "\n");
  printf("Copyright (c) 2017, Ghost Bird Operating System Project Developers. "
         "All rights reserved."
         "\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Ghost Bird File System Reader\0A\00"
@.str.1 = [90 x i8] c"Copyright (c) 2017, Ghost Bird Operating System Project Developers. All rights reserved.\0A\00"
define i32 @arg_v() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Ghost Bird File System Reader\00"
@str.2 = [89 x i8] c"Copyright (c) 2017, Ghost Bird Operating System Project Developers. All rights reserved.\00"
define i32 @arg_v() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
log2v(n) long n;
{
  register int i;
  if (n == 0)
    return (0);
  i = 31;
  if (n < 0)
    return (i);
  while ((n = n << 1) > 0)
    i--;
  return (--i);
}


x86 assembly (clang, -O0):
<log2v>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <log2v+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1171 <log2v+0x71>
movl   $0x1f,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    113c <log2v+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <log2v+0x71>
jmp    1141 <log2v+0x41>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jle    1165 <log2v+0x65>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <log2v+0x41>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2v>:
test   %rdi,%rdi
je     111c <log2v+0x1c>
mov    $0x1f,%eax
js     111b <log2v+0x1b>
nopl   0x0(%rax)
add    %rdi,%rdi
add    $0xffffffff,%eax
test   %rdi,%rdi
jg     1110 <log2v+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @log2v(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp slt i64 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %8, %5 ], [ %0, %3 ]
%7 = phi i32 [ %10, %5 ], [ 30, %3 ]
%8 = shl nuw i64 %6, 1
%9 = icmp sgt i64 %8, 0
%10 = add nsw i32 %7, -1
br i1 %9, label %5, label %11
11: ; preds = %5, %3, %1
%12 = phi i32 [ 0, %1 ], [ 31, %3 ], [ %7, %5 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ dot(char);
scalar_t__ num(char);
int decimal(char c) { return num(c) || dot(c); }


x86 assembly (clang, -O0):
<decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <num@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <decimal+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <dot@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal>:
push   %rbx
mov    %edi,%ebx
call   1030 <num@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <decimal+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <dot@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @decimal(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @num(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @dot(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @decimal(i8 signext %0) {
%2 = tail call i64 @num(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @dot(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int test_imm_3Buint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x3B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Buint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x3b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Buint64_highword_mem>:
testb  $0x3b,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Buint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 59
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_3Buint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 253403070464
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int read_u8(unsigned char const *);
unsigned short read_u16(const unsigned char *b) {
  return (unsigned short)(read_u8(b) + (read_u8(b + 1) << 8));
}


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

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

LLVM IR (-O0):
define zeroext i16 @read_u16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @read_u8(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = call i32 @read_u8(i8* %6)
%8 = shl i32 %7, 8
%9 = add nsw i32 %4, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @read_u16(i8* %0) {
%2 = tail call i32 @read_u8(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = tail call i32 @read_u8(i8* %3)
%5 = shl i32 %4, 8
%6 = add nsw i32 %5, %2
%7 = trunc i32 %6 to i16
ret i16 %7
}
int cmp_int_qsort(const void *a, const void *b) {
  int *first = (int *)a;
  int *secnd = (int *)b;
  if (*first > *secnd)
    return 1;
  if (*first < *secnd)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_int_qsort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    113a <cmp_int_qsort+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115f <cmp_int_qsort+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <cmp_int_qsort+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <cmp_int_qsort+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int_qsort>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_int_qsort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
struct sembuf {
  int sem_op;
  scalar_t__ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ die(char *);
int semop(int, struct sembuf *, int);
void p(int semid) {
  struct sembuf sem_p;
  sem_p.sem_op = -1;
  sem_p.sem_num = 0;
  sem_p.sem_flg = 0;
  if (semop(semid, &sem_p, 1) == -1) {
    die("semop");
  }
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
cmp    $0xffffffff,%eax
jne    1168 <p+0x48>
lea    0xe9d(%rip),%rdi
call   1030 <die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
sub    $0x18,%rsp
movl   $0xffffffff,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
cmp    $0xffffffff,%eax
je     114a <p+0x2a>
add    $0x18,%rsp
ret
lea    0xeaf(%rip),%rdi
call   1030 <die@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i64, i64 }
@.str = [6 x i8] c"semop\00"
define void @p(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 0
store i32 -1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 1
store i64 0, i64* %6
%7 = load i32, i32* %2
%8 = call i32 @semop(i32 %7, %struct.sembuf* %3, i32 1)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @die(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i64, i64 }
@.str = [6 x i8] c"semop\00"
define void @p(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 -1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
%6 = bitcast i64* %5 to i8*
%7 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @die(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}
/* Variables and functions */
double **dmatrix(size_t const, size_t const);
int /*<<< orphan*/ memcpy_dmatrix(double **, double **const, size_t const,
                                  size_t const);
double **clone_dmatrix(double **const m, const size_t nrow, const size_t ncol) {
  double **m2 = dmatrix(nrow, ncol);
  memcpy_dmatrix(m2, m, nrow, ncol);
  return m2;
}


x86 assembly (clang, -O0):
<clone_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <dmatrix@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <memcpy_dmatrix@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone_dmatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <dmatrix@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1040 <memcpy_dmatrix@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double** @clone_dmatrix(double** %0, i64 %1, i64 %2) {
%4 = alloca double**
%5 = alloca i64
%6 = alloca i64
%7 = alloca double**
store double** %0, double*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call double** @dmatrix(i64 %8, i64 %9)
store double** %10, double*** %7
%11 = load double**, double*** %7
%12 = load double**, double*** %4
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = call i32 @memcpy_dmatrix(double** %11, double** %12, i64 %13, i64 %14)
%16 = load double**, double*** %7
ret double** %16
}

LLVM IR (-O2):
define double** @clone_dmatrix(double** %0, i64 %1, i64 %2) {
%4 = tail call double** @dmatrix(i64 %1, i64 %2)
%5 = tail call i32 @memcpy_dmatrix(double** %4, double** %0, i64 %1, i64 %2)
ret double** %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ recurser_void(int /*<<< orphan*/);
int main() {
  recurser_void(0);
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @recurser_void(i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long ps_faa(unsigned long *, long);
long ps_upfaa(unsigned long *var, long value) { return ps_faa(var, value); }


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

x86 assembly (clang, -O2):
<ps_upfaa>:
jmp    1030 <ps_faa@plt>

LLVM IR (-O0):
define i64 @ps_upfaa(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = call i64 @ps_faa(i64* %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @ps_upfaa(i64* %0, i64 %1) {
%3 = tail call i64 @ps_faa(i64* %0, i64 %1)
ret i64 %3
}
char *RCSid() {
  return RCSid("$Id: internal.c,v 1.67.2.2 2013/09/14 20:24:45 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"$Id: internal.c,v 1.67.2.2 2013/09/14 20:24:45 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int sum(int, int, int, int);
int main() { return sum(1, 2, 4, 8); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 2, i32 4, i32 8)
ret i32 %1
}
short doubleToFixed(double value) {
  long intValue = (long)32768 * value + 0.5;
  return intValue > 32767    ? 32767
         : intValue < -32768 ? -32768
                             : (short)intValue;
}


x86 assembly (clang, -O0):
<doubleToFixed>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x7fff,-0x10(%rbp)
jle    114a <doubleToFixed+0x4a>
mov    $0x7fff,%eax
mov    %eax,-0x14(%rbp)
jmp    1173 <doubleToFixed+0x73>
cmpq   $0xffffffffffff8000,-0x10(%rbp)
ff
jge    1165 <doubleToFixed+0x65>
mov    $0xffff8000,%eax
mov    %eax,-0x18(%rbp)
jmp    116d <doubleToFixed+0x6d>
mov    -0x10(%rbp),%rax
cwtl
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleToFixed>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
minsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define signext i16 @doubleToFixed(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 3.276800e+04, double %4, double 5.000000e-01)
%6 = fptosi double %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp sgt i64 %7, 32767
br i1 %8, label %9, label %10
9: ; preds = %1
br label %20
10: ; preds = %1
%11 = load i64, i64* %3
%12 = icmp slt i64 %11, -32768
br i1 %12, label %13, label %14
13: ; preds = %10
br label %18
14: ; preds = %10
%15 = load i64, i64* %3
%16 = trunc i64 %15 to i16
%17 = sext i16 %16 to i32
br label %18
18: ; preds = %14, %13
%19 = phi i32 [ -32768, %13 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %9
%21 = phi i32 [ 32767, %9 ], [ %19, %18 ]
%22 = trunc i32 %21 to i16
ret i16 %22
}

LLVM IR (-O2):
define signext i16 @doubleToFixed(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.276800e+04, double 5.000000e-01)
%3 = fptosi double %2 to i64
%4 = icmp sgt i64 %3, -32768
%5 = select i1 %4, i64 %3, i64 -32768
%6 = icmp slt i64 %5, 32767
%7 = select i1 %6, i64 %5, i64 32767
%8 = trunc i64 %7 to i16
ret i16 %8
}
void vtClr(float *vec, int N) {
  float *p1 = vec;
  for (int k = 0; k < N; k++) {
    *p1 = 0.0f;
    p1++;
  }
}


x86 assembly (clang, -O0):
<vtClr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114b <vtClr+0x4b>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <vtClr+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtClr>:
test   %esi,%esi
jle    1126 <vtClr+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @vtClr(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t getppid(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @getppid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getppid() {
ret i32 1
}
int prepare() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @prepare() {
ret i32 0
}
void signed_char_add_unsigned_char(signed char *LHS, unsigned char RHS) {
  (*LHS) += RHS;
}


x86 assembly (clang, -O0):
<signed_char_add_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_add_unsigned_char>:
add    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_add_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_add_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, %1
store i8 %4, i8* %0
ret void
}