xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
float rand_float(int positive_only) {
  if (positive_only)
    return (float)((double)rand() / (double)RAND_MAX);
  else
    return (float)(((double)rand() / (double)RAND_MAX * 2.0) - 1.0);
}


x86 assembly (clang, -O0):
<rand_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <rand_float+0x3f>
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb0(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1184 <rand_float+0x74>
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e86(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  0xe89(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_float>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec2(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
test   %ebx,%ebx
jne    113f <rand_float+0x2f>
addsd  %xmm0,%xmm0
addsd  0xec1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @rand_float(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = call i64 (...) @rand()
%8 = sitofp i64 %7 to double
%9 = load i64, i64* @RAND_MAX
%10 = sitofp i64 %9 to double
%11 = fdiv double %8, %10
%12 = fptrunc double %11 to float
store float %12, float* %2
br label %21
13: ; preds = %1
%14 = call i64 (...) @rand()
%15 = sitofp i64 %14 to double
%16 = load i64, i64* @RAND_MAX
%17 = sitofp i64 %16 to double
%18 = fdiv double %15, %17
%19 = call double @llvm.fmuladd.f64(double %18, double 2.000000e+00, double -1.000000e+00)
%20 = fptrunc double %19 to float
store float %20, float* %2
br label %21
21: ; preds = %13, %6
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @rand_float(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 2.000000e+00, double -1.000000e+00)
%9 = select i1 %2, double %8, double %7
%10 = fptrunc double %9 to float
ret float %10
}
/* Variables and functions */
double sqrt(double);
double bsvm2_ssqrt(double x) { return ((x > 0) ? sqrt(x) : (-sqrt(-x))); }


x86 assembly (clang, -O0):
<bsvm2_ssqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1143 <bsvm2_ssqrt+0x33>
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1180 <bsvm2_ssqrt+0x70>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsvm2_ssqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1121 <bsvm2_ssqrt+0x11>
jb     1145 <bsvm2_ssqrt+0x35>
sqrtsd %xmm0,%xmm0
ret
push   %rax
movapd 0xed6(%rip),%xmm1
xorpd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm2
ucomisd %xmm0,%xmm2
jb     114a <bsvm2_ssqrt+0x3a>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1153 <bsvm2_ssqrt+0x43>
jmp    1030 <sqrt@plt>
movapd %xmm1,%xmm0
call   1030 <sqrt@plt>
xorpd  0xea5(%rip),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define double @bsvm2_ssqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @sqrt(double %6)
br label %13
8: ; preds = %1
%9 = load double, double* %2
%10 = fneg double %9
%11 = call double @sqrt(double %10)
%12 = fneg double %11
br label %13
13: ; preds = %8, %5
%14 = phi double [ %7, %5 ], [ %12, %8 ]
ret double %14
}

LLVM IR (-O2):
define double @bsvm2_ssqrt(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
br label %9
5: ; preds = %1
%6 = fneg double %0
%7 = tail call double @sqrt(double %6)
%8 = fneg double %7
br label %9
9: ; preds = %5, %3
%10 = phi double [ %4, %3 ], [ %8, %5 ]
ret double %10
}
/* Type definitions */
struct fuse_file_info {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int afp_meta_read(const char *path, char *buf, size_t size, off_t offset,
                  struct fuse_file_info *fi) {}


x86 assembly (clang, -O0):
<afp_meta_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fuse_file_info = type { i32 }
define i32 @afp_meta_read(i8* %0, i8* %1, i64 %2, i32 %3, %struct.fuse_file_info* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.fuse_file_info*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.fuse_file_info* %4, %struct.fuse_file_info** %11
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
%struct.fuse_file_info = type { i32 }
define i32 @afp_meta_read(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3, %struct.fuse_file_info* nocapture readnone %4) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr_fd(char const *, int);
void ft_putstr(const char *s) { ft_putstr_fd(s, 1); }


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

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

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = tail call i32 @ft_putstr_fd(i8* %0, i32 1)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int /*<<< orphan*/ log(double);
double pow(int /*<<< orphan*/, int);
scalar_t__ rand();
double rweibull(double wscale, double wshape) {
  double zufall;
  zufall = ((double)rand() / (double)(RAND_MAX));
  return (wscale * pow((-log(zufall)), (1 / wshape)));
}


x86 assembly (clang, -O0):
<rweibull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e93(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log@plt>
xor    %edi,%edi
sub    %eax,%edi
movsd  0xe7d(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rweibull>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2e92(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
neg    %eax
movsd  0xe8f(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%esi
mov    %eax,%edi
call   1040 <pow@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rweibull(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to double
%10 = fdiv double %7, %9
store double %10, double* %5
%11 = load double, double* %3
%12 = load double, double* %5
%13 = call i32 @log(double %12)
%14 = sub nsw i32 0, %13
%15 = load double, double* %4
%16 = fdiv double 1.000000e+00, %15
%17 = fptosi double %16 to i32
%18 = call double @pow(i32 %14, i32 %17)
%19 = fmul double %11, %18
ret double %19
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rweibull(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = tail call i32 @log(double %7)
%9 = sub nsw i32 0, %8
%10 = fdiv double 1.000000e+00, %1
%11 = fptosi double %10 to i32
%12 = tail call double @pow(i32 %9, i32 %11)
%13 = fmul double %12, %0
ret double %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void yieldcpu(uint32_t ms) { usleep(ms * 1000); }


x86 assembly (clang, -O0):
<yieldcpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yieldcpu>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @yieldcpu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @yieldcpu(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mat3d_rotateQuatVec_new(double *, double const *);
int /*<<< orphan*/ mat4d_from_mat3d(double *, double *);
void mat4d_rotateQuatVec_new(double matrix[16], const double quat[4]) {
  double tmpMat[9];
  mat3d_rotateQuatVec_new(tmpMat, quat);
  mat4d_from_mat3d(matrix, tmpMat);
}


x86 assembly (clang, -O0):
<mat4d_rotateQuatVec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mat3d_rotateQuatVec_new@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <mat4d_from_mat3d@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4d_rotateQuatVec_new>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <mat3d_rotateQuatVec_new@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <mat4d_from_mat3d@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mat4d_rotateQuatVec_new(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [9 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%7 = load double*, double** %4
%8 = call i32 @mat3d_rotateQuatVec_new(double* %6, double* %7)
%9 = load double*, double** %3
%10 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%11 = call i32 @mat4d_from_mat3d(double* %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @mat4d_rotateQuatVec_new(double* %0, double* %1) {
%3 = alloca [9 x double]
%4 = bitcast [9 x double]* %3 to i8*
%5 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 0
%6 = call i32 @mat3d_rotateQuatVec_new(double* %5, double* %1)
%7 = call i32 @mat4d_from_mat3d(double* %0, double* %5)
ret void
}
/* Variables and functions */
size_t vec_len(void *);
extern size_t vec_size(void *vec) { return vec_len(vec); }


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

x86 assembly (clang, -O2):
<vec_size>:
jmp    1030 <vec_len@plt>

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

LLVM IR (-O2):
define i64 @vec_size(i8* %0) {
%2 = tail call i64 @vec_len(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
gen_jump_case() { gen_call("^case"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"^case\00"
define i32 @gen_jump_case() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int fsize(char const *);
int file_size_(const char *fname, int len) { return fsize(fname); }


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

x86 assembly (clang, -O2):
<file_size_>:
jmp    1030 <fsize@plt>

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

LLVM IR (-O2):
define i32 @file_size_(i8* %0, i32 %1) {
%3 = tail call i32 @fsize(i8* %0)
ret i32 %3
}
float get_color_interval_inv(float max) {
  if (max < 4.0f)
    max = 4.0f;
  return (float)4 / max;
}


x86 assembly (clang, -O0):
<get_color_interval_inv>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1128 <get_color_interval_inv+0x28>
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xed0(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_color_interval_inv>:
movss  0xef8(%rip),%xmm1
movaps %xmm1,%xmm2
maxss  %xmm0,%xmm2
divss  %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @get_color_interval_inv(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 4.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
store float 4.000000e+00, float* %2
br label %6
6: ; preds = %5, %1
%7 = load float, float* %2
%8 = fdiv float 4.000000e+00, %7
ret float %8
}

LLVM IR (-O2):
define float @get_color_interval_inv(float %0) {
%2 = fcmp olt float %0, 4.000000e+00
%3 = select i1 %2, float 4.000000e+00, float %0
%4 = fdiv float 4.000000e+00, %3
ret float %4
}
/* Variables and functions */
void *memalign(size_t, size_t);
int posix_memalign(void **memptr, size_t alignment, size_t size) {
  *memptr = memalign(alignment, size);
  return *memptr == NULL;
}


x86 assembly (clang, -O0):
<posix_memalign>:
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 <memalign@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_memalign>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <memalign@plt>
mov    %rax,(%rbx)
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @posix_memalign(i8** %0, i64 %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %6
%9 = call i8* @memalign(i64 %7, i64 %8)
%10 = load i8**, i8*** %4
store i8* %9, i8** %10
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @posix_memalign(i8** nocapture writeonly %0, i64 %1, i64 %2) {
%4 = tail call i8* @memalign(i64 %1, i64 %2)
store i8* %4, i8** %0
%5 = icmp eq i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
void my_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @my_exit() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int embed_quaddobl_Laurent_system(int d) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(627, &d, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<embed_quaddobl_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x273,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<embed_quaddobl_Laurent_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x273,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @embed_quaddobl_Laurent_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 627, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int random_uint32();
uint32_t random_uint(uint32_t n) { return (random_uint32() >> 8) % n; }


x86 assembly (clang, -O0):
<random_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random_uint32@plt>
sar    $0x8,%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_uint>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random_uint32@plt>
sar    $0x8,%eax
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_uint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @random_uint32()
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @random_uint(i32 %0) {
%2 = tail call i32 (...) @random_uint32()
%3 = ashr i32 %2, 8
%4 = srem i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *strdup(char *);
int /*<<< orphan*/ yyerror(char *);
char *newstr(char *yyInText) {
  char *p;
  if (!(p = strdup(yyInText))) {
    yyerror("newstr: out of space");
    abort();
  }
  p = strdup(yyInText);
  return p;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1166 <newstr+0x36>
lea    0xea6(%rip),%rdi
call   1040 <yyerror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"newstr: out of space\00"
define i8* @newstr(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 %10, label %7
7: ; preds = %1
%8 = call i32 @yyerror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @newstr(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmpfunc(const void *a, const void *b) {
  const char *pa = *(const char **)a;
  const char *pb = *(const char **)b;
  return strcmp(pa, pb);
}


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

x86 assembly (clang, -O2):
<cmpfunc>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void catch_sigchild(int sig) {}


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

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

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

LLVM IR (-O2):
define void @catch_sigchild(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int do_pk8pkey_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int,
                  int /*<<< orphan*/ const *, char *, int, int /*<<< orphan*/ *,
                  void *);
int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
                           char *kstr, int klen, pem_password_cb *cb, void *u) {
  return do_pk8pkey_fp(fp, x, 1, -1, enc, kstr, klen, cb, u);
}


x86 assembly (clang, -O0):
<i2d_PKCS8PrivateKey_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
mov    $0x1,%edx
mov    $0xffffffff,%ecx
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <do_pk8pkey_fp@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_PKCS8PrivateKey_fp>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %rdx,%r8
sub    $0x8,%rsp
mov    $0x1,%edx
mov    $0xffffffff,%ecx
push   0x18(%rsp)
push   %rax
push   %r10
call   1030 <do_pk8pkey_fp@plt>
add    $0x20,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @i2d_PKCS8PrivateKey_fp(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = tail call i32 @do_pk8pkey_fp(i32* %0, i32* %1, i32 1, i32 -1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6)
ret i32 %8
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
struct session *do_bell(struct session *ses, char *arg) {
  printf("\007");
  return ses;
}


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

x86 assembly (clang, -O2):
<do_bell>:
push   %rbx
mov    %rdi,%rbx
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [2 x i8] c"\07\00"
define %struct.session* @do_bell(%struct.session* %0, i8* %1) {
%3 = alloca %struct.session*
%4 = alloca i8*
store %struct.session* %0, %struct.session** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.session*, %struct.session** %3
ret %struct.session* %6
}

LLVM IR (-O2):
%struct.session = type { i32 }
define %struct.session* @do_bell(%struct.session* readnone returned %0, i8* nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 7)
ret %struct.session* %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long double wfaxb(long double, long double, long double);
int main(void) { assert(wfaxb(1.11L, 2.22L, 3.33L) == 6.66L); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rsp,%rax
fldt   0xecf(%rip)
fstpt  0x20(%rax)
fldt   0xed6(%rip)
fstpt  0x10(%rax)
fldt   0xedd(%rip)
fstpt  (%rax)
call   1030 <wfaxb@plt>
fldt   0xee0(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
fldt   0xed6(%rip)
fstpt  0x20(%rsp)
fldt   0xedc(%rip)
fstpt  0x10(%rsp)
fldt   0xee2(%rip)
fstpt  (%rsp)
call   1030 <wfaxb@plt>
fldt   0xee4(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call x86_fp80 @wfaxb(x86_fp80 0xK3FFF8E147AE147AE147B, x86_fp80 0xK40008E147AE147AE147B, x86_fp80 0xK4000D51EB851EB851EB8)
%2 = fcmp oeq x86_fp80 %1, 0xK4001D51EB851EB851EB8
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call x86_fp80 @wfaxb(x86_fp80 0xK3FFF8E147AE147AE147B, x86_fp80 0xK40008E147AE147AE147B, x86_fp80 0xK4000D51EB851EB851EB8)
%2 = fcmp oeq x86_fp80 %1, 0xK4001D51EB851EB851EB8
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AL_writeDelay(int);
int /*<<< orphan*/ writePort1(int, unsigned char);
void AL_writeRegister(int number, unsigned char data) {
  writePort1(0X388, number);
  AL_writeDelay(6);
  writePort1((0X388 + 1), data);
  AL_writeDelay(35);
}


x86 assembly (clang, -O0):
<AL_writeRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x388,%edi
movzbl %al,%esi
call   1040 <writePort1@plt>
mov    $0x6,%edi
call   1030 <AL_writeDelay@plt>
mov    $0x389,%edi
movzbl -0x5(%rbp),%esi
call   1040 <writePort1@plt>
mov    $0x23,%edi
call   1030 <AL_writeDelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AL_writeRegister>:
push   %rbx
mov    %esi,%ebx
movzbl %dil,%esi
mov    $0x388,%edi
call   1040 <writePort1@plt>
mov    $0x6,%edi
call   1030 <AL_writeDelay@plt>
mov    $0x389,%edi
mov    %ebx,%esi
call   1040 <writePort1@plt>
mov    $0x23,%edi
pop    %rbx
jmp    1030 <AL_writeDelay@plt>

LLVM IR (-O0):
define void @AL_writeRegister(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i8
%7 = call i32 @writePort1(i32 904, i8 zeroext %6)
%8 = call i32 @AL_writeDelay(i32 6)
%9 = load i8, i8* %4
%10 = call i32 @writePort1(i32 905, i8 zeroext %9)
%11 = call i32 @AL_writeDelay(i32 35)
ret void
}

LLVM IR (-O2):
define void @AL_writeRegister(i32 %0, i8 zeroext %1) {
%3 = trunc i32 %0 to i8
%4 = tail call i32 @writePort1(i32 904, i8 zeroext %3)
%5 = tail call i32 @AL_writeDelay(i32 6)
%6 = tail call i32 @writePort1(i32 905, i8 zeroext %1)
%7 = tail call i32 @AL_writeDelay(i32 35)
ret void
}
int maxCharacter(void) { return 21; }


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

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

LLVM IR (-O0):
define i32 @maxCharacter() {
ret i32 21
}

LLVM IR (-O2):
define i32 @maxCharacter() {
ret i32 21
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int test_qbbc_reg(int, int, unsigned int);
int main(int argc, char **argv) {
  if (test_qbbc_reg(101, 505, (1u << 19)) != 505)
    abort();
  if (test_qbbc_reg(101, 505, (1u << 18)) != 101)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x65,%edi
mov    $0x1f9,%esi
mov    $0x80000,%edx
call   1040 <test_qbbc_reg@plt>
cmp    $0x1f9,%eax
je     115c <main+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x65,%edi
mov    $0x1f9,%esi
mov    $0x40000,%edx
call   1040 <test_qbbc_reg@plt>
cmp    $0x65,%eax
je     1180 <main+0x60>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x65,%edi
mov    $0x1f9,%esi
mov    $0x80000,%edx
call   1040 <test_qbbc_reg@plt>
cmp    $0x1f9,%eax
jne    1159 <main+0x39>
mov    $0x65,%edi
mov    $0x1f9,%esi
mov    $0x40000,%edx
call   1040 <test_qbbc_reg@plt>
cmp    $0x65,%eax
jne    1159 <main+0x39>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @test_qbbc_reg(i32 101, i32 505, i32 524288)
%7 = icmp ne i32 %6, 505
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
%11 = call i32 @test_qbbc_reg(i32 101, i32 505, i32 262144)
%12 = icmp ne i32 %11, 101
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_qbbc_reg(i32 101, i32 505, i32 524288)
%4 = icmp eq i32 %3, 505
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32 @test_qbbc_reg(i32 101, i32 505, i32 262144)
%9 = icmp eq i32 %8, 101
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ concat(char *, char *);
void qr_diran(char *binary, int data, int h) {
  for (; h; h >>= 1) {
    concat(binary, data & h ? "1" : "0");
  }
}


x86 assembly (clang, -O0):
<qr_diran>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115e <qr_diran+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    -0x10(%rbp),%ecx
lea    0xec5(%rip),%rsi
lea    0xebc(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   1030 <concat@plt>
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1122 <qr_diran+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qr_diran>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     115b <qr_diran+0x4b>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%r13
lea    0xed4(%rip),%r15
lea    0xecb(%rip),%r12
mov    %edx,%ebp
nopw   0x0(%rax,%rax,1)
test   %r14d,%ebx
mov    %r12,%rsi
cmove  %r15,%rsi
mov    %r13,%rdi
call   1030 <concat@plt>
sar    %ebp
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1140 <qr_diran+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @qr_diran(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %19, %3
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%18 = call i32 @concat(i8* %11, i8* %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %6
%21 = ashr i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @qr_diran(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ %2, %3 ]
%7 = and i32 %6, %1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%10 = tail call i32 @concat(i8* %0, i8* %9)
%11 = ashr i32 %6, 1
%12 = icmp ult i32 %6, 2
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
int atoi(const char *str) {
  int val = 0;
  for (;; str++) {
    switch (*str) {
    case '0' ... '9':
      val = 10 * val + (*str - '0');
      break;
    default:
      return val;
    }
  }
  return val;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffd0,%eax
sub    $0x9,%eax
ja     113f <atoi+0x3f>
jmp    1127 <atoi+0x27>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <atoi+0x44>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    1149 <atoi+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <atoi+0xf>

x86 assembly (clang, -O2):
<atoi>:
movsbl (%rdi),%ecx
add    $0xffffffd0,%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
ja     1135 <atoi+0x35>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
movsbl (%rdi),%ecx
add    $0xffffffd0,%ecx
add    $0x1,%rdi
cmp    $0xa,%ecx
jb     1120 <atoi+0x20>
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %16 [
i32 48, label %8
i32 49, label %8
i32 50, label %8
i32 51, label %8
i32 52, label %8
i32 53, label %8
i32 54, label %8
i32 55, label %8
i32 56, label %8
i32 57, label %8
]
8: ; preds = %4, %4, %4, %4, %4, %4, %4, %4, %4, %4
%9 = load i32, i32* %3
%10 = mul nsw i32 10, %9
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = add nsw i32 %10, %14
store i32 %15, i32* %3
br label %18
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
18: ; preds = %8
br label %19
19: ; preds = %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %4
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -48
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %17
6: ; preds = %1, %6
%7 = phi i32 [ %15, %6 ], [ %4, %1 ]
%8 = phi i32 [ %11, %6 ], [ 0, %1 ]
%9 = phi i8* [ %12, %6 ], [ %0, %1 ]
%10 = mul nsw i32 %8, 10
%11 = add nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, -48
%16 = icmp ult i32 %15, 10
br i1 %16, label %6, label %17
17: ; preds = %6, %1
%18 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %18
}
/* Variables and functions */
long double strtod(char const *, char **);
long double strtold(const char *s, char **end) { return strtod(s, end); }


x86 assembly (clang, -O0):
<strtold>:
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 <strtod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtold>:
jmp    1030 <strtod@plt>

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

LLVM IR (-O2):
define x86_fp80 @strtold(i8* %0, i8** nocapture %1) {
%3 = tail call x86_fp80 @strtod(i8* %0, i8** %1)
ret x86_fp80 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ RC4_KEY;

/* Variables and functions */
void *g_malloc(int, int);
void *ssl_rc4_info_create(void) { return g_malloc(sizeof(RC4_KEY), 1); }


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

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

LLVM IR (-O0):
define i8* @ssl_rc4_info_create() {
%1 = call i8* @g_malloc(i32 4, i32 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @ssl_rc4_info_create() {
%1 = tail call i8* @g_malloc(i32 4, i32 1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ swapc2n_(float *, float *, int *, int *, int *, int *, int *,
                            int *, int *);
void cswapc2n(float f[], float s[], int isign, int nxh, int nyi, int nyt,
              int nxhd, int nyd, int ndim) {
  swapc2n_(f, s, &isign, &nxh, &nyi, &nyt, &nxhd, &nyd, &ndim);
  return;
}


x86 assembly (clang, -O0):
<cswapc2n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    0x10(%rbp),%r11
lea    0x18(%rbp),%r10
lea    0x20(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <swapc2n_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cswapc2n>:
sub    $0x18,%rsp
mov    %edx,0x14(%rsp)
mov    %ecx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
mov    %r9d,0x8(%rsp)
sub    $0x8,%rsp
lea    0x38(%rsp),%rax
lea    0x30(%rsp),%r10
lea    0x28(%rsp),%r11
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x10(%rsp),%r9
push   %rax
push   %r10
push   %r11
call   1030 <swapc2n_@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @cswapc2n(float* %0, float* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca float*
%11 = alloca float*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store float* %0, float** %10
store float* %1, float** %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load float*, float** %10
%20 = load float*, float** %11
%21 = call i32 @swapc2n_(float* %19, float* %20, i32* %12, i32* %13, i32* %14, i32* %15, i32* %16, i32* %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @cswapc2n(float* %0, float* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
store i32 %7, i32* %15
store i32 %8, i32* %16
%17 = call i32 @swapc2n_(float* %0, float* %1, i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32* %16)
ret void
}
int main0() {
  int *arr0 = (int *)0x00000000;
  int *arr1 = (int *)0x02000000;
  *(arr0 + 0) = 0;
  *(arr1 + 0) = 0;
  for (int i = 0; i < 20; i++) {
    *(arr0 + 0) += 1;
    *(arr1 + 0) += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main0>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    $0x2000000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    115e <main0+0x5e>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <main0+0x30>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main0() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
store i32* null, i32** %1
store i32* inttoptr (i64 33554432 to i32*), i32** %2
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 0, i32* %5
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 0, i32* %7
store i32 0, i32* %3
br label %8
8: ; preds = %20, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 20
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %17
br label %20
20: ; preds = %11
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %8
23: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
OP(ed, cb) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
int boink() {
  char *x = "__attribute__((rah))";
  __attribute__((oink)) int y;
}


x86 assembly (clang, -O0):
<boink>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @boink() {
ret i32 undef
}
int char_value(char c) { return c < '0' || c > '9' ? -1 : c - '0'; }


x86 assembly (clang, -O0):
<char_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <char_value+0x24>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jle    1131 <char_value+0x31>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <char_value+0x3b>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_value>:
lea    -0x3a(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xf6,%al
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @char_value(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 48
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %8, 57
br i1 %9, label %10, label %11
10: ; preds = %6, %1
br label %15
11: ; preds = %6
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
br label %15
15: ; preds = %11, %10
%16 = phi i32 [ -1, %10 ], [ %14, %11 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @char_value(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -58
%4 = icmp ult i8 %3, -10
%5 = add nsw i32 %2, -48
%6 = select i1 %4, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void OutC(char c) { fputc(c, stdout); }


x86 assembly (clang, -O0):
<OutC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OutC>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @OutC(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputc(i8 signext %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @OutC(i8 signext %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i8 signext %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __ieee754_acoshl(long double x) {
  fputs("__ieee754_acoshl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__ieee754_acoshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ieee754_acoshl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [34 x i8] c"__ieee754_acoshl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_acoshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [34 x i8] c"__ieee754_acoshl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_acoshl(x86_fp80 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret x86_fp80 0xK00000000000000000000
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ *stdscr;
WINDOW *returnstd(void) { return (stdscr); }


x86 assembly (clang, -O0):
<returnstd>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnstd>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stdscr = global i32* null
define i32* @returnstd() {
%1 = load i32*, i32** @stdscr
ret i32* %1
}

LLVM IR (-O2):
@stdscr = global i32* null
define i32* @returnstd() {
%1 = load i32*, i32** @stdscr
ret i32* %1
}