; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnflow/polygon/polygon.ll (ZNK8Triangle15snapOffPrsImbNREv)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.ElemModel = type { ptr, double, double, ptr, ptr, double, ptr, i8, i8, i8, i8, i32, double, double, double, double, double, double, double, %"struct.std::pair", %"struct.std::pair" }
%"struct.std::pair" = type { double, double }
%class.VoidElem = type { %class.ElemModel, double, double, double, double }
%class.Polygon = type { %class.VoidElem, i32, %"class.std::vector.16", ptr, ptr, i16, i8, double }
%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.CornerApex = type { %class.Apex, ptr, double, double, double, ptr }
%class.Apex = type { ptr, i8, double, double, ptr, i32, double, double, double, double, i8, i8, i8, i8, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, double }

@_ZN9ElemModel12MAX_NEWT_ITRE = external constant i32, align 4
@_ZN9ElemModel7EPSILONE = external constant double, align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.25 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK10CornerApex13trappedCornerEv(ptr noundef nonnull align 8 dereferenceable(144)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: nounwind
declare double @cos(double noundef) #6

; Function Attrs: nounwind
declare double @tan(double noundef) #6

; Function Attrs: nounwind
declare double @sin(double noundef) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10CommonData14GuessCappPressEv(ptr noundef nonnull align 8 dereferenceable(1972)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4Apex17gravityCorrectionEv(ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK7GNMData7sigmaOWEv(ptr noundef nonnull align 8 dereferenceable(984)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4Elem11trappingOilEv(ptr noundef nonnull align 8 dereferenceable(408)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK8Triangle15snapOffPrsImbNREv(ptr noundef nonnull align 8 dereferenceable(248) %0) unnamed_addr #3 align 2 {
  %2 = alloca double, align 8
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %18 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 4
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = call noundef double @_ZNK7GNMData7sigmaOWEv(ptr noundef nonnull align 8 dereferenceable(984) %19)
  store double %20, ptr %4, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %21 = load double, ptr %4, align 8, !tbaa !15
  %22 = getelementptr inbounds %class.VoidElem, ptr %17, i32 0, i32 3
  %23 = load double, ptr %22, align 8, !tbaa !16
  %24 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef 0) #8
  %26 = load double, ptr %25, align 8, !tbaa !15
  %27 = fadd double %23, %26
  %28 = call double @cos(double noundef %27) #8
  %29 = fmul double %21, %28
  %30 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 5
  %31 = load double, ptr %30, align 8, !tbaa !18
  %32 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef 0) #8
  %34 = load double, ptr %33, align 8, !tbaa !15
  %35 = call double @tan(double noundef %34) #8
  %36 = fdiv double %31, %35
  %37 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 5
  %38 = load double, ptr %37, align 8, !tbaa !18
  %39 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef 2) #8
  %41 = load double, ptr %40, align 8, !tbaa !15
  %42 = call double @tan(double noundef %41) #8
  %43 = fdiv double %38, %42
  %44 = fadd double %36, %43
  %45 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !19
  %47 = getelementptr inbounds %class.CornerApex, ptr %46, i64 2
  %48 = call noundef double @_ZNK10CornerApex14pinnedApexDistEv(ptr noundef nonnull align 8 dereferenceable(144) %47)
  %49 = fsub double %44, %48
  %50 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef 0) #8
  %52 = load double, ptr %51, align 8, !tbaa !15
  %53 = call double @sin(double noundef %52) #8
  %54 = fmul double %49, %53
  %55 = fdiv double %29, %54
  store double %55, ptr %5, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store double 1.000000e+00, ptr %7, align 8, !tbaa !15
  %56 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = getelementptr inbounds %class.CornerApex, ptr %57, i64 0
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK10CornerApex13trappedCornerEv(ptr noundef nonnull align 8 dereferenceable(144) %58)
  %60 = getelementptr inbounds %"struct.std::pair.0", ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !26
  %62 = icmp sgt i32 %61, -1
  br i1 %62, label %63, label %70

63:                                               ; preds = %1
  %64 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 3
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  %66 = getelementptr inbounds %class.CornerApex, ptr %65, i64 0
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK10CornerApex13trappedCornerEv(ptr noundef nonnull align 8 dereferenceable(144) %66)
  %68 = getelementptr inbounds %"struct.std::pair.0", ptr %67, i32 0, i32 1
  %69 = load double, ptr %68, align 8, !tbaa !28
  store double %69, ptr %6, align 8, !tbaa !15
  br label %91

70:                                               ; preds = %1
  %71 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 4
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  %73 = call noundef zeroext i1 @_ZNK7GNMData10isDrainageEv(ptr noundef nonnull align 8 dereferenceable(984) %72)
  br i1 %73, label %74, label %82

74:                                               ; preds = %70
  %75 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 4
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  %77 = call noundef double @_ZNK10CommonData14GuessCappPressEv(ptr noundef nonnull align 8 dereferenceable(1972) %76)
  %78 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !29
  %80 = call noundef double @_ZNK4Apex17gravityCorrectionEv(ptr noundef nonnull align 8 dereferenceable(104) %79)
  %81 = fsub double %77, %80
  store double %81, ptr %6, align 8, !tbaa !15
  br label %90

82:                                               ; preds = %70
  %83 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = call noundef double @_ZNK10CommonData19maxPcLastDrainCycleEv(ptr noundef nonnull align 8 dereferenceable(1972) %84)
  %86 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 3
  %87 = load ptr, ptr %86, align 8, !tbaa !29
  %88 = call noundef double @_ZNK4Apex17gravityCorrectionEv(ptr noundef nonnull align 8 dereferenceable(104) %87)
  %89 = fsub double %85, %88
  store double %89, ptr %6, align 8, !tbaa !15
  br label %90

90:                                               ; preds = %82, %74
  br label %91

91:                                               ; preds = %90, %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %92 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 5
  %93 = load double, ptr %92, align 8, !tbaa !18
  %94 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %94, i64 noundef 0) #8
  %96 = load double, ptr %95, align 8, !tbaa !15
  %97 = call double @tan(double noundef %96) #8
  %98 = fdiv double %93, %97
  %99 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 5
  %100 = load double, ptr %99, align 8, !tbaa !18
  %101 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef 1) #8
  %103 = load double, ptr %102, align 8, !tbaa !15
  %104 = call double @tan(double noundef %103) #8
  %105 = fdiv double %100, %104
  %106 = fadd double %98, %105
  store double %106, ptr %8, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !30
  br label %107

