void beschb(double x, double *gam1, double *gam2, double *gampl,
            double *gammi) {
  double chebev(double a, double b, double c[], int m, double x);
  double xx;
  static double c1[] = {-1.142022680371168e0,
                        6.5165112670737e-3,
                        3.087090173086e-4,
                        -3.4706269649e-6,
                        6.9437664e-9,
                        3.67795e-11,
                        -1.356e-13};
  static double 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, 7, xx);
  *gam2 = chebev(-1.0, 1.0, c2, 8, 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  0xeb5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm2
movsd  0xe9f(%rip),%xmm0
movsd  0xe9f(%rip),%xmm1
lea    0x2ec0(%rip),%rdi
mov    $0x7,%esi
call   1030 <chebev@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm2
movsd  0xe71(%rip),%xmm0
movsd  0xe71(%rip),%xmm1
lea    0x2ed2(%rip),%rdi
mov    $0x8,%esi
call   1030 <chebev@plt>
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
movsd  0xec3(%rip),%xmm0
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
movsd  %xmm1,0x8(%rsp)
lea    0x2ed6(%rip),%rdi
movsd  0xeae(%rip),%xmm1
mov    $0x7,%esi
call   1030 <chebev@plt>
movsd  %xmm0,(%rbx)
lea    0x2ef9(%rip),%rdi
movsd  0xe89(%rip),%xmm0
movsd  0xe89(%rip),%xmm1
mov    $0x8,%esi
movsd  0x8(%rsp),%xmm2
call   1030 <chebev@plt>
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 double] [double 0xBFF245B992F7C037, double 0x3F7AB10EAC6AE4C1, double 0x3F343B4722214EC4, double 0xBECD1D1D5A0EECD2, double 0x3E3DD2C07C586C6B, double 3.677950e-11, double -1.356000e-13]
@beschb.c2 = internal global [8 x double] [double 0x3FFD7FF6214C3E57, double 0xBFB3ACA0B6087617, double 0x3F54D6D95D1BE050, double 0xBED4DA5C9441AD67, double 0xBE61C8D1B9933490, double 0x3DF0A6C16C9CD8CF, double -1.702000e-13, double -1.490000e-15]
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 double
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)
store double %15, double* %11
%16 = load double, double* %11
%17 = call double @chebev(double -1.000000e+00, double 1.000000e+00, double* getelementptr inbounds ([7 x double], [7 x double]* @beschb.c1, i64 0, i64 0), i32 7, double %16)
%18 = load double*, double** %7
store double %17, double* %18
%19 = load double, double* %11
%20 = call double @chebev(double -1.000000e+00, double 1.000000e+00, double* getelementptr inbounds ([8 x double], [8 x double]* @beschb.c2, i64 0, i64 0), i32 8, double %19)
%21 = load double*, double** %8
store double %20, double* %21
%22 = load double*, double** %8
%23 = load double, double* %22
%24 = load double, double* %6
%25 = load double*, double** %7
%26 = load double, double* %25
%27 = fneg double %24
%28 = call double @llvm.fmuladd.f64(double %27, double %26, double %23)
%29 = load double*, double** %9
store double %28, double* %29
%30 = load double*, double** %8
%31 = load double, double* %30
%32 = load double, double* %6
%33 = load double*, double** %7
%34 = load double, double* %33
%35 = call double @llvm.fmuladd.f64(double %32, double %34, double %31)
%36 = load double*, double** %10
store double %35, double* %36
ret void
}

LLVM IR (-O2):
@beschb.c1 = internal global [7 x double] [double 0xBFF245B992F7C037, double 0x3F7AB10EAC6AE4C1, double 0x3F343B4722214EC4, double 0xBECD1D1D5A0EECD2, double 0x3E3DD2C07C586C6B, double 3.677950e-11, double -1.356000e-13]
@beschb.c2 = internal global [8 x double] [double 0x3FFD7FF6214C3E57, double 0xBFB3ACA0B6087617, double 0x3F54D6D95D1BE050, double 0xBED4DA5C9441AD67, double 0xBE61C8D1B9933490, double 0x3DF0A6C16C9CD8CF, double -1.702000e-13, double -1.490000e-15]
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 = tail call double @chebev(double -1.000000e+00, double 1.000000e+00, double* getelementptr inbounds ([7 x double], [7 x double]* @beschb.c1, i64 0, i64 0), i32 7, double %7)
store double %8, double* %1
%9 = tail call double @chebev(double -1.000000e+00, double 1.000000e+00, double* getelementptr inbounds ([8 x double], [8 x double]* @beschb.c2, i64 0, i64 0), i32 8, double %7)
store double %9, double* %2
%10 = load double, double* %1
%11 = fneg double %0
%12 = tail call double @llvm.fmuladd.f64(double %11, double %10, double %9)
store double %12, double* %3
%13 = load double, double* %2
%14 = load double, double* %1
%15 = tail call double @llvm.fmuladd.f64(double %0, double %14, double %13)
store double %15, double* %4
ret void
}