#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*/ fpsimple_delta_coeff(int, int, int, double *);
int /*<<< orphan*/ fpsimple_factor_6j(int, int, int, int, int, int, double *);
double sqrt(double);
void fpsimple_6j(double *result, int two_j1, int two_j2, int two_j3, int two_j4,
                 int two_j5, int two_j6) {
  int two_a = two_j1;
  int two_b = two_j2;
  int two_c = two_j5;
  int two_d = two_j4;
  int two_e = two_j3;
  int two_f = two_j6;
  double sum_prod;
  fpsimple_factor_6j(two_j1, two_j2, two_j3, two_j4, two_j5, two_j6, &sum_prod);
  double prefact = 1;
  fpsimple_delta_coeff(two_a, two_b, two_e, &prefact);
  fpsimple_delta_coeff(two_c, two_d, two_e, &prefact);
  fpsimple_delta_coeff(two_a, two_c, two_f, &prefact);
  fpsimple_delta_coeff(two_b, two_d, two_f, &prefact);
  *result = sqrt(prefact) * sum_prod;
}


x86 assembly (clang, -O0):
<fpsimple_6j>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    0x10(%rbp),%r9d
lea    -0x40(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <fpsimple_factor_6j@plt>
movsd  0xe63(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    -0x48(%rbp),%rcx
call   1050 <fpsimple_delta_coeff@plt>
mov    -0x28(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    -0x48(%rbp),%rcx
call   1050 <fpsimple_delta_coeff@plt>
mov    -0x20(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    -0x48(%rbp),%rcx
call   1050 <fpsimple_delta_coeff@plt>
mov    -0x24(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    -0x48(%rbp),%rcx
call   1050 <fpsimple_delta_coeff@plt>
movsd  -0x48(%rbp),%xmm0
call   1040 <sqrt@plt>
mulsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpsimple_6j>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,%ebp
mov    %r8d,%r12d
mov    %ecx,%r14d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %rdi,0x18(%rsp)
mov    0x60(%rsp),%r9d
lea    0x20(%rsp),%rax
mov    %rax,(%rsp)
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %ebp,%r8d
call   1030 <fpsimple_factor_6j@plt>
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%r15
mov    %ebx,%edi
mov    %r13d,%esi
mov    %r14d,%edx
mov    %r15,%rcx
call   1050 <fpsimple_delta_coeff@plt>
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r14d,%edx
mov    %r15,%rcx
call   1050 <fpsimple_delta_coeff@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    0x60(%rsp),%ebx
mov    %ebx,%edx
mov    %r15,%rcx
call   1050 <fpsimple_delta_coeff@plt>
mov    %r13d,%edi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r15,%rcx
call   1050 <fpsimple_delta_coeff@plt>
movsd  0x10(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11dc <fpsimple_6j+0xac>
sqrtsd %xmm0,%xmm0
jmp    11e1 <fpsimple_6j+0xb1>
call   1040 <sqrt@plt>
mulsd  0x20(%rsp),%xmm0
mov    0x18(%rsp),%rax
movsd  %xmm0,(%rax)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fpsimple_6j(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca double
store double* %0, double** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%23 = load i32, i32* %9
store i32 %23, i32* %15
%24 = load i32, i32* %10
store i32 %24, i32* %16
%25 = load i32, i32* %13
store i32 %25, i32* %17
%26 = load i32, i32* %12
store i32 %26, i32* %18
%27 = load i32, i32* %11
store i32 %27, i32* %19
%28 = load i32, i32* %14
store i32 %28, i32* %20
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = load i32, i32* %11
%32 = load i32, i32* %12
%33 = load i32, i32* %13
%34 = load i32, i32* %14
%35 = call i32 @fpsimple_factor_6j(i32 %29, i32 %30, i32 %31, i32 %32, i32 %33, i32 %34, double* %21)
store double 1.000000e+00, double* %22
%36 = load i32, i32* %15
%37 = load i32, i32* %16
%38 = load i32, i32* %19
%39 = call i32 @fpsimple_delta_coeff(i32 %36, i32 %37, i32 %38, double* %22)
%40 = load i32, i32* %17
%41 = load i32, i32* %18
%42 = load i32, i32* %19
%43 = call i32 @fpsimple_delta_coeff(i32 %40, i32 %41, i32 %42, double* %22)
%44 = load i32, i32* %15
%45 = load i32, i32* %17
%46 = load i32, i32* %20
%47 = call i32 @fpsimple_delta_coeff(i32 %44, i32 %45, i32 %46, double* %22)
%48 = load i32, i32* %16
%49 = load i32, i32* %18
%50 = load i32, i32* %20
%51 = call i32 @fpsimple_delta_coeff(i32 %48, i32 %49, i32 %50, double* %22)
%52 = load double, double* %22
%53 = call double @sqrt(double %52)
%54 = load double, double* %21
%55 = fmul double %53, %54
%56 = load double*, double** %8
store double %55, double* %56
ret void
}

LLVM IR (-O2):
define void @fpsimple_6j(double* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double
%9 = alloca double
%10 = bitcast double* %8 to i8*
%11 = call i32 @fpsimple_factor_6j(i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, double* %8)
%12 = bitcast double* %9 to i8*
store double 1.000000e+00, double* %9
%13 = call i32 @fpsimple_delta_coeff(i32 %1, i32 %2, i32 %3, double* %9)
%14 = call i32 @fpsimple_delta_coeff(i32 %5, i32 %4, i32 %3, double* %9)
%15 = call i32 @fpsimple_delta_coeff(i32 %1, i32 %5, i32 %6, double* %9)
%16 = call i32 @fpsimple_delta_coeff(i32 %2, i32 %4, i32 %6, double* %9)
%17 = load double, double* %9
%18 = call double @sqrt(double %17)
%19 = load double, double* %8
%20 = fmul double %18, %19
store double %20, double* %0
ret void
}