107:                                              ; preds = %240, %91
  %108 = load i32, ptr %9, align 4, !tbaa !30
  %109 = load i32, ptr @_ZN9ElemModel12MAX_NEWT_ITRE, align 4, !tbaa !30
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 2, ptr %10, align 4
  br label %243

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store double 0.000000e+00, ptr %11, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %113 = getelementptr inbounds %class.VoidElem, ptr %17, i32 0, i32 3
  %114 = load double, ptr %113, align 8, !tbaa !16
  store double %114, ptr %12, align 8, !tbaa !15
  %115 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 3
  %116 = load ptr, ptr %115, align 8, !tbaa !19
  %117 = getelementptr inbounds %class.CornerApex, ptr %116, i64 1
  %118 = load double, ptr %6, align 8, !tbaa !15
  %119 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %119, i64 noundef 1) #8
  %121 = load double, ptr %120, align 8, !tbaa !15
  %122 = load double, ptr %4, align 8, !tbaa !15
  call void @_ZNK10CornerApex18getCApexDistConAngERdS0_dddbbb(ptr noundef nonnull align 8 dereferenceable(144) %117, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, double noundef %118, double noundef %121, double noundef %122, i1 noundef zeroext true, i1 noundef zeroext true, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %123 = load double, ptr %11, align 8, !tbaa !15
  %124 = fneg double %123
  %125 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %125, i64 noundef 1) #8
  %127 = load double, ptr %126, align 8, !tbaa !15
  %128 = call double @sin(double noundef %127) #8
  %129 = fmul double %124, %128
  %130 = load double, ptr %4, align 8, !tbaa !15
  %131 = load double, ptr %12, align 8, !tbaa !15
  %132 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %132, i64 noundef 1) #8
  %134 = load double, ptr %133, align 8, !tbaa !15
  %135 = fadd double %131, %134
  %136 = call double @sin(double noundef %135) #8
  %137 = fmul double %130, %136
  %138 = fdiv double %129, %137
  store double %138, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %139 = load double, ptr %6, align 8, !tbaa !15
  %140 = load double, ptr %4, align 8, !tbaa !15
  %141 = getelementptr inbounds %class.VoidElem, ptr %17, i32 0, i32 3
  %142 = load double, ptr %141, align 8, !tbaa !16
  %143 = call double @cos(double noundef %142) #8
  %144 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %144, i64 noundef 0) #8
  %146 = load double, ptr %145, align 8, !tbaa !15
  %147 = call double @tan(double noundef %146) #8
  %148 = fdiv double %143, %147
  %149 = getelementptr inbounds %class.VoidElem, ptr %17, i32 0, i32 3
  %150 = load double, ptr %149, align 8, !tbaa !16
  %151 = call double @sin(double noundef %150) #8
  %152 = fsub double %148, %151
  %153 = load double, ptr %12, align 8, !tbaa !15
  %154 = call double @cos(double noundef %153) #8
  %155 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %155, i64 noundef 1) #8
  %157 = load double, ptr %156, align 8, !tbaa !15
  %158 = call double @tan(double noundef %157) #8
  %159 = fdiv double %154, %158
  %160 = fadd double %152, %159
  %161 = load double, ptr %12, align 8, !tbaa !15
  %162 = call double @sin(double noundef %161) #8
  %163 = fsub double %160, %162
  %164 = fmul double %140, %163
  %165 = load double, ptr %8, align 8, !tbaa !15
  %166 = fdiv double %164, %165
  %167 = fsub double %139, %166
  store double %167, ptr %14, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %168 = load double, ptr %4, align 8, !tbaa !15
  %169 = load double, ptr %13, align 8, !tbaa !15
  %170 = load double, ptr %12, align 8, !tbaa !15
  %171 = call double @sin(double noundef %170) #8
  %172 = fmul double %169, %171
  %173 = getelementptr inbounds %class.Polygon, ptr %17, i32 0, i32 2
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %173, i64 noundef 1) #8
  %175 = load double, ptr %174, align 8, !tbaa !15
  %176 = call double @tan(double noundef %175) #8
  %177 = fdiv double %172, %176
  %178 = load double, ptr %13, align 8, !tbaa !15
  %179 = load double, ptr %12, align 8, !tbaa !15
  %180 = call double @cos(double noundef %179) #8
  %181 = call double @llvm.fmuladd.f64(double %178, double %180, double %177)
  %182 = fmul double %168, %181
  %183 = load double, ptr %8, align 8, !tbaa !15
  %184 = fdiv double %182, %183
  %185 = fadd double 1.000000e+00, %184
  store double %185, ptr %15, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %186 = load double, ptr %15, align 8, !tbaa !15
  %187 = call noundef double @_ZSt3absd(double noundef %186)
  %188 = fcmp ogt double %187, 1.000000e-32
  br i1 %188, label %189, label %195

