#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*/ fabs(double);
double sqrt(int /*<<< orphan*/);
void GetMonoPolFNFM(double mc_pol_Rup, double mc_pol_Rdown, double *mc_pol_FN,
                    double *mc_pol_FM) {
  if (mc_pol_Rup > 0)
    mc_pol_Rup = sqrt(fabs(mc_pol_Rup));
  else
    mc_pol_Rup = -sqrt(fabs(mc_pol_Rup));
  if (mc_pol_Rdown > 0)
    mc_pol_Rdown = sqrt(fabs(mc_pol_Rdown));
  else
    mc_pol_Rdown = -sqrt(fabs(mc_pol_Rdown));
  *mc_pol_FN = 0.5 * (mc_pol_Rup + mc_pol_Rdown);
  *mc_pol_FM = 0.5 * (mc_pol_Rup - mc_pol_Rdown);
  return;
}


x86 assembly (clang, -O0):
<GetMonoPolFNFM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1167 <GetMonoPolFNFM+0x47>
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1194 <GetMonoPolFNFM+0x74>
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11c1 <GetMonoPolFNFM+0xa1>
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    11ee <GetMonoPolFNFM+0xce>
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xe00(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xde2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMonoPolFNFM>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
xorpd  %xmm2,%xmm2
cmpltsd 0x10(%rsp),%xmm2
movapd %xmm2,%xmm1
andpd  %xmm0,%xmm2
xorpd  0xea0(%rip),%xmm0
andnpd %xmm0,%xmm1
orpd   %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movapd 0xe78(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
cmpltsd 0x8(%rsp),%xmm3
movapd %xmm3,%xmm1
andnpd %xmm2,%xmm1
andpd  %xmm0,%xmm3
orpd   %xmm1,%xmm3
movapd 0x10(%rsp),%xmm2
movapd %xmm2,%xmm0
addsd  %xmm3,%xmm0
movsd  0xe53(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
subsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @GetMonoPolFNFM(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = fcmp ogt double %9, 0.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = load double, double* %5
%13 = call i32 @fabs(double %12)
%14 = call double @sqrt(i32 %13)
store double %14, double* %5
br label %20
15: ; preds = %4
%16 = load double, double* %5
%17 = call i32 @fabs(double %16)
%18 = call double @sqrt(i32 %17)
%19 = fneg double %18
store double %19, double* %5
br label %20
20: ; preds = %15, %11
%21 = load double, double* %6
%22 = fcmp ogt double %21, 0.000000e+00
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load double, double* %6
%25 = call i32 @fabs(double %24)
%26 = call double @sqrt(i32 %25)
store double %26, double* %6
br label %32
27: ; preds = %20
%28 = load double, double* %6
%29 = call i32 @fabs(double %28)
%30 = call double @sqrt(i32 %29)
%31 = fneg double %30
store double %31, double* %6
br label %32
32: ; preds = %27, %23
%33 = load double, double* %5
%34 = load double, double* %6
%35 = fadd double %33, %34
%36 = fmul double 5.000000e-01, %35
%37 = load double*, double** %7
store double %36, double* %37
%38 = load double, double* %5
%39 = load double, double* %6
%40 = fsub double %38, %39
%41 = fmul double 5.000000e-01, %40
%42 = load double*, double** %8
store double %41, double* %42
ret void
}

LLVM IR (-O2):
define void @GetMonoPolFNFM(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fcmp ogt double %0, 0.000000e+00
%6 = tail call i32 @fabs(double %0)
%7 = tail call double @sqrt(i32 %6)
%8 = fneg double %7
%9 = select i1 %5, double %7, double %8
%10 = fcmp ogt double %1, 0.000000e+00
%11 = tail call i32 @fabs(double %1)
%12 = tail call double @sqrt(i32 %11)
%13 = fneg double %12
%14 = select i1 %10, double %12, double %13
%15 = fadd double %9, %14
%16 = fmul double %15, 5.000000e-01
store double %16, double* %2
%17 = fsub double %9, %14
%18 = fmul double %17, 5.000000e-01
store double %18, double* %3
ret void
}