#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 M_PI;
double factorial(int);
double pow(int, int);
double sqrt(double);
double CINTgto_norm(int n, double a) {
  double nn = pow(2, (2 * n + 3)) * factorial(n + 1) * pow((2 * a), (n + 1.5)) /
              (factorial(2 * n + 2) * sqrt(M_PI));
  return sqrt(nn);
}


x86 assembly (clang, -O0):
<CINTgto_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x1,%esi
add    $0x3,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <factorial@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8c(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe6e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x2,%edi
call   1030 <factorial@plt>
movsd  %xmm0,-0x28(%rbp)
mov    0x2e1e(%rip),%rax
movsd  (%rax),%xmm0
call   1050 <sqrt@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <sqrt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CINTgto_norm>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%esi
add    $0x3,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,(%rsp)
lea    0x1(%rbx),%edi
call   1030 <factorial@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  0xe7f(%rip),%xmm0
cvttsd2si %xmm0,%esi
call   1040 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    (%rbx,%rbx,1),%edi
add    $0x2,%edi
call   1030 <factorial@plt>
movapd %xmm0,%xmm1
mov    0x2e3d(%rip),%rax
movsd  (%rax),%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     11bf <CINTgto_norm+0x8f>
sqrtsd %xmm0,%xmm0
jmp    11d2 <CINTgto_norm+0xa2>
movsd  %xmm1,(%rsp)
call   1050 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jb     11f0 <CINTgto_norm+0xc0>
sqrtsd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret
add    $0x10,%rsp
pop    %rbx
jmp    1050 <sqrt@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @CINTgto_norm(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 2, %6
%8 = add nsw i32 %7, 3
%9 = call double @pow(i32 2, i32 %8)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
%12 = call double @factorial(i32 %11)
%13 = fmul double %9, %12
%14 = load double, double* %4
%15 = fmul double 2.000000e+00, %14
%16 = fptosi double %15 to i32
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to double
%19 = fadd double %18, 1.500000e+00
%20 = fptosi double %19 to i32
%21 = call double @pow(i32 %16, i32 %20)
%22 = fmul double %13, %21
%23 = load i32, i32* %3
%24 = mul nsw i32 2, %23
%25 = add nsw i32 %24, 2
%26 = call double @factorial(i32 %25)
%27 = load double, double* @M_PI
%28 = call double @sqrt(double %27)
%29 = fmul double %26, %28
%30 = fdiv double %22, %29
store double %30, double* %5
%31 = load double, double* %5
%32 = call double @sqrt(double %31)
ret double %32
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @CINTgto_norm(i32 %0, double %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, 3
%5 = tail call double @pow(i32 2, i32 %4)
%6 = add nsw i32 %0, 1
%7 = tail call double @factorial(i32 %6)
%8 = fmul double %5, %7
%9 = fmul double %1, 2.000000e+00
%10 = fptosi double %9 to i32
%11 = sitofp i32 %0 to double
%12 = fadd double %11, 1.500000e+00
%13 = fptosi double %12 to i32
%14 = tail call double @pow(i32 %10, i32 %13)
%15 = fmul double %8, %14
%16 = add nsw i32 %3, 2
%17 = tail call double @factorial(i32 %16)
%18 = load double, double* @M_PI
%19 = tail call double @sqrt(double %18)
%20 = fmul double %17, %19
%21 = fdiv double %15, %20
%22 = tail call double @sqrt(double %21)
ret double %22
}