189:                                              ; preds = %112
  %190 = load double, ptr %6, align 8, !tbaa !15
  %191 = load double, ptr %14, align 8, !tbaa !15
  %192 = load double, ptr %15, align 8, !tbaa !15
  %193 = fdiv double %191, %192
  %194 = fsub double %190, %193
  br label %199

195:                                              ; preds = %112
  %196 = load double, ptr %6, align 8, !tbaa !15
  %197 = load double, ptr %14, align 8, !tbaa !15
  %198 = fsub double %196, %197
  br label %199

199:                                              ; preds = %195, %189
  %200 = phi double [ %194, %189 ], [ %198, %195 ]
  store double %200, ptr %16, align 8, !tbaa !15
  %201 = load i32, ptr %9, align 4, !tbaa !30
  %202 = load i32, ptr @_ZN9ElemModel12MAX_NEWT_ITRE, align 4, !tbaa !30
  %203 = sdiv i32 %202, 2
  %204 = icmp sgt i32 %201, %203
  br i1 %204, label %205, label %210

205:                                              ; preds = %199
  %206 = load double, ptr %16, align 8, !tbaa !15
  %207 = load double, ptr %6, align 8, !tbaa !15
  %208 = fadd double %206, %207
  %209 = fmul double 5.000000e-01, %208
  store double %209, ptr %16, align 8, !tbaa !15
  br label %210

