#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 */
int fabs(double);
double s(int, int, int);
char internal(int i, int j, int k, int p) {
  double s1, s2;
  s1 = s(i, j, k);
  s2 = s(p, i, j) + s(p, j, k) + s(p, k, i);
  if ((fabs(s1 - s2) < 1e-6))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <s@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <s@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <s@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <s@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe4d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c6 <internal+0xa6>
movb   $0x1,-0x1(%rbp)
jmp    11ca <internal+0xaa>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <s@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <s@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
mov    %ebx,%esi
mov    %r15d,%edx
call   1040 <s@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
call   1040 <s@plt>
addsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
setle  %al
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @internal(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call double @s(i32 %12, i32 %13, i32 %14)
store double %15, double* %10
%16 = load i32, i32* %9
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = call double @s(i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %9
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call double @s(i32 %20, i32 %21, i32 %22)
%24 = fadd double %19, %23
%25 = load i32, i32* %9
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = call double @s(i32 %25, i32 %26, i32 %27)
%29 = fadd double %24, %28
store double %29, double* %11
%30 = load double, double* %10
%31 = load double, double* %11
%32 = fsub double %30, %31
%33 = call i32 @fabs(double %32)
%34 = sitofp i32 %33 to double
%35 = fcmp olt double %34, 0x3EB0C6F7A0B5ED8D
br i1 %35, label %36, label %37
36: ; preds = %4
store i8 1, i8* %5
br label %38
37: ; preds = %4
store i8 0, i8* %5
br label %38
38: ; preds = %37, %36
%39 = load i8, i8* %5
ret i8 %39
}

LLVM IR (-O2):
define signext i8 @internal(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call double @s(i32 %0, i32 %1, i32 %2)
%6 = tail call double @s(i32 %3, i32 %0, i32 %1)
%7 = tail call double @s(i32 %3, i32 %1, i32 %2)
%8 = fadd double %6, %7
%9 = tail call double @s(i32 %3, i32 %2, i32 %0)
%10 = fadd double %8, %9
%11 = fsub double %5, %10
%12 = tail call i32 @fabs(double %11)
%13 = icmp slt i32 %12, 1
%14 = zext i1 %13 to i8
ret i8 %14
}