#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 /*<<< orphan*/ __CPROVER_assert(int, char *);
int /*<<< orphan*/ __CPROVER_assume(int);
double sqrt(double);
double trianglesorted(double a, double c, double b) {
  __CPROVER_assume(1.0 <= a && a <= 9.0);
  __CPROVER_assume(1.0 <= b && b <= 9.0);
  __CPROVER_assume(1.0 <= c && c <= 9.0);
  __CPROVER_assume(a + b > c + 0.000001);
  __CPROVER_assume(a + c > b + 0.000001);
  __CPROVER_assume(b + c > a + 0.000001);
  __CPROVER_assume(a < c && b < c);
  double temp;
  if ((a < b)) {
    temp = (sqrt(((((c + (b + a)) * (a - (c - b))) * (a + (c - b))) *
                  (c + (b - a)))) /
            4.0);
  } else {
    temp = (sqrt(((((c + (a + b)) * (b - (c - a))) * (b + (c - a))) *
                  (c + (a - b)))) /
            4.0);
  }
  __CPROVER_assert(temp >= 0.0, "postcondition");
  return temp;
}


x86 assembly (clang, -O0):
<trianglesorted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
movsd  0xeaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x21(%rbp)
jb     1176 <trianglesorted+0x46>
movsd  0xe9d(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe6e(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x22(%rbp)
jb     11b2 <trianglesorted+0x82>
movsd  0xe61(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe32(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x23(%rbp)
jb     11ee <trianglesorted+0xbe>
movsd  0xe25(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x23(%rbp)
mov    -0x23(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe03(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xddb(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xdb3(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x24(%rbp)
jbe    12a0 <trianglesorted+0x170>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x24(%rbp)
mov    -0x24(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1334 <trianglesorted+0x204>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  0xcf2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13a2 <trianglesorted+0x272>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  0xc7f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
lea    0xc63(%rip),%rsi
call   1050 <__CPROVER_assert@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trianglesorted>:
sub    $0x28,%rsp
movsd  %xmm0,0x18(%rsp)
ucomisd 0xebe(%rip),%xmm0
setae  %al
movsd  0xebb(%rip),%xmm3
ucomisd %xmm0,%xmm3
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <__CPROVER_assume@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe88(%rip),%xmm0
setae  %al
movsd  0xe85(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <__CPROVER_assume@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0xe5e(%rip),%xmm0
setae  %al
movsd  0xe5b(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <__CPROVER_assume@plt>
movsd  0x18(%rsp),%xmm1
addsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xe32(%rip),%xmm0
xor    %edi,%edi
ucomisd %xmm0,%xmm1
seta   %dil
call   1030 <__CPROVER_assume@plt>
movsd  0x18(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  0xe09(%rip),%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
seta   %dil
call   1030 <__CPROVER_assume@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0xde6(%rip),%xmm1
addsd  0x18(%rsp),%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
seta   %dil
call   1030 <__CPROVER_assume@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0x18(%rsp),%xmm0
seta   %al
ucomisd 0x8(%rsp),%xmm0
seta   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <__CPROVER_assume@plt>
movsd  0x20(%rsp),%xmm5
movsd  0x18(%rsp),%xmm4
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm0
ucomisd %xmm4,%xmm0
addsd  %xmm3,%xmm5
movapd %xmm3,%xmm2
jbe    12a5 <trianglesorted+0x175>
subsd  %xmm0,%xmm2
movapd %xmm4,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm5
addsd  %xmm4,%xmm2
mulsd  %xmm5,%xmm2
subsd  %xmm4,%xmm0
jmp    12c5 <trianglesorted+0x195>
subsd  %xmm4,%xmm2
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm5,%xmm1
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm0,%xmm4
movapd %xmm4,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12dd <trianglesorted+0x1ad>
sqrtsd %xmm0,%xmm0
jmp    12e6 <trianglesorted+0x1b6>
call   1040 <sqrt@plt>
xorpd  %xmm1,%xmm1
mulsd  0xd2a(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
ucomisd %xmm1,%xmm0
setae  %dil
lea    0xd1b(%rip),%rsi
call   1050 <__CPROVER_assert@plt>
movsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"postcondition\00"
define double @trianglesorted(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = fcmp ole double 1.000000e+00, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load double, double* %4
%12 = fcmp ole double %11, 9.000000e+00
br label %13
13: ; preds = %10, %3
%14 = phi i1 [ false, %3 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @__CPROVER_assume(i32 %15)
%17 = load double, double* %6
%18 = fcmp ole double 1.000000e+00, %17
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load double, double* %6
%21 = fcmp ole double %20, 9.000000e+00
br label %22
22: ; preds = %19, %13
%23 = phi i1 [ false, %13 ], [ %21, %19 ]
%24 = zext i1 %23 to i32
%25 = call i32 @__CPROVER_assume(i32 %24)
%26 = load double, double* %5
%27 = fcmp ole double 1.000000e+00, %26
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = load double, double* %5
%30 = fcmp ole double %29, 9.000000e+00
br label %31
31: ; preds = %28, %22
%32 = phi i1 [ false, %22 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
%34 = call i32 @__CPROVER_assume(i32 %33)
%35 = load double, double* %4
%36 = load double, double* %6
%37 = fadd double %35, %36
%38 = load double, double* %5
%39 = fadd double %38, 0x3EB0C6F7A0B5ED8D
%40 = fcmp ogt double %37, %39
%41 = zext i1 %40 to i32
%42 = call i32 @__CPROVER_assume(i32 %41)
%43 = load double, double* %4
%44 = load double, double* %5
%45 = fadd double %43, %44
%46 = load double, double* %6
%47 = fadd double %46, 0x3EB0C6F7A0B5ED8D
%48 = fcmp ogt double %45, %47
%49 = zext i1 %48 to i32
%50 = call i32 @__CPROVER_assume(i32 %49)
%51 = load double, double* %6
%52 = load double, double* %5
%53 = fadd double %51, %52
%54 = load double, double* %4
%55 = fadd double %54, 0x3EB0C6F7A0B5ED8D
%56 = fcmp ogt double %53, %55
%57 = zext i1 %56 to i32
%58 = call i32 @__CPROVER_assume(i32 %57)
%59 = load double, double* %4
%60 = load double, double* %5
%61 = fcmp olt double %59, %60
br i1 %61, label %62, label %66
62: ; preds = %31
%63 = load double, double* %6
%64 = load double, double* %5
%65 = fcmp olt double %63, %64
br label %66
66: ; preds = %62, %31
%67 = phi i1 [ false, %31 ], [ %65, %62 ]
%68 = zext i1 %67 to i32
%69 = call i32 @__CPROVER_assume(i32 %68)
%70 = load double, double* %4
%71 = load double, double* %6
%72 = fcmp olt double %70, %71
br i1 %72, label %73, label %99
73: ; preds = %66
%74 = load double, double* %5
%75 = load double, double* %6
%76 = load double, double* %4
%77 = fadd double %75, %76
%78 = fadd double %74, %77
%79 = load double, double* %4
%80 = load double, double* %5
%81 = load double, double* %6
%82 = fsub double %80, %81
%83 = fsub double %79, %82
%84 = fmul double %78, %83
%85 = load double, double* %4
%86 = load double, double* %5
%87 = load double, double* %6
%88 = fsub double %86, %87
%89 = fadd double %85, %88
%90 = fmul double %84, %89
%91 = load double, double* %5
%92 = load double, double* %6
%93 = load double, double* %4
%94 = fsub double %92, %93
%95 = fadd double %91, %94
%96 = fmul double %90, %95
%97 = call double @sqrt(double %96)
%98 = fdiv double %97, 4.000000e+00
store double %98, double* %7
br label %125
99: ; preds = %66
%100 = load double, double* %5
%101 = load double, double* %4
%102 = load double, double* %6
%103 = fadd double %101, %102
%104 = fadd double %100, %103
%105 = load double, double* %6
%106 = load double, double* %5
%107 = load double, double* %4
%108 = fsub double %106, %107
%109 = fsub double %105, %108
%110 = fmul double %104, %109
%111 = load double, double* %6
%112 = load double, double* %5
%113 = load double, double* %4
%114 = fsub double %112, %113
%115 = fadd double %111, %114
%116 = fmul double %110, %115
%117 = load double, double* %5
%118 = load double, double* %4
%119 = load double, double* %6
%120 = fsub double %118, %119
%121 = fadd double %117, %120
%122 = fmul double %116, %121
%123 = call double @sqrt(double %122)
%124 = fdiv double %123, 4.000000e+00
store double %124, double* %7
br label %125
125: ; preds = %99, %73
%126 = load double, double* %7
%127 = fcmp oge double %126, 0.000000e+00
%128 = zext i1 %127 to i32
%129 = call i32 @__CPROVER_assert(i32 %128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%130 = load double, double* %7
ret double %130
}

LLVM IR (-O2):
@.str = [14 x i8] c"postcondition\00"
define double @trianglesorted(double %0, double %1, double %2) {
%4 = fcmp oge double %0, 1.000000e+00
%5 = fcmp ole double %0, 9.000000e+00
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @__CPROVER_assume(i32 %7)
%9 = fcmp oge double %2, 1.000000e+00
%10 = fcmp ole double %2, 9.000000e+00
%11 = and i1 %9, %10
%12 = zext i1 %11 to i32
%13 = tail call i32 @__CPROVER_assume(i32 %12)
%14 = fcmp oge double %1, 1.000000e+00
%15 = fcmp ole double %1, 9.000000e+00
%16 = and i1 %14, %15
%17 = zext i1 %16 to i32
%18 = tail call i32 @__CPROVER_assume(i32 %17)
%19 = fadd double %0, %2
%20 = fadd double %1, 0x3EB0C6F7A0B5ED8D
%21 = fcmp ogt double %19, %20
%22 = zext i1 %21 to i32
%23 = tail call i32 @__CPROVER_assume(i32 %22)
%24 = fadd double %0, %1
%25 = fadd double %2, 0x3EB0C6F7A0B5ED8D
%26 = fcmp ogt double %24, %25
%27 = zext i1 %26 to i32
%28 = tail call i32 @__CPROVER_assume(i32 %27)
%29 = fadd double %1, %2
%30 = fadd double %0, 0x3EB0C6F7A0B5ED8D
%31 = fcmp ogt double %29, %30
%32 = zext i1 %31 to i32
%33 = tail call i32 @__CPROVER_assume(i32 %32)
%34 = fcmp olt double %0, %1
%35 = fcmp olt double %2, %1
%36 = and i1 %34, %35
%37 = zext i1 %36 to i32
%38 = tail call i32 @__CPROVER_assume(i32 %37)
%39 = fcmp olt double %0, %2
%40 = fadd double %19, %1
br i1 %39, label %41, label %48
41: ; preds = %3
%42 = fsub double %1, %2
%43 = fsub double %0, %42
%44 = fmul double %40, %43
%45 = fadd double %42, %0
%46 = fmul double %45, %44
%47 = fsub double %2, %0
br label %55
48: ; preds = %3
%49 = fsub double %1, %0
%50 = fsub double %2, %49
%51 = fmul double %50, %40
%52 = fadd double %49, %2
%53 = fmul double %52, %51
%54 = fsub double %0, %2
br label %55
55: ; preds = %48, %41
%56 = phi double [ %54, %48 ], [ %47, %41 ]
%57 = phi double [ %53, %48 ], [ %46, %41 ]
%58 = fadd double %56, %1
%59 = fmul double %58, %57
%60 = tail call double @sqrt(double %59)
%61 = fmul double %60, 2.500000e-01
%62 = fcmp oge double %61, 0.000000e+00
%63 = zext i1 %62 to i32
%64 = tail call i32 @__CPROVER_assert(i32 %63, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret double %61
}