#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 */
struct conf_mat {
  int dummy;
};

/* Variables and functions */
double precision_micro(struct conf_mat const *);
double recall_micro(struct conf_mat const *);
double F1_micro(const struct conf_mat *mat) {
  double prec = precision_micro(mat);
  double rec = recall_micro(mat);
  if (prec || rec)
    return 2 * prec * rec / (prec + rec);
  return 0.;
}


x86 assembly (clang, -O0):
<F1_micro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <precision_micro@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <recall_micro@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117d <F1_micro+0x5d>
jp     117d <F1_micro+0x5d>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117d <F1_micro+0x5d>
jp     117d <F1_micro+0x5d>
jmp    11a7 <F1_micro+0x87>
movsd  0xe7b(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11af <F1_micro+0x8f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F1_micro>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <precision_micro@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <recall_micro@plt>
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jne    115d <F1_micro+0x3d>
jp     115d <F1_micro+0x3d>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    115d <F1_micro+0x3d>
jnp    1171 <F1_micro+0x51>
movapd %xmm3,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm3
divsd  %xmm3,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.conf_mat = type { i32 }
define double @F1_micro(%struct.conf_mat* %0) {
%2 = alloca double
%3 = alloca %struct.conf_mat*
%4 = alloca double
%5 = alloca double
store %struct.conf_mat* %0, %struct.conf_mat** %3
%6 = load %struct.conf_mat*, %struct.conf_mat** %3
%7 = call double @precision_micro(%struct.conf_mat* %6)
store double %7, double* %4
%8 = load %struct.conf_mat*, %struct.conf_mat** %3
%9 = call double @recall_micro(%struct.conf_mat* %8)
store double %9, double* %5
%10 = load double, double* %4
%11 = fcmp une double %10, 0.000000e+00
br i1 %11, label %15, label %12
12: ; preds = %1
%13 = load double, double* %5
%14 = fcmp une double %13, 0.000000e+00
br i1 %14, label %15, label %24
15: ; preds = %12, %1
%16 = load double, double* %4
%17 = fmul double 2.000000e+00, %16
%18 = load double, double* %5
%19 = fmul double %17, %18
%20 = load double, double* %4
%21 = load double, double* %5
%22 = fadd double %20, %21
%23 = fdiv double %19, %22
store double %23, double* %2
br label %25
24: ; preds = %12
store double 0.000000e+00, double* %2
br label %25
25: ; preds = %24, %15
%26 = load double, double* %2
ret double %26
}

LLVM IR (-O2):
%struct.conf_mat = type { i32 }
define double @F1_micro(%struct.conf_mat* %0) {
%2 = tail call double @precision_micro(%struct.conf_mat* %0)
%3 = tail call double @recall_micro(%struct.conf_mat* %0)
%4 = fcmp une double %2, 0.000000e+00
%5 = fcmp une double %3, 0.000000e+00
%6 = select i1 %4, i1 true, i1 %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = fmul double %2, 2.000000e+00
%9 = fmul double %8, %3
%10 = fadd double %2, %3
%11 = fdiv double %9, %10
br label %12
12: ; preds = %1, %7
%13 = phi double [ %11, %7 ], [ 0.000000e+00, %1 ]
ret double %13
}