210:                                              ; preds = %205, %199
  %211 = load double, ptr %16, align 8, !tbaa !15
  %212 = load double, ptr %6, align 8, !tbaa !15
  %213 = fsub double %211, %212
  %214 = call double @llvm.fabs.f64(double %213)
  %215 = load double, ptr %6, align 8, !tbaa !15
  %216 = call noundef double @_ZSt3absd(double noundef %215)
  %217 = fadd double %216, 1.000000e-08
  %218 = fdiv double %214, %217
  store double %218, ptr %7, align 8, !tbaa !15
  %219 = load double, ptr %7, align 8, !tbaa !15
  %220 = load double, ptr @_ZN9ElemModel7EPSILONE, align 8, !tbaa !15
  %221 = fcmp olt double %219, %220
  br i1 %221, label %222, label %235

222:                                              ; preds = %210
  %223 = load double, ptr %12, align 8, !tbaa !15
  %224 = getelementptr inbounds %class.VoidElem, ptr %17, i32 0, i32 3
  %225 = load double, ptr %224, align 8, !tbaa !16
  %226 = fadd double %225, 0x3EB0C6F7A0B5ED8D
  %227 = fcmp ole double %223, %226
  br i1 %227, label %228, label %232

228:                                              ; preds = %222
  %229 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %230 = load double, ptr %229, align 8, !tbaa !15
  %231 = fadd double %230, 1.000000e-04
  store double %231, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %237

232:                                              ; preds = %222
  %233 = load double, ptr %5, align 8, !tbaa !15
  %234 = fadd double %233, 1.000000e-04
  store double %234, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %237

235:                                              ; preds = %210
  %236 = load double, ptr %16, align 8, !tbaa !15
  store double %236, ptr %6, align 8, !tbaa !15
  store i32 0, ptr %10, align 4
  br label %237

237:                                              ; preds = %235, %232, %228
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  %238 = load i32, ptr %10, align 4
  switch i32 %238, label %243 [
    i32 0, label %239
  ]

239:                                              ; preds = %237
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %9, align 4, !tbaa !30
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %9, align 4, !tbaa !30
  br label %107, !llvm.loop !31

243:                                              ; preds = %237, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  %244 = load i32, ptr %10, align 4
  switch i32 %244, label %274 [
    i32 2, label %245
  ]

245:                                              ; preds = %243
  %246 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.25)
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %246, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %248 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %247, ptr noundef @.str.26)
  %249 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %248, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %250 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %249, ptr noundef @.str.27)
  %251 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %250, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %252 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %251, ptr noundef @.str.28)
  %253 = getelementptr inbounds %class.VoidElem, ptr %17, i32 0, i32 3
  %254 = load double, ptr %253, align 8, !tbaa !16
  %255 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %252, double noundef %254)
  %256 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %255, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %256, ptr noundef @.str.29)
  %258 = getelementptr inbounds %class.ElemModel, ptr %17, i32 0, i32 3
  %259 = load ptr, ptr %258, align 8, !tbaa !29
  %260 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4Elem11trappingOilEv(ptr noundef nonnull align 8 dereferenceable(408) %259)
  %261 = getelementptr inbounds %"struct.std::pair.0", ptr %260, i32 0, i32 0
  %262 = load i32, ptr %261, align 8, !tbaa !26
  %263 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %257, i32 noundef %262)
  %264 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %263, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %265 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %264, ptr noundef @.str.30)
  %266 = load double, ptr %7, align 8, !tbaa !15
  %267 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %265, double noundef %266)
  %268 = load double, ptr %6, align 8, !tbaa !15
  %269 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %267, double noundef %268)
  %270 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %269, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %271 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %270, ptr noundef @.str.31)
  %272 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %271, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %273 = load double, ptr %6, align 8, !tbaa !15
  store double %273, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %274

