void beschb(double x, double *gam1, double *gam2, double *gampl,
            double *gammi) {
  float chebev(float a, float b, float c[], int m, float x);
  float xx;
  static float c1[] = {-1.142022680371168e0,
                       6.5165112670737e-3,
                       3.087090173086e-4,
                       -3.4706269649e-6,
                       6.9437664e-9,
                       3.67795e-11,
                       -1.356e-13};
  static float c2[] = {1.843740587300905e0, -7.68528408447867e-2,
                       1.2719271366546e-3,  -4.9717367042e-6,
                       -3.31261198e-8,      2.423096e-10,
                       -1.702e-13,          -1.49e-15};
  xx = 8.0 * x * x - 1.0;
  *gam1 = chebev(-1.0, 1.0, c1, 5, xx);
  *gam2 = chebev(-1.0, 1.0, c2, 5, xx);
  *gampl = *gam2 - x * (*gam1);
  *gammi = *gam2 + x * (*gam1);
}


x86 assembly (clang, -O0):
<beschb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm2
movss  0xe9b(%rip),%xmm0
movss  0xe97(%rip),%xmm1
lea    0x2ebc(%rip),%rdi
mov    $0x5,%esi
call   1030 <chebev@plt>
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movss  -0x2c(%rbp),%xmm2
movss  0xe69(%rip),%xmm0
movss  0xe65(%rip),%xmm1
lea    0x2eaa(%rip),%rdi
mov    $0x5,%esi
call   1030 <chebev@plt>
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beschb>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  %xmm0,0x10(%rsp)
movsd  0xecb(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xec3(%rip),%xmm1
cvtsd2ss %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
lea    0x2eda(%rip),%rdi
movss  0xeb2(%rip),%xmm0
movss  0xeae(%rip),%xmm1
mov    $0x5,%esi
call   1030 <chebev@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rbx)
lea    0x2ed1(%rip),%rdi
movss  0xe89(%rip),%xmm0
movss  0xe85(%rip),%xmm1
mov    $0x5,%esi
movss  0xc(%rsp),%xmm2
call   1030 <chebev@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%r15)
movsd  (%rbx),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%r12)
mulsd  (%rbx),%xmm2
addsd  (%r15),%xmm2
movsd  %xmm2,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@beschb.c1 = internal global [7 x float] [float 0xBFF245B9A0000000, float 0x3F7AB10EA0000000, float 0x3F343B4720000000, float 0xBECD1D1D60000000, float 0x3E3DD2C080000000, float 0x3DC4384120000000, float 0xBD43158140000000]
@beschb.c2 = internal global [8 x float] [float 0x3FFD7FF620000000, float 0xBFB3ACA0C0000000, float 0x3F54D6D960000000, float 0xBED4DA5CA0000000, float 0xBE61C8D1C0000000, float 0x3DF0A6C160000000, float 0xBD47F419E0000000, float 0xBCDAD76980000000]
define void @beschb(double %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca float
store double %0, double* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%12 = load double, double* %6
%13 = fmul double 8.000000e+00, %12
%14 = load double, double* %6
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double -1.000000e+00)
%16 = fptrunc double %15 to float
store float %16, float* %11
%17 = load float, float* %11
%18 = call float @chebev(float -1.000000e+00, float 1.000000e+00, float* getelementptr inbounds ([7 x float], [7 x float]* @beschb.c1, i64 0, i64 0), i32 5, float %17)
%19 = fpext float %18 to double
%20 = load double*, double** %7
store double %19, double* %20
%21 = load float, float* %11
%22 = call float @chebev(float -1.000000e+00, float 1.000000e+00, float* getelementptr inbounds ([8 x float], [8 x float]* @beschb.c2, i64 0, i64 0), i32 5, float %21)
%23 = fpext float %22 to double
%24 = load double*, double** %8
store double %23, double* %24
%25 = load double*, double** %8
%26 = load double, double* %25
%27 = load double, double* %6
%28 = load double*, double** %7
%29 = load double, double* %28
%30 = fneg double %27
%31 = call double @llvm.fmuladd.f64(double %30, double %29, double %26)
%32 = load double*, double** %9
store double %31, double* %32
%33 = load double*, double** %8
%34 = load double, double* %33
%35 = load double, double* %6
%36 = load double*, double** %7
%37 = load double, double* %36
%38 = call double @llvm.fmuladd.f64(double %35, double %37, double %34)
%39 = load double*, double** %10
store double %38, double* %39
ret void
}

LLVM IR (-O2):
@beschb.c1 = internal global [7 x float] [float 0xBFF245B9A0000000, float 0x3F7AB10EA0000000, float 0x3F343B4720000000, float 0xBECD1D1D60000000, float 0x3E3DD2C080000000, float 0x3DC4384120000000, float 0xBD43158140000000]
@beschb.c2 = internal global [8 x float] [float 0x3FFD7FF620000000, float 0xBFB3ACA0C0000000, float 0x3F54D6D960000000, float 0xBED4DA5CA0000000, float 0xBE61C8D1C0000000, float 0x3DF0A6C160000000, float 0xBD47F419E0000000, float 0xBCDAD76980000000]
define void @beschb(double %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = fmul double %0, 8.000000e+00
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double -1.000000e+00)
%8 = fptrunc double %7 to float
%9 = tail call float @chebev(float -1.000000e+00, float 1.000000e+00, float* getelementptr inbounds ([7 x float], [7 x float]* @beschb.c1, i64 0, i64 0), i32 5, float %8)
%10 = fpext float %9 to double
store double %10, double* %1
%11 = tail call float @chebev(float -1.000000e+00, float 1.000000e+00, float* getelementptr inbounds ([8 x float], [8 x float]* @beschb.c2, i64 0, i64 0), i32 5, float %8)
%12 = fpext float %11 to double
store double %12, double* %2
%13 = load double, double* %1
%14 = fneg double %0
%15 = tail call double @llvm.fmuladd.f64(double %14, double %13, double %12)
store double %15, double* %3
%16 = load double, double* %2
%17 = load double, double* %1
%18 = tail call double @llvm.fmuladd.f64(double %0, double %17, double %16)
store double %18, double* %4
ret void
}