#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 */
struct wigxjpf_temp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ calcsum_6j(struct wigxjpf_temp *, int, int, int, int, int,
                              int);
int /*<<< orphan*/ eval_calcsum_info_double(double *, struct wigxjpf_temp *);
scalar_t__ trivial_zero_6j(int, int, int, int, int, int);
void calc_6j_double(double *result, int two_j1, int two_j2, int two_j3,
                    int two_j4, int two_j5, int two_j6,
                    struct wigxjpf_temp *temp) {
  if (trivial_zero_6j(two_j1, two_j2, two_j3, two_j4, two_j5, two_j6)) {
    *result = 0;
    return;
  }
  calcsum_6j(temp, two_j1, two_j2, two_j3, two_j4, two_j5, two_j6);
  eval_calcsum_info_double(result, temp);
}


x86 assembly (clang, -O0):
<calc_6j_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
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),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    0x10(%rbp),%r9d
call   1030 <trivial_zero_6j@plt>
cmp    $0x0,%rax
je     1187 <calc_6j_double+0x57>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    11b4 <calc_6j_double+0x84>
mov    0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1050 <calcsum_6j@plt>
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%rsi
call   1040 <eval_calcsum_info_double@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_6j_double>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%r12d
mov    %r8d,%r13d
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%r15d
mov    %rdi,0x8(%rsp)
mov    0x58(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x50(%rsp),%r14d
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %r9d,%r8d
mov    %r14d,%r9d
call   1030 <trivial_zero_6j@plt>
test   %rax,%rax
je     1193 <calc_6j_double+0x63>
mov    0x8(%rsp),%rax
movq   $0x0,(%rax)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14d,(%rsp)
mov    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %r13d,%r8d
mov    %r12d,%r9d
call   1050 <calcsum_6j@plt>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <eval_calcsum_info_double@plt>

LLVM IR (-O0):
%struct.wigxjpf_temp = type { i32 }
define void @calc_6j_double(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, %struct.wigxjpf_temp* %7) {
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca %struct.wigxjpf_temp*
store double* %0, double** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store %struct.wigxjpf_temp* %7, %struct.wigxjpf_temp** %16
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = load i32, i32* %15
%23 = call i64 @trivial_zero_6j(i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %8
%26 = load double*, double** %9
store double 0.000000e+00, double* %26
br label %39
27: ; preds = %8
%28 = load %struct.wigxjpf_temp*, %struct.wigxjpf_temp** %16
%29 = load i32, i32* %10
%30 = load i32, i32* %11
%31 = load i32, i32* %12
%32 = load i32, i32* %13
%33 = load i32, i32* %14
%34 = load i32, i32* %15
%35 = call i32 @calcsum_6j(%struct.wigxjpf_temp* %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33, i32 %34)
%36 = load double*, double** %9
%37 = load %struct.wigxjpf_temp*, %struct.wigxjpf_temp** %16
%38 = call i32 @eval_calcsum_info_double(double* %36, %struct.wigxjpf_temp* %37)
br label %39
39: ; preds = %27, %25
ret void
}

LLVM IR (-O2):
%struct.wigxjpf_temp = type { i32 }
define void @calc_6j_double(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, %struct.wigxjpf_temp* %7) {
%9 = tail call i64 @trivial_zero_6j(i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
%10 = icmp eq i64 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8
store double 0.000000e+00, double* %0
br label %15
12: ; preds = %8
%13 = tail call i32 @calcsum_6j(%struct.wigxjpf_temp* %7, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
%14 = tail call i32 @eval_calcsum_info_double(double* %0, %struct.wigxjpf_temp* %7)
br label %15
15: ; preds = %12, %11
ret void
}