#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 binomial_prefactor(int, int, int, double, double);
double fact(int);
double pow(double, int);
double A_term(int i, int r, int u, int l1, int l2, double PAx, double PBx,
              double CPx, double gamma) {
  return pow(-1, i) * binomial_prefactor(i, l1, l2, PAx, PBx) * pow(-1, u) *
         fact(i) * pow(CPx, i - 2 * r - 2 * u) * pow(0.25 / gamma, r + u) /
         fact(r) / fact(u) / fact(i - 2 * r - 2 * u);
}


x86 assembly (clang, -O0):
<A_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
mov    -0x4(%rbp),%edi
movsd  0xe9e(%rip),%xmm0
call   1050 <pow@plt>
movsd  %xmm0,-0x78(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <binomial_prefactor@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0xc(%rbp),%edi
movsd  0xe60(%rip),%xmm0
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <fact@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    %eax,%edi
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    %eax,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xdf3(%rip),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <fact@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    %eax,%edi
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    %eax,%edi
call   1040 <fact@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<A_term>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %r8d,%r12d
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
movsd  0xe97(%rip),%xmm0
call   1050 <pow@plt>
movsd  %xmm0,0x20(%rsp)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12d,%edx
movsd  0x28(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <binomial_prefactor@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe60(%rip),%xmm0
mov    %r14d,%edi
call   1050 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1040 <fact@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    (%r14,%r15,1),%ebp
sub    %ebp,%ebx
sub    %ebp,%ebx
movsd  0x18(%rsp),%xmm0
mov    %ebx,%edi
call   1050 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xe18(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
mov    %ebp,%edi
call   1050 <pow@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r15d,%edi
call   1040 <fact@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %r14d,%edi
call   1040 <fact@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %ebx,%edi
call   1040 <fact@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @A_term(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, double %5, double %6, double %7, double %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store double %8, double* %18
%19 = load i32, i32* %10
%20 = call double @pow(double -1.000000e+00, i32 %19)
%21 = load i32, i32* %10
%22 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = load double, double* %15
%25 = load double, double* %16
%26 = call double @binomial_prefactor(i32 %21, i32 %22, i32 %23, double %24, double %25)
%27 = fmul double %20, %26
%28 = load i32, i32* %12
%29 = call double @pow(double -1.000000e+00, i32 %28)
%30 = fmul double %27, %29
%31 = load i32, i32* %10
%32 = call double @fact(i32 %31)
%33 = fmul double %30, %32
%34 = load double, double* %17
%35 = load i32, i32* %10
%36 = load i32, i32* %11
%37 = mul nsw i32 2, %36
%38 = sub nsw i32 %35, %37
%39 = load i32, i32* %12
%40 = mul nsw i32 2, %39
%41 = sub nsw i32 %38, %40
%42 = call double @pow(double %34, i32 %41)
%43 = fmul double %33, %42
%44 = load double, double* %18
%45 = fdiv double 2.500000e-01, %44
%46 = load i32, i32* %11
%47 = load i32, i32* %12
%48 = add nsw i32 %46, %47
%49 = call double @pow(double %45, i32 %48)
%50 = fmul double %43, %49
%51 = load i32, i32* %11
%52 = call double @fact(i32 %51)
%53 = fdiv double %50, %52
%54 = load i32, i32* %12
%55 = call double @fact(i32 %54)
%56 = fdiv double %53, %55
%57 = load i32, i32* %10
%58 = load i32, i32* %11
%59 = mul nsw i32 2, %58
%60 = sub nsw i32 %57, %59
%61 = load i32, i32* %12
%62 = mul nsw i32 2, %61
%63 = sub nsw i32 %60, %62
%64 = call double @fact(i32 %63)
%65 = fdiv double %56, %64
ret double %65
}

LLVM IR (-O2):
define double @A_term(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, double %5, double %6, double %7, double %8) {
%10 = tail call double @pow(double -1.000000e+00, i32 %0)
%11 = tail call double @binomial_prefactor(i32 %0, i32 %3, i32 %4, double %5, double %6)
%12 = fmul double %10, %11
%13 = tail call double @pow(double -1.000000e+00, i32 %2)
%14 = fmul double %12, %13
%15 = tail call double @fact(i32 %0)
%16 = fmul double %14, %15
%17 = add i32 %2, %1
%18 = mul i32 %17, -2
%19 = add i32 %18, %0
%20 = tail call double @pow(double %7, i32 %19)
%21 = fmul double %16, %20
%22 = fdiv double 2.500000e-01, %8
%23 = tail call double @pow(double %22, i32 %17)
%24 = fmul double %21, %23
%25 = tail call double @fact(i32 %1)
%26 = fdiv double %24, %25
%27 = tail call double @fact(i32 %2)
%28 = fdiv double %26, %27
%29 = tail call double @fact(i32 %19)
%30 = fdiv double %28, %29
ret double %30
}