#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 cos(double);
double tan(double);
int f1(double x, double y) {
  double z1 = cos(y < 10 ? x : tan(x < 20 ? x : y));
  double z2 = cos(y < 10 ? x : tan(x < 20 ? x : y));
  return z1 == z2;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1154 <f1+0x34>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    118f <f1+0x6f>
movsd  0xeac(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1176 <f1+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1180 <f1+0x60>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <tan@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe5a(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11c0 <f1+0xa0>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    11fb <f1+0xdb>
movsd  0xe40(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11e2 <f1+0xc2>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11ec <f1+0xcc>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1030 <tan@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x28,%rsp
movsd  0xed4(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    114b <f1+0x2b>
movapd %xmm0,0x10(%rsp)
call   1040 <cos@plt>
movapd 0x10(%rsp),%xmm1
movsd  %xmm0,0x8(%rsp)
jmp    118d <f1+0x6d>
movapd %xmm0,%xmm2
cmpltsd 0xeb0(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
movapd %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
call   1030 <tan@plt>
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
call   1030 <tan@plt>
movapd %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <cos@plt>
cmpeqsd 0x8(%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @f1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = fcmp olt double %7, 1.000000e+01
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %3
br label %21
11: ; preds = %2
%12 = load double, double* %3
%13 = fcmp olt double %12, 2.000000e+01
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load double, double* %3
br label %18
16: ; preds = %11
%17 = load double, double* %4
br label %18
18: ; preds = %16, %14
%19 = phi double [ %15, %14 ], [ %17, %16 ]
%20 = call double @tan(double %19)
br label %21
21: ; preds = %18, %9
%22 = phi double [ %10, %9 ], [ %20, %18 ]
%23 = call double @cos(double %22)
store double %23, double* %5
%24 = load double, double* %4
%25 = fcmp olt double %24, 1.000000e+01
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = load double, double* %3
br label %38
28: ; preds = %21
%29 = load double, double* %3
%30 = fcmp olt double %29, 2.000000e+01
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = load double, double* %3
br label %35
33: ; preds = %28
%34 = load double, double* %4
br label %35
35: ; preds = %33, %31
%36 = phi double [ %32, %31 ], [ %34, %33 ]
%37 = call double @tan(double %36)
br label %38
38: ; preds = %35, %26
%39 = phi double [ %27, %26 ], [ %37, %35 ]
%40 = call double @cos(double %39)
store double %40, double* %6
%41 = load double, double* %5
%42 = load double, double* %6
%43 = fcmp oeq double %41, %42
%44 = zext i1 %43 to i32
ret i32 %44
}

LLVM IR (-O2):
define i32 @f1(double %0, double %1) {
%3 = fcmp olt double %1, 1.000000e+01
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call double @cos(double %0)
br label %12
6: ; preds = %2
%7 = fcmp olt double %0, 2.000000e+01
%8 = select i1 %7, double %0, double %1
%9 = tail call double @tan(double %8)
%10 = tail call double @cos(double %9)
%11 = tail call double @tan(double %8)
br label %12
12: ; preds = %4, %6
%13 = phi double [ %10, %6 ], [ %5, %4 ]
%14 = phi double [ %11, %6 ], [ %0, %4 ]
%15 = tail call double @cos(double %14)
%16 = fcmp oeq double %13, %15
%17 = zext i1 %16 to i32
ret i32 %17
}