#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 sqrt(double);
double L2_bN_so3(int j, int m1, int m2) {
  double dj, dm1, dm2;
  dj = (double)j;
  dm1 = (double)m1;
  dm2 = (double)m2;
  return (sqrt((2. * dj + 3.) / (2. * dj + 1.)) * (dj + 1.) * (2. * dj + 1.) /
          sqrt(((dj + 1.) * (dj + 1.) - dm1 * dm1) *
               ((dj + 1.) * (dj + 1.) - dm2 * dm2)));
}


x86 assembly (clang, -O0):
<L2_bN_so3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xeb8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xe9b(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  0xe86(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xe6c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe57(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe4a(%rip),%xmm2
addsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe14(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xe07(%rip),%xmm3
addsd  -0x18(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
mulsd  -0x28(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L2_bN_so3>:
sub    $0x38,%rsp
cvtsi2sd %edi,%xmm2
movd   %edx,%xmm0
movd   %esi,%xmm1
punpckldq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm3
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
unpcklpd %xmm0,%xmm0
addpd  0xec4(%rip),%xmm0
movapd %xmm0,%xmm5
unpckhpd %xmm0,%xmm5
divsd  %xmm5,%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
jb     115b <L2_bN_so3+0x4b>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    1189 <L2_bN_so3+0x79>
movapd %xmm2,(%rsp)
movaps %xmm3,0x20(%rsp)
movapd %xmm5,0x10(%rsp)
call   1030 <sqrt@plt>
movapd 0x10(%rsp),%xmm5
xorpd  %xmm4,%xmm4
movapd 0x20(%rsp),%xmm3
movapd (%rsp),%xmm2
movapd %xmm0,%xmm1
addsd  0xe7f(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm5,%xmm1
mulpd  %xmm3,%xmm3
mulsd  %xmm2,%xmm2
unpcklpd %xmm2,%xmm2
subpd  %xmm3,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm4,%xmm0
jb     11c1 <L2_bN_so3+0xb1>
sqrtsd %xmm0,%xmm0
jmp    11d0 <L2_bN_so3+0xc0>
movsd  %xmm1,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
define double @L2_bN_so3(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = insertelement <2 x i32> poison, i32 %1, i64 0
%6 = insertelement <2 x i32> %5, i32 %2, i64 1
%7 = sitofp <2 x i32> %6 to <2 x double>
%8 = insertelement <2 x double> poison, double %4, i64 0
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> zeroinitializer
%10 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %9, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> <double 3.000000e+00, double 1.000000e+00>)
%11 = extractelement <2 x double> %10, i64 0
%12 = extractelement <2 x double> %10, i64 1
%13 = fdiv double %11, %12
%14 = tail call double @sqrt(double %13)
%15 = fadd double %4, 1.000000e+00
%16 = fmul double %15, %14
%17 = fmul double %12, %16
%18 = fneg <2 x double> %7
%19 = fmul <2 x double> %18, %7
%20 = insertelement <2 x double> poison, double %15, i64 0
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> zeroinitializer
%22 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %21, <2 x double> %21, <2 x double> %19)
%23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%24 = fmul <2 x double> %22, %23
%25 = extractelement <2 x double> %24, i64 0
%26 = tail call double @sqrt(double %25)
%27 = fdiv double %17, %26
ret double %27
}