#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 */
double HTS_mlsadf1(double, double *, int, double const, double const, int const,
                   double *, double const *);
double HTS_mlsadf2(double, double *, int, double const, double const, int const,
                   double *, double const *);
double HTS_mlsadf(double x, double *b, int m, const double a, const int pd,
                  double *d, double *pade) {
  const double aa = 1 - a * a;
  const double *ppade = &(pade[pd * (pd + 1) / 2]);
  x = HTS_mlsadf1(x, b, m, a, aa, pd, d, ppade);
  x = HTS_mlsadf2(x, b, m, a, aa, pd, &d[2 * (pd + 1)], ppade);
  return (x);
}


x86 assembly (clang, -O0):
<HTS_mlsadf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
movsd  -0x20(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x48(%rbp),%r8
call   1040 <HTS_mlsadf1@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
movsd  -0x20(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x24(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x48(%rbp),%r8
call   1030 <HTS_mlsadf2@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTS_mlsadf>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r12
movapd %xmm1,%xmm2
movsd  %xmm1,0x8(%rsp)
mulsd  %xmm1,%xmm2
movsd  0xeb3(%rip),%xmm3
subsd  %xmm2,%xmm3
movapd %xmm3,%xmm2
movsd  %xmm3,(%rsp)
lea    0x1(%rbx),%eax
imul   %edx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
lea    (%r8,%rax,8),%rbp
mov    %r14,%rcx
mov    %rbp,%r8
call   1040 <HTS_mlsadf1@plt>
lea    (%rbx,%rbx,1),%eax
add    $0x2,%eax
cltq
lea    (%r14,%rax,8),%rcx
mov    %r12,%rdi
mov    %r15d,%esi
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    %ebx,%edx
mov    %rbp,%r8
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <HTS_mlsadf2@plt>

LLVM IR (-O0):
define double @HTS_mlsadf(double %0, double* %1, i32 %2, double %3, i32 %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca double*
%10 = alloca i32
%11 = alloca double
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double*
store double %0, double* %8
store double* %1, double** %9
store i32 %2, i32* %10
store double %3, double* %11
store i32 %4, i32* %12
store double* %5, double** %13
store double* %6, double** %14
%17 = load double, double* %11
%18 = load double, double* %11
%19 = fneg double %17
%20 = call double @llvm.fmuladd.f64(double %19, double %18, double 1.000000e+00)
store double %20, double* %15
%21 = load double*, double** %14
%22 = load i32, i32* %12
%23 = load i32, i32* %12
%24 = add nsw i32 %23, 1
%25 = mul nsw i32 %22, %24
%26 = sdiv i32 %25, 2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %21, i64 %27
store double* %28, double** %16
%29 = load double, double* %8
%30 = load double*, double** %9
%31 = load i32, i32* %10
%32 = load double, double* %11
%33 = load double, double* %15
%34 = load i32, i32* %12
%35 = load double*, double** %13
%36 = load double*, double** %16
%37 = call double @HTS_mlsadf1(double %29, double* %30, i32 %31, double %32, double %33, i32 %34, double* %35, double* %36)
store double %37, double* %8
%38 = load double, double* %8
%39 = load double*, double** %9
%40 = load i32, i32* %10
%41 = load double, double* %11
%42 = load double, double* %15
%43 = load i32, i32* %12
%44 = load double*, double** %13
%45 = load i32, i32* %12
%46 = add nsw i32 %45, 1
%47 = mul nsw i32 2, %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %44, i64 %48
%50 = load double*, double** %16
%51 = call double @HTS_mlsadf2(double %38, double* %39, i32 %40, double %41, double %42, i32 %43, double* %49, double* %50)
store double %51, double* %8
%52 = load double, double* %8
ret double %52
}

LLVM IR (-O2):
define double @HTS_mlsadf(double %0, double* %1, i32 %2, double %3, i32 %4, double* %5, double* %6) {
%8 = fneg double %3
%9 = tail call double @llvm.fmuladd.f64(double %8, double %3, double 1.000000e+00)
%10 = add nsw i32 %4, 1
%11 = mul nsw i32 %10, %4
%12 = sdiv i32 %11, 2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %6, i64 %13
%15 = tail call double @HTS_mlsadf1(double %0, double* %1, i32 %2, double %3, double %9, i32 %4, double* %5, double* %14)
%16 = shl nsw i32 %10, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %5, i64 %17
%19 = tail call double @HTS_mlsadf2(double %15, double* %1, i32 %2, double %3, double %9, i32 %4, double* %18, double* %14)
ret double %19
}