#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 coshf(float);
float expf(float);
float fabsf(float);
float sinhf(float);
void _cchshf(float xx, float *c, float *s) {
  float x, e, ei;
  x = xx;
  if (fabsf(x) <= 0.5f) {
    *c = coshf(x);
    *s = sinhf(x);
  } else {
    e = expf(x);
    ei = 0.5f / e;
    e = 0.5f * e;
    *s = e - ei;
    *c = e + ei;
  }
}


x86 assembly (clang, -O0):
<_cchshf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm1
movaps 0xeb5(%rip),%xmm0
pand   %xmm0,%xmm1
movss  0xe99(%rip),%xmm0
ucomiss %xmm1,%xmm0
jb     1199 <_cchshf+0x69>
movss  -0x1c(%rbp),%xmm0
call   1030 <coshf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
call   1050 <sinhf@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
jmp    11f0 <_cchshf+0xc0>
movss  -0x1c(%rbp),%xmm0
call   1040 <expf@plt>
movss  %xmm0,-0x20(%rbp)
movss  0xe50(%rip),%xmm0
divss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xe3e(%rip),%xmm0
mulss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cchshf>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movaps 0xebc(%rip),%xmm1
andps  %xmm0,%xmm1
movss  0xec1(%rip),%xmm2
ucomiss %xmm1,%xmm2
jae    1182 <_cchshf+0x52>
call   1040 <expf@plt>
movss  0xeaf(%rip),%xmm2
movaps %xmm2,%xmm1
divss  %xmm0,%xmm1
mulss  %xmm2,%xmm0
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
movss  %xmm2,(%r14)
addss  %xmm1,%xmm0
movss  %xmm0,(%rbx)
jmp    119d <_cchshf+0x6d>
movaps %xmm0,(%rsp)
call   1030 <coshf@plt>
movss  %xmm0,(%rbx)
movaps (%rsp),%xmm0
call   1050 <sinhf@plt>
movss  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @_cchshf(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
store float %10, float* %7
%11 = load float, float* %7
%12 = call float @llvm.fabs.f32(float %11)
%13 = fcmp ole float %12, 5.000000e-01
br i1 %13, label %14, label %21
14: ; preds = %3
%15 = load float, float* %7
%16 = call float @coshf(float %15)
%17 = load float*, float** %5
store float %16, float* %17
%18 = load float, float* %7
%19 = call float @sinhf(float %18)
%20 = load float*, float** %6
store float %19, float* %20
br label %36
21: ; preds = %3
%22 = load float, float* %7
%23 = call float @expf(float %22)
store float %23, float* %8
%24 = load float, float* %8
%25 = fdiv float 5.000000e-01, %24
store float %25, float* %9
%26 = load float, float* %8
%27 = fmul float 5.000000e-01, %26
store float %27, float* %8
%28 = load float, float* %8
%29 = load float, float* %9
%30 = fsub float %28, %29
%31 = load float*, float** %6
store float %30, float* %31
%32 = load float, float* %8
%33 = load float, float* %9
%34 = fadd float %32, %33
%35 = load float*, float** %5
store float %34, float* %35
br label %36
36: ; preds = %21, %14
ret void
}

LLVM IR (-O2):
define void @_cchshf(float %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = tail call float @llvm.fabs.f32(float %0)
%5 = fcmp ugt float %4, 5.000000e-01
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call float @coshf(float %0)
store float %7, float* %1
%8 = tail call float @sinhf(float %0)
store float %8, float* %2
br label %15
9: ; preds = %3
%10 = tail call float @expf(float %0)
%11 = fdiv float 5.000000e-01, %10
%12 = fmul float %10, 5.000000e-01
%13 = fsub float %12, %11
store float %13, float* %2
%14 = fadd float %12, %11
store float %14, float* %1
br label %15
15: ; preds = %9, %6
ret void
}