xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
char *strcpy(char *, char *);
int strlen(char *);
char *stringdup(char *s) {
  char *result = (char *)malloc(sizeof(char) * (strlen(s) + 1));
  return strcpy(result, s);
}


x86 assembly (clang, -O0):
<stringdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @stringdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i8* @strcpy(i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @stringdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t rot16r3(uint16_t x) { return (x >> 3) | (x << 13); }


x86 assembly (clang, -O0):
<rot16r3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
mov    -0x4(%rbp),%ecx
shl    $0xd,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16r3>:
mov    %edi,%eax
sar    $0x3,%eax
shl    $0xd,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot16r3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = load i32, i32* %2
%6 = shl i32 %5, 13
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot16r3(i32 %0) {
%2 = ashr i32 %0, 3
%3 = shl i32 %0, 13
%4 = or i32 %2, %3
ret i32 %4
}
void of_overlay_mutex_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @of_overlay_mutex_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pic_disable();
void disable_irqs() { pic_disable(); }


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

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

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

LLVM IR (-O2):
define void @disable_irqs() {
%1 = tail call i32 (...) @pic_disable()
ret void
}
void foo_2_1_1_2_1_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_1_1_1_2() {
ret void
}
/* Variables and functions */
char toupper(char);
char *strupr(char *str) {
  char *c;
  c = str;
  while (*c) {
    *c = toupper(*c);
    c++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strupr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strupr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call signext i8 @toupper(i8 signext %11)
%13 = load i8*, i8** %3
store i8 %12, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %5
16: ; preds = %5
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double ShareRand(double min, double max) {
  double delta;
  double value;
  delta = max - min;
  value = (double)rand() / (RAND_MAX);
  value = min + delta * value;
  return value;
}


x86 assembly (clang, -O0):
<ShareRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ea4(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShareRand>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eae(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @ShareRand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
store double %9, double* %5
%10 = call i64 (...) @rand()
%11 = sitofp i64 %10 to double
%12 = load double, double* @RAND_MAX
%13 = fdiv double %11, %12
store double %13, double* %6
%14 = load double, double* %3
%15 = load double, double* %5
%16 = load double, double* %6
%17 = call double @llvm.fmuladd.f64(double %15, double %16, double %14)
store double %17, double* %6
%18 = load double, double* %6
ret double %18
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @ShareRand(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load double, double* @RAND_MAX
%7 = fdiv double %5, %6
%8 = tail call double @llvm.fmuladd.f64(double %3, double %7, double %0)
ret double %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysTickPeriodSet(uint32_t ui32Period) {
  ;
  (*((volatile unsigned long *)(0xE000E014))) = ui32Period - 1;
}


x86 assembly (clang, -O0):
<SysTickPeriodSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
mov    $0xe000e014,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickPeriodSet>:
add    $0xffffffff,%edi
movslq %edi,%rax
mov    $0xe000e014,%ecx
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @SysTickPeriodSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sext i32 %4 to i64
store volatile i64 %5, i64* inttoptr (i64 3758153748 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysTickPeriodSet(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sext i32 %2 to i64
store volatile i64 %3, i64* inttoptr (i64 3758153748 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
unsigned int spng_dec_go_to_image_data(FILE *fp) {
  fseek(fp, 823, SEEK_SET);
  return 1;
}


x86 assembly (clang, -O0):
<spng_dec_go_to_image_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    $0x337,%esi
call   1030 <fseek@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spng_dec_go_to_image_data>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
mov    $0x337,%esi
call   1030 <fseek@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @spng_dec_go_to_image_data(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i32 823, i32 %4)
ret i32 1
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @spng_dec_go_to_image_data(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i32 823, i32 %2)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int __infer_nondet_int();
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) {
  if (attr == 0)
    while (1)
      ;
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<pthread_mutexattr_settype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <pthread_mutexattr_settype+0x24>
jmp    112f <pthread_mutexattr_settype+0x1f>
jmp    112f <pthread_mutexattr_settype+0x1f>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutexattr_settype>:
test   %rdi,%rdi
je     1120 <pthread_mutexattr_settype+0x10>
xor    %eax,%eax
jmp    1030 <__infer_nondet_int@plt>
nopl   0x0(%rax)
jmp    1120 <pthread_mutexattr_settype+0x10>

LLVM IR (-O0):
define i32 @pthread_mutexattr_settype(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
br label %8
8: ; preds = %7, %8
br label %8
9: ; preds = %2
%10 = call i32 (...) @__infer_nondet_int()
ret i32 %10
}

LLVM IR (-O2):
define i32 @pthread_mutexattr_settype(i32* readnone %0, i32 %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %5
4: ; preds = %2, %4
br label %4
5: ; preds = %2
%6 = tail call i32 (...) @__infer_nondet_int()
ret i32 %6
}
void genericmultifunction(long other, char *bufptr, long messleng,
                          long command) {}


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

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

LLVM IR (-O0):
define void @genericmultifunction(i64 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
define void @genericmultifunction(i64 %0, i8* nocapture %1, i64 %2, i64 %3) {
ret void
}
/* Variables and functions */
double exp(double);
double kneecurve(double x, double k, double linearthreshold) {
  return linearthreshold + (1.0 - exp(-k * (x - linearthreshold))) / k;
}


x86 assembly (clang, -O0):
<kneecurve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
subsd  %xmm2,%xmm1
divsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kneecurve>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movapd %xmm1,0x10(%rsp)
movapd 0xed8(%rip),%xmm3
xorpd  %xmm1,%xmm3
subsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm0
call   1030 <exp@plt>
movsd  0xecf(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  0x10(%rsp),%xmm1
addsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @kneecurve(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %5
%9 = fneg double %8
%10 = load double, double* %4
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = fmul double %9, %12
%14 = call double @exp(double %13)
%15 = fsub double 1.000000e+00, %14
%16 = load double, double* %5
%17 = fdiv double %15, %16
%18 = fadd double %7, %17
ret double %18
}

LLVM IR (-O2):
define double @kneecurve(double %0, double %1, double %2) {
%4 = fneg double %1
%5 = fsub double %0, %2
%6 = fmul double %5, %4
%7 = tail call double @exp(double %6)
%8 = fsub double 1.000000e+00, %7
%9 = fdiv double %8, %1
%10 = fadd double %9, %2
ret double %10
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_container_to_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(6, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_container_to_target_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x6,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @copy_container_to_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 6, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_36(void) {
  if (*(uint32_t *)0x10000130ul == 0xAul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x1ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_36>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0xa,%rax
jne    1157 <errata_36+0x57>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_36+0x34>
movl   $0x1,-0x4(%rbp)
jmp    115e <errata_36+0x5e>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x1,%rax
jne    1152 <errata_36+0x52>
movl   $0x1,-0x4(%rbp)
jmp    115e <errata_36+0x5e>
jmp    1157 <errata_36+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @errata_36() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 10
br i1 %4, label %5, label %16
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %17
10: ; preds = %5
%11 = load i32, i32* inttoptr (i64 268435764 to i32*)
%12 = sext i32 %11 to i64
%13 = icmp eq i64 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %1
br label %17
15: ; preds = %10
br label %16
16: ; preds = %15, %0
store i32 1, i32* %1
br label %17
17: ; preds = %16, %14, %9
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @errata_36() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void error_quit(char *message) {
  if (message) {
    fprintf(stderr, "%s\n", message);
  } else {
    fprintf(stderr, "Unable to allocate more memory. Exiting...\n");
  }
  exit(1);
}


x86 assembly (clang, -O0):
<error_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <error_quit+0x37>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    116e <error_quit+0x4e>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_quit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
test   %rdx,%rdx
jne    114a <error_quit+0x2a>
lea    0xecb(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xeaf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [44 x i8] c"Unable to allocate more memory. Exiting...\0A\00"
define void @error_quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %5
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [44 x i8] c"Unable to allocate more memory. Exiting...\0A\00"
define void @error_quit(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = load i32, i32* @stderr
br i1 %2, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 1)
unreachable
}
void RasterSoftWareClkDisable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x6C)))) &= ~(0x00000001u);
}


x86 assembly (clang, -O0):
<RasterSoftWareClkDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x6c,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterSoftWareClkDisable>:
add    $0x6c,%edi
andl   $0xfffffffe,(%rdi)
ret

LLVM IR (-O0):
define void @RasterSoftWareClkDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 108
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterSoftWareClkDisable(i32 %0) {
%2 = add i32 %0, 108
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -2
store volatile i32 %6, i32* %4
ret void
}
int bit_get(unsigned int x, unsigned char pos) {
  if (pos < sizeof(unsigned int) * 8) {
    return (x & (1 << pos)) >> pos;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<bit_get>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x20,%rax
jae    113b <bit_get+0x3b>
mov    -0x8(%rbp),%eax
movzbl -0x9(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
movzbl -0x9(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <bit_get+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_get>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
and    %edi,%edx
shr    %cl,%edx
cmp    $0x20,%cl
mov    $0xffffffff,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @bit_get(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = icmp ult i64 %7, 32
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = shl i32 1, %12
%14 = and i32 %10, %13
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = lshr i32 %14, %16
store i32 %17, i32* %3
br label %19
18: ; preds = %2
store i32 -1, i32* %3
br label %19
19: ; preds = %18, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @bit_get(i32 %0, i8 zeroext %1) {
%3 = icmp ult i8 %1, 32
%4 = zext i8 %1 to i32
%5 = shl nuw i32 1, %4
%6 = and i32 %5, %0
%7 = lshr i32 %6, %4
%8 = select i1 %3, i32 %7, i32 -1
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int x264_tapfilter1(uint8_t *pix) {
  return pix[-2] - 5 * pix[-1] + 20 * (pix[0] + pix[1]) - 5 * pix[2] + pix[3];
}


x86 assembly (clang, -O0):
<x264_tapfilter1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   $0x5,-0x4(%rcx),%ecx
sub    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x8(%rbp),%rdx
add    0x4(%rdx),%ecx
imul   $0x14,%ecx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
imul   $0x5,0x8(%rcx),%ecx
sub    %ecx,%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_tapfilter1>:
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%ecx
add    (%rdi),%eax
lea    (%rax,%rax,4),%eax
shl    $0x2,%eax
add    -0x4(%rdi),%ecx
add    -0x8(%rdi),%eax
lea    (%rcx,%rcx,4),%ecx
add    0xc(%rdi),%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @x264_tapfilter1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -2
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 -1
%5 = load i32, i32* %4
%6 = load i32, i32* %0
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
%10 = mul nsw i32 %9, 20
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = add i32 %12, %5
%16 = mul i32 %15, -5
%17 = add i32 %10, %3
%18 = add i32 %17, %14
%19 = add i32 %18, %16
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ drv_T6_write_cmd(unsigned char const);
int /*<<< orphan*/ drv_T6_write_data(unsigned short const);
void drv_T6_send_word(const unsigned char cmd, const unsigned short data) {
  drv_T6_write_data(data & 0xff);
  drv_T6_write_data(data >> 8);
  drv_T6_write_cmd(cmd);
}


x86 assembly (clang, -O0):
<drv_T6_send_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
movzwl %ax,%edi
call   1030 <drv_T6_write_data@plt>
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
movzwl %ax,%edi
call   1030 <drv_T6_write_data@plt>
movzbl -0x1(%rbp),%edi
call   1040 <drv_T6_write_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_T6_send_word>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movzbl %bl,%edi
call   1030 <drv_T6_write_data@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
call   1030 <drv_T6_write_data@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <drv_T6_write_cmd@plt>

LLVM IR (-O0):
define void @drv_T6_send_word(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i16
%9 = call i32 @drv_T6_write_data(i16 zeroext %8)
%10 = load i16, i16* %4
%11 = zext i16 %10 to i32
%12 = ashr i32 %11, 8
%13 = trunc i32 %12 to i16
%14 = call i32 @drv_T6_write_data(i16 zeroext %13)
%15 = load i8, i8* %3
%16 = call i32 @drv_T6_write_cmd(i8 zeroext %15)
ret void
}

LLVM IR (-O2):
define void @drv_T6_send_word(i8 zeroext %0, i16 zeroext %1) {
%3 = and i16 %1, 255
%4 = tail call i32 @drv_T6_write_data(i16 zeroext %3)
%5 = lshr i16 %1, 8
%6 = tail call i32 @drv_T6_write_data(i16 zeroext %5)
%7 = tail call i32 @drv_T6_write_cmd(i8 zeroext %0)
ret void
}
void zlextshutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @zlextshutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char const *argv[]) {
  char buffer[256];
  while (1) {
    printf("Please enter the message: ");
    bzero(buffer, 256);
    fgets(buffer, 255, stdin);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1050 <bzero@plt>
lea    -0x110(%rbp),%rdi
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1040 <fgets@plt>
jmp    1149 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
lea    0xebd(%rip),%r14
mov    %rsp,%rbx
mov    0x2e9b(%rip),%r15
nopl   (%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <bzero@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1040 <fgets@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter the message: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %2, %7
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%10 = call i32 @bzero(i8* %9, i32 256)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* @stdin
%13 = call i32 @fgets(i8* %11, i32 255, i32 %12)
br label %7
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please enter the message: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %5, %2
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @bzero(i8* %4, i32 256)
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %4, i32 255, i32 %8)
br label %5
}
/* Variables and functions */
scalar_t__ beq();
int /*<<< orphan*/ inc(int, int);
int /*<<< orphan*/ jsr_inc_pointer();
int /*<<< orphan*/ jsr_reset_output();
int /*<<< orphan*/ lda(int, int);
int /*<<< orphan*/ sty(int, int);
void jsr_strlen() {
  jsr_reset_output();
  sty(1, 0xf4);
strlen_loop:
  lda(2, 0xfc);
  if (beq())
    goto strlen_done;
  inc(1, 0xf4);
  jsr_inc_pointer();
  goto strlen_loop;
strlen_done:;
}


x86 assembly (clang, -O0):
<jsr_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <jsr_reset_output@plt>
mov    $0x1,%edi
mov    $0xf4,%esi
call   1030 <sty@plt>
mov    $0x2,%edi
mov    $0xfc,%esi
call   1060 <lda@plt>
mov    $0x0,%al
call   1040 <beq@plt>
cmp    $0x0,%rax
je     119f <jsr_strlen+0x3f>
jmp    11ba <jsr_strlen+0x5a>
mov    $0x1,%edi
mov    $0xf4,%esi
call   1080 <inc@plt>
mov    $0x0,%al
call   1050 <jsr_inc_pointer@plt>
jmp    117a <jsr_strlen+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsr_strlen>:
push   %rax
xor    %eax,%eax
call   1070 <jsr_reset_output@plt>
mov    $0x1,%edi
mov    $0xf4,%esi
call   1030 <sty@plt>
nopw   0x0(%rax,%rax,1)
mov    $0x2,%edi
mov    $0xfc,%esi
call   1060 <lda@plt>
xor    %eax,%eax
call   1040 <beq@plt>
test   %rax,%rax
jne    11b3 <jsr_strlen+0x53>
mov    $0x1,%edi
mov    $0xf4,%esi
call   1080 <inc@plt>
xor    %eax,%eax
call   1050 <jsr_inc_pointer@plt>
jmp    1180 <jsr_strlen+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @jsr_strlen() {
%1 = call i32 (...) @jsr_reset_output()
%2 = call i32 @sty(i32 1, i32 244)
br label %3
3: ; preds = %8, %0
%4 = call i32 @lda(i32 2, i32 252)
%5 = call i64 (...) @beq()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %11
8: ; preds = %3
%9 = call i32 @inc(i32 1, i32 244)
%10 = call i32 (...) @jsr_inc_pointer()
br label %3
11: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @jsr_strlen() {
%1 = tail call i32 (...) @jsr_reset_output()
%2 = tail call i32 @sty(i32 1, i32 244)
%3 = tail call i32 @lda(i32 2, i32 252)
%4 = tail call i64 (...) @beq()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = tail call i32 @inc(i32 1, i32 244)
%8 = tail call i32 (...) @jsr_inc_pointer()
%9 = tail call i32 @lda(i32 2, i32 252)
%10 = tail call i64 (...) @beq()
%11 = icmp eq i64 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret void
}
/* Variables and functions */
double sqrt(double const);
double radius_from_diagonal(double radius_minor, double r_ratio,
                            double length) {
  const double radius_max =
      (r_ratio > 1.0 ? radius_minor * r_ratio : radius_minor);
  return sqrt(radius_max * radius_max + 0.25 * length * length);
}


x86 assembly (clang, -O0):
<radius_from_diagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1152 <radius_from_diagonal+0x42>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115c <radius_from_diagonal+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xe90(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_from_diagonal>:
maxsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1146 <radius_from_diagonal+0x36>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
ret
movapd %xmm1,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @radius_from_diagonal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = fcmp ogt double %8, 1.000000e+00
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fmul double %11, %12
br label %16
14: ; preds = %3
%15 = load double, double* %4
br label %16
16: ; preds = %14, %10
%17 = phi double [ %13, %10 ], [ %15, %14 ]
store double %17, double* %7
%18 = load double, double* %7
%19 = load double, double* %7
%20 = load double, double* %6
%21 = fmul double 2.500000e-01, %20
%22 = load double, double* %6
%23 = fmul double %21, %22
%24 = call double @llvm.fmuladd.f64(double %18, double %19, double %23)
%25 = call double @sqrt(double %24)
ret double %25
}

LLVM IR (-O2):
define double @radius_from_diagonal(double %0, double %1, double %2) {
%4 = fcmp ogt double %1, 1.000000e+00
%5 = select i1 %4, double %1, double 1.000000e+00
%6 = fmul double %5, %0
%7 = fmul double %2, 2.500000e-01
%8 = fmul double %7, %2
%9 = tail call double @llvm.fmuladd.f64(double %6, double %6, double %8)
%10 = tail call double @sqrt(double %9)
ret double %10
}
void g_cclosure_marshal_VOID__BOOLEAN() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_VOID__BOOLEAN() {
ret void
}
double v3_dotproduct(double v1[3], double v2[3]) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<v3_dotproduct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3_dotproduct>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @v3_dotproduct(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @v3_dotproduct(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void copiar(FILE *tx, FILE *tx2) {
  int ch;
  while (!feof(tx)) {
    ch = fgetc(tx);
    fputc(ch, tx2);
  }
}


x86 assembly (clang, -O0):
<copiar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115e <copiar+0x2e>
jmp    117b <copiar+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fputc@plt>
jmp    1140 <copiar+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copiar>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
call   1050 <feof@plt>
test   %eax,%eax
jne    1160 <copiar+0x30>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
jmp    1140 <copiar+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @copiar(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = call i32 @feof(i32* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i32*, i32** %3
%13 = call i32 @fgetc(i32* %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32*, i32** %4
%16 = call i32 @fputc(i32 %14, i32* %15)
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @copiar(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = tail call i32 @fgetc(i32* %0)
%7 = tail call i32 @fputc(i32 %6, i32* %1)
%8 = tail call i32 @feof(i32* %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %2
ret void
}
void good_expr(const int *p) {
  __builtin_prefetch(p, 1 - 1, 6 - (2 * 3));
  __builtin_prefetch(p, 1 + 0, 1 + 2);
}


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

x86 assembly (clang, -O2):
<good_expr>:
prefetchnta (%rdi)
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @good_expr(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
tail call void @llvm.prefetch.p0i8(i8* %2, i32 0, i32 0, i32 1)
tail call void @llvm.prefetch.p0i8(i8* %2, i32 1, i32 3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_silence_cache_init() {
  printf("NOT IMPLEMENTED:"
         "pa_silence_cache_init"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_silence_cache_init\00"
define i32 @pa_silence_cache_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned char iColorQuantize(double value) {
  if (value >= 1.0)
    return 255;
  if (value <= 0.0)
    return 0;
  return (unsigned char)(value * 256);
}


x86 assembly (clang, -O0):
<iColorQuantize>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1129 <iColorQuantize+0x29>
movb   $0xff,-0x1(%rbp)
jmp    1158 <iColorQuantize+0x58>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1140 <iColorQuantize+0x40>
movb   $0x0,-0x1(%rbp)
jmp    1158 <iColorQuantize+0x58>
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iColorQuantize>:
mov    $0xff,%al
ucomisd 0xef6(%rip),%xmm0
jae    1122 <iColorQuantize+0x22>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1123 <iColorQuantize+0x23>
mulsd  0xeea(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @iColorQuantize(double %0) {
%2 = alloca i8
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 1.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 -1, i8* %2
br label %15
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ole double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 0, i8* %2
br label %15
11: ; preds = %7
%12 = load double, double* %3
%13 = fmul double %12, 2.560000e+02
%14 = fptoui double %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %11, %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @iColorQuantize(double %0) {
%2 = fcmp ult double %0, 1.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fcmp ugt double %0, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = fmul double %0, 2.560000e+02
%7 = fptoui double %6 to i8
br label %8
8: ; preds = %3, %1, %5
%9 = phi i8 [ %7, %5 ], [ -1, %1 ], [ 0, %3 ]
ret i8 %9
}
/* Variables and functions */
double range(double);
double gst(double d) {
  double t = d / 36525;
  double theta;
  theta = range(280.46061837 + 360.98564736629 * d + 0.000387933 * t * t);
  return (theta * 0.0174532925199433);
}


x86 assembly (clang, -O0):
<gst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xed0(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xecc(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <range@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe84(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gst>:
push   %rax
movapd %xmm0,%xmm1
divsd  0xee3(%rip),%xmm1
mulsd  0xee3(%rip),%xmm0
addsd  0xee3(%rip),%xmm0
movsd  0xee3(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
call   1030 <range@plt>
mulsd  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gst(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 3.652500e+04
store double %6, double* %3
%7 = load double, double* %2
%8 = call double @llvm.fmuladd.f64(double 0x40768FC5362C39AA, double %7, double 0x4071875EB15E3164)
%9 = load double, double* %3
%10 = fmul double 3.879330e-04, %9
%11 = load double, double* %3
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double %8)
%13 = call double @range(double %12)
store double %13, double* %4
%14 = load double, double* %4
%15 = fmul double %14, 0x3F91DF46A2529D3A
ret double %15
}

LLVM IR (-O2):
define double @gst(double %0) {
%2 = fdiv double %0, 3.652500e+04
%3 = tail call double @llvm.fmuladd.f64(double %0, double 0x40768FC5362C39AA, double 0x4071875EB15E3164)
%4 = fmul double %2, 3.879330e-04
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %3)
%6 = tail call double @range(double %5)
%7 = fmul double %6, 0x3F91DF46A2529D3A
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ ttflush();
int /*<<< orphan*/ ttputc(char);
int ansieeop() {
  ttflush();
  ttputc(0x1B);
  ttputc('[');
  ttputc('J');
  return 0;
}


x86 assembly (clang, -O0):
<ansieeop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ttflush@plt>
mov    $0x1b,%edi
call   1040 <ttputc@plt>
mov    $0x5b,%edi
call   1040 <ttputc@plt>
mov    $0x4a,%edi
call   1040 <ttputc@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansieeop>:
push   %rax
xor    %eax,%eax
call   1030 <ttflush@plt>
mov    $0x1b,%edi
call   1040 <ttputc@plt>
mov    $0x5b,%edi
call   1040 <ttputc@plt>
mov    $0x4a,%edi
call   1040 <ttputc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ansieeop() {
%1 = call i32 (...) @ttflush()
%2 = call i32 @ttputc(i8 signext 27)
%3 = call i32 @ttputc(i8 signext 91)
%4 = call i32 @ttputc(i8 signext 74)
ret i32 0
}

LLVM IR (-O2):
define i32 @ansieeop() {
%1 = tail call i32 (...) @ttflush()
%2 = tail call i32 @ttputc(i8 signext 27)
%3 = tail call i32 @ttputc(i8 signext 91)
%4 = tail call i32 @ttputc(i8 signext 74)
ret i32 0
}
double fahrenheit(double celsius) { return celsius * (9.0 / 5.0) + 32.0; }


x86 assembly (clang, -O0):
<fahrenheit>:
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
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fahrenheit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 1.800000e+00, double 3.200000e+01)
ret double %4
}

LLVM IR (-O2):
define double @fahrenheit(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.800000e+00, double 3.200000e+01)
ret double %2
}