__attribute__((always_)) void tsc(float a, float *c, float *s) {
  if (a < (1.0f / 3.0f)) {
    float m = a / (1.0f / 3.0f);
    *c = 0.0f + (-0.8660254038f - 0.0f) * m;
    *s = 1.0f + (-0.5f - 1.0f) * m;
  } else if (a < 2.0f * (1.0f / 3.0f)) {
    float m = (a - (1.0f / 3.0f)) / (1.0f / 3.0f);
    *c = -0.8660254038f + (0.8660254038f - -0.8660254038f) * m;
    *s = -0.5f + (-0.5f - -0.5f) * m;
  } else {
    float m = (a - 2.0f * (1.0f / 3.0f)) / (1.0f / 3.0f);
    *c = 0.8660254038f + (0.0f - 0.8660254038f) * m;
    *s = -0.5f + (1.0f - -0.5f) * m;
  }
}


x86 assembly (clang, -O0):
<tsc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  0xee7(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1183 <tsc+0x83>
movss  -0x4(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xeca(%rip),%xmm1
mulss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
movss  0xeb6(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xeae(%rip),%xmm1
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
jmp    1272 <tsc+0x172>
movss  0xe79(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1201 <tsc+0x101>
movss  -0x4(%rbp),%xmm0
movss  0xe5e(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe52(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  0xe54(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe40(%rip),%xmm1
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
mulss  %xmm1,%xmm0
movss  0xe1c(%rip),%xmm1
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
jmp    126d <tsc+0x16d>
movss  -0x4(%rbp),%xmm0
movss  0xdf6(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xde6(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
movss  0xde0(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xdd8(%rip),%xmm1
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x24(%rbp),%xmm0
movss  0xdb3(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xdab(%rip),%xmm1
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
jmp    1272 <tsc+0x172>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsc>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1141 <tsc+0x41>
divss  0xeeb(%rip),%xmm0
movss  0xeef(%rip),%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
addss  %xmm1,%xmm2
movss  %xmm2,(%rdi)
mulss  0xef0(%rip),%xmm0
addss  0xeec(%rip),%xmm0
movss  %xmm0,(%rsi)
ret
movss  0xebb(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    118a <tsc+0x8a>
addss  0xec6(%rip),%xmm0
divss  0xea2(%rip),%xmm0
movss  0xeba(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe9a(%rip),%xmm1
movss  %xmm1,(%rdi)
xorps  %xmm1,%xmm1
mulss  %xmm0,%xmm1
addss  0xe93(%rip),%xmm1
movss  %xmm1,(%rsi)
ret
addss  0xe76(%rip),%xmm0
divss  0xe66(%rip),%xmm0
movss  0xe6a(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe62(%rip),%xmm1
movss  %xmm1,(%rdi)
mulss  0xe5a(%rip),%xmm0
addss  0xe56(%rip),%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @tsc(float %0, float* %1, float* %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %4
store float* %1, float** %5
store float* %2, float** %6
%10 = load float, float* %4
%11 = fcmp olt float %10, 0x3FD5555560000000
br i1 %11, label %12, label %21
12: ; preds = %3
%13 = load float, float* %4
%14 = fdiv float %13, 0x3FD5555560000000
store float %14, float* %7
%15 = load float, float* %7
%16 = call float @llvm.fmuladd.f32(float 0xBFEBB67AE0000000, float %15, float 0.000000e+00)
%17 = load float*, float** %5
store float %16, float* %17
%18 = load float, float* %7
%19 = call float @llvm.fmuladd.f32(float -1.500000e+00, float %18, float 1.000000e+00)
%20 = load float*, float** %6
store float %19, float* %20
br label %45
21: ; preds = %3
%22 = load float, float* %4
%23 = fcmp olt float %22, 0x3FE5555560000000
br i1 %23, label %24, label %34
24: ; preds = %21
%25 = load float, float* %4
%26 = fsub float %25, 0x3FD5555560000000
%27 = fdiv float %26, 0x3FD5555560000000
store float %27, float* %8
%28 = load float, float* %8
%29 = call float @llvm.fmuladd.f32(float 0x3FFBB67AE0000000, float %28, float 0xBFEBB67AE0000000)
%30 = load float*, float** %5
store float %29, float* %30
%31 = load float, float* %8
%32 = call float @llvm.fmuladd.f32(float 0.000000e+00, float %31, float -5.000000e-01)
%33 = load float*, float** %6
store float %32, float* %33
br label %44
34: ; preds = %21
%35 = load float, float* %4
%36 = fsub float %35, 0x3FE5555560000000
%37 = fdiv float %36, 0x3FD5555560000000
store float %37, float* %9
%38 = load float, float* %9
%39 = call float @llvm.fmuladd.f32(float 0xBFEBB67AE0000000, float %38, float 0x3FEBB67AE0000000)
%40 = load float*, float** %5
store float %39, float* %40
%41 = load float, float* %9
%42 = call float @llvm.fmuladd.f32(float 1.500000e+00, float %41, float -5.000000e-01)
%43 = load float*, float** %6
store float %42, float* %43
br label %44
44: ; preds = %34, %24
br label %45
45: ; preds = %44, %12
ret void
}

LLVM IR (-O2):
define void @tsc(float %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = fcmp olt float %0, 0x3FD5555560000000
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = fdiv float %0, 0x3FD5555560000000
%7 = tail call float @llvm.fmuladd.f32(float %6, float 0xBFEBB67AE0000000, float 0.000000e+00)
store float %7, float* %1
%8 = tail call float @llvm.fmuladd.f32(float %6, float -1.500000e+00, float 1.000000e+00)
br label %21
9: ; preds = %3
%10 = fcmp olt float %0, 0x3FE5555560000000
br i1 %10, label %11, label %16
11: ; preds = %9
%12 = fadd float %0, 0xBFD5555560000000
%13 = fdiv float %12, 0x3FD5555560000000
%14 = tail call float @llvm.fmuladd.f32(float %13, float 0x3FFBB67AE0000000, float 0xBFEBB67AE0000000)
store float %14, float* %1
%15 = tail call float @llvm.fmuladd.f32(float %13, float 0.000000e+00, float -5.000000e-01)
br label %21
16: ; preds = %9
%17 = fadd float %0, 0xBFE5555560000000
%18 = fdiv float %17, 0x3FD5555560000000
%19 = tail call float @llvm.fmuladd.f32(float %18, float 0xBFEBB67AE0000000, float 0x3FEBB67AE0000000)
store float %19, float* %1
%20 = tail call float @llvm.fmuladd.f32(float %18, float 1.500000e+00, float -5.000000e-01)
br label %21
21: ; preds = %11, %16, %5
%22 = phi float [ %15, %11 ], [ %20, %16 ], [ %8, %5 ]
store float %22, float* %2
ret void
}