#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 distance(double *, double *, int);
double fabs(double);
double norm(double *, int);
int H_end(double x0[], double x1[], double f0, double f1, double e1, double e2,
          int n) {
  double r;
  if ((r = norm(x0, n)) < e2)
    r = 1;
  r *= e1;
  if (distance(x1, x0, n) >= r)
    return (0);
  r = fabs(f0);
  if (r < e2)
    r = 1;
  r *= e1;
  if (fabs(f1 - f0) >= r)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<H_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
mov    %edx,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1030 <norm@plt>
movaps %xmm0,%xmm1
movsd  %xmm1,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1177 <H_end+0x57>
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x3c(%rbp),%edx
call   1040 <distance@plt>
ucomisd -0x48(%rbp),%xmm0
jb     11ad <H_end+0x8d>
movl   $0x0,-0x4(%rbp)
jmp    1225 <H_end+0x105>
movsd  -0x20(%rbp),%xmm0
movaps 0xe57(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e3 <H_end+0xc3>
movsd  0xe22(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movaps 0xe0d(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x48(%rbp),%xmm0
jb     121e <H_end+0xfe>
movl   $0x0,-0x4(%rbp)
jmp    1225 <H_end+0x105>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H_end>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %edx,%ebp
movsd  %xmm3,(%rsp)
movsd  %xmm2,0x8(%rsp)
movaps %xmm1,0x20(%rsp)
movapd %xmm0,0x10(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%esi
call   1030 <norm@plt>
movapd %xmm0,%xmm2
cmpltsd (%rsp),%xmm2
movapd %xmm2,%xmm1
andnpd %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
andpd  %xmm0,%xmm2
orpd   %xmm1,%xmm2
mulsd  0x8(%rsp),%xmm2
movapd %xmm2,0x30(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <distance@plt>
xor    %eax,%eax
ucomisd 0x30(%rsp),%xmm0
jae    11e5 <H_end+0xc5>
movapd 0xe76(%rip),%xmm0
movapd 0x20(%rsp),%xmm3
movapd 0x10(%rsp),%xmm4
subsd  %xmm4,%xmm3
andpd  %xmm0,%xmm4
movapd %xmm4,%xmm1
cmpltsd (%rsp),%xmm1
movapd %xmm1,%xmm2
andnpd %xmm4,%xmm2
movsd  0xe38(%rip),%xmm4
andpd  %xmm4,%xmm1
orpd   %xmm2,%xmm1
mulsd  0x8(%rsp),%xmm1
andpd  %xmm0,%xmm3
ucomisd %xmm1,%xmm3
jae    11e5 <H_end+0xc5>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @H_end(double* %0, double* %1, double %2, double %3, double %4, double %5, i32 %6) {
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca double
store double* %0, double** %9
store double* %1, double** %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store i32 %6, i32* %15
%17 = load double*, double** %9
%18 = load i32, i32* %15
%19 = call double @norm(double* %17, i32 %18)
store double %19, double* %16
%20 = load double, double* %14
%21 = fcmp olt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %7
store double 1.000000e+00, double* %16
br label %23
23: ; preds = %22, %7
%24 = load double, double* %13
%25 = load double, double* %16
%26 = fmul double %25, %24
store double %26, double* %16
%27 = load double*, double** %10
%28 = load double*, double** %9
%29 = load i32, i32* %15
%30 = call double @distance(double* %27, double* %28, i32 %29)
%31 = load double, double* %16
%32 = fcmp oge double %30, %31
br i1 %32, label %33, label %34
33: ; preds = %23
store i32 0, i32* %8
br label %53
34: ; preds = %23
%35 = load double, double* %11
%36 = call double @llvm.fabs.f64(double %35)
store double %36, double* %16
%37 = load double, double* %16
%38 = load double, double* %14
%39 = fcmp olt double %37, %38
br i1 %39, label %40, label %41
40: ; preds = %34
store double 1.000000e+00, double* %16
br label %41
41: ; preds = %40, %34
%42 = load double, double* %13
%43 = load double, double* %16
%44 = fmul double %43, %42
store double %44, double* %16
%45 = load double, double* %12
%46 = load double, double* %11
%47 = fsub double %45, %46
%48 = call double @llvm.fabs.f64(double %47)
%49 = load double, double* %16
%50 = fcmp oge double %48, %49
br i1 %50, label %51, label %52
51: ; preds = %41
store i32 0, i32* %8
br label %53
52: ; preds = %41
store i32 1, i32* %8
br label %53
53: ; preds = %52, %51, %33
%54 = load i32, i32* %8
ret i32 %54
}

LLVM IR (-O2):
define i32 @H_end(double* %0, double* %1, double %2, double %3, double %4, double %5, i32 %6) {
%8 = tail call double @norm(double* %0, i32 %6)
%9 = fcmp olt double %8, %5
%10 = select i1 %9, double 1.000000e+00, double %8
%11 = fmul double %10, %4
%12 = tail call double @distance(double* %1, double* %0, i32 %6)
%13 = fcmp ult double %12, %11
br i1 %13, label %14, label %23
14: ; preds = %7
%15 = tail call double @llvm.fabs.f64(double %2)
%16 = fcmp olt double %15, %5
%17 = select i1 %16, double 1.000000e+00, double %15
%18 = fmul double %17, %4
%19 = fsub double %3, %2
%20 = tail call double @llvm.fabs.f64(double %19)
%21 = fcmp ult double %20, %18
br i1 %21, label %22, label %23
22: ; preds = %14
br label %23
23: ; preds = %14, %7, %22
%24 = phi i32 [ 1, %22 ], [ 0, %7 ], [ 0, %14 ]
ret i32 %24
}