xunge/DecIR huggingface dataset:
/* Variables and functions */
int isspace(char c) {
  return (c == ' ' || c == '\t' || c == '\f' || c == '\n' || c == '\r' ||
          c == '\v');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0xb,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%dil
ja     1120 <isspace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    1120 <isspace+0x20>
ret
xor    %eax,%eax
cmp    $0xb,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %26, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 12
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 13
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 11
br label %26
26: ; preds = %22, %18, %14, %10, %6, %1
%27 = phi i1 [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 12, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
long double __qatan(long double);
long double __q_atan(long double *arg) { return (__qatan(*arg)); }


x86 assembly (clang, -O0):
<__q_atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qatan@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_atan>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qatan@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__q_atan(x86_fp80* %0) {
%2 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %2
%3 = load x86_fp80*, x86_fp80** %2
%4 = load x86_fp80, x86_fp80* %3
%5 = call x86_fp80 @__qatan(x86_fp80 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @__q_atan(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qatan(x86_fp80 %2)
ret x86_fp80 %3
}
void V(int *s) { (*s)++; }


x86 assembly (clang, -O0):
<V>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<V>:
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @V(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @V(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
void imv_window_get_mouse_position(struct imv_window *window, double *x,
                                   double *y) {
  (void)window;
  (void)x;
  (void)y;
}


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

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

LLVM IR (-O0):
%struct.imv_window = type opaque
define void @imv_window_get_mouse_position(%struct.imv_window* %0, double* %1, double* %2) {
%4 = alloca %struct.imv_window*
%5 = alloca double*
%6 = alloca double*
store %struct.imv_window* %0, %struct.imv_window** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load %struct.imv_window*, %struct.imv_window** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
ret void
}

LLVM IR (-O2):
%struct.imv_window = type opaque
define void @imv_window_get_mouse_position(%struct.imv_window* nocapture %0, double* nocapture %1, double* nocapture %2) {
ret void
}
/* Variables and functions */
int f87(int *);
int f88(int *p) { return f87(p); }


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

x86 assembly (clang, -O2):
<f88>:
jmp    1030 <f87@plt>

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

LLVM IR (-O2):
define i32 @f88(i32* %0) {
%2 = tail call i32 @f87(i32* %0)
ret i32 %2
}
void gtk_widget_get_ancestor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_ancestor() {
ret void
}
int main() {
  int i, j, k;
  const int N = 100;
  int X[N];
  int Y[N];
  int Z[N];
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++)
      for (k = 0; k < N; k++)
        Z[i] = X[k] * Y[j];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x14(%rbp)
mov    %rsp,%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11a9 <main+0xa9>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1196 <main+0x96>
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    1183 <main+0x83>
movslq -0x10(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%ecx
movslq -0xc(%rbp),%rax
imul   -0x340(%rbp,%rax,4),%ecx
ff
movslq -0x8(%rbp),%rax
mov    %ecx,-0x4d0(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <main+0x49>
jmp    1188 <main+0x88>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <main+0x38>
jmp    119b <main+0x9b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <main+0x27>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %1
store i32 100, i32* %5
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %6
%8 = alloca i32, i64 100
%9 = alloca i32, i64 100
%10 = alloca i32, i64 100
store i32 0, i32* %2
br label %11
11: ; preds = %43, %0
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 100
br i1 %13, label %14, label %46
14: ; preds = %11
store i32 0, i32* %3
br label %15
15: ; preds = %39, %14
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 100
br i1 %17, label %18, label %42
18: ; preds = %15
store i32 0, i32* %4
br label %19
19: ; preds = %35, %18
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 100
br i1 %21, label %22, label %38
22: ; preds = %19
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %8, i64 %24
%26 = load i32, i32* %25
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %9, i64 %28
%30 = load i32, i32* %29
%31 = mul nsw i32 %26, %30
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %10, i64 %33
store i32 %31, i32* %34
br label %35
35: ; preds = %22
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %19
38: ; preds = %19
br label %39
39: ; preds = %38
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %15
42: ; preds = %15
br label %43
43: ; preds = %42
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
store i32 %45, i32* %2
br label %11
46: ; preds = %11
store i32 0, i32* %1
%47 = load i8*, i8** %6
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(int argc, const char *argv[]) {
  double doubleResult = 3.0;
  doubleResult *= doubleResult;
  doubleResult /= (4 % 7);
  doubleResult += 4.0 * doubleResult;
  doubleResult -= -1.5;
  doubleResult += 'A';
  printf("Result = %f\n", doubleResult);
  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)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xea6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe6b(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Result = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 3.000000e+00, double* %6
%7 = load double, double* %6
%8 = load double, double* %6
%9 = fmul double %8, %7
store double %9, double* %6
%10 = load double, double* %6
%11 = fdiv double %10, 4.000000e+00
store double %11, double* %6
%12 = load double, double* %6
%13 = load double, double* %6
%14 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %12, double %13)
store double %14, double* %6
%15 = load double, double* %6
%16 = fsub double %15, -1.500000e+00
store double %16, double* %6
%17 = load double, double* %6
%18 = fadd double %17, 6.500000e+01
store double %18, double* %6
%19 = load double, double* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Result = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 7.775000e+01)
ret i32 0
}
float E3D_Min(float a, float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<E3D_Min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <E3D_Min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <E3D_Min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<E3D_Min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @E3D_Min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @E3D_Min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
unsigned int srate2blocksize(unsigned int srate_chan_product) {
  if (srate_chan_product < 12000)
    return 256;
  if (srate_chan_product < 23000)
    return 512;
  if (srate_chan_product < 44000)
    return 1024;
  return 2048;
}


x86 assembly (clang, -O0):
<srate2blocksize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2ee0,-0x8(%rbp)
jae    1120 <srate2blocksize+0x20>
movl   $0x100,-0x4(%rbp)
jmp    1159 <srate2blocksize+0x59>
cmpl   $0x59d8,-0x8(%rbp)
jae    1139 <srate2blocksize+0x39>
movl   $0x200,-0x4(%rbp)
jmp    1159 <srate2blocksize+0x59>
cmpl   $0xabe0,-0x8(%rbp)
jae    1152 <srate2blocksize+0x52>
movl   $0x400,-0x4(%rbp)
jmp    1159 <srate2blocksize+0x59>
movl   $0x800,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<srate2blocksize>:
mov    $0x100,%eax
cmp    $0x2ee0,%edi
jb     112d <srate2blocksize+0x2d>
mov    $0x200,%eax
cmp    $0x59d8,%edi
jb     112d <srate2blocksize+0x2d>
xor    %eax,%eax
cmp    $0xabe0,%edi
setae  %al
shl    $0xa,%eax
add    $0x400,%eax
ret

LLVM IR (-O0):
define i32 @srate2blocksize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 12000
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 256, i32* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 23000
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 512, i32* %2
br label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 44000
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 1024, i32* %2
br label %16
15: ; preds = %11
store i32 2048, i32* %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @srate2blocksize(i32 %0) {
%2 = icmp ult i32 %0, 12000
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 23000
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 44000
%7 = select i1 %6, i32 1024, i32 2048
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 256, %1 ], [ 512, %3 ], [ %7, %5 ]
ret i32 %9
}
int is_prime(int n, int i) {
  if (n < 4)
    return 1;
  else if ((n % 2) == 0)
    return 0;
  else if (n % i == 0)
    return 0;
  else if (i * i > n)
    return 1;
  else
    return is_prime(n, i + 2);
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1134 <is_prime+0x24>
movl   $0x1,-0x4(%rbp)
jmp    119d <is_prime+0x8d>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1154 <is_prime+0x44>
movl   $0x0,-0x4(%rbp)
jmp    119d <is_prime+0x8d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1170 <is_prime+0x60>
movl   $0x0,-0x4(%rbp)
jmp    119d <is_prime+0x8d>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    118c <is_prime+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    119d <is_prime+0x8d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
add    $0x2,%esi
call   1030 <is_prime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x4,%edi
jge    110d <is_prime+0xd>
mov    %ecx,%eax
ret
test   $0x1,%dil
jne    1120 <is_prime+0x20>
xor    %eax,%eax
ret
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1113 <is_prime+0x13>
mov    %esi,%eax
imul   %esi,%eax
add    $0x2,%esi
cmp    %edi,%eax
jle    1120 <is_prime+0x20>
jmp    110a <is_prime+0xa>

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 4
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4, %11
%8 = phi i32 [ %14, %11 ], [ %1, %4 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = mul nsw i32 %8, %8
%13 = icmp sgt i32 %12, %0
%14 = add nsw i32 %8, 2
br i1 %13, label %15, label %7
15: ; preds = %11, %7, %4, %2
%16 = phi i32 [ 1, %2 ], [ 0, %4 ], [ 1, %11 ], [ 0, %7 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ dhcp_packet(int, char *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               char *, char *);
void dhcp_release(char *ipaddr, char *gwaddr, char *hardware) {
  dhcp_packet(7, ipaddr, NULL, NULL, NULL, gwaddr, hardware);
}


x86 assembly (clang, -O0):
<dhcp_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
mov    $0x7,%edi
xor    %ecx,%ecx
mov    %ecx,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
mov    %rax,(%rsp)
call   1030 <dhcp_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_release>:
push   %rax
mov    %rsi,%r9
mov    %rdi,%rsi
mov    %rdx,(%rsp)
mov    $0x7,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <dhcp_packet@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @dhcp_release(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @dhcp_packet(i32 7, i8* %7, i32* null, i32* null, i32* null, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @dhcp_release(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @dhcp_packet(i32 7, i8* %0, i32* null, i32* null, i32* null, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI_CS_High();
void __SD_Deassert(void) { SPI_CS_High(); }


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

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

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

LLVM IR (-O2):
define void @__SD_Deassert() {
%1 = tail call i32 (...) @SPI_CS_High()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int romanToInt(char *);
int main() { printf("%d\n", romanToInt("XXX")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
call   1040 <romanToInt@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1040 <romanToInt@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"XXX\00"
define i32 @main() {
%1 = call i32 @romanToInt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"XXX\00"
define i32 @main() {
%1 = tail call i32 @romanToInt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ UP3D_GetParameter(int);
int32_t UP3D_GetReadFromSD() { return UP3D_GetParameter(0x36); }


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

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

LLVM IR (-O0):
define i32 @UP3D_GetReadFromSD() {
%1 = call i32 @UP3D_GetParameter(i32 54)
ret i32 %1
}

LLVM IR (-O2):
define i32 @UP3D_GetReadFromSD() {
%1 = tail call i32 @UP3D_GetParameter(i32 54)
ret i32 %1
}
int str_count_occurences(const char *str, char x) {
  int rv = 0;
  while (*str++) {
    if (*str == x)
      rv++;
  }
  return rv;
}


x86 assembly (clang, -O0):
<str_count_occurences>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     114e <str_count_occurences+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <str_count_occurences+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <str_count_occurences+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_count_occurences>:
cmpb   $0x0,(%rdi)
je     1126 <str_count_occurences+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_count_occurences+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @str_count_occurences(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %21
21: ; preds = %18, %11
br label %6
22: ; preds = %6
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @str_count_occurences(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %0, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = icmp eq i8 %9, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %15
}
/* Variables and functions */
double exp(double);
double pow(double, double);
double _ol_flux_curve(double curvei, double kelvin) {
  return pow(curvei * 0.000000001, -5.0) * 3.74183e-16 /
         (exp(0.014388 / (curvei * 0.000000001 * kelvin)) - 1.0);
}


x86 assembly (clang, -O0):
<_ol_flux_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xec4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeab(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe91(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe70(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ol_flux_curve>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
mulsd  0xece(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xec9(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xec4(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  0xeb3(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
addsd  0xeaa(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @_ol_flux_curve(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 = fmul double %5, 1.000000e-09
%7 = call double @pow(double %6, double -5.000000e+00)
%8 = fmul double %7, 3.741830e-16
%9 = load double, double* %3
%10 = fmul double %9, 1.000000e-09
%11 = load double, double* %4
%12 = fmul double %10, %11
%13 = fdiv double 1.438800e-02, %12
%14 = call double @exp(double %13)
%15 = fsub double %14, 1.000000e+00
%16 = fdiv double %8, %15
ret double %16
}

LLVM IR (-O2):
define double @_ol_flux_curve(double %0, double %1) {
%3 = fmul double %0, 1.000000e-09
%4 = tail call double @pow(double %3, double -5.000000e+00)
%5 = fmul double %4, 3.741830e-16
%6 = fmul double %3, %1
%7 = fdiv double 1.438800e-02, %6
%8 = tail call double @exp(double %7)
%9 = fadd double %8, -1.000000e+00
%10 = fdiv double %5, %9
ret double %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __REV16(uint32_t value) {
  uint32_t result;
  result = ((value & 0xFF000000) >> 8) | ((value & 0x00FF0000) << 8) |
           ((value & 0x0000FF00) >> 8) | ((value & 0x000000FF) << 8);
  return (result);
}


x86 assembly (clang, -O0):
<__REV16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__REV16>:
mov    %edi,%eax
bswap  %eax
rol    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @__REV16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, -16777216
%6 = lshr i32 %5, 8
%7 = load i32, i32* %2
%8 = and i32 %7, 16711680
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 65280
%13 = ashr i32 %12, 8
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = and i32 %15, 255
%17 = shl i32 %16, 8
%18 = or i32 %14, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @__REV16(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 16711680
%4 = shl i32 %0, 8
%5 = and i32 %4, -16777216
%6 = or i32 %3, %5
%7 = and i32 %2, 255
%8 = or i32 %6, %7
%9 = and i32 %4, 65280
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int askForInt() {
  int askedInt;
  scanf("%d", &askedInt);
  return askedInt;
}


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

x86 assembly (clang, -O2):
<askForInt>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @askForInt() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
void ECAPClockEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + 0x08))) |= 0x01;
}


x86 assembly (clang, -O0):
<ECAPClockEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPClockEnable>:
add    $0x8,%edi
orl    $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @ECAPClockEnable(i32 %0) {
%2 = add i32 %0, 8
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
ret void
}
int __attribute__((weak)) _close(int file) { return -1; }


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

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

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

LLVM IR (-O2):
define weak i32 @_close(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void sat_print_uninit(void) {
  fprintf(stdout, "%s", "\E[?25h");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<sat_print_uninit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xec8(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_print_uninit>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
lea    0xecb(%rip),%rdx
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"\1B[?25h\00"
define void @sat_print_uninit() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"\1B[?25h\00"
define void @sat_print_uninit() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
double put_in_box(double r, double lmin, double lmax) {
  double l;
  l = lmax - lmin;
  if (r < lmin)
    return r + l;
  else if (r > lmax)
    return r - l;
  else
    return r;
}


x86 assembly (clang, -O0):
<put_in_box>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <put_in_box+0x4a>
movsd  -0x10(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1178 <put_in_box+0x78>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    116e <put_in_box+0x6e>
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1178 <put_in_box+0x78>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_in_box>:
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
ucomisd %xmm0,%xmm1
jbe    1113 <put_in_box+0x13>
addsd  %xmm3,%xmm0
ret
ucomisd %xmm2,%xmm0
jbe    111d <put_in_box+0x1d>
subsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @put_in_box(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%9 = load double, double* %7
%10 = load double, double* %6
%11 = fsub double %9, %10
store double %11, double* %8
%12 = load double, double* %5
%13 = load double, double* %6
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load double, double* %5
%17 = load double, double* %8
%18 = fadd double %16, %17
store double %18, double* %4
br label %29
19: ; preds = %3
%20 = load double, double* %5
%21 = load double, double* %7
%22 = fcmp ogt double %20, %21
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load double, double* %5
%25 = load double, double* %8
%26 = fsub double %24, %25
store double %26, double* %4
br label %29
27: ; preds = %19
%28 = load double, double* %5
store double %28, double* %4
br label %29
29: ; preds = %27, %23, %15
%30 = load double, double* %4
ret double %30
}

LLVM IR (-O2):
define double @put_in_box(double %0, double %1, double %2) {
%4 = fsub double %2, %1
%5 = fcmp olt double %0, %1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = fadd double %4, %0
br label %12
8: ; preds = %3
%9 = fcmp ogt double %0, %2
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = fsub double %0, %4
br label %12
12: ; preds = %8, %10, %6
%13 = phi double [ %7, %6 ], [ %11, %10 ], [ %0, %8 ]
ret double %13
}
/* Variables and functions */
int test_demo();
int main() { return -test_demo(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_demo@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_demo@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_demo()
%3 = sub nsw i32 0, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_demo()
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ WriteByte(int);
void WriteUnVarint(unsigned int v) {
  for (;;) {
    int out = v & 0x7F;
    v >>= 7;
    if (v == 0) {
      WriteByte(out);
      return;
    }
    out |= 0x80;
    WriteByte(out);
  }
}


x86 assembly (clang, -O0):
<WriteUnVarint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x7,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1145 <WriteUnVarint+0x35>
mov    -0x8(%rbp),%edi
call   1030 <WriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%eax
or     $0x80,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <WriteByte@plt>
jmp    111b <WriteUnVarint+0xb>

x86 assembly (clang, -O2):
<WriteUnVarint>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
and    $0x7f,%edi
cmp    $0x80,%ebx
jb     114d <WriteUnVarint+0x3d>
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
shr    $0x7,%ebp
or     $0x80,%edi
call   1030 <WriteByte@plt>
mov    %ebp,%edi
and    $0x7f,%edi
cmp    $0x3fff,%ebx
mov    %ebp,%ebx
ja     1130 <WriteUnVarint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <WriteByte@plt>

LLVM IR (-O0):
define void @WriteUnVarint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %2
%6 = and i32 %5, 127
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = lshr i32 %7, 7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = call i32 @WriteByte(i32 %12)
ret void
14: ; preds = %4
%15 = load i32, i32* %3
%16 = or i32 %15, 128
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = call i32 @WriteByte(i32 %17)
br label %4
}

LLVM IR (-O2):
define void @WriteUnVarint(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp ult i32 %0, 128
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = lshr i32 %6, 7
%8 = or i32 %5, 128
%9 = tail call i32 @WriteByte(i32 %8)
%10 = and i32 %7, 127
%11 = icmp ult i32 %6, 16384
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i32 [ %2, %1 ], [ %10, %4 ]
%14 = tail call i32 @WriteByte(i32 %13)
ret void
}
void scr_focus(type, is_in) int type, is_in;
{}


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

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

LLVM IR (-O0):
define void @scr_focus(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @scr_focus(i32 %0, i32 %1) {
ret void
}
int abs(int j) { return (j >= 0) ? j : -j; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <abs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort_report(char *, char const *, ...);
scalar_t__ rmdir(char const *);
void srmdir(const char *path) {
  if ((rmdir(path)) < 0)
    (2 == 1) ? abort_report("Could not remove directory %s", path, "")
             : abort_report("Could not remove directory %s", path);
}


x86 assembly (clang, -O0):
<srmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rmdir@plt>
cmp    $0x0,%rax
jge    1151 <srmdir+0x31>
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <abort_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srmdir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rmdir@plt>
test   %rax,%rax
js     1130 <srmdir+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <abort_report@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Could not remove directory %s\00"
define void @srmdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @rmdir(i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, i8*, ...) @abort_report(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Could not remove directory %s\00"
define void @srmdir(i8* %0) {
%2 = tail call i64 @rmdir(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, ...) @abort_report(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void clamp(uint8_t secret_scalar_ser[57]) {
  secret_scalar_ser[0] &= -4;
  secret_scalar_ser[57 - 1] = 0;
  secret_scalar_ser[57 - 2] |= 0x80;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xfffffffc,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0xe0(%rax)
mov    -0x8(%rbp),%rax
mov    0xdc(%rax),%ecx
or     $0x80,%ecx
mov    %ecx,0xdc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
andb   $0xfc,(%rdi)
movl   $0x0,0xe0(%rdi)
orb    $0x80,0xdc(%rdi)
ret

LLVM IR (-O0):
define void @clamp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, -4
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 56
store i32 0, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 55
%11 = load i32, i32* %10
%12 = or i32 %11, 128
store i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @clamp(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, -4
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 56
store i32 0, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 55
%6 = load i32, i32* %5
%7 = or i32 %6, 128
store i32 %7, i32* %5
ret void
}
int wps_validate_wsc_done(const struct wpabuf *tlvs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_wsc_done(%struct.wpabuf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int nain() {
  printf("Hello world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @nain() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @nain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void nand_addr(unsigned char addr) {
  (*((volatile unsigned long *)0x7020000C)) = addr;
}


x86 assembly (clang, -O0):
<nand_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    $0x7020000c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_addr>:
mov    %edi,%eax
mov    %rax,0x7020000c
70
ret

LLVM IR (-O0):
define void @nand_addr(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1881145356 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_addr(i8 zeroext %0) {
%2 = zext i8 %0 to i64
store volatile i64 %2, i64* inttoptr (i64 1881145356 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ printf(char *);
int main(void) {
  f();
  printf("skipped\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"skipped\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"skipped\00"
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_resolve_getaddrinfo(void *resolve, void **q, const char *node,
                       const char *service, const struct addrinfo *hints,
                       void *callback, void *userdata) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_resolve_getaddrinfo>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
mov    0x2eb7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_resolve_getaddrinfo>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
@EINVAL = global i32 0
define i32 @sd_resolve_getaddrinfo(i8* %0, i8** %1, i8* %2, i8* %3, %struct.addrinfo* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8**
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca %struct.addrinfo*
%13 = alloca i8*
%14 = alloca i8*
store i8* %0, i8** %8
store i8** %1, i8*** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store %struct.addrinfo* %4, %struct.addrinfo** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load i32, i32* @EINVAL
%16 = sub nsw i32 0, %15
ret i32 %16
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
@EINVAL = global i32 0
define i32 @sd_resolve_getaddrinfo(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, %struct.addrinfo* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6) {
%8 = load i32, i32* @EINVAL
%9 = sub nsw i32 0, %8
ret i32 %9
}
int UV(int Z8h, int wlb6, int R, int lk) {
  int Cwyx;
  int fXy;
  int sCg;
}


x86 assembly (clang, -O0):
<UV>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @UV(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @UV(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}