xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("success\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = 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"success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float pow(float, int);
float gamma_OETF(float value, float gamma) {
  if (value == 0) {
    return 0;
  } else {
    return pow(value, 1 / gamma);
  }
}


x86 assembly (clang, -O0):
<gamma_OETF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1146 <gamma_OETF+0x36>
jp     1146 <gamma_OETF+0x36>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1166 <gamma_OETF+0x56>
movss  -0x8(%rbp),%xmm0
movss  0xead(%rip),%xmm1
divss  -0xc(%rbp),%xmm1
cvttss2si %xmm1,%edi
call   1030 <pow@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_OETF>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jne    111e <gamma_OETF+0xe>
jp     111e <gamma_OETF+0xe>
xorps  %xmm0,%xmm0
ret
movss  0xeda(%rip),%xmm2
divss  %xmm1,%xmm2
cvttss2si %xmm2,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @gamma_OETF(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store float 0.000000e+00, float* %3
br label %15
9: ; preds = %2
%10 = load float, float* %4
%11 = load float, float* %5
%12 = fdiv float 1.000000e+00, %11
%13 = fptosi float %12 to i32
%14 = call float @pow(float %10, i32 %13)
store float %14, float* %3
br label %15
15: ; preds = %9, %8
%16 = load float, float* %3
ret float %16
}

LLVM IR (-O2):
define float @gamma_OETF(float %0, float %1) {
%3 = fcmp oeq float %0, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = fdiv float 1.000000e+00, %1
%6 = fptosi float %5 to i32
%7 = tail call float @pow(float %0, i32 %6)
br label %8
8: ; preds = %2, %4
%9 = phi float [ %7, %4 ], [ 0.000000e+00, %2 ]
ret float %9
}
/* Variables and functions */
int get_Delaunay_reduction_2D(double **, double **, int const, double const);
int lat_smallest_lattice_vector_2D(double min_lattice[3][3],
                                   double lattice[3][3], const int unique_axis,
                                   const double symprec) {
  ;
  return get_Delaunay_reduction_2D(min_lattice, lattice, unique_axis, symprec);
}


x86 assembly (clang, -O0):
<lat_smallest_lattice_vector_2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
call   1030 <get_Delaunay_reduction_2D@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lat_smallest_lattice_vector_2D>:
jmp    1030 <get_Delaunay_reduction_2D@plt>

LLVM IR (-O0):
define i32 @lat_smallest_lattice_vector_2D([3 x double]* %0, [3 x double]* %1, i32 %2, double %3) {
%5 = alloca [3 x double]*
%6 = alloca [3 x double]*
%7 = alloca i32
%8 = alloca double
store [3 x double]* %0, [3 x double]** %5
store [3 x double]* %1, [3 x double]** %6
store i32 %2, i32* %7
store double %3, double* %8
%9 = load [3 x double]*, [3 x double]** %5
%10 = bitcast [3 x double]* %9 to double**
%11 = load [3 x double]*, [3 x double]** %6
%12 = bitcast [3 x double]* %11 to double**
%13 = load i32, i32* %7
%14 = load double, double* %8
%15 = call i32 @get_Delaunay_reduction_2D(double** %10, double** %12, i32 %13, double %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @lat_smallest_lattice_vector_2D([3 x double]* %0, [3 x double]* %1, i32 %2, double %3) {
%5 = bitcast [3 x double]* %0 to double**
%6 = bitcast [3 x double]* %1 to double**
%7 = tail call i32 @get_Delaunay_reduction_2D(double** %5, double** %6, i32 %2, double %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int isAllDigit(char *s) {
  char c;
  while ((c = *s++) != 0) {
    if (!isdigit(c))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isAllDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     115f <isAllDigit+0x4f>
movsbl -0x11(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    115a <isAllDigit+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1166 <isAllDigit+0x56>
jmp    111c <isAllDigit+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAllDigit>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
test   %al,%al
je     113b <isAllDigit+0x2b>
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
jne    1120 <isAllDigit+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isAllDigit(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = tail call i32 @isdigit(i8 signext %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %2
10: ; preds = %2, %6
%11 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %11
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=20 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=Tue Nov  5 17:52:46 KST 2013 BUILD=release "
         "TARGET_PLATFORM=exynos4415 MALI_PLATFORM=exynos4415 KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


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

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [333 x i8] c"malidrv: API_VERSION=20 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Tue Nov 5 17:52:46 KST 2013 BUILD=release TARGET_PLATFORM=exynos4415 MALI_PLATFORM=exynos4415 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [333 x i8] c"malidrv: API_VERSION=20 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Tue Nov 5 17:52:46 KST 2013 BUILD=release TARGET_PLATFORM=exynos4415 MALI_PLATFORM=exynos4415 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int pow(float, int);
float cubic_out(float step, float max_steps, float max_val) {
  float ratio = step / (max_steps - 1.0);
  return max_val * (pow(ratio, 3) + 1);
}


x86 assembly (clang, -O0):
<cubic_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xebf(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movss  -0x14(%rbp),%xmm0
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_out>:
push   %rax
movss  %xmm2,0x4(%rsp)
cvtss2sd %xmm1,%xmm1
addsd  0xedd(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cubic_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = load float, float* %5
%11 = fpext float %10 to double
%12 = fsub double %11, 1.000000e+00
%13 = fdiv double %9, %12
%14 = fptrunc double %13 to float
store float %14, float* %7
%15 = load float, float* %6
%16 = load float, float* %7
%17 = call i32 @pow(float %16, i32 3)
%18 = add nsw i32 %17, 1
%19 = sitofp i32 %18 to float
%20 = fmul float %15, %19
ret float %20
}

LLVM IR (-O2):
define float @cubic_out(float %0, float %1, float %2) {
%4 = fpext float %0 to double
%5 = fpext float %1 to double
%6 = fadd double %5, -1.000000e+00
%7 = fdiv double %4, %6
%8 = fptrunc double %7 to float
%9 = tail call i32 @pow(float %8, i32 3)
%10 = add nsw i32 %9, 1
%11 = sitofp i32 %10 to float
%12 = fmul float %11, %2
ret float %12
}
/* Variables and functions */
scalar_t__ fmod(float, float);
float fmodf(float x, float y) { return (float)fmod(x, y); }


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmod@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
push   %rax
call   1030 <fmod@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fmodf(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 = call i64 @fmod(float %5, float %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = tail call i64 @fmod(float %0, float %1)
%4 = sitofp i64 %3 to float
ret float %4
}
double sqrt(double x) {
  double n;
  double y;
  n = x / 2.0;
  y = 0.0;
  while (n != y) {
    y = n;
    n = (n + x / n) / 2.0;
  }
  return n;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1142 <sqrt+0x42>
jp     1142 <sqrt+0x42>
jmp    1175 <sqrt+0x75>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1127 <sqrt+0x27>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jne    1118 <sqrt+0x18>
jnp    1141 <sqrt+0x41>
movsd  0xee0(%rip),%xmm3
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm1
ucomisd %xmm2,%xmm1
movapd %xmm1,%xmm2
jne    1120 <sqrt+0x20>
jp     1120 <sqrt+0x20>
movapd %xmm1,%xmm0
ret
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 2.000000e+00
store double %6, double* %3
store double 0.000000e+00, double* %4
br label %7
7: ; preds = %11, %1
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fcmp une double %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load double, double* %3
store double %12, double* %4
%13 = load double, double* %3
%14 = load double, double* %2
%15 = load double, double* %3
%16 = fdiv double %14, %15
%17 = fadd double %13, %16
%18 = fdiv double %17, 2.000000e+00
store double %18, double* %3
br label %7
19: ; preds = %7
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = fcmp une double %2, 0.000000e+00
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi double [ %8, %4 ], [ %2, %1 ]
%6 = fdiv double %0, %5
%7 = fadd double %5, %6
%8 = fmul double %7, 5.000000e-01
%9 = fcmp une double %8, %5
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi double [ %2, %1 ], [ %8, %4 ]
ret double %11
}
void IntSystemEnable(unsigned int intrNum) {
  (*((volatile unsigned int *)((0x48200000) +
                               (0x88 + ((intrNum >> (0x05)) * 0x20))))) =
      (0x01 << (intrNum & (0x1F)));
}


x86 assembly (clang, -O0):
<IntSystemEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
shl    $0x5,%eax
add    $0x88,%eax
add    $0x48200000,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntSystemEnable>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    $0xffffffe0,%ecx
add    $0x48200088,%ecx
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @IntSystemEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = shl i32 1, %4
%6 = load i32, i32* %2
%7 = lshr i32 %6, 5
%8 = mul i32 %7, 32
%9 = add i32 136, %8
%10 = add i32 1210056704, %9
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @IntSystemEnable(i32 %0) {
%2 = and i32 %0, 31
%3 = shl nuw i32 1, %2
%4 = and i32 %0, -32
%5 = add i32 %4, 1210056840
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %3, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int read_devattr(char const *, char **);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int read_devattr_double(const char *attr, double *value) {
  char *buf;
  int ret;
  ret = read_devattr(attr, &buf);
  if (ret < 0)
    return ret;
  sscanf(buf, "%lf", value);
  free(buf);
  return 0;
}


x86 assembly (clang, -O0):
<read_devattr_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <read_devattr@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1165 <read_devattr_double+0x35>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <read_devattr_double+0x59>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe8c(%rip),%rsi
call   1050 <sscanf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_devattr_double>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <read_devattr@plt>
test   %eax,%eax
js     1166 <read_devattr_double+0x36>
mov    0x8(%rsp),%rdi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
call   1050 <sscanf@plt>
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @read_devattr_double(i8* %0, double* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca double*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store double* %1, double** %5
%8 = load i8*, i8** %4
%9 = call i32 @read_devattr(i8* %8, i8** %6)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* %7
store i32 %13, i32* %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load double*, double** %5
%17 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %16)
%18 = load i8*, i8** %6
%19 = call i32 @free(i8* %18)
store i32 0, i32* %3
br label %20
20: ; preds = %14, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @read_devattr_double(i8* %0, double* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @read_devattr(i8* %0, i8** %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %2, %7
%13 = phi i32 [ 0, %7 ], [ %5, %2 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ le_to_u64(int /*<<< orphan*/ const *);
double le_to_double(const uint8_t *buf) {
  union {
    uint64_t u;
    double f;
  } convert;
  convert.u = le_to_u64(buf);
  return convert.f;
}


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

x86 assembly (clang, -O2):
<le_to_double>:
push   %rax
call   1030 <le_to_u64@plt>
mov    %eax,%eax
movq   %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @le_to_double(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @le_to_u64(i32* %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to double*
%8 = load double, double* %7
ret double %8
}

LLVM IR (-O2):
define double @le_to_double(i32* %0) {
%2 = tail call i32 @le_to_u64(i32* %0)
%3 = zext i32 %2 to i64
%4 = bitcast i64 %3 to double
ret double %4
}
double grouping(double i1, double i2, double i3) {
  double d = i1 * i2;
  return d + i3;
}


x86 assembly (clang, -O0):
<grouping>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grouping>:
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @grouping(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fmul double %8, %9
store double %10, double* %7
%11 = load double, double* %7
%12 = load double, double* %6
%13 = fadd double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @grouping(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fadd double %4, %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ com_strlcpy(char *, int /*<<< orphan*/, int);
void Cmd_ArgvBuffer(int arg, char *buffer, int bufferLength) {
  com_strlcpy(buffer, Cmd_Argv(arg), bufferLength);
}


x86 assembly (clang, -O0):
<Cmd_ArgvBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <Cmd_Argv@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x14(%rbp),%edx
call   1030 <com_strlcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_ArgvBuffer>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <Cmd_Argv@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <com_strlcpy@plt>

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

LLVM IR (-O2):
define void @Cmd_ArgvBuffer(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @Cmd_Argv(i32 %0)
%5 = tail call i32 @com_strlcpy(i8* %1, i32 %4, i32 %2)
ret void
}
/* Variables and functions */
unsigned long long unpacku64(unsigned char *);
extern unsigned long long int deserialize_uint64(unsigned char *buf) {
  return (unpacku64(buf));
}


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

x86 assembly (clang, -O2):
<deserialize_uint64>:
jmp    1030 <unpacku64@plt>

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

LLVM IR (-O2):
define i64 @deserialize_uint64(i8* %0) {
%2 = tail call i64 @unpacku64(i8* %0)
ret i64 %2
}
/* Variables and functions */
float min(double, float);
float blend_color_dodge(float A, float B) {
  return (B < 1.0) ? min(1.0, A / (1.0 - B)) : 1.0;
}


x86 assembly (clang, -O0):
<blend_color_dodge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117e <blend_color_dodge+0x6e>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xea9(%rip),%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm1
movsd  0xe95(%rip),%xmm0
call   1030 <min@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1190 <blend_color_dodge+0x80>
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1190 <blend_color_dodge+0x80>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_color_dodge>:
movss  0xee8(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    1148 <blend_color_dodge+0x38>
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movsd  0xed8(%rip),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
divsd  %xmm3,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
jmp    1030 <min@plt>
movss  0xeb0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @blend_color_dodge(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 1.000000e+00
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = load float, float* %4
%12 = fpext float %11 to double
%13 = fsub double 1.000000e+00, %12
%14 = fdiv double %10, %13
%15 = fptrunc double %14 to float
%16 = call float @min(double 1.000000e+00, float %15)
%17 = fpext float %16 to double
br label %19
18: ; preds = %2
br label %19
19: ; preds = %18, %8
%20 = phi double [ %17, %8 ], [ 1.000000e+00, %18 ]
%21 = fptrunc double %20 to float
ret float %21
}

LLVM IR (-O2):
define float @blend_color_dodge(float %0, float %1) {
%3 = fcmp olt float %1, 1.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = fpext float %1 to double
%6 = fpext float %0 to double
%7 = fsub double 1.000000e+00, %5
%8 = fdiv double %6, %7
%9 = fptrunc double %8 to float
%10 = tail call float @min(double 1.000000e+00, float %9)
br label %11
11: ; preds = %2, %4
%12 = phi float [ %10, %4 ], [ 1.000000e+00, %2 ]
ret float %12
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void PWMFaultIntClearExt(uint32_t ui32Base, uint32_t ui32FaultInts) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000001C))) = ui32FaultInts;
}


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

x86 assembly (clang, -O2):
<PWMFaultIntClearExt>:
mov    %rsi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @PWMFaultIntClearExt(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, 28
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntClearExt(i64 %0, i64 %1) {
%3 = add i64 %0, 28
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
size_t block_size(size_t alloc_size) { return (0) + alloc_size; }


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

x86 assembly (clang, -O2):
<block_size>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @block_size(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, int *);
int countInteger(FILE *fptr) {
  int numInt = 0;
  int value;
  while (fscanf(fptr, "%d", &value) == 1) {
    numInt++;
  }
  return numInt;
}


x86 assembly (clang, -O0):
<countInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jne    114e <countInteger+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <countInteger+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countInteger>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffff,%ebx
lea    0xed9(%rip),%r15
lea    0x4(%rsp),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
add    $0x1,%ebx
cmp    $0x1,%eax
je     1130 <countInteger+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @countInteger(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = icmp eq i32 %6, 1
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %4, label %9
9: ; preds = %4
ret i32 %5
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t __attribute__((no, noclone)) vec_while_int8_t(int8_t *restrict a) {
  for (int i = 0; i < 8; ++i)
    a[i] += 1;
}


x86 assembly (clang, -O0):
<vec_while_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1138 <vec_while_int8_t+0x38>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <vec_while_int8_t+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_while_int8_t>:
pcmpeqd %xmm0,%xmm0
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
psubd  %xmm0,%xmm1
movdqu %xmm1,(%rdi)
psubd  %xmm0,%xmm2
movdqu %xmm2,0x10(%rdi)
ret

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

LLVM IR (-O2):
define i32 @vec_while_int8_t(i32* noalias nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = add nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = add nsw <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
%10 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
ret i32 undef
}
/* Variables and functions */
unsigned long GPIOGetIntNumber(unsigned long);
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
void GPIOIntRegister(unsigned long ulPort, void (*pfnIntHandler)(void)) {
  ;
  ulPort = GPIOGetIntNumber(ulPort);
  IntRegister(ulPort, pfnIntHandler);
  IntEnable(ulPort);
}


x86 assembly (clang, -O0):
<GPIOIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <GPIOGetIntNumber@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <IntRegister@plt>
mov    -0x8(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOIntRegister>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <GPIOGetIntNumber@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <IntRegister@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @GPIOIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load i64, i64* %3
%6 = call i64 @GPIOGetIntNumber(i64 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load void ()*, void ()** %4
%9 = bitcast void ()* %8 to void (...)*
%10 = call i32 @IntRegister(i64 %7, void (...)* %9)
%11 = load i64, i64* %3
%12 = call i32 @IntEnable(i64 %11)
ret void
}

LLVM IR (-O2):
define void @GPIOIntRegister(i64 %0, void ()* %1) {
%3 = tail call i64 @GPIOGetIntNumber(i64 %0)
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i32 @IntRegister(i64 %3, void (...)* %4)
%6 = tail call i32 @IntEnable(i64 %3)
ret void
}
int sumHead(int number) {
  if (number == 1) {
    return 1;
  }
  return number + sumHead(number - 1);
}


x86 assembly (clang, -O0):
<sumHead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <sumHead+0x21>
movl   $0x1,-0x4(%rbp)
jmp    114c <sumHead+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sumHead@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumHead>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1124 <sumHead+0x24>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %ecx,%eax
lea    -0x3(%rdi),%edx
imul   %rcx,%rdx
shr    %rdx
add    %edi,%eax
sub    %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sumHead(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = add i32 %0, -2
%6 = mul i32 %4, %5
%7 = zext i32 %5 to i33
%8 = add i32 %0, -3
%9 = zext i32 %8 to i33
%10 = mul i33 %7, %9
%11 = lshr i33 %10, 1
%12 = trunc i33 %11 to i32
%13 = add i32 %6, %0
%14 = sub i32 %13, %12
%15 = add i32 %14, 1
br label %16
16: ; preds = %3, %1
%17 = phi i32 [ 1, %1 ], [ %15, %3 ]
ret i32 %17
}
/* Variables and functions */
void close_audit_fd(void) {}


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

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

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

LLVM IR (-O2):
define void @close_audit_fd() {
ret void
}
int *load_number(int n) {
  int *number;
  return number;
}


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

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

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

LLVM IR (-O2):
define noalias i32* @load_number(i32 %0) {
ret i32* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long volatile);
int main() {
  volatile long a = 0xFFFFFFFFFFFFFFFF;
  a--;
  a *= 2;
  printf("%ld\n", a);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0xffffffffffffffff,(%rsp)
ff
addq   $0xffffffffffffffff,(%rsp)
shlq   (%rsp)
mov    (%rsp),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store volatile i64 -1, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, -1
store volatile i64 %4, i64* %2
%5 = load volatile i64, i64* %2
%6 = mul nsw i64 %5, 2
store volatile i64 %6, i64* %2
%7 = load volatile i64, i64* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load volatile i64, i64* %2
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store volatile i64 -1, i64* %1
%3 = load volatile i64, i64* %1
%4 = add nsw i64 %3, -1
store volatile i64 %4, i64* %1
%5 = load volatile i64, i64* %1
%6 = shl nsw i64 %5, 1
store volatile i64 %6, i64* %1
%7 = load volatile i64, i64* %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load volatile i64, i64* %1
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ debug_node_print();
int /*<<< orphan*/ reset_debug_buffer();
void flush_debug_buffer(void) {
  debug_node_print();
  reset_debug_buffer();
}


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

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

LLVM IR (-O0):
define void @flush_debug_buffer() {
%1 = call i32 (...) @debug_node_print()
%2 = call i32 (...) @reset_debug_buffer()
ret void
}

LLVM IR (-O2):
define void @flush_debug_buffer() {
%1 = tail call i32 (...) @debug_node_print()
%2 = tail call i32 (...) @reset_debug_buffer()
ret void
}
/* Variables and functions */
int find_missing1(int array[], size_t len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @find_missing1(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
int slength(char *str) {
  char *s;
  for (s = str; *s; s++)
    ;
  return s - str;
}


x86 assembly (clang, -O0):
<slength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <slength+0x33>
jmp    1122 <slength+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <slength+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <slength+0x10>
ret

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

LLVM IR (-O2):
define i32 @slength(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
scalar_t__ calloc(size_t, size_t);
int /*<<< orphan*/ free(int *);
void uninitvar_calloc(void) {
  size_t nitems;
  size_t size;
  int *p = (int *)calloc(nitems, size);
  free(p);
}


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

x86 assembly (clang, -O2):
<uninitvar_calloc>:
push   %rax
call   1040 <calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @uninitvar_calloc() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32*
%4 = load i64, i64* %1
%5 = load i64, i64* %2
%6 = call i64 @calloc(i64 %4, i64 %5)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = call i32 @free(i32* %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_calloc() {
%1 = tail call i64 @calloc(i64 undef, i64 undef)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int html_armor_text(char const *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char const *);
int html_armor_string(char const *str, char *out) {
  return html_armor_text(str, strlen(str), out);
}


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

x86 assembly (clang, -O2):
<html_armor_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <html_armor_text@plt>

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

LLVM IR (-O2):
define i32 @html_armor_string(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @html_armor_text(i8* %0, i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, int *, int);
getchar() {
  int c;
  c = 0;
  read(0, &c, 1);
  return (c);
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getchar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @read(i32 0, i32* %1, i32 1)
%4 = load i32, i32* %1
ret i32 %4
}
int uStrFindChar(const char *str, char find) {
  int i = 0;
  while (str[i] != '\0') {
    if (str[i] == find)
      return i;
    i++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<uStrFindChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <uStrFindChar+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <uStrFindChar+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <uStrFindChar+0x62>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <uStrFindChar+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uStrFindChar>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <uStrFindChar+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <uStrFindChar+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <uStrFindChar+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @uStrFindChar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %1
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %9 ]
ret i32 %17
}
void event_abbreviation(symbol, string, container) char symbol;
char *string;
char container;
{}


x86 assembly (clang, -O0):
<event_abbreviation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%cl
mov    %dl,%al
mov    %cl,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @event_abbreviation(i32 %0, i8* %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8
%7 = trunc i32 %0 to i8
%8 = trunc i32 %2 to i8
store i8 %7, i8* %4
store i8* %1, i8** %5
store i8 %8, i8* %6
ret void
}

LLVM IR (-O2):
define void @event_abbreviation(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("cl_icd_layer.h standalone test PASSED.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"cl_icd_layer.h standalone test PASSED.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"cl_icd_layer.h standalone test PASSED.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int pes_get_headerlength(int /*<<< orphan*/ *);
uint8_t *pes_payload(uint8_t *p_pes) {
  return p_pes + 6 + 3 + pes_get_headerlength(p_pes);
}


x86 assembly (clang, -O0):
<pes_payload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x18,%rax
add    $0xc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pes_get_headerlength@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_payload>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pes_get_headerlength@plt>
cltq
lea    (%rbx,%rax,4),%rax
add    $0x24,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @pes_payload(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = getelementptr inbounds i32, i32* %4, i64 3
%6 = load i32*, i32** %2
%7 = call i32 @pes_get_headerlength(i32* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
ret i32* %9
}

LLVM IR (-O2):
define i32* @pes_payload(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = tail call i32 @pes_get_headerlength(i32* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
ret i32* %5
}