#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*/ error2(char *);
double CountTrees(int ns, int rooted) {
  double i, ntree = 1;
  if (ns > 70)
    error2("ns too large in NumberofTrees().");
  for (i = 4; i <= ns + rooted; i++)
    ntree *= 2 * i - 5;
  return (ntree);
}


x86 assembly (clang, -O0):
<CountTrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x46,-0x4(%rbp)
jle    1141 <CountTrees+0x31>
lea    0xedc(%rip),%rdi
call   1030 <error2@plt>
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
ucomisd %xmm1,%xmm0
jb     119d <CountTrees+0x8d>
movsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe98(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe72(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114e <CountTrees+0x3e>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountTrees>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmp    $0x47,%edi
jl     1128 <CountTrees+0x18>
lea    0xef5(%rip),%rdi
call   1030 <error2@plt>
add    %ebp,%ebx
cmp    $0x4,%ebx
jge    1139 <CountTrees+0x29>
movsd  0xec9(%rip),%xmm0
jmp    117a <CountTrees+0x6a>
cvtsi2sd %ebx,%xmm1
movsd  0xec3(%rip),%xmm2
movsd  0xeb3(%rip),%xmm3
movsd  0xebb(%rip),%xmm4
movapd %xmm3,%xmm0
nopl   0x0(%rax)
movapd %xmm2,%xmm5
addsd  %xmm2,%xmm5
addsd  %xmm4,%xmm5
mulsd  %xmm5,%xmm0
addsd  %xmm3,%xmm2
ucomisd %xmm2,%xmm1
jae    1160 <CountTrees+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"ns too large in NumberofTrees().\00"
define double @CountTrees(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %6
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 70
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @error2(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
store double 4.000000e+00, double* %5
br label %12
12: ; preds = %24, %11
%13 = load double, double* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
%17 = sitofp i32 %16 to double
%18 = fcmp ole double %13, %17
br i1 %18, label %19, label %27
19: ; preds = %12
%20 = load double, double* %5
%21 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %20, double -5.000000e+00)
%22 = load double, double* %6
%23 = fmul double %22, %21
store double %23, double* %6
br label %24
24: ; preds = %19
%25 = load double, double* %5
%26 = fadd double %25, 1.000000e+00
store double %26, double* %5
br label %12
27: ; preds = %12
%28 = load double, double* %6
ret double %28
}

LLVM IR (-O2):
@.str = [33 x i8] c"ns too large in NumberofTrees().\00"
define double @CountTrees(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 70
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @error2(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = add nsw i32 %1, %0
%8 = sitofp i32 %7 to double
%9 = icmp slt i32 %7, 4
br i1 %9, label %17, label %10
10: ; preds = %6, %10
%11 = phi double [ %14, %10 ], [ 1.000000e+00, %6 ]
%12 = phi double [ %15, %10 ], [ 4.000000e+00, %6 ]
%13 = tail call double @llvm.fmuladd.f64(double %12, double 2.000000e+00, double -5.000000e+00)
%14 = fmul double %11, %13
%15 = fadd double %12, 1.000000e+00
%16 = fcmp ugt double %15, %8
br i1 %16, label %17, label %10
17: ; preds = %10, %6
%18 = phi double [ 1.000000e+00, %6 ], [ %14, %10 ]
ret double %18
}