#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 R(double, double, double);
double Z_A(double, double);
double Z_0(double alpha, double beta, double F) {
  double r = 0.0;
  if (F >= 0.0) {
    r = R(alpha, beta, F);
    if (r > 6.96e5)
      return F;
    else
      return Z_A(alpha, beta);
  } else {
    r = R(alpha, beta, 0.0);
    if (r > 6.96e5)
      return F;
    else
      return Z_A(alpha, beta);
  }
}


x86 assembly (clang, -O0):
<Z_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11a9 <Z_0+0x89>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <R@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe89(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1190 <Z_0+0x70>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11fa <Z_0+0xda>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <Z_A@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11fa <Z_0+0xda>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
xorps  %xmm2,%xmm2
call   1030 <R@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe33(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11e6 <Z_0+0xc6>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11fa <Z_0+0xda>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <Z_A@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Z_0>:
sub    $0x18,%rsp
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm0,(%rsp)
jae    1143 <Z_0+0x23>
xorpd  %xmm2,%xmm2
call   1030 <R@plt>
ucomisd 0xeb0(%rip),%xmm0
jbe    115d <Z_0+0x3d>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1040 <Z_A@plt>

LLVM IR (-O0):
define double @Z_0(double %0, double %1, double %2) {
%4 = alloca double
%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 0.000000e+00, double* %8
%9 = load double, double* %7
%10 = fcmp oge double %9, 0.000000e+00
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load double, double* %5
%13 = load double, double* %6
%14 = load double, double* %7
%15 = call double @R(double %12, double %13, double %14)
store double %15, double* %8
%16 = load double, double* %8
%17 = fcmp ogt double %16, 6.960000e+05
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = load double, double* %7
store double %19, double* %4
br label %36
20: ; preds = %11
%21 = load double, double* %5
%22 = load double, double* %6
%23 = call double @Z_A(double %21, double %22)
store double %23, double* %4
br label %36
24: ; preds = %3
%25 = load double, double* %5
%26 = load double, double* %6
%27 = call double @R(double %25, double %26, double 0.000000e+00)
store double %27, double* %8
%28 = load double, double* %8
%29 = fcmp ogt double %28, 6.960000e+05
br i1 %29, label %30, label %32
30: ; preds = %24
%31 = load double, double* %7
store double %31, double* %4
br label %36
32: ; preds = %24
%33 = load double, double* %5
%34 = load double, double* %6
%35 = call double @Z_A(double %33, double %34)
store double %35, double* %4
br label %36
36: ; preds = %32, %30, %20, %18
%37 = load double, double* %4
ret double %37
}

LLVM IR (-O2):
define double @Z_0(double %0, double %1, double %2) {
%4 = fcmp ult double %2, 0.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call double @R(double %0, double %1, double %2)
%7 = fcmp ogt double %6, 6.960000e+05
br i1 %7, label %13, label %11
8: ; preds = %3
%9 = tail call double @R(double %0, double %1, double 0.000000e+00)
%10 = fcmp ogt double %9, 6.960000e+05
br i1 %10, label %13, label %11
11: ; preds = %8, %5
%12 = tail call double @Z_A(double %0, double %1)
br label %13
13: ; preds = %11, %8, %5
%14 = phi double [ %2, %5 ], [ %2, %8 ], [ %12, %11 ]
ret double %14
}