#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 get_precision(double, double, long, long);
double get_recall(double, double, long, long);
double get_F_measure(double FPR, double TPR, long P, long N) {
  double precision = get_precision(FPR, TPR, P, N);
  double recall = get_recall(FPR, TPR, P, N);
  if (precision + recall > 0)
    return 2 * precision * recall / (precision + recall);
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_F_measure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <get_precision@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <get_recall@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11b3 <get_F_measure+0x93>
movsd  0xe6f(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11bb <get_F_measure+0x9b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_F_measure>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <get_precision@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <get_recall@plt>
movsd  (%rsp),%xmm3
movapd %xmm3,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jbe    1181 <get_F_measure+0x61>
addsd  %xmm3,%xmm3
mulsd  %xmm0,%xmm3
divsd  %xmm2,%xmm3
movapd %xmm3,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @get_F_measure(double %0, double %1, i64 %2, i64 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i64
%9 = alloca i64
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
%12 = load double, double* %6
%13 = load double, double* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = call double @get_precision(double %12, double %13, i64 %14, i64 %15)
store double %16, double* %10
%17 = load double, double* %6
%18 = load double, double* %7
%19 = load i64, i64* %8
%20 = load i64, i64* %9
%21 = call double @get_recall(double %17, double %18, i64 %19, i64 %20)
store double %21, double* %11
%22 = load double, double* %10
%23 = load double, double* %11
%24 = fadd double %22, %23
%25 = fcmp ogt double %24, 0.000000e+00
br i1 %25, label %26, label %35
26: ; preds = %4
%27 = load double, double* %10
%28 = fmul double 2.000000e+00, %27
%29 = load double, double* %11
%30 = fmul double %28, %29
%31 = load double, double* %10
%32 = load double, double* %11
%33 = fadd double %31, %32
%34 = fdiv double %30, %33
store double %34, double* %5
br label %36
35: ; preds = %4
store double 0.000000e+00, double* %5
br label %36
36: ; preds = %35, %26
%37 = load double, double* %5
ret double %37
}

LLVM IR (-O2):
define double @get_F_measure(double %0, double %1, i64 %2, i64 %3) {
%5 = tail call double @get_precision(double %0, double %1, i64 %2, i64 %3)
%6 = tail call double @get_recall(double %0, double %1, i64 %2, i64 %3)
%7 = fadd double %5, %6
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = fmul double %5, 2.000000e+00
%11 = fmul double %10, %6
%12 = fdiv double %11, %7
br label %13
13: ; preds = %4, %9
%14 = phi double [ %12, %9 ], [ 0.000000e+00, %4 ]
ret double %14
}