274:                                              ; preds = %245, %243
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  %275 = load double, ptr %2, align 8
  ret double %275
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10CornerApex14pinnedApexDistEv(ptr noundef nonnull align 8 dereferenceable(144)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7GNMData10isDrainageEv(ptr noundef nonnull align 8 dereferenceable(984)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10CommonData19maxPcLastDrainCycleEv(ptr noundef nonnull align 8 dereferenceable(1972)) #1 align 2

declare void @_ZNK10CornerApex18getCApexDistConAngERdS0_dddbbb(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), double noundef, double noundef, double noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"_ZTS9ElemModel", !11, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !12, i64 56, !12, i64 57, !12, i64 58, !12, i64 59, !13, i64 60, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !14, i64 120, !14, i64 136}
!11 = !{!"double", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt4pairIddE", !11, i64 0, !11, i64 8}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !11, i64 168}
!17 = !{!"_ZTS8VoidElem", !10, i64 0, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176}
!18 = !{!10, !11, i64 40}
!19 = !{!20, !6, i64 216}
!20 = !{!"_ZTS7Polygon", !17, i64 0, !13, i64 184, !21, i64 192, !6, i64 216, !6, i64 224, !25, i64 232, !7, i64 234, !11, i64 240}
!21 = !{!"_ZTSSt6vectorIdSaIdEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"short", !7, i64 0}
!26 = !{!27, !13, i64 0}
!27 = !{!"_ZTSSt4pairIidE", !13, i64 0, !11, i64 8}
!28 = !{!27, !11, i64 8}
!29 = !{!10, !6, i64 24}
!30 = !{!13, !13, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZN9ElemModel12MAX_NEWT_ITRE = external local_unnamed_addr constant i32, align 4
@_ZN9ElemModel7EPSILONE = external local_unnamed_addr constant double, align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.25 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK10CornerApex13trappedCornerEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @tan(double noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10CommonData14GuessCappPressEv(ptr noundef nonnull align 8 dereferenceable(1972)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4Apex17gravityCorrectionEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK7GNMData7sigmaOWEv(ptr noundef nonnull align 8 dereferenceable(984)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4Elem11trappingOilEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK8Triangle15snapOffPrsImbNREv(ptr noundef nonnull align 8 dereferenceable(248) %0) unnamed_addr #3 align 2 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = tail call noundef double @_ZNK7GNMData7sigmaOWEv(ptr noundef nonnull align 8 dereferenceable(984) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %9 = getelementptr inbounds i8, ptr %0, i64 168
  %10 = load double, ptr %9, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %0, i64 192
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 0) #8
  %13 = load double, ptr %12, align 8, !tbaa !16
  %14 = fadd double %10, %13
  %15 = tail call double @cos(double noundef %14) #8
  %16 = fmul double %8, %15
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = load double, ptr %17, align 8, !tbaa !17
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 0) #8
  %20 = load double, ptr %19, align 8, !tbaa !16
  %21 = tail call double @tan(double noundef %20) #8
  %22 = fdiv double %18, %21
  %23 = load double, ptr %17, align 8, !tbaa !17
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 2) #8
  %25 = load double, ptr %24, align 8, !tbaa !16
  %26 = tail call double @tan(double noundef %25) #8
  %27 = fdiv double %23, %26
  %28 = fadd double %22, %27
  %29 = getelementptr inbounds i8, ptr %0, i64 216
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %30, i64 288
  %32 = tail call noundef double @_ZNK10CornerApex14pinnedApexDistEv(ptr noundef nonnull align 8 dereferenceable(144) %31)
  %33 = fsub double %28, %32
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 0) #8
  %35 = load double, ptr %34, align 8, !tbaa !16
  %36 = tail call double @sin(double noundef %35) #8
  %37 = fmul double %33, %36
  %38 = fdiv double %16, %37
  store double %38, ptr %2, align 8, !tbaa !16
  %39 = load ptr, ptr %29, align 8, !tbaa !18
  %40 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK10CornerApex13trappedCornerEv(ptr noundef nonnull align 8 dereferenceable(144) %39)
  %41 = load i32, ptr %40, align 8, !tbaa !25
  %42 = icmp sgt i32 %41, -1
  br i1 %42, label %43, label %48

43:                                               ; preds = %1
  %44 = load ptr, ptr %29, align 8, !tbaa !18
  %45 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK10CornerApex13trappedCornerEv(ptr noundef nonnull align 8 dereferenceable(144) %44)
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = load double, ptr %46, align 8, !tbaa !27
  br label %63

48:                                               ; preds = %1
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = tail call noundef zeroext i1 @_ZNK7GNMData10isDrainageEv(ptr noundef nonnull align 8 dereferenceable(984) %49)
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %0, i64 24
  br i1 %50, label %53, label %58

53:                                               ; preds = %48
  %54 = tail call noundef double @_ZNK10CommonData14GuessCappPressEv(ptr noundef nonnull align 8 dereferenceable(1972) %51)
  %55 = load ptr, ptr %52, align 8, !tbaa !28
  %56 = tail call noundef double @_ZNK4Apex17gravityCorrectionEv(ptr noundef nonnull align 8 dereferenceable(104) %55)
  %57 = fsub double %54, %56
  br label %63

58:                                               ; preds = %48
  %59 = tail call noundef double @_ZNK10CommonData19maxPcLastDrainCycleEv(ptr noundef nonnull align 8 dereferenceable(1972) %51)
  %60 = load ptr, ptr %52, align 8, !tbaa !28
  %61 = tail call noundef double @_ZNK4Apex17gravityCorrectionEv(ptr noundef nonnull align 8 dereferenceable(104) %60)
  %62 = fsub double %59, %61
  br label %63

63:                                               ; preds = %53, %58, %43
  %.031 = phi double [ %47, %43 ], [ %57, %53 ], [ %62, %58 ]
  %64 = load double, ptr %17, align 8, !tbaa !17
  %65 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 0) #8
  %66 = load double, ptr %65, align 8, !tbaa !16
  %67 = tail call double @tan(double noundef %66) #8
  %68 = load double, ptr %17, align 8, !tbaa !17
  %69 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 1) #8
  %70 = load double, ptr %69, align 8, !tbaa !16
  %71 = tail call double @tan(double noundef %70) #8
  %72 = load i32, ptr @_ZN9ElemModel12MAX_NEWT_ITRE, align 4, !tbaa !29
  %.not48 = icmp sgt i32 %72, 0
  br i1 %.not48, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %63
  %73 = fdiv double %64, %67
  %74 = fdiv double %68, %71
  %75 = fadd double %73, %74
  %76 = lshr i32 %72, 1
  %77 = load double, ptr @_ZN9ElemModel7EPSILONE, align 8
  %78 = insertelement <2 x double> poison, double %8, i64 0
  %79 = shufflevector <2 x double> %78, <2 x double> poison, <2 x i32> zeroinitializer
  %80 = insertelement <2 x double> poison, double %75, i64 0
  %81 = shufflevector <2 x double> %80, <2 x double> poison, <2 x i32> zeroinitializer
  br label %82

82:                                               ; preds = %.lr.ph, %163
  %.13250 = phi double [ %.031, %.lr.ph ], [ %storemerge, %163 ]
  %.03949 = phi i32 [ 0, %.lr.ph ], [ %164, %163 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store double 0.000000e+00, ptr %3, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %83 = load double, ptr %9, align 8, !tbaa !14
  store double %83, ptr %4, align 8, !tbaa !16
  %84 = load ptr, ptr %29, align 8, !tbaa !18
  %85 = getelementptr inbounds i8, ptr %84, i64 144
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 1) #8
  %87 = load double, ptr %86, align 8, !tbaa !16
  call void @_ZNK10CornerApex18getCApexDistConAngERdS0_dddbbb(ptr noundef nonnull align 8 dereferenceable(144) %85, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4, double noundef %.13250, double noundef %87, double noundef %8, i1 noundef zeroext true, i1 noundef zeroext true, i1 noundef zeroext false)
  %88 = load double, ptr %3, align 8, !tbaa !16
  %89 = fneg double %88
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 1) #8
  %91 = load double, ptr %90, align 8, !tbaa !16
  %92 = call double @sin(double noundef %91) #8
  %93 = fmul double %92, %89
  %94 = load double, ptr %4, align 8, !tbaa !16
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 1) #8
  %96 = load double, ptr %95, align 8, !tbaa !16
  %97 = fadd double %94, %96
  %98 = call double @sin(double noundef %97) #8
  %99 = fmul double %8, %98
  %100 = fdiv double %93, %99
  %101 = load double, ptr %9, align 8, !tbaa !14
  %102 = call double @cos(double noundef %101) #8
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 0) #8
  %104 = load double, ptr %103, align 8, !tbaa !16
  %105 = call double @tan(double noundef %104) #8
  %106 = load double, ptr %9, align 8, !tbaa !14
  %107 = call double @sin(double noundef %106) #8
  %108 = load double, ptr %4, align 8, !tbaa !16
  %109 = call double @cos(double noundef %108) #8
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 1) #8
  %111 = load double, ptr %110, align 8, !tbaa !16
  %112 = call double @tan(double noundef %111) #8
  %113 = insertelement <2 x double> poison, double %102, i64 0
  %114 = insertelement <2 x double> %113, double %109, i64 1
  %115 = insertelement <2 x double> poison, double %105, i64 0
  %116 = insertelement <2 x double> %115, double %112, i64 1
  %117 = fdiv <2 x double> %114, %116
  %118 = extractelement <2 x double> %117, i64 0
  %119 = fsub double %118, %107
  %120 = extractelement <2 x double> %117, i64 1
  %121 = fadd double %119, %120
  %122 = load double, ptr %4, align 8, !tbaa !16
  %123 = call double @sin(double noundef %122) #8
  %124 = fsub double %121, %123
  %125 = load double, ptr %4, align 8, !tbaa !16
  %126 = call double @sin(double noundef %125) #8
  %127 = fmul double %100, %126
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 1) #8
  %129 = load double, ptr %128, align 8, !tbaa !16
  %130 = call double @tan(double noundef %129) #8
  %131 = fdiv double %127, %130
  %132 = load double, ptr %4, align 8, !tbaa !16
  %133 = call double @cos(double noundef %132) #8
  %134 = call double @llvm.fmuladd.f64(double %100, double %133, double %131)
  %135 = insertelement <2 x double> poison, double %124, i64 0
  %136 = insertelement <2 x double> %135, double %134, i64 1
  %137 = fmul <2 x double> %79, %136
  %138 = fdiv <2 x double> %137, %81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %139 = extractelement <2 x double> %138, i64 1
  %140 = fadd double %139, 1.000000e+00
  %141 = call noundef double @_ZSt3absd(double noundef %140)
  %142 = fcmp ogt double %141, 1.000000e-32
  %143 = extractelement <2 x double> %138, i64 0
  %144 = fsub double %.13250, %143
  %145 = fdiv double %144, %140
  %.pn = select i1 %142, double %145, double %144
  %146 = fsub double %.13250, %.pn
  %147 = icmp ugt i32 %.03949, %76
  %148 = fadd double %.13250, %146
  %149 = fmul double %148, 5.000000e-01
  %storemerge = select i1 %147, double %149, double %146
  store double %storemerge, ptr %5, align 8, !tbaa !16
  %150 = fsub double %storemerge, %.13250
  %151 = call double @llvm.fabs.f64(double %150)
  %152 = call noundef double @_ZSt3absd(double noundef %.13250)
  %153 = fadd double %152, 1.000000e-08
  %154 = fdiv double %151, %153
  %155 = fcmp uge double %154, %77
  br i1 %155, label %163, label %156

156:                                              ; preds = %82
  %157 = load double, ptr %4, align 8, !tbaa !16
  %158 = load double, ptr %9, align 8, !tbaa !14
  %159 = fadd double %158, 0x3EB0C6F7A0B5ED8D
  %160 = fcmp ugt double %157, %159
  br i1 %160, label %.thread42, label %161

161:                                              ; preds = %156
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %.1.ph.in.pre = load double, ptr %162, align 8, !tbaa !16
  br label %.thread42

.thread42:                                        ; preds = %156, %161
  %.1.ph.in = phi double [ %.1.ph.in.pre, %161 ], [ %38, %156 ]
  %.1.ph = fadd double %.1.ph.in, 1.000000e-04
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %188

163:                                              ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %164 = add nuw nsw i32 %.03949, 1
  %exitcond.not = icmp eq i32 %164, %72
  br i1 %exitcond.not, label %._crit_edge, label %82, !llvm.loop !30

._crit_edge:                                      ; preds = %163, %63
  %.035.lcssa = phi double [ 1.000000e+00, %63 ], [ %154, %163 ]
  %.132.lcssa = phi double [ %.031, %63 ], [ %storemerge, %163 ]
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.25)
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %165, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %166, ptr noundef nonnull @.str.26)
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %167, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %168, ptr noundef nonnull @.str.27)
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %169, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %170, ptr noundef nonnull @.str.28)
  %172 = load double, ptr %9, align 8, !tbaa !14
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %171, double noundef %172)
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %173, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %174, ptr noundef nonnull @.str.29)
  %176 = getelementptr inbounds i8, ptr %0, i64 24
  %177 = load ptr, ptr %176, align 8, !tbaa !28
  %178 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4Elem11trappingOilEv(ptr noundef nonnull align 8 dereferenceable(408) %177)
  %179 = load i32, ptr %178, align 8, !tbaa !25
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %175, i32 noundef %179)
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %180, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %181, ptr noundef nonnull @.str.30)
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %182, double noundef %.035.lcssa)
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %183, double noundef %.132.lcssa)
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %184, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %185, ptr noundef nonnull @.str.31)
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %186, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %188

188:                                              ; preds = %.thread42, %._crit_edge
  %.3 = phi double [ %.132.lcssa, %._crit_edge ], [ %.1.ph, %.thread42 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  ret double %.3
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10CornerApex14pinnedApexDistEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7GNMData10isDrainageEv(ptr noundef nonnull align 8 dereferenceable(984)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10CommonData19maxPcLastDrainCycleEv(ptr noundef nonnull align 8 dereferenceable(1972)) local_unnamed_addr #1 align 2

declare void @_ZNK10CornerApex18getCApexDistConAngERdS0_dddbbb(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), double noundef, double noundef, double noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 32}
!6 = !{!"_ZTS9ElemModel", !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !11, i64 56, !11, i64 57, !11, i64 58, !11, i64 59, !12, i64 60, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !13, i64 120, !13, i64 136}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSSt4pairIddE", !7, i64 0, !7, i64 8}
!14 = !{!15, !7, i64 168}
!15 = !{!"_ZTS8VoidElem", !6, i64 0, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !7, i64 40}
!18 = !{!19, !10, i64 216}
!19 = !{!"_ZTS7Polygon", !15, i64 0, !12, i64 184, !20, i64 192, !10, i64 216, !10, i64 224, !24, i64 232, !8, i64 234, !7, i64 240}
!20 = !{!"_ZTSSt6vectorIdSaIdEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!24 = !{!"short", !8, i64 0}
!25 = !{!26, !12, i64 0}
!26 = !{!"_ZTSSt4pairIidE", !12, i64 0, !7, i64 8}
!27 = !{!26, !7, i64 8}
!28 = !{!6, !10, i64 24}
!29 = !{!12, !12, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass