float _cotf(float x) {
  long int n;
  float xn;
  float f, g;
  float x_int, x_fract;
  float result;
  float xnum, xden;
  if ((x > (float)(+9.099024257348e3L)) || (x < (float)-(+9.099024257348e3L))) {
    return (float)0.0;
  }
  x_int = ((float)(((long)(x))));
  x_fract = ((float)(x) - (float)(x_int));
  if (x > (float)0.0) {
    n = ((long)((
        (float)(((float)(x) *
                 (float)((float)(0.63661977236758134307553505349006L)))) +
        (float)(0.5))));
  } else {
    n = ((long)((
        (float)(((float)(x) *
                 (float)((float)(0.63661977236758134307553505349006L)))) +
        (float)(-0.5))));
  }
  xn = ((float)(n));
  f = ((float)(x_int) - (float)(((float)(xn) * (float)((1.5703125F)))));
  f = ((float)(f) + (float)(x_fract));
  f = ((float)(f) - (float)(((float)(xn) * (float)((4.84466552734375e-4F)))));
  f = ((float)(f) - (float)(((float)(xn) *
                             (float)((-6.39757837755768678308360248557e-7F)))));
  if (f < (float)0.0) {
    g = -f;
  } else {
    g = f;
  }
  if (g < (float)(+3.452669830012e-4F)) {
    if (n & 0x0001) {
      result = -f;
    } else {
      result = ((float)(1.0) / (float)(f));
    }
    return result;
  }
  g = ((float)(f) * (float)(f));
  xnum = ((float)(g) * (float)((+1.075154738488e-3F)));
  xnum = ((float)(xnum) + (float)((-1.113614403566e-1F)));
  xnum = ((float)(xnum) * (float)(g));
  xnum = ((float)(xnum) * (float)(f));
  xnum = ((float)(xnum) + (float)(f));
  xden = ((float)(g) * (float)((+1.597339213300e-2F)));
  xden = ((float)(xden) + (float)((-4.446947720281e-1F)));
  xden = ((float)(xden) * (float)(g));
  xden = ((float)(xden) + (float)((+1.000000000000F)));
  if (n & 0x0001) {
    xnum = -xnum;
  } else {
    result = xden;
    xden = xnum;
    xnum = result;
  }
  result = ((float)(xnum) / (float)(xden));
  return result;
}


x86 assembly (clang, -O0):
<_cotf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1131 <_cotf+0x31>
movss  0xedd(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    113e <_cotf+0x3e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    13fb <_cotf+0x2fb>
cvttss2si -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1199 <_cotf+0x99>
movss  -0x8(%rbp),%xmm0
movss  0xe8d(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe89(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
jmp    11bf <_cotf+0xbf>
movss  -0x8(%rbp),%xmm0
movss  0xe62(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe5a(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
cvtsi2ssq -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe33(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xdf4(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xdc4(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    1286 <_cotf+0x186>
movss  -0x18(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1290 <_cotf+0x190>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xd88(%rip),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    12f1 <_cotf+0x1f1>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     12d0 <_cotf+0x1d0>
movss  -0x18(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x28(%rbp)
jmp    12e2 <_cotf+0x1e2>
movss  0xd4c(%rip),%xmm0
divss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    13fb <_cotf+0x2fb>
movss  -0x18(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xd2c(%rip),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  0xd16(%rip),%xmm0
addss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  0xcd3(%rip),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  0xcbd(%rip),%xmm0
addss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  0xc98(%rip),%xmm0
addss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     13c4 <_cotf+0x2c4>
movss  -0x2c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
jmp    13e2 <_cotf+0x2e2>
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
divss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cotf>:
movaps %xmm0,%xmm1
ucomiss 0xef6(%rip),%xmm0
xorps  %xmm0,%xmm0
ja     122e <_cotf+0x12e>
movss  0xee9(%rip),%xmm2
ucomiss %xmm1,%xmm2
ja     122e <_cotf+0x12e>
xorps  %xmm2,%xmm2
xor    %eax,%eax
ucomiss %xmm2,%xmm1
seta   %al
cvttss2si %xmm1,%rcx
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
movaps %xmm1,%xmm3
mulss  0xec1(%rip),%xmm1
lea    0xee2(%rip),%rcx
addss  (%rcx,%rax,4),%xmm1
cvttss2si %xmm1,%rax
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
subss  %xmm0,%xmm3
movss  0xea0(%rip),%xmm4
mulss  %xmm1,%xmm4
addss  %xmm0,%xmm4
addss  %xmm3,%xmm4
movss  0xe90(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  %xmm4,%xmm0
mulss  0xe84(%rip),%xmm1
addss  %xmm0,%xmm1
movaps 0xea5(%rip),%xmm0
xorps  %xmm1,%xmm0
movaps %xmm1,%xmm3
cmpltss %xmm2,%xmm3
movaps %xmm3,%xmm2
andps  %xmm0,%xmm2
andnps %xmm1,%xmm3
orps   %xmm2,%xmm3
movss  0xe5e(%rip),%xmm2
ucomiss %xmm3,%xmm2
jbe    11cd <_cotf+0xcd>
test   $0x1,%al
jne    122e <_cotf+0x12e>
movss  0xe61(%rip),%xmm0
jmp    122a <_cotf+0x12a>
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
movss  0xe40(%rip),%xmm2
mulss  %xmm0,%xmm2
addss  0xe38(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm1,%xmm2
movss  0xe28(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe20(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe18(%rip),%xmm1
test   $0x1,%al
je     1224 <_cotf+0x124>
xorps  0xe21(%rip),%xmm2
movaps %xmm2,%xmm0
jmp    122a <_cotf+0x12a>
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_cotf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i64
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %3
%13 = load float, float* %3
%14 = fcmp ogt float %13, 0x40C1C58320000000
br i1 %14, label %18, label %15
15: ; preds = %1
%16 = load float, float* %3
%17 = fcmp olt float %16, 0xC0C1C58320000000
br i1 %17, label %18, label %19
18: ; preds = %15, %1
store float 0.000000e+00, float* %2
br label %117
19: ; preds = %15
%20 = load float, float* %3
%21 = fptosi float %20 to i64
%22 = sitofp i64 %21 to float
store float %22, float* %8
%23 = load float, float* %3
%24 = load float, float* %8
%25 = fsub float %23, %24
store float %25, float* %9
%26 = load float, float* %3
%27 = fcmp ogt float %26, 0.000000e+00
br i1 %27, label %28, label %32
28: ; preds = %19
%29 = load float, float* %3
%30 = call float @llvm.fmuladd.f32(float %29, float 0x3FE45F3060000000, float 5.000000e-01)
%31 = fptosi float %30 to i64
store i64 %31, i64* %4
br label %36
32: ; preds = %19
%33 = load float, float* %3
%34 = call float @llvm.fmuladd.f32(float %33, float 0x3FE45F3060000000, float -5.000000e-01)
%35 = fptosi float %34 to i64
store i64 %35, i64* %4
br label %36
36: ; preds = %32, %28
%37 = load i64, i64* %4
%38 = sitofp i64 %37 to float
store float %38, float* %5
%39 = load float, float* %8
%40 = load float, float* %5
%41 = fneg float %40
%42 = call float @llvm.fmuladd.f32(float %41, float 0x3FF9200000000000, float %39)
store float %42, float* %6
%43 = load float, float* %6
%44 = load float, float* %9
%45 = fadd float %43, %44
store float %45, float* %6
%46 = load float, float* %6
%47 = load float, float* %5
%48 = fneg float %47
%49 = call float @llvm.fmuladd.f32(float %48, float 0x3F3FC00000000000, float %46)
store float %49, float* %6
%50 = load float, float* %6
%51 = load float, float* %5
%52 = fneg float %51
%53 = call float @llvm.fmuladd.f32(float %52, float 0xBEA5777A60000000, float %50)
store float %53, float* %6
%54 = load float, float* %6
%55 = fcmp olt float %54, 0.000000e+00
br i1 %55, label %56, label %59
56: ; preds = %36
%57 = load float, float* %6
%58 = fneg float %57
store float %58, float* %7
br label %61
59: ; preds = %36
%60 = load float, float* %6
store float %60, float* %7
br label %61
61: ; preds = %59, %56
%62 = load float, float* %7
%63 = fcmp olt float %62, 0x3F36A09E60000000
br i1 %63, label %64, label %76
64: ; preds = %61
%65 = load i64, i64* %4
%66 = and i64 %65, 1
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %64
%69 = load float, float* %6
%70 = fneg float %69
store float %70, float* %10
br label %74
71: ; preds = %64
%72 = load float, float* %6
%73 = fdiv float 1.000000e+00, %72
store float %73, float* %10
br label %74
74: ; preds = %71, %68
%75 = load float, float* %10
store float %75, float* %2
br label %117
76: ; preds = %61
%77 = load float, float* %6
%78 = load float, float* %6
%79 = fmul float %77, %78
store float %79, float* %7
%80 = load float, float* %7
%81 = fmul float %80, 0x3F519D86A0000000
store float %81, float* %11
%82 = load float, float* %11
%83 = fadd float %82, 0xBFBC822F00000000
store float %83, float* %11
%84 = load float, float* %11
%85 = load float, float* %7
%86 = fmul float %84, %85
store float %86, float* %11
%87 = load float, float* %11
%88 = load float, float* %6
%89 = fmul float %87, %88
store float %89, float* %11
%90 = load float, float* %11
%91 = load float, float* %6
%92 = fadd float %90, %91
store float %92, float* %11
%93 = load float, float* %7
%94 = fmul float %93, 0x3F905B5440000000
store float %94, float* %12
%95 = load float, float* %12
%96 = fadd float %95, 0xBFDC75E100000000
store float %96, float* %12
%97 = load float, float* %12
%98 = load float, float* %7
%99 = fmul float %97, %98
store float %99, float* %12
%100 = load float, float* %12
%101 = fadd float %100, 1.000000e+00
store float %101, float* %12
%102 = load i64, i64* %4
%103 = and i64 %102, 1
%104 = icmp ne i64 %103, 0
br i1 %104, label %105, label %108
105: ; preds = %76
%106 = load float, float* %11
%107 = fneg float %106
store float %107, float* %11
br label %112
108: ; preds = %76
%109 = load float, float* %12
store float %109, float* %10
%110 = load float, float* %11
store float %110, float* %12
%111 = load float, float* %10
store float %111, float* %11
br label %112
112: ; preds = %108, %105
%113 = load float, float* %11
%114 = load float, float* %12
%115 = fdiv float %113, %114
store float %115, float* %10
%116 = load float, float* %10
store float %116, float* %2
br label %117
117: ; preds = %112, %74, %18
%118 = load float, float* %2
ret float %118
}

LLVM IR (-O2):
define float @_cotf(float %0) {
%2 = fcmp ogt float %0, 0x40C1C58320000000
%3 = fcmp olt float %0, 0xC0C1C58320000000
%4 = or i1 %2, %3
br i1 %4, label %46, label %5
5: ; preds = %1
%6 = fptosi float %0 to i64
%7 = sitofp i64 %6 to float
%8 = fsub float %0, %7
%9 = fcmp ogt float %0, 0.000000e+00
%10 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FE45F3060000000, float 5.000000e-01)
%11 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FE45F3060000000, float -5.000000e-01)
%12 = select i1 %9, float %10, float %11
%13 = fptosi float %12 to i64
%14 = sitofp i64 %13 to float
%15 = fneg float %14
%16 = tail call float @llvm.fmuladd.f32(float %15, float 0x3FF9200000000000, float %7)
%17 = fadd float %8, %16
%18 = tail call float @llvm.fmuladd.f32(float %15, float 0x3F3FC00000000000, float %17)
%19 = tail call float @llvm.fmuladd.f32(float %15, float 0xBEA5777A60000000, float %18)
%20 = fcmp olt float %19, 0.000000e+00
%21 = fneg float %19
%22 = select i1 %20, float %21, float %19
%23 = fcmp olt float %22, 0x3F36A09E60000000
br i1 %23, label %24, label %29
24: ; preds = %5
%25 = and i64 %13, 1
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %46
27: ; preds = %24
%28 = fdiv float 1.000000e+00, %19
br label %46
29: ; preds = %5
%30 = fmul float %19, %19
%31 = fmul float %30, 0x3F519D86A0000000
%32 = fadd float %31, 0xBFBC822F00000000
%33 = fmul float %30, %32
%34 = fmul float %19, %33
%35 = fadd float %19, %34
%36 = fmul float %30, 0x3F905B5440000000
%37 = fadd float %36, 0xBFDC75E100000000
%38 = fmul float %30, %37
%39 = fadd float %38, 1.000000e+00
%40 = and i64 %13, 1
%41 = icmp eq i64 %40, 0
%42 = fneg float %35
%43 = select i1 %41, float %39, float %42
%44 = select i1 %41, float %35, float %39
%45 = fdiv float %43, %44
br label %46
46: ; preds = %24, %27, %1, %29
%47 = phi float [ %45, %29 ], [ 0.000000e+00, %1 ], [ %28, %27 ], [ %21, %24 ]
ret float %47
}