#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
double incomplete_beta(double, double, double, char const *);
int /*<<< orphan*/ stderr;
double fisher(double m, double n, double x, const char *prompt) {
  if (m <= 0 || n <= 0) {
    fprintf(stderr,
            "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
            "\"fisher\")\n",
            prompt);
    exit(4);
  }
  return incomplete_beta(m / 2, n / 2, n / (n + m * x), prompt);
}


x86 assembly (clang, -O0):
<fisher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jae    1167 <fisher+0x37>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     118a <fisher+0x5a>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%edi
call   1050 <exit@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe58(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm4
movsd  -0x8(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
divsd  %xmm3,%xmm2
mov    -0x20(%rbp),%rdi
call   1040 <incomplete_beta@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisher>:
push   %rax
mov    %rdi,%rdx
movapd %xmm1,%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1179 <fisher+0x49>
ucomisd %xmm3,%xmm1
jae    1179 <fisher+0x49>
movsd  0xeb0(%rip),%xmm1
movapd %xmm0,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm3
movapd %xmm4,%xmm0
movapd %xmm3,%xmm2
mov    %rdx,%rdi
pop    %rax
jmp    1040 <incomplete_beta@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xe7f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"%s: IMPLEMENTATION ERROR! (Invalid argument in function \22fisher\22)\0A\00"
define double @fisher(double %0, double %1, double %2, i8* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i8*
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i8* %3, i8** %8
%9 = load double, double* %5
%10 = fcmp ole double %9, 0.000000e+00
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = load double, double* %6
%13 = fcmp ole double %12, 0.000000e+00
br i1 %13, label %14, label %19
14: ; preds = %11, %4
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %8
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i32 @exit(i32 4)
unreachable
19: ; preds = %11
%20 = load double, double* %5
%21 = fdiv double %20, 2.000000e+00
%22 = load double, double* %6
%23 = fdiv double %22, 2.000000e+00
%24 = load double, double* %6
%25 = load double, double* %6
%26 = load double, double* %5
%27 = load double, double* %7
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double %25)
%29 = fdiv double %24, %28
%30 = load i8*, i8** %8
%31 = call double @incomplete_beta(double %21, double %23, double %29, i8* %30)
ret double %31
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"%s: IMPLEMENTATION ERROR! (Invalid argument in function \22fisher\22)\0A\00"
define double @fisher(double %0, double %1, double %2, i8* %3) {
%5 = fcmp ole double %0, 0.000000e+00
%6 = fcmp ole double %1, 0.000000e+00
%7 = or i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %3)
%11 = tail call i32 @exit(i32 4)
unreachable
12: ; preds = %4
%13 = fmul double %0, 5.000000e-01
%14 = fmul double %1, 5.000000e-01
%15 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %1)
%16 = fdiv double %1, %15
%17 = tail call double @incomplete_beta(double %13, double %14, double %16, i8* %3)
ret double %17
}