#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 L2_bN_so3(int, int, int);
double L2_cN_so3(int j, int m1, int m2) {
  double dj, dm1, dm2;
  dj = (double)j;
  dm1 = (double)m1;
  dm2 = (double)m2;
  if (j != 0)
    return (-L2_bN_so3(j, m1, m2) * dm1 * dm2 / (dj * (dj + 1.)));
  else
    return 0.;
}


x86 assembly (clang, -O0):
<L2_cN_so3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     119c <L2_cN_so3+0x8c>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <L2_bN_so3@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe7b(%rip),%xmm2
addsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a4 <L2_cN_so3+0x94>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L2_cN_so3>:
test   %edi,%edi
je     1172 <L2_cN_so3+0x62>
sub    $0x18,%rsp
cvtsi2sd %edi,%xmm0
movsd  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <L2_bN_so3@plt>
xorpd  0xeb8(%rip),%xmm0
mulsd  (%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0xeb5(%rip),%xmm1
movsd  0x10(%rsp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @L2_cN_so3(i32 %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
store double %12, double* %8
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to double
store double %14, double* %9
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to double
store double %16, double* %10
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %34
19: ; preds = %3
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call double @L2_bN_so3(i32 %20, i32 %21, i32 %22)
%24 = fneg double %23
%25 = load double, double* %9
%26 = fmul double %24, %25
%27 = load double, double* %10
%28 = fmul double %26, %27
%29 = load double, double* %8
%30 = load double, double* %8
%31 = fadd double %30, 1.000000e+00
%32 = fmul double %29, %31
%33 = fdiv double %28, %32
store double %33, double* %4
br label %35
34: ; preds = %3
store double 0.000000e+00, double* %4
br label %35
35: ; preds = %34, %19
%36 = load double, double* %4
ret double %36
}

LLVM IR (-O2):
define double @L2_cN_so3(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = icmp eq i32 %0, 0
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = sitofp i32 %2 to double
%8 = sitofp i32 %1 to double
%9 = tail call double @L2_bN_so3(i32 %0, i32 %1, i32 %2)
%10 = fneg double %9
%11 = fmul double %8, %10
%12 = fmul double %11, %7
%13 = fadd double %4, 1.000000e+00
%14 = fmul double %13, %4
%15 = fdiv double %12, %14
br label %16
16: ; preds = %3, %6
%17 = phi double [ %15, %6 ], [ 0.000000e+00, %3 ]
ret double %17
}