#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 pow(int, int);
double shortfactorial(int, int);
int sqrt(int);
double AssociatedLegendreP(int l, int m, double x) {
  if (m < 0)
    return pow(-1, m) * shortfactorial(l + m, l - m) *
           AssociatedLegendreP(l, -1 * m, x);
  if (l < m)
    return 0;
  if (l == 0 && m == 0)
    return 1;
  if (l == 1 && m == 0)
    return x;
  if (l == 1 && m == 1)
    return -sqrt(1 - x * x);
  if (l == 2 && m == 1)
    return -3 * x * sqrt(1 - x * x);
  if (l == 2 && m == 0)
    return (3 * x * x - 1) / 2;
  if (l == 2 && m == 2)
    return 3 * (1 - x * x);
  if (l == m)
    return -(2 * (l - 1) + 1) * sqrt(1 - x * x) *
           AssociatedLegendreP(l - 1, m - 1, x);
  return AssociatedLegendreP(l - 2, m, x) -
         (2 * (l - 1) + 1) * sqrt(1 - x * x) *
             AssociatedLegendreP(l - 1, m - 1, x);
}


x86 assembly (clang, -O0):
<AssociatedLegendreP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    11bb <AssociatedLegendreP+0x7b>
mov    -0x10(%rbp),%esi
mov    $0xffffffff,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1060 <shortfactorial@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%edi
imul   $0xffffffff,-0x10(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <AssociatedLegendreP@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d4 <AssociatedLegendreP+0x94>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
cmpl   $0x0,-0xc(%rbp)
jne    11fa <AssociatedLegendreP+0xba>
cmpl   $0x0,-0x10(%rbp)
jne    11fa <AssociatedLegendreP+0xba>
movsd  0xe10(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
cmpl   $0x1,-0xc(%rbp)
jne    121d <AssociatedLegendreP+0xdd>
cmpl   $0x0,-0x10(%rbp)
jne    121d <AssociatedLegendreP+0xdd>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
cmpl   $0x1,-0xc(%rbp)
jne    127f <AssociatedLegendreP+0x13f>
cmpl   $0x1,-0x10(%rbp)
jne    127f <AssociatedLegendreP+0x13f>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xda2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
cmpl   $0x2,-0xc(%rbp)
jne    12f6 <AssociatedLegendreP+0x1b6>
cmpl   $0x1,-0x10(%rbp)
jne    12f6 <AssociatedLegendreP+0x1b6>
movsd  0xd85(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd2e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
cmpl   $0x2,-0xc(%rbp)
jne    1342 <AssociatedLegendreP+0x202>
cmpl   $0x0,-0x10(%rbp)
jne    1342 <AssociatedLegendreP+0x202>
movsd  0xcf6(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcf0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xcdc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
cmpl   $0x2,-0xc(%rbp)
jne    139d <AssociatedLegendreP+0x25d>
cmpl   $0x2,-0x10(%rbp)
jne    139d <AssociatedLegendreP+0x25d>
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xc7d(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xc79(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1433 <AssociatedLegendreP+0x2f3>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xc17(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <AssociatedLegendreP@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14ec <AssociatedLegendreP+0x3ac>
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
mov    -0x10(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <AssociatedLegendreP@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xb79(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <AssociatedLegendreP@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssociatedLegendreP>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movapd %xmm0,%xmm1
mov    %esi,%ebx
mov    %edi,%r14d
test   %esi,%esi
js     117c <AssociatedLegendreP+0x3c>
xorpd  %xmm0,%xmm0
cmp    %ebx,%r14d
jl     129e <AssociatedLegendreP+0x15e>
mov    %ebx,%eax
or     %r14d,%eax
je     11cb <AssociatedLegendreP+0x8b>
cmp    $0x1,%r14d
jne    11d8 <AssociatedLegendreP+0x98>
test   %ebx,%ebx
jne    11d8 <AssociatedLegendreP+0x98>
movapd %xmm1,%xmm0
jmp    129e <AssociatedLegendreP+0x15e>
mov    $0xffffffff,%edi
mov    %ebx,%esi
movsd  %xmm1,0x10(%rsp)
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
lea    (%rbx,%r14,1),%edi
mov    %r14d,%esi
sub    %ebx,%esi
call   1060 <shortfactorial@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
neg    %ebx
mov    %r14d,%edi
mov    %ebx,%esi
movsd  0x10(%rsp),%xmm0
call   1030 <AssociatedLegendreP@plt>
mulsd  0x8(%rsp),%xmm0
jmp    129e <AssociatedLegendreP+0x15e>
movsd  0xe2d(%rip),%xmm0
jmp    129e <AssociatedLegendreP+0x15e>
cmp    $0x1,%r14d
jne    120a <AssociatedLegendreP+0xca>
cmp    $0x1,%ebx
jne    120a <AssociatedLegendreP+0xca>
mulsd  %xmm1,%xmm1
movsd  0xe11(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    129e <AssociatedLegendreP+0x15e>
cmp    $0x2,%r14d
jne    124f <AssociatedLegendreP+0x10f>
cmp    $0x1,%ebx
jne    124f <AssociatedLegendreP+0x10f>
movsd  0xe03(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm1,%xmm1
movsd  0xdcd(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
jmp    129e <AssociatedLegendreP+0x15e>
cmp    $0x2,%r14d
jne    127b <AssociatedLegendreP+0x13b>
test   %ebx,%ebx
jne    127b <AssociatedLegendreP+0x13b>
movsd  0xda7(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xd9f(%rip),%xmm0
mulsd  0xd9f(%rip),%xmm0
jmp    129e <AssociatedLegendreP+0x15e>
cmp    $0x2,%r14d
jne    12a7 <AssociatedLegendreP+0x167>
cmp    $0x2,%ebx
jne    12a7 <AssociatedLegendreP+0x167>
mulsd  %xmm1,%xmm1
movsd  0xd6e(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  0xd6a(%rip),%xmm0
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
cmp    %ebx,%r14d
movsd  %xmm1,0x10(%rsp)
jne    12f4 <AssociatedLegendreP+0x1b4>
mov    %ebx,%ebp
add    $0xffffffff,%ebp
add    %ebx,%ebx
add    $0xfffffffe,%ebx
not    %ebx
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd32(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <sqrt@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
mov    %ebp,%esi
jmp    11b5 <AssociatedLegendreP+0x75>
lea    -0x2(%r14),%edi
mov    %ebx,%esi
movapd %xmm1,%xmm0
call   1030 <AssociatedLegendreP@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%ebp
add    $0xffffffff,%ebp
add    %r14d,%r14d
add    $0xffffffff,%r14d
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xcd8(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <sqrt@plt>
imul   %r14d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%rsp)
add    $0xffffffff,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
movsd  0x10(%rsp),%xmm0
call   1030 <AssociatedLegendreP@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
jmp    1173 <AssociatedLegendreP+0x33>

LLVM IR (-O0):
define double @AssociatedLegendreP(i32 %0, i32 %1, double %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %3
%11 = load i32, i32* %6
%12 = call double @pow(i32 -1, i32 %11)
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = sub nsw i32 %16, %17
%19 = call double @shortfactorial(i32 %15, i32 %18)
%20 = fmul double %12, %19
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = mul nsw i32 -1, %22
%24 = load double, double* %7
%25 = call double @AssociatedLegendreP(i32 %21, i32 %23, double %24)
%26 = fmul double %20, %25
store double %26, double* %4
br label %154
27: ; preds = %3
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %32
31: ; preds = %27
store double 0.000000e+00, double* %4
br label %154
32: ; preds = %27
%33 = load i32, i32* %5
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = load i32, i32* %6
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %35
store double 1.000000e+00, double* %4
br label %154
39: ; preds = %35, %32
%40 = load i32, i32* %5
%41 = icmp eq i32 %40, 1
br i1 %41, label %42, label %47
42: ; preds = %39
%43 = load i32, i32* %6
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = load double, double* %7
store double %46, double* %4
br label %154
47: ; preds = %42, %39
%48 = load i32, i32* %5
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %62
50: ; preds = %47
%51 = load i32, i32* %6
%52 = icmp eq i32 %51, 1
br i1 %52, label %53, label %62
53: ; preds = %50
%54 = load double, double* %7
%55 = load double, double* %7
%56 = fneg double %54
%57 = call double @llvm.fmuladd.f64(double %56, double %55, double 1.000000e+00)
%58 = fptosi double %57 to i32
%59 = call i32 @sqrt(i32 %58)
%60 = sub nsw i32 0, %59
%61 = sitofp i32 %60 to double
store double %61, double* %4
br label %154
62: ; preds = %50, %47
%63 = load i32, i32* %5
%64 = icmp eq i32 %63, 2
br i1 %64, label %65, label %79
65: ; preds = %62
%66 = load i32, i32* %6
%67 = icmp eq i32 %66, 1
br i1 %67, label %68, label %79
68: ; preds = %65
%69 = load double, double* %7
%70 = fmul double -3.000000e+00, %69
%71 = load double, double* %7
%72 = load double, double* %7
%73 = fneg double %71
%74 = call double @llvm.fmuladd.f64(double %73, double %72, double 1.000000e+00)
%75 = fptosi double %74 to i32
%76 = call i32 @sqrt(i32 %75)
%77 = sitofp i32 %76 to double
%78 = fmul double %70, %77
store double %78, double* %4
br label %154
79: ; preds = %65, %62
%80 = load i32, i32* %5
%81 = icmp eq i32 %80, 2
br i1 %81, label %82, label %91
82: ; preds = %79
%83 = load i32, i32* %6
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %91
85: ; preds = %82
%86 = load double, double* %7
%87 = fmul double 3.000000e+00, %86
%88 = load double, double* %7
%89 = call double @llvm.fmuladd.f64(double %87, double %88, double -1.000000e+00)
%90 = fdiv double %89, 2.000000e+00
store double %90, double* %4
br label %154
91: ; preds = %82, %79
%92 = load i32, i32* %5
%93 = icmp eq i32 %92, 2
br i1 %93, label %94, label %103
94: ; preds = %91
%95 = load i32, i32* %6
%96 = icmp eq i32 %95, 2
br i1 %96, label %97, label %103
97: ; preds = %94
%98 = load double, double* %7
%99 = load double, double* %7
%100 = fneg double %98
%101 = call double @llvm.fmuladd.f64(double %100, double %99, double 1.000000e+00)
%102 = fmul double 3.000000e+00, %101
store double %102, double* %4
br label %154
103: ; preds = %94, %91
%104 = load i32, i32* %5
%105 = load i32, i32* %6
%106 = icmp eq i32 %104, %105
br i1 %106, label %107, label %128
107: ; preds = %103
%108 = load i32, i32* %5
%109 = sub nsw i32 %108, 1
%110 = mul nsw i32 2, %109
%111 = add nsw i32 %110, 1
%112 = sub nsw i32 0, %111
%113 = load double, double* %7
%114 = load double, double* %7
%115 = fneg double %113
%116 = call double @llvm.fmuladd.f64(double %115, double %114, double 1.000000e+00)
%117 = fptosi double %116 to i32
%118 = call i32 @sqrt(i32 %117)
%119 = mul nsw i32 %112, %118
%120 = sitofp i32 %119 to double
%121 = load i32, i32* %5
%122 = sub nsw i32 %121, 1
%123 = load i32, i32* %6
%124 = sub nsw i32 %123, 1
%125 = load double, double* %7
%126 = call double @AssociatedLegendreP(i32 %122, i32 %124, double %125)
%127 = fmul double %120, %126
store double %127, double* %4
br label %154
128: ; preds = %103
%129 = load i32, i32* %5
%130 = sub nsw i32 %129, 2
%131 = load i32, i32* %6
%132 = load double, double* %7
%133 = call double @AssociatedLegendreP(i32 %130, i32 %131, double %132)
%134 = load i32, i32* %5
%135 = sub nsw i32 %134, 1
%136 = mul nsw i32 2, %135
%137 = add nsw i32 %136, 1
%138 = load double, double* %7
%139 = load double, double* %7
%140 = fneg double %138
%141 = call double @llvm.fmuladd.f64(double %140, double %139, double 1.000000e+00)
%142 = fptosi double %141 to i32
%143 = call i32 @sqrt(i32 %142)
%144 = mul nsw i32 %137, %143
%145 = sitofp i32 %144 to double
%146 = load i32, i32* %5
%147 = sub nsw i32 %146, 1
%148 = load i32, i32* %6
%149 = sub nsw i32 %148, 1
%150 = load double, double* %7
%151 = call double @AssociatedLegendreP(i32 %147, i32 %149, double %150)
%152 = fneg double %145
%153 = call double @llvm.fmuladd.f64(double %152, double %151, double %133)
store double %153, double* %4
br label %154
154: ; preds = %128, %107, %97, %85, %68, %53, %45, %38, %31, %10
%155 = load double, double* %4
ret double %155
}

LLVM IR (-O2):
define double @AssociatedLegendreP(i32 %0, i32 %1, double %2) {
%4 = icmp slt i32 %1, 0
br i1 %4, label %7, label %16
5: ; preds = %28, %38, %48, %55, %16, %18, %22, %73, %61, %7
%6 = phi double [ %15, %7 ], [ %72, %61 ], [ %88, %73 ], [ %34, %28 ], [ %45, %38 ], [ %51, %48 ], [ %58, %55 ], [ 0.000000e+00, %16 ], [ 1.000000e+00, %18 ], [ %2, %22 ]
ret double %6
7: ; preds = %3
%8 = tail call double @pow(i32 -1, i32 %1)
%9 = add nsw i32 %1, %0
%10 = sub nsw i32 %0, %1
%11 = tail call double @shortfactorial(i32 %9, i32 %10)
%12 = fmul double %8, %11
%13 = sub nsw i32 0, %1
%14 = tail call double @AssociatedLegendreP(i32 %0, i32 %13, double %2)
%15 = fmul double %12, %14
br label %5
16: ; preds = %3
%17 = icmp slt i32 %0, %1
br i1 %17, label %5, label %18
18: ; preds = %16
%19 = icmp eq i32 %1, 0
%20 = or i32 %1, %0
%21 = icmp eq i32 %20, 0
br i1 %21, label %5, label %22
22: ; preds = %18
%23 = icmp eq i32 %0, 1
%24 = and i1 %23, %19
br i1 %24, label %5, label %25
25: ; preds = %22
%26 = icmp eq i32 %1, 1
%27 = and i1 %23, %26
br i1 %27, label %28, label %35
28: ; preds = %25
%29 = fneg double %2
%30 = tail call double @llvm.fmuladd.f64(double %29, double %2, double 1.000000e+00)
%31 = fptosi double %30 to i32
%32 = tail call i32 @sqrt(i32 %31)
%33 = sub nsw i32 0, %32
%34 = sitofp i32 %33 to double
br label %5
35: ; preds = %25
%36 = icmp eq i32 %0, 2
%37 = and i1 %36, %26
br i1 %37, label %38, label %46
38: ; preds = %35
%39 = fmul double %2, -3.000000e+00
%40 = fneg double %2
%41 = tail call double @llvm.fmuladd.f64(double %40, double %2, double 1.000000e+00)
%42 = fptosi double %41 to i32
%43 = tail call i32 @sqrt(i32 %42)
%44 = sitofp i32 %43 to double
%45 = fmul double %39, %44
br label %5
46: ; preds = %35
%47 = and i1 %36, %19
br i1 %47, label %48, label %52
48: ; preds = %46
%49 = fmul double %2, 3.000000e+00
%50 = tail call double @llvm.fmuladd.f64(double %49, double %2, double -1.000000e+00)
%51 = fmul double %50, 5.000000e-01
br label %5
52: ; preds = %46
%53 = icmp eq i32 %1, 2
%54 = and i1 %36, %53
br i1 %54, label %55, label %59
55: ; preds = %52
%56 = fneg double %2
%57 = tail call double @llvm.fmuladd.f64(double %56, double %2, double 1.000000e+00)
%58 = fmul double %57, 3.000000e+00
br label %5
59: ; preds = %52
%60 = icmp eq i32 %0, %1
br i1 %60, label %61, label %73
61: ; preds = %59
%62 = add nsw i32 %1, -1
%63 = shl nsw i32 %62, 1
%64 = xor i32 %63, -1
%65 = fneg double %2
%66 = tail call double @llvm.fmuladd.f64(double %65, double %2, double 1.000000e+00)
%67 = fptosi double %66 to i32
%68 = tail call i32 @sqrt(i32 %67)
%69 = mul nsw i32 %68, %64
%70 = sitofp i32 %69 to double
%71 = tail call double @AssociatedLegendreP(i32 %62, i32 %62, double %2)
%72 = fmul double %71, %70
br label %5
73: ; preds = %59
%74 = add nsw i32 %0, -2
%75 = tail call double @AssociatedLegendreP(i32 %74, i32 %1, double %2)
%76 = add nsw i32 %0, -1
%77 = shl nsw i32 %76, 1
%78 = or i32 %77, 1
%79 = fneg double %2
%80 = tail call double @llvm.fmuladd.f64(double %79, double %2, double 1.000000e+00)
%81 = fptosi double %80 to i32
%82 = tail call i32 @sqrt(i32 %81)
%83 = mul nsw i32 %82, %78
%84 = sitofp i32 %83 to double
%85 = add nsw i32 %1, -1
%86 = tail call double @AssociatedLegendreP(i32 %76, i32 %85, double %2)
%87 = fneg double %84
%88 = tail call double @llvm.fmuladd.f64(double %87, double %86, double %75)
br label %5
}