#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 */
int /*<<< orphan*/ get_scaling_basis_TRI(unsigned int const, unsigned int const,
                                         double const, double *, double *,
                                         double *);
double pow(double, double);
double sqrt(double);
void get_scaling_basis_TET(const unsigned int i, const unsigned int j,
                           const unsigned int k, const double b, const double c,
                           double *con_i, double *con_j, double *con_k,
                           double *con_b, double *con_c) {
  get_scaling_basis_TRI(i, j, b, con_i, con_j, con_b);
  *con_k = sqrt((2.0 * (i + j + k) + 3.0) / pow(2.0, 2.0 * (i + j) + 3.0));
  *con_c = pow(1.0 - c, (double)(i + j));
}


x86 assembly (clang, -O0):
<get_scaling_basis_TET>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    0x10(%rbp),%r8
call   1030 <get_scaling_basis_TRI@plt>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
add    %edx,%ecx
cvtsi2sd %rcx,%xmm1
addsd  %xmm1,%xmm1
movsd  0xe65(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x40(%rbp)
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe4f(%rip),%xmm0
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm1
movsd  0xe2c(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %rax,%xmm1
call   1040 <pow@plt>
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_scaling_basis_TET>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %r9,%r14
mov    %r8,%rax
movsd  %xmm1,0x18(%rsp)
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x58(%rsp),%r12
mov    0x50(%rsp),%r8
mov    %rcx,%rdx
mov    %rax,%rcx
call   1040 <get_scaling_basis_TRI@plt>
add    %ebp,%ebx
add    %ebx,%r15d
xorps  %xmm0,%xmm0
cvtsi2sd %r15,%xmm0
addsd  %xmm0,%xmm0
movsd  0xe73(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %rbx,%xmm0
movsd  %xmm0,0x10(%rsp)
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1030 <exp2@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     11d0 <get_scaling_basis_TET+0x90>
sqrtsd %xmm0,%xmm0
jmp    11d5 <get_scaling_basis_TET+0x95>
call   1060 <sqrt@plt>
movsd  %xmm0,(%r14)
movsd  0xe26(%rip),%xmm0
subsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,(%r12)
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @get_scaling_basis_TET(i32 %0, i32 %1, i32 %2, double %3, double %4, double* %5, double* %6, double* %7, double* %8, double* %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store double %3, double* %14
store double %4, double* %15
store double* %5, double** %16
store double* %6, double** %17
store double* %7, double** %18
store double* %8, double** %19
store double* %9, double** %20
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = load double, double* %14
%24 = load double*, double** %16
%25 = load double*, double** %17
%26 = load double*, double** %19
%27 = call i32 @get_scaling_basis_TRI(i32 %21, i32 %22, double %23, double* %24, double* %25, double* %26)
%28 = load i32, i32* %11
%29 = load i32, i32* %12
%30 = add i32 %28, %29
%31 = load i32, i32* %13
%32 = add i32 %30, %31
%33 = uitofp i32 %32 to double
%34 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %33, double 3.000000e+00)
%35 = load i32, i32* %11
%36 = load i32, i32* %12
%37 = add i32 %35, %36
%38 = uitofp i32 %37 to double
%39 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %38, double 3.000000e+00)
%40 = call double @pow(double 2.000000e+00, double %39)
%41 = fdiv double %34, %40
%42 = call double @sqrt(double %41)
%43 = load double*, double** %18
store double %42, double* %43
%44 = load double, double* %15
%45 = fsub double 1.000000e+00, %44
%46 = load i32, i32* %11
%47 = load i32, i32* %12
%48 = add i32 %46, %47
%49 = uitofp i32 %48 to double
%50 = call double @pow(double %45, double %49)
%51 = load double*, double** %20
store double %50, double* %51
ret void
}

LLVM IR (-O2):
define void @get_scaling_basis_TET(i32 %0, i32 %1, i32 %2, double %3, double %4, double* %5, double* %6, double* nocapture writeonly %7, double* %8, double* nocapture writeonly %9) {
%11 = tail call i32 @get_scaling_basis_TRI(i32 %0, i32 %1, double %3, double* %5, double* %6, double* %8)
%12 = add i32 %1, %0
%13 = add i32 %12, %2
%14 = uitofp i32 %13 to double
%15 = tail call double @llvm.fmuladd.f64(double %14, double 2.000000e+00, double 3.000000e+00)
%16 = uitofp i32 %12 to double
%17 = tail call double @llvm.fmuladd.f64(double %16, double 2.000000e+00, double 3.000000e+00)
%18 = tail call double @exp2(double %17)
%19 = fdiv double %15, %18
%20 = tail call double @sqrt(double %19)
store double %20, double* %7
%21 = fsub double 1.000000e+00, %4
%22 = tail call double @pow(double %21, double %16)
store double %22, double* %9
ret void
}