#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
float normalcutoff(float mu, float sigma, float percent) {
  percent = percent / 100.0;
  float z = 0.0;
  if (percent == 0.7) {
    z = 0.524;
  } else if (percent == 0.8) {
    z = 0.842;
  } else if (percent == 0.9) {
    z = 1.282;
  } else if (percent == 0.95) {
    z = 1.645;
  } else if (percent == 0.975) {
    z = 1.96;
  } else if (percent == 0.98) {
    z = 2.054;
  } else {
    z = 2.054;
  }
  float x = (z * (sqrtf(sigma))) + mu;
  return x;
}


x86 assembly (clang, -O0):
<normalcutoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1180 <normalcutoff+0x70>
jp     1180 <normalcutoff+0x70>
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    12a5 <normalcutoff+0x195>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11b3 <normalcutoff+0xa3>
jp     11b3 <normalcutoff+0xa3>
movss  0xe9f(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    12a0 <normalcutoff+0x190>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe54(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11e6 <normalcutoff+0xd6>
jp     11e6 <normalcutoff+0xd6>
movss  0xe68(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    129b <normalcutoff+0x18b>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe29(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1219 <normalcutoff+0x109>
jp     1219 <normalcutoff+0x109>
movss  0xe31(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1296 <normalcutoff+0x186>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    124c <normalcutoff+0x13c>
jp     124c <normalcutoff+0x13c>
movss  0xdfa(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1291 <normalcutoff+0x181>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    127f <normalcutoff+0x16f>
jp     127f <normalcutoff+0x16f>
movss  0xdc3(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    128c <normalcutoff+0x17c>
movss  0xdb1(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1291 <normalcutoff+0x181>
jmp    1296 <normalcutoff+0x186>
jmp    129b <normalcutoff+0x18b>
jmp    12a0 <normalcutoff+0x190>
jmp    12a5 <normalcutoff+0x195>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm2
movss  -0x18(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalcutoff>:
push   %rax
movaps %xmm0,%xmm3
divss  0xee4(%rip),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
ucomisd 0xef5(%rip),%xmm0
jne    1139 <normalcutoff+0x29>
jp     1139 <normalcutoff+0x29>
movss  0xecd(%rip),%xmm2
jmp    1199 <normalcutoff+0x89>
ucomisd 0xee7(%rip),%xmm0
jne    114f <normalcutoff+0x3f>
jp     114f <normalcutoff+0x3f>
movss  0xebb(%rip),%xmm2
jmp    1199 <normalcutoff+0x89>
ucomisd 0xed9(%rip),%xmm0
jne    1165 <normalcutoff+0x55>
jp     1165 <normalcutoff+0x55>
movss  0xea9(%rip),%xmm2
jmp    1199 <normalcutoff+0x89>
ucomisd 0xecb(%rip),%xmm0
jne    117b <normalcutoff+0x6b>
jp     117b <normalcutoff+0x6b>
movss  0xe97(%rip),%xmm2
jmp    1199 <normalcutoff+0x89>
ucomisd 0xebd(%rip),%xmm0
jne    1191 <normalcutoff+0x81>
jp     1191 <normalcutoff+0x81>
movss  0xe85(%rip),%xmm2
jmp    1199 <normalcutoff+0x89>
movss  0xe7f(%rip),%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jb     11aa <normalcutoff+0x9a>
xorps  %xmm0,%xmm0
sqrtss %xmm1,%xmm0
jmp    11c8 <normalcutoff+0xb8>
movaps %xmm1,%xmm0
movss  %xmm3,0x4(%rsp)
movss  %xmm2,(%rsp)
call   1030 <sqrtf@plt>
movss  (%rsp),%xmm2
movss  0x4(%rsp),%xmm3
mulss  %xmm0,%xmm2
addss  %xmm3,%xmm2
movaps %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @normalcutoff(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %6
%10 = fpext float %9 to double
%11 = fdiv double %10, 1.000000e+02
%12 = fptrunc double %11 to float
store float %12, float* %6
store float 0.000000e+00, float* %7
%13 = load float, float* %6
%14 = fpext float %13 to double
%15 = fcmp oeq double %14, 0x3FE6666666666666
br i1 %15, label %16, label %17
16: ; preds = %3
store float 0x3FE0C49BA0000000, float* %7
br label %48
17: ; preds = %3
%18 = load float, float* %6
%19 = fpext float %18 to double
%20 = fcmp oeq double %19, 8.000000e-01
br i1 %20, label %21, label %22
21: ; preds = %17
store float 0x3FEAF1AA00000000, float* %7
br label %47
22: ; preds = %17
%23 = load float, float* %6
%24 = fpext float %23 to double
%25 = fcmp oeq double %24, 9.000000e-01
br i1 %25, label %26, label %27
26: ; preds = %22
store float 0x3FF4831260000000, float* %7
br label %46
27: ; preds = %22
%28 = load float, float* %6
%29 = fpext float %28 to double
%30 = fcmp oeq double %29, 0x3FEE666666666666
br i1 %30, label %31, label %32
31: ; preds = %27
store float 0x3FFA51EB80000000, float* %7
br label %45
32: ; preds = %27
%33 = load float, float* %6
%34 = fpext float %33 to double
%35 = fcmp oeq double %34, 0x3FEF333333333333
br i1 %35, label %36, label %37
36: ; preds = %32
store float 0x3FFF5C2900000000, float* %7
br label %44
37: ; preds = %32
%38 = load float, float* %6
%39 = fpext float %38 to double
%40 = fcmp oeq double %39, 0x3FEF5C28F5C28F5C
br i1 %40, label %41, label %42
41: ; preds = %37
store float 0x40006E9780000000, float* %7
br label %43
42: ; preds = %37
store float 0x40006E9780000000, float* %7
br label %43
43: ; preds = %42, %41
br label %44
44: ; preds = %43, %36
br label %45
45: ; preds = %44, %31
br label %46
46: ; preds = %45, %26
br label %47
47: ; preds = %46, %21
br label %48
48: ; preds = %47, %16
%49 = load float, float* %7
%50 = load float, float* %5
%51 = call float @sqrtf(float %50)
%52 = load float, float* %4
%53 = call float @llvm.fmuladd.f32(float %49, float %51, float %52)
store float %53, float* %8
%54 = load float, float* %8
ret float %54
}

LLVM IR (-O2):
define float @normalcutoff(float %0, float %1, float %2) {
%4 = fdiv float %2, 1.000000e+02
%5 = fpext float %4 to double
%6 = fcmp oeq double %5, 0x3FE6666666666666
br i1 %6, label %16, label %7
7: ; preds = %3
%8 = fcmp oeq double %5, 8.000000e-01
br i1 %8, label %16, label %9
9: ; preds = %7
%10 = fcmp oeq double %5, 9.000000e-01
br i1 %10, label %16, label %11
11: ; preds = %9
%12 = fcmp oeq double %5, 0x3FEE666666666666
br i1 %12, label %16, label %13
13: ; preds = %11
%14 = fcmp oeq double %5, 0x3FEF333333333333
br i1 %14, label %16, label %15
15: ; preds = %13
br label %16
16: ; preds = %15, %13, %11, %9, %7, %3
%17 = phi float [ 0x3FE0C49BA0000000, %3 ], [ 0x3FEAF1AA00000000, %7 ], [ 0x3FF4831260000000, %9 ], [ 0x3FFA51EB80000000, %11 ], [ 0x3FFF5C2900000000, %13 ], [ 0x40006E9780000000, %15 ]
%18 = tail call float @sqrtf(float %1)
%19 = tail call float @llvm.fmuladd.f32(float %17, float %18, float %0)
ret float %19
}