#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 fabs(double);
int condicoes(double x0, double x1, double x2, double fx2, double fxm) {
  double interval = fabs(x1 - x0);
  return fabs(fx2) < fabs(fxm) && ((x2 < 0 && interval / 2 > fabs(x1 - x2)) ||
                                   (x2 > 0 && interval / 2 > fabs(x0 - x2)));
}


x86 assembly (clang, -O0):
<condicoes>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movaps 0xed2(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
movaps 0xebd(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movaps 0xead(%rip),%xmm2
pand   %xmm2,%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x31(%rbp)
jbe    11fc <condicoes+0xfc>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11a9 <condicoes+0xa9>
movsd  -0x30(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xe6a(%rip),%xmm2
pand   %xmm2,%xmm1
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x32(%rbp)
ja     11f6 <condicoes+0xf6>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x33(%rbp)
jbe    11f0 <condicoes+0xf0>
movsd  -0x30(%rbp),%xmm0
movsd  0xe43(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xe1e(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x33(%rbp)
mov    -0x33(%rbp),%al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condicoes>:
movapd 0xef8(%rip),%xmm5
andpd  %xmm5,%xmm3
andpd  %xmm5,%xmm4
xor    %eax,%eax
ucomisd %xmm3,%xmm4
jbe    1179 <condicoes+0x79>
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
andpd  %xmm5,%xmm3
xorpd  %xmm4,%xmm4
ucomisd %xmm2,%xmm4
jbe    1151 <condicoes+0x51>
movsd  0xeda(%rip),%xmm5
subsd  %xmm2,%xmm1
andpd  0xebe(%rip),%xmm1
mulsd  %xmm3,%xmm5
mov    $0x1,%eax
ucomisd %xmm1,%xmm5
ja     1179 <condicoes+0x79>
ucomisd %xmm4,%xmm2
mov    $0x0,%eax
jbe    1179 <condicoes+0x79>
mulsd  0xeac(%rip),%xmm3
subsd  %xmm2,%xmm0
andpd  0xe90(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm3
seta   %al
ret

LLVM IR (-O0):
define i32 @condicoes(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %7
%13 = load double, double* %6
%14 = fsub double %12, %13
%15 = call double @llvm.fabs.f64(double %14)
store double %15, double* %11
%16 = load double, double* %9
%17 = call double @llvm.fabs.f64(double %16)
%18 = load double, double* %10
%19 = call double @llvm.fabs.f64(double %18)
%20 = fcmp olt double %17, %19
br i1 %20, label %21, label %47
21: ; preds = %5
%22 = load double, double* %8
%23 = fcmp olt double %22, 0.000000e+00
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = load double, double* %11
%26 = fdiv double %25, 2.000000e+00
%27 = load double, double* %7
%28 = load double, double* %8
%29 = fsub double %27, %28
%30 = call double @llvm.fabs.f64(double %29)
%31 = fcmp ogt double %26, %30
br i1 %31, label %45, label %32
32: ; preds = %24, %21
%33 = load double, double* %8
%34 = fcmp ogt double %33, 0.000000e+00
br i1 %34, label %35, label %43
35: ; preds = %32
%36 = load double, double* %11
%37 = fdiv double %36, 2.000000e+00
%38 = load double, double* %6
%39 = load double, double* %8
%40 = fsub double %38, %39
%41 = call double @llvm.fabs.f64(double %40)
%42 = fcmp ogt double %37, %41
br label %43
43: ; preds = %35, %32
%44 = phi i1 [ false, %32 ], [ %42, %35 ]
br label %45
45: ; preds = %43, %24
%46 = phi i1 [ true, %24 ], [ %44, %43 ]
br label %47
47: ; preds = %45, %5
%48 = phi i1 [ false, %5 ], [ %46, %45 ]
%49 = zext i1 %48 to i32
ret i32 %49
}

LLVM IR (-O2):
define i32 @condicoes(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %1, %0
%7 = tail call double @llvm.fabs.f64(double %6)
%8 = tail call double @llvm.fabs.f64(double %3)
%9 = tail call double @llvm.fabs.f64(double %4)
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %26
11: ; preds = %5
%12 = fcmp olt double %2, 0.000000e+00
br i1 %12, label %13, label %18
13: ; preds = %11
%14 = fmul double %7, 5.000000e-01
%15 = fsub double %1, %2
%16 = tail call double @llvm.fabs.f64(double %15)
%17 = fcmp ogt double %14, %16
br i1 %17, label %26, label %18
18: ; preds = %13, %11
%19 = fcmp ogt double %2, 0.000000e+00
br i1 %19, label %20, label %26
20: ; preds = %18
%21 = fmul double %7, 5.000000e-01
%22 = fsub double %0, %2
%23 = tail call double @llvm.fabs.f64(double %22)
%24 = fcmp ogt double %21, %23
%25 = zext i1 %24 to i32
br label %26
26: ; preds = %13, %20, %18, %5
%27 = phi i32 [ 0, %5 ], [ 1, %13 ], [ 0, %18 ], [ %25, %20 ]
ret i32 %27
}