float _acosf(float x) {
  float y, g;
  float num, den, result;
  long int i;
  y = x;
  if (y < (float)0.0) {
    y = -y;
  }
  if (y > (float)0.5) {
    i = 0;
    if (y > (float)1.0) {
      result = 0.0;
      return result;
    }
    g = ((float)(1.0) - (float)(y));
    g = ((float)(0.5) * (float)(g));
    y = sqrtf(g);
    y = ((float)(y) * (float)(-2.0));
  } else {
    i = 1;
    if (y < (float)(+3.452669830012e-4F)) {
      result = y;
      if (x < (float)0.0) {
        result = ((float)((float)(0.78539816339744830961566084581988L)) +
                  (float)(result));
        result = ((float)(result) +
                  (float)((float)(0.78539816339744830961566084581988L)));
      } else {
        result = ((float)((float)(0.78539816339744830961566084581988L)) -
                  (float)(result));
        result = ((float)(result) +
                  (float)((float)(0.78539816339744830961566084581988L)));
      }
      return result;
    }
    g = ((float)(y) * (float)(y));
  }
  num = ((float)((-5.9450144193246e-1F)) * (float)(g));
  num = ((float)(num) + (float)((+2.9058762374859F)));
  num = ((float)(num) * (float)(g));
  num = ((float)(num) + (float)((-2.7516555290596F)));
  num = ((float)(num) * (float)(g));
  den = ((float)(g) + (float)((-1.0333867072113e+1F)));
  den = ((float)(den) * (float)(g));
  den = ((float)(den) + (float)((+2.4864728969164e+1F)));
  den = ((float)(den) * (float)(g));
  den = ((float)(den) + (float)((-1.6509933202424e+1F)));
  result = ((float)(num) / (float)(den));
  result = ((float)(result) * (float)(y));
  result = ((float)(result) + (float)(y));
  if (x < (float)0.0) {
    if (i == 0) {
      result = ((float)(result) +
                (float)((float)(1.5707963267948966192313216916398L)));
      result = ((float)(result) +
                (float)((float)(1.5707963267948966192313216916398L)));
    } else {
      result = ((float)((float)(0.78539816339744830961566084581988L)) +
                (float)(result));
      result = ((float)(result) +
                (float)((float)(0.78539816339744830961566084581988L)));
    }
  } else {
    if (i == 1) {
      result = ((float)((float)(0.78539816339744830961566084581988L)) -
                (float)(result));
      result = ((float)(result) +
                (float)((float)(0.78539816339744830961566084581988L)));
    } else {
      result = -result;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<_acosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    114b <_acosf+0x3b>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xea8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11e0 <_acosf+0xd0>
movq   $0x0,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe96(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1196 <_acosf+0x86>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1415 <_acosf+0x305>
movss  0xe6e(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe50(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <sqrtf@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xe3f(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    127c <_acosf+0x16c>
movq   $0x1,-0x28(%rbp)
movss  0xe14(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    126d <_acosf+0x15d>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    123a <_acosf+0x12a>
movss  0xdef(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xddd(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    125e <_acosf+0x14e>
movss  0xdc6(%rip),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xdb4(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1415 <_acosf+0x305>
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xda4(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xd8e(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xd69(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xd44(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xd1f(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xcfa(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
divss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    13bb <_acosf+0x2ab>
cmpq   $0x0,-0x28(%rbp)
jne    1392 <_acosf+0x282>
movss  0xcbb(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xca9(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    13b6 <_acosf+0x2a6>
movss  0xc6e(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xc5c(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    140b <_acosf+0x2fb>
cmpq   $0x1,-0x28(%rbp)
jne    13ef <_acosf+0x2df>
movss  0xc3a(%rip),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xc28(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1406 <_acosf+0x2f6>
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    140b <_acosf+0x2fb>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_acosf>:
sub    $0x38,%rsp
movaps %xmm0,%xmm2
movaps 0xee2(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm0,%xmm0
movaps %xmm2,%xmm3
cmpltss %xmm0,%xmm3
andps  %xmm3,%xmm1
andnps %xmm2,%xmm3
orps   %xmm1,%xmm3
ucomiss 0xed4(%rip),%xmm3
jbe    1170 <_acosf+0x60>
ucomiss 0xed7(%rip),%xmm3
ja     124f <_acosf+0x13f>
movss  0xec9(%rip),%xmm4
subss  %xmm3,%xmm4
mulss  0xeb1(%rip),%xmm4
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm4
jb     119d <_acosf+0x8d>
xorps  %xmm1,%xmm1
sqrtss %xmm4,%xmm1
jmp    11c8 <_acosf+0xb8>
movss  0xe9c(%rip),%xmm0
ucomiss %xmm3,%xmm0
jbe    1191 <_acosf+0x81>
movss  0xe93(%rip),%xmm1
movaps %xmm1,%xmm0
subss  %xmm2,%xmm0
jmp    1260 <_acosf+0x150>
movaps %xmm3,%xmm4
mulss  %xmm3,%xmm4
movaps %xmm3,%xmm1
jmp    11d0 <_acosf+0xc0>
movaps %xmm4,%xmm0
movaps %xmm3,0x20(%rsp)
movaps %xmm2,0x10(%rsp)
movss  %xmm4,0xc(%rsp)
call   1030 <sqrtf@plt>
movss  0xc(%rsp),%xmm4
movaps 0x10(%rsp),%xmm2
movaps 0x20(%rsp),%xmm3
movaps %xmm0,%xmm1
mulss  0xe50(%rip),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm2,%xmm0
movss  0xe46(%rip),%xmm0
mulss  %xmm4,%xmm0
addss  0xe3e(%rip),%xmm0
mulss  %xmm4,%xmm0
addss  0xe36(%rip),%xmm0
movss  0xe32(%rip),%xmm2
addss  %xmm4,%xmm2
mulss  %xmm4,%xmm2
addss  0xe26(%rip),%xmm2
mulss  %xmm4,%xmm2
addss  0xe1e(%rip),%xmm2
mulss  %xmm4,%xmm0
divss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
jbe    123f <_acosf+0x12f>
ucomiss 0xddd(%rip),%xmm3
jbe    1254 <_acosf+0x144>
movss  0xdff(%rip),%xmm1
jmp    125c <_acosf+0x14c>
ucomiss 0xdca(%rip),%xmm3
jbe    1269 <_acosf+0x159>
xorps  0xdb1(%rip),%xmm0
add    $0x38,%rsp
ret
movss  0xdbc(%rip),%xmm1
addss  %xmm1,%xmm0
addss  %xmm1,%xmm0
add    $0x38,%rsp
ret
movss  0xda7(%rip),%xmm1
movaps %xmm1,%xmm2
subss  %xmm0,%xmm2
addss  %xmm1,%xmm2
movaps %xmm2,%xmm0
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
define float @_acosf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
%5 = fcmp ogt float %4, 5.000000e-01
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = fcmp ogt float %4, 1.000000e+00
br i1 %7, label %49, label %8
8: ; preds = %6
%9 = fsub float 1.000000e+00, %4
%10 = fmul float %9, 5.000000e-01
%11 = tail call float @sqrtf(float %10)
%12 = fmul float %11, -2.000000e+00
br label %20
13: ; preds = %1
%14 = fcmp olt float %4, 0x3F36A09E60000000
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = fsub float 0x3FE921FB60000000, %0
%17 = fadd float %16, 0x3FE921FB60000000
br label %49
18: ; preds = %13
%19 = fmul float %4, %4
br label %20
20: ; preds = %18, %8
%21 = phi float [ %10, %8 ], [ %19, %18 ]
%22 = phi float [ %12, %8 ], [ %4, %18 ]
%23 = fmul float %21, 0x3FE30627E0000000
%24 = fsub float 0x40073F3C00000000, %23
%25 = fmul float %21, %24
%26 = fadd float %25, 0xC006036400000000
%27 = fmul float %21, %26
%28 = fadd float %21, 0xC024AAF0A0000000
%29 = fmul float %21, %28
%30 = fadd float %29, 0x4038DD5EE0000000
%31 = fmul float %21, %30
%32 = fadd float %31, 0xC030828B00000000
%33 = fdiv float %27, %32
%34 = fmul float %22, %33
%35 = fadd float %22, %34
br i1 %2, label %36, label %43
36: ; preds = %20
br i1 %5, label %37, label %40
37: ; preds = %36
%38 = fadd float %35, 0x3FF921FB60000000
%39 = fadd float %38, 0x3FF921FB60000000
br label %49
40: ; preds = %36
%41 = fadd float %35, 0x3FE921FB60000000
%42 = fadd float %41, 0x3FE921FB60000000
br label %49
43: ; preds = %20
br i1 %5, label %47, label %44
44: ; preds = %43
%45 = fsub float 0x3FE921FB60000000, %35
%46 = fadd float %45, 0x3FE921FB60000000
br label %49
47: ; preds = %43
%48 = fneg float %35
br label %49
49: ; preds = %40, %37, %47, %44, %6, %15
%50 = phi float [ %17, %15 ], [ 0.000000e+00, %6 ], [ %39, %37 ], [ %42, %40 ], [ %46, %44 ], [ %48, %47 ]
ret float %50
}