xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void PRCMGPTimerClockDivisionSet(uint32_t clkDiv) {
  ;
  (*((volatile unsigned long *)(0x40082000 + 0x000000CC))) = clkDiv;
}


x86 assembly (clang, -O0):
<PRCMGPTimerClockDivisionSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400820cc,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMGPTimerClockDivisionSet>:
mov    %rdi,0x400820cc
40
ret

LLVM IR (-O0):
define void @PRCMGPTimerClockDivisionSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074274508 to i64*)
ret void
}

LLVM IR (-O2):
define void @PRCMGPTimerClockDivisionSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074274508 to i64*)
ret void
}
int get_facility(int prival) { return prival & 0xf8; }


x86 assembly (clang, -O0):
<get_facility>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_facility>:
mov    %edi,%eax
and    $0xf8,%eax
ret

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

LLVM IR (-O2):
define i32 @get_facility(i32 %0) {
%2 = and i32 %0, 248
ret i32 %2
}
char *mystrcpy(p, q)
register char *p, *q;
{
  while ((*p++ = *q++) != 0)
    ;
  return p - 1;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <mystrcpy+0x3f>
jmp    110c <mystrcpy+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <mystrcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @mystrcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int exp(double);
double temperature(double t, int n) {
  return ((n / 2.0) / (1 + exp(t / 8 - 5)));
}


x86 assembly (clang, -O0):
<temperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<temperature>:
push   %rax
cvtsi2sd %edi,%xmm1
mulsd  0xee3(%rip),%xmm1
movsd  %xmm1,(%rsp)
mulsd  0xede(%rip),%xmm0
addsd  0xede(%rip),%xmm0
call   1030 <exp@plt>
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @temperature(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 2.000000e+00
%8 = load double, double* %3
%9 = fdiv double %8, 8.000000e+00
%10 = fsub double %9, 5.000000e+00
%11 = call i32 @exp(double %10)
%12 = add nsw i32 1, %11
%13 = sitofp i32 %12 to double
%14 = fdiv double %7, %13
ret double %14
}

LLVM IR (-O2):
define double @temperature(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fmul double %3, 5.000000e-01
%5 = fmul double %0, 1.250000e-01
%6 = fadd double %5, -5.000000e+00
%7 = tail call i32 @exp(double %6)
%8 = add nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = fdiv double %4, %9
ret double %10
}
int iabs(int x) {
  if (x < 0)
    x = -x;
  return x;
}


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <iabs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iabs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @iabs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
__attribute__((no, noclone)) unsigned __int128 t161_3add(signed __int128 y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((signed __int128)(-5), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t161_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0xfffffffffffffffb,%rdx
adc    $0xffffffffffffffff,%rcx
mov    %r9,%r8
adc    $0xffffffffffffffff,%r8
adc    $0xffffffffffffffff,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t161_3add+0x77>
jmp    118e <t161_3add+0x7e>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t161_3add>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
mov    %rdi,%r14
add    $0xfffffffffffffffb,%r14
mov    %rsi,%rbx
adc    $0xffffffffffffffff,%rbx
mov    $0x4,%ecx
cmp    %rdi,%rcx
sbb    %rsi,%rax
jl     1138 <t161_3add+0x28>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t161_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 -5, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t161_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nsw i129 %7, -5
%9 = icmp slt i128 %6, 5
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
int text_importwrap(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @text_importwrap() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ malloc(int);
int rand();
int return_res_leak(void) {
  uint8_t *foo_p = (uint8_t *)malloc(sizeof(uint8_t));
  if (foo_p == NULL)
    return 1;
  int bar = rand();
  if (bar == 0)
    return 2;
  int baz = rand();
  if (baz == 0)
    return 3;
  return 0;
}


x86 assembly (clang, -O0):
<return_res_leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <return_res_leak+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1194 <return_res_leak+0x74>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116d <return_res_leak+0x4d>
movl   $0x2,-0x4(%rbp)
jmp    1194 <return_res_leak+0x74>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    118d <return_res_leak+0x6d>
movl   $0x3,-0x4(%rbp)
jmp    1194 <return_res_leak+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_res_leak>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     114e <return_res_leak+0x2e>
xor    %eax,%eax
call   1040 <rand@plt>
test   %eax,%eax
je     1155 <return_res_leak+0x35>
xor    %eax,%eax
call   1040 <rand@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,2),%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret
mov    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @return_res_leak() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 (...) @rand()
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (...) @rand()
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 3, i32 0
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %0 ], [ %9, %6 ], [ 2, %3 ]
ret i32 %11
}
int htoi(char *s) {}


x86 assembly (clang, -O0):
<htoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @htoi(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
double fluxfun(double);
double G(double s, void *data) {
  double *D = (double *)data;
  return s + D[0] * fluxfun(s) - D[1];
}


x86 assembly (clang, -O0):
<G>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fluxfun@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <fluxfun@plt>
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
subsd  0x8(%rbx),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @G(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca double*
store double %0, double* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
store double* %7, double** %5
%8 = load double, double* %3
%9 = load double*, double** %5
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double, double* %3
%13 = call double @fluxfun(double %12)
%14 = call double @llvm.fmuladd.f64(double %11, double %13, double %8)
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fsub double %14, %17
ret double %18
}

LLVM IR (-O2):
define double @G(double %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to double*
%4 = load double, double* %3
%5 = tail call double @fluxfun(double %0)
%6 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %0)
%7 = getelementptr inbounds i8, i8* %1, i64 8
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
%10 = fsub double %6, %9
ret double %10
}
int getMax(int a, int b) {
  int i;
  for (i = 0; (i < a) || (i < b); i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<getMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112e <getMax+0x2e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113e <getMax+0x3e>
jmp    1151 <getMax+0x51>
jmp    1143 <getMax+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <getMax+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMax>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmp    %edi,%eax
jl     1110 <getMax+0x10>
cmp    %esi,%eax
jl     1110 <getMax+0x10>
ret

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

LLVM IR (-O2):
define i32 @getMax(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %8, %3 ]
%5 = icmp slt i32 %4, %0
%6 = icmp slt i32 %4, %1
%7 = or i1 %5, %6
%8 = add nuw nsw i32 %4, 1
br i1 %7, label %3, label %9
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int RAND_MAX;
int rand();
int rand_lim(int limit) {
  int divisor = RAND_MAX / (limit + 1);
  int retval = 0;
  do {
    retval = rand() / divisor;
  } while (retval > limit);
  return retval;
}


x86 assembly (clang, -O0):
<rand_lim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1137 <rand_lim+0x27>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_lim>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rbx),%ecx
cltd
idiv   %ecx
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
cmp    %ebx,%eax
jg     1130 <rand_lim+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rand_lim(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @RAND_MAX
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %5, %7
store i32 %8, i32* %3
store i32 0, i32* %4
br label %9
9: ; preds = %13, %1
%10 = call i32 (...) @rand()
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sgt i32 %14, %15
br i1 %16, label %9, label %17
17: ; preds = %13
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand_lim(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @rand()
%7 = sdiv i32 %6, %4
%8 = icmp sgt i32 %7, %0
br i1 %8, label %5, label %9
9: ; preds = %5
ret i32 %7
}
/* Variables and functions */
scalar_t__ send_command_to_variable_server(int, char *);
int close(int socket) {
  if (send_command_to_variable_server(socket, "trick.var_exit()") < 0) {
    return -1;
  } else {
    close(socket);
    return 0;
  }
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <send_command_to_variable_server@plt>
cmp    $0x0,%rax
jge    1150 <close+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <close+0x3f>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xee2(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
mov    %rax,%r14
test   %rax,%rax
js     114f <close+0x3f>
lea    0xece(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r15,%rsi
call   1030 <send_command_to_variable_server@plt>
test   %rax,%rax
jns    1140 <close+0x30>
sar    $0x3f,%r14
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"trick.var_exit()\00"
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @send_command_to_variable_server(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @close(i32 %9)
store i32 0, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [17 x i8] c"trick.var_exit()\00"
define i32 @close(i32 %0) {
%2 = tail call i64 @send_command_to_variable_server(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1, %4
%5 = tail call i64 @send_command_to_variable_server(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4, %1
%8 = ashr i64 %2, 63
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ cs2skcb(void *);
void cs2skcb_(void *cbfn) { cs2skcb(cbfn); }


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

x86 assembly (clang, -O2):
<cs2skcb_>:
jmp    1030 <cs2skcb@plt>

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

LLVM IR (-O2):
define void @cs2skcb_(i8* %0) {
%2 = tail call i32 @cs2skcb(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ChebKernel_L2L(int, void *, int, void *, void *);
void cheb_l2l(int level, void *parentCell, int childPosition, void *childCell,
              void *userData) {
  ChebKernel_L2L(level, parentCell, childPosition, childCell, userData);
}


x86 assembly (clang, -O0):
<cheb_l2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <ChebKernel_L2L@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheb_l2l>:
jmp    1030 <ChebKernel_L2L@plt>

LLVM IR (-O0):
define void @cheb_l2l(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @ChebKernel_L2L(i32 %11, i8* %12, i32 %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @cheb_l2l(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4) {
%6 = tail call i32 @ChebKernel_L2L(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bwd();
void move_back() { bwd(); }


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

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

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

LLVM IR (-O2):
define void @move_back() {
%1 = tail call i32 (...) @bwd()
ret void
}
void QEIIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000020))) |= ulIntFlags;
}


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

x86 assembly (clang, -O2):
<QEIIntEnable>:
or     %rsi,0x20(%rdi)
ret

LLVM IR (-O0):
define void @QEIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 32
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @QEIIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 32
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int shmget(int /*<<< orphan*/, int, int);
int main(int argc, char *argv[]) {
  int shmid = shmget((key_t)1234, 1 << 12, IPC_CREAT | 0600);
  if (shmid < 0) {
    perror("shmget");
    exit(-1);
  }
  printf("shmid: %d\n", shmid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
or     $0x180,%edx
mov    $0x4d2,%edi
mov    $0x1000,%esi
call   1050 <shmget@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1197 <main+0x57>
lea    0xe78(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x14(%rbp),%esi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    $0x180,%edx
or     (%rax),%edx
mov    $0x4d2,%edi
mov    $0x1000,%esi
call   1050 <shmget@plt>
test   %eax,%eax
js     1174 <main+0x34>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe85(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [7 x i8] c"shmget\00"
@.str.1 = [11 x i8] c"shmid: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @IPC_CREAT
%8 = or i32 %7, 384
%9 = call i32 @shmget(i32 1234, i32 4096, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %2
%16 = load i32, i32* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@.str = [7 x i8] c"shmget\00"
@.str.1 = [11 x i8] c"shmid: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 384
%5 = tail call i32 @shmget(i32 1234, i32 4096, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_oss_sound_device();
int /*<<< orphan*/ read_asteroid_sounds();
void init_sound(void) {
  init_oss_sound_device();
  read_asteroid_sounds();
  return;
}


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

x86 assembly (clang, -O2):
<init_sound>:
push   %rax
xor    %eax,%eax
call   1030 <init_oss_sound_device@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <read_asteroid_sounds@plt>

LLVM IR (-O0):
define void @init_sound() {
%1 = call i32 (...) @init_oss_sound_device()
%2 = call i32 (...) @read_asteroid_sounds()
ret void
}

LLVM IR (-O2):
define void @init_sound() {
%1 = tail call i32 (...) @init_oss_sound_device()
%2 = tail call i32 (...) @read_asteroid_sounds()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_flatten_unflatten();
void run_tests() { test_flatten_unflatten(); }


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

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

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

LLVM IR (-O2):
define void @run_tests() {
%1 = tail call i32 (...) @test_flatten_unflatten()
ret void
}
int inside_edge(double x0, double y0, double x1, double y1, double x,
                double y) {
  const double SMALL = 1.e-12;
  double product;
  product = (x - x0) * (y1 - y0) + (x0 - x1) * (y - y0);
  return (product <= SMALL) ? 1 : 0;
}


x86 assembly (clang, -O0):
<inside_edge>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  0xe8b(%rip),%xmm0
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmovae %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inside_edge>:
subsd  %xmm0,%xmm4
subsd  %xmm1,%xmm3
mulsd  %xmm4,%xmm3
subsd  %xmm2,%xmm0
subsd  %xmm1,%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm3,%xmm5
movsd  0xedc(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm5,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @inside_edge(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
store double 0x3D719799812DEA11, double* %13
%15 = load double, double* %11
%16 = load double, double* %7
%17 = fsub double %15, %16
%18 = load double, double* %10
%19 = load double, double* %8
%20 = fsub double %18, %19
%21 = load double, double* %7
%22 = load double, double* %9
%23 = fsub double %21, %22
%24 = load double, double* %12
%25 = load double, double* %8
%26 = fsub double %24, %25
%27 = fmul double %23, %26
%28 = call double @llvm.fmuladd.f64(double %17, double %20, double %27)
store double %28, double* %14
%29 = load double, double* %14
%30 = fcmp ole double %29, 0x3D719799812DEA11
%31 = zext i1 %30 to i64
%32 = select i1 %30, i32 1, i32 0
ret i32 %32
}

LLVM IR (-O2):
define i32 @inside_edge(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %4, %0
%8 = fsub double %3, %1
%9 = fsub double %0, %2
%10 = fsub double %5, %1
%11 = fmul double %9, %10
%12 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = fcmp ole double %12, 0x3D719799812DEA11
%14 = zext i1 %13 to i32
ret i32 %14
}
void setdirpath(fpath, direct, fname) char *fpath, *direct, *fname;
{
  int ch;
  char *target;
  while (ch = *direct) {
    *fpath++ = ch;
    if (ch == '/')
      target = fpath;
    direct++;
  }
  strcpy(target, fname);
}


x86 assembly (clang, -O0):
<setdirpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1170 <setdirpath+0x60>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
cmpl   $0x2f,-0x1c(%rbp)
jne    115f <setdirpath+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <setdirpath+0x14>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setdirpath>:
mov    (%rsi),%cl
add    $0x1,%rdi
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %cl,-0x1(%rdi)
cmp    $0x2f,%cl
cmove  %rdi,%rax
movzbl (%rsi),%ecx
add    $0x1,%rdi
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <setdirpath+0x10>
mov    %rax,%rdi
mov    %rdx,%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @setdirpath(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %9
9: ; preds = %23, %3
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
store i32 %12, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %9
%15 = load i32, i32* %7
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
store i8 %16, i8* %17
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 47
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = load i8*, i8** %4
store i8* %22, i8** %8
br label %23
23: ; preds = %21, %14
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %9
26: ; preds = %9
%27 = load i8*, i8** %8
%28 = load i8*, i8** %6
%29 = call i8* @strcpy(i8* %27, i8* %28)
ret void
}

LLVM IR (-O2):
define void @setdirpath(i8* %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i8, i8* %1
%5 = icmp ne i8 %4, 0
br label %6
6: ; preds = %3, %6
%7 = phi i8 [ %15, %6 ], [ %4, %3 ]
%8 = phi i8* [ %13, %6 ], [ undef, %3 ]
%9 = phi i8* [ %11, %6 ], [ %0, %3 ]
%10 = phi i8* [ %14, %6 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %7, i8* %9
%12 = icmp eq i8 %7, 47
%13 = select i1 %12, i8* %11, i8* %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6
%18 = tail call i8* @strcpy(i8* dereferenceable(1) %13, i8* dereferenceable(1) %2)
ret void
}
/* Variables and functions */
int rounded_int_division(int, int);
int /*<<< orphan*/ xv_get_output_aspect(int *, int *);
int xv_get_width_for_height(int window_height) {
  int n, d;
  xv_get_output_aspect(&n, &d);
  return rounded_int_division(window_height * n, d);
}


x86 assembly (clang, -O0):
<xv_get_width_for_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <xv_get_output_aspect@plt>
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <rounded_int_division@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xv_get_width_for_height>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <xv_get_output_aspect@plt>
imul   0xc(%rsp),%ebx
mov    0x8(%rsp),%esi
mov    %ebx,%edi
call   1030 <rounded_int_division@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xv_get_width_for_height(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @xv_get_output_aspect(i32* %3, i32* %4)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = call i32 @rounded_int_division(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @xv_get_width_for_height(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @xv_get_output_aspect(i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %0
%9 = load i32, i32* %3
%10 = call i32 @rounded_int_division(i32 %8, i32 %9)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void strcat_unknown_src_length(char *src, int offset) {
  char dst[8] = "1234";
  strcat(dst, &src[offset]);
  clang_analyzer_eval(strlen(dst) >= 4);
}


x86 assembly (clang, -O0):
<strcat_unknown_src_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
call   1040 <strcat@plt>
lea    -0x14(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_unknown_src_length>:
push   %rbx
sub    $0x10,%rsp
movq   $0x34333231,0x8(%rsp)
33 34
movslq %esi,%rsi
add    %rdi,%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x4,%eax
setge  %dil
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strcat_unknown_src_length.dst = [8 x i8] c"1234\00\00\00\00"
define void @strcat_unknown_src_length(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [8 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [8 x i8]* %5 to i8*
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = call i32 @strcat(i8* %7, i8* %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = icmp sge i32 %14, 4
%16 = zext i1 %15 to i32
%17 = call i32 @clang_analyzer_eval(i32 %16)
ret void
}

LLVM IR (-O2):
define void @strcat_unknown_src_length(i8* %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 875770417, i64* %3
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = call i32 @strcat(i8* %4, i8* %6)
%8 = call i32 @strlen(i8* %4)
%9 = icmp sgt i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
ret void
}
/* Variables and functions */
double time_getWallclockSeconds();
double time_get_wallclock_seconds_(void) {
  return (time_getWallclockSeconds());
}


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

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

LLVM IR (-O0):
define double @time_get_wallclock_seconds_() {
%1 = call double (...) @time_getWallclockSeconds()
ret double %1
}

LLVM IR (-O2):
define double @time_get_wallclock_seconds_() {
%1 = tail call double (...) @time_getWallclockSeconds()
ret double %1
}
void memzero_str(int *p_str_bmap, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    p_str_bmap[i] = 0;
  }
}


x86 assembly (clang, -O0):
<memzero_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1142 <memzero_str+0x42>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <memzero_str+0x19>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @memzero_str(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
long double sqrt(long double);
double histo_stddev(long double N, long double S, long double Q) {
  return sqrt(N * Q - S * S) / N;
}


x86 assembly (clang, -O0):
<histo_stddev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
fmul   %st,%st(0)
fxch   %st(2)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sqrt@plt>
fldt   -0x10(%rbp)
fdivrp %st,%st(1)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<histo_stddev>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x50(%rsp)
fldt   0x40(%rsp)
fmul   %st,%st(0)
fxch   %st(1)
fmul   %st(2),%st
fsubp  %st,%st(1)
fld    %st(0)
fsqrt
fldz
fxch   %st(2)
fucomi %st(2),%st
fstp   %st(2)
jae    114e <histo_stddev+0x3e>
fstp   %st(0)
fstpt  (%rsp)
fstpt  0x1c(%rsp)
call   1030 <sqrt@plt>
fldt   0x1c(%rsp)
fldz
fxch   %st(1)
fxch   %st(2)
fstp   %st(1)
fdivp  %st,%st(1)
fstpl  0x10(%rsp)
movsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @histo_stddev(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %4
%8 = load x86_fp80, x86_fp80* %6
%9 = load x86_fp80, x86_fp80* %5
%10 = load x86_fp80, x86_fp80* %5
%11 = fmul x86_fp80 %9, %10
%12 = fneg x86_fp80 %11
%13 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %7, x86_fp80 %8, x86_fp80 %12)
%14 = call x86_fp80 @sqrt(x86_fp80 %13)
%15 = load x86_fp80, x86_fp80* %4
%16 = fdiv x86_fp80 %14, %15
%17 = fptrunc x86_fp80 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @histo_stddev(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = fneg x86_fp80 %1
%5 = fmul x86_fp80 %4, %1
%6 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %2, x86_fp80 %5)
%7 = tail call x86_fp80 @sqrt(x86_fp80 %6)
%8 = fdiv x86_fp80 %7, %0
%9 = fptrunc x86_fp80 %8 to double
ret double %9
}
extern int JKMarray_idx(const int J, const int K, const int M) {
  return (((4 * J * J + 5) * J) / 3 + 2 * J * J + K * (2 * J + 1) + M);
}


x86 assembly (clang, -O0):
<JKMarray_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
imul   -0x4(%rbp),%eax
add    $0x5,%eax
imul   -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<JKMarray_idx>:
mov    %edi,%eax
imul   %eax,%eax
lea    0x5(,%rax,4),%eax
imul   %edi,%eax
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
add    %eax,%ecx
lea    (%rdi,%rdi,1),%eax
imul   %edi,%eax
add    %edi,%edi
add    $0x1,%edi
imul   %esi,%edi
add    %edx,%eax
add    %edi,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @JKMarray_idx(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %0, 2
%5 = mul nsw i32 %4, %0
%6 = add nsw i32 %5, 5
%7 = mul nsw i32 %6, %0
%8 = sdiv i32 %7, 3
%9 = shl nsw i32 %0, 1
%10 = mul nsw i32 %9, %0
%11 = or i32 %9, 1
%12 = mul nsw i32 %11, %1
%13 = add i32 %10, %2
%14 = add i32 %13, %12
%15 = add i32 %14, %8
ret i32 %15
}
int test_imm_6Fint64_lowword_mem(long long *val) {
  return ((*val) & (0x6F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Fint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 111
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int main(void) {
  int i;
  long *buf;
  for (i = 0;; i++) {
    buf = (long *)calloc(5, sizeof(long));
    if (buf != NULL) {
      buf[1] = 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <main+0x40>
mov    -0x10(%rbp),%rax
movq   $0x1,0x8(%rax)
jmp    1155 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x5,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1120 <main+0x10>
movq   $0x1,0x8(%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64*
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = call i64 @calloc(i32 5, i32 8)
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = icmp ne i64* %7, null
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 1
store i64 1, i64* %11
br label %12
12: ; preds = %9, %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %4, %0
%2 = tail call i64 @calloc(i32 5, i32 8)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
br label %1
5: ; preds = %1
%6 = inttoptr i64 %2 to i64*
%7 = getelementptr inbounds i64, i64* %6, i64 1
store i64 1, i64* %7
br label %4
}
int check_wakeup_reason(int irq) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_wakeup_reason(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int isatty(int /*<<< orphan*/);
int eiki_stdin_is_tty() { return isatty(STDIN_FILENO); }


x86 assembly (clang, -O0):
<eiki_stdin_is_tty>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <isatty@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eiki_stdin_is_tty>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <isatty@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @eiki_stdin_is_tty() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @isatty(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @eiki_stdin_is_tty() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @isatty(i32 %1)
ret i32 %2
}