; LLVM IR from erayzesen/QuarkPhysics :: QuarkPhysics/polypartition (polypartition)

; 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.TPPLPoly = type <{ ptr, i64, i8, [7 x i8] }>
%struct.TPPLPoint = type { double, double, i32 }

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(17)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN13TPPLPartition8IsConvexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8TPPLPoly5ValidEv(ptr noundef nonnull align 8 dereferenceable(17)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN13TPPLPartition19TriangulateMonotoneEP8TPPLPolyPNSt7__cxx114listIS0_SaIS0_EEE(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef %1, ptr noundef %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca %class.TPPLPoly, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call noundef zeroext i1 @_ZNK8TPPLPoly5ValidEv(ptr noundef nonnull align 8 dereferenceable(17) %27)
  br i1 %28, label %30, label %29

29:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  br label %584

30:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #7
  call void @_ZN8TPPLPolyC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %18)
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = invoke noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %31)
          to label %33 unwind label %43

33:                                               ; preds = %30
  store i64 %32, ptr %17, align 8, !tbaa !9
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = invoke noundef ptr @_ZN8TPPLPoly9GetPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %34)
          to label %36 unwind label %43

36:                                               ; preds = %33
  store ptr %35, ptr %16, align 8, !tbaa !5
  %37 = load i64, ptr %17, align 8, !tbaa !9
  %38 = icmp eq i64 %37, 3
  br i1 %38, label %39, label %47

39:                                               ; preds = %36
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(17) %41)
          to label %42 unwind label %43

42:                                               ; preds = %39
  store i32 1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %582

43:                                               ; preds = %39, %33, %30
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %19, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %20, align 4
  br label %583

47:                                               ; preds = %36
  store i64 0, ptr %11, align 8, !tbaa !9
  store i64 0, ptr %12, align 8, !tbaa !9
  store i64 1, ptr %8, align 8, !tbaa !9
  br label %48

48:                                               ; preds = %73, %47
  %49 = load i64, ptr %8, align 8, !tbaa !9
  %50 = load i64, ptr %17, align 8, !tbaa !9
  %51 = icmp slt i64 %49, %50
  br i1 %51, label %52, label %76

52:                                               ; preds = %48
  %53 = load ptr, ptr %16, align 8, !tbaa !5
  %54 = load i64, ptr %8, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.TPPLPoint, ptr %53, i64 %54
  %56 = load ptr, ptr %16, align 8, !tbaa !5
  %57 = load i64, ptr %12, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.TPPLPoint, ptr %56, i64 %57
  %59 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 8 dereferenceable(24) %58)
  br i1 %59, label %60, label %62

60:                                               ; preds = %52
  %61 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %61, ptr %12, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %60, %52
  %63 = load ptr, ptr %16, align 8, !tbaa !5
  %64 = load i64, ptr %11, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.TPPLPoint, ptr %63, i64 %64
  %66 = load ptr, ptr %16, align 8, !tbaa !5
  %67 = load i64, ptr %8, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.TPPLPoint, ptr %66, i64 %67
  %69 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 8 dereferenceable(24) %65, ptr noundef nonnull align 8 dereferenceable(24) %68)
  br i1 %69, label %70, label %72

70:                                               ; preds = %62
  %71 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %71, ptr %11, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %70, %62
  br label %73

73:                                               ; preds = %72
  %74 = load i64, ptr %8, align 8, !tbaa !9
  %75 = add nsw i64 %74, 1
  store i64 %75, ptr %8, align 8, !tbaa !9
  br label %48, !llvm.loop !11

76:                                               ; preds = %48
  %77 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %77, ptr %8, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %98, %76
  %79 = load i64, ptr %8, align 8, !tbaa !9
  %80 = load i64, ptr %12, align 8, !tbaa !9
  %81 = icmp ne i64 %79, %80
  br i1 %81, label %82, label %100

82:                                               ; preds = %78
  %83 = load i64, ptr %8, align 8, !tbaa !9
  %84 = add nsw i64 %83, 1
  store i64 %84, ptr %9, align 8, !tbaa !9
  %85 = load i64, ptr %9, align 8, !tbaa !9
  %86 = load i64, ptr %17, align 8, !tbaa !9
  %87 = icmp sge i64 %85, %86
  br i1 %87, label %88, label %89

88:                                               ; preds = %82
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %89

89:                                               ; preds = %88, %82
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  %91 = load i64, ptr %9, align 8, !tbaa !9
  %92 = getelementptr inbounds %struct.TPPLPoint, ptr %90, i64 %91
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = load i64, ptr %8, align 8, !tbaa !9
  %95 = getelementptr inbounds %struct.TPPLPoint, ptr %93, i64 %94
  %96 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 8 dereferenceable(24) %95)
  br i1 %96, label %98, label %97

97:                                               ; preds = %89
  store i32 0, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %582

98:                                               ; preds = %89
  %99 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %99, ptr %8, align 8, !tbaa !9
  br label %78, !llvm.loop !13

100:                                              ; preds = %78
  %101 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %101, ptr %8, align 8, !tbaa !9
  br label %102

102:                                              ; preds = %122, %100
  %103 = load i64, ptr %8, align 8, !tbaa !9
  %104 = load i64, ptr %11, align 8, !tbaa !9
  %105 = icmp ne i64 %103, %104
  br i1 %105, label %106, label %124

106:                                              ; preds = %102
  %107 = load i64, ptr %8, align 8, !tbaa !9
  %108 = add nsw i64 %107, 1
  store i64 %108, ptr %9, align 8, !tbaa !9
  %109 = load i64, ptr %9, align 8, !tbaa !9
  %110 = load i64, ptr %17, align 8, !tbaa !9
  %111 = icmp sge i64 %109, %110
  br i1 %111, label %112, label %113

112:                                              ; preds = %106
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %113

113:                                              ; preds = %112, %106
  %114 = load ptr, ptr %16, align 8, !tbaa !5
  %115 = load i64, ptr %8, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.TPPLPoint, ptr %114, i64 %115
  %117 = load ptr, ptr %16, align 8, !tbaa !5
  %118 = load i64, ptr %9, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.TPPLPoint, ptr %117, i64 %118
  %120 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 8 dereferenceable(24) %116, ptr noundef nonnull align 8 dereferenceable(24) %119)
  br i1 %120, label %122, label %121

121:                                              ; preds = %113
  store i32 0, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %582

122:                                              ; preds = %113
  %123 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %123, ptr %8, align 8, !tbaa !9
  br label %102, !llvm.loop !14

124:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %125 = load i64, ptr %17, align 8, !tbaa !9
  %126 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %125) #8
          to label %127 unwind label %147

127:                                              ; preds = %124
  store ptr %126, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %128 = load i64, ptr %17, align 8, !tbaa !9
  %129 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %128, i64 8)
  %130 = extractvalue { i64, i1 } %129, 1
  %131 = extractvalue { i64, i1 } %129, 0
  %132 = select i1 %130, i64 -1, i64 %131
  %133 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %132) #8
          to label %134 unwind label %151

134:                                              ; preds = %127
  store ptr %133, ptr %23, align 8, !tbaa !5
  %135 = load i64, ptr %11, align 8, !tbaa !9
  %136 = load ptr, ptr %23, align 8, !tbaa !5
  %137 = getelementptr inbounds i64, ptr %136, i64 0
  store i64 %135, ptr %137, align 8, !tbaa !9
  %138 = load ptr, ptr %22, align 8, !tbaa !5
  %139 = load i64, ptr %11, align 8, !tbaa !9
  %140 = getelementptr inbounds i8, ptr %138, i64 %139
  store i8 0, ptr %140, align 1, !tbaa !15
  %141 = load i64, ptr %11, align 8, !tbaa !9
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %13, align 8, !tbaa !9
  %143 = load i64, ptr %13, align 8, !tbaa !9
  %144 = load i64, ptr %17, align 8, !tbaa !9
  %145 = icmp sge i64 %143, %144
  br i1 %145, label %146, label %155

146:                                              ; preds = %134
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %155

147:                                              ; preds = %124
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %19, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %20, align 4
  br label %581

151:                                              ; preds = %127
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %19, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %20, align 4
  br label %580

155:                                              ; preds = %146, %134
  %156 = load i64, ptr %11, align 8, !tbaa !9
  %157 = sub nsw i64 %156, 1
  store i64 %157, ptr %14, align 8, !tbaa !9
  %158 = load i64, ptr %14, align 8, !tbaa !9
  %159 = icmp slt i64 %158, 0
  br i1 %159, label %160, label %163

160:                                              ; preds = %155
  %161 = load i64, ptr %17, align 8, !tbaa !9
  %162 = sub nsw i64 %161, 1
  store i64 %162, ptr %14, align 8, !tbaa !9
  br label %163

163:                                              ; preds = %160, %155
  store i64 1, ptr %8, align 8, !tbaa !9
  br label %164

164:                                              ; preds = %262, %163
  %165 = load i64, ptr %8, align 8, !tbaa !9
  %166 = load i64, ptr %17, align 8, !tbaa !9
  %167 = sub nsw i64 %166, 1
  %168 = icmp slt i64 %165, %167
  br i1 %168, label %169, label %265

169:                                              ; preds = %164
  %170 = load i64, ptr %13, align 8, !tbaa !9
  %171 = load i64, ptr %12, align 8, !tbaa !9
  %172 = icmp eq i64 %170, %171
  br i1 %172, label %173, label %192

173:                                              ; preds = %169
  %174 = load i64, ptr %14, align 8, !tbaa !9
  %175 = load ptr, ptr %23, align 8, !tbaa !5
  %176 = load i64, ptr %8, align 8, !tbaa !9
  %177 = getelementptr inbounds i64, ptr %175, i64 %176
  store i64 %174, ptr %177, align 8, !tbaa !9
  %178 = load i64, ptr %14, align 8, !tbaa !9
  %179 = add nsw i64 %178, -1
  store i64 %179, ptr %14, align 8, !tbaa !9
  %180 = load i64, ptr %14, align 8, !tbaa !9
  %181 = icmp slt i64 %180, 0
  br i1 %181, label %182, label %185

182:                                              ; preds = %173
  %183 = load i64, ptr %17, align 8, !tbaa !9
  %184 = sub nsw i64 %183, 1
  store i64 %184, ptr %14, align 8, !tbaa !9
  br label %185

185:                                              ; preds = %182, %173
  %186 = load ptr, ptr %22, align 8, !tbaa !5
  %187 = load ptr, ptr %23, align 8, !tbaa !5
  %188 = load i64, ptr %8, align 8, !tbaa !9
  %189 = getelementptr inbounds i64, ptr %187, i64 %188
  %190 = load i64, ptr %189, align 8, !tbaa !9
  %191 = getelementptr inbounds i8, ptr %186, i64 %190
  store i8 -1, ptr %191, align 1, !tbaa !15
  br label %261

192:                                              ; preds = %169
  %193 = load i64, ptr %14, align 8, !tbaa !9
  %194 = load i64, ptr %12, align 8, !tbaa !9
  %195 = icmp eq i64 %193, %194
  br i1 %195, label %196, label %214

196:                                              ; preds = %192
  %197 = load i64, ptr %13, align 8, !tbaa !9
  %198 = load ptr, ptr %23, align 8, !tbaa !5
  %199 = load i64, ptr %8, align 8, !tbaa !9
  %200 = getelementptr inbounds i64, ptr %198, i64 %199
  store i64 %197, ptr %200, align 8, !tbaa !9
  %201 = load i64, ptr %13, align 8, !tbaa !9
  %202 = add nsw i64 %201, 1
  store i64 %202, ptr %13, align 8, !tbaa !9
  %203 = load i64, ptr %13, align 8, !tbaa !9
  %204 = load i64, ptr %17, align 8, !tbaa !9
  %205 = icmp sge i64 %203, %204
  br i1 %205, label %206, label %207

206:                                              ; preds = %196
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %207

207:                                              ; preds = %206, %196
  %208 = load ptr, ptr %22, align 8, !tbaa !5
  %209 = load ptr, ptr %23, align 8, !tbaa !5
  %210 = load i64, ptr %8, align 8, !tbaa !9
  %211 = getelementptr inbounds i64, ptr %209, i64 %210
  %212 = load i64, ptr %211, align 8, !tbaa !9
  %213 = getelementptr inbounds i8, ptr %208, i64 %212
  store i8 1, ptr %213, align 1, !tbaa !15
  br label %260

214:                                              ; preds = %192
  %215 = load ptr, ptr %16, align 8, !tbaa !5
  %216 = load i64, ptr %13, align 8, !tbaa !9
  %217 = getelementptr inbounds %struct.TPPLPoint, ptr %215, i64 %216
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = load i64, ptr %14, align 8, !tbaa !9
  %220 = getelementptr inbounds %struct.TPPLPoint, ptr %218, i64 %219
  %221 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 8 dereferenceable(24) %217, ptr noundef nonnull align 8 dereferenceable(24) %220)
  br i1 %221, label %222, label %241

222:                                              ; preds = %214
  %223 = load i64, ptr %14, align 8, !tbaa !9
  %224 = load ptr, ptr %23, align 8, !tbaa !5
  %225 = load i64, ptr %8, align 8, !tbaa !9
  %226 = getelementptr inbounds i64, ptr %224, i64 %225
  store i64 %223, ptr %226, align 8, !tbaa !9
  %227 = load i64, ptr %14, align 8, !tbaa !9
  %228 = add nsw i64 %227, -1
  store i64 %228, ptr %14, align 8, !tbaa !9
  %229 = load i64, ptr %14, align 8, !tbaa !9
  %230 = icmp slt i64 %229, 0
  br i1 %230, label %231, label %234

231:                                              ; preds = %222
  %232 = load i64, ptr %17, align 8, !tbaa !9
  %233 = sub nsw i64 %232, 1
  store i64 %233, ptr %14, align 8, !tbaa !9
  br label %234

234:                                              ; preds = %231, %222
  %235 = load ptr, ptr %22, align 8, !tbaa !5
  %236 = load ptr, ptr %23, align 8, !tbaa !5
  %237 = load i64, ptr %8, align 8, !tbaa !9
  %238 = getelementptr inbounds i64, ptr %236, i64 %237
  %239 = load i64, ptr %238, align 8, !tbaa !9
  %240 = getelementptr inbounds i8, ptr %235, i64 %239
  store i8 -1, ptr %240, align 1, !tbaa !15
  br label %259

241:                                              ; preds = %214
  %242 = load i64, ptr %13, align 8, !tbaa !9
  %243 = load ptr, ptr %23, align 8, !tbaa !5
  %244 = load i64, ptr %8, align 8, !tbaa !9
  %245 = getelementptr inbounds i64, ptr %243, i64 %244
  store i64 %242, ptr %245, align 8, !tbaa !9
  %246 = load i64, ptr %13, align 8, !tbaa !9
  %247 = add nsw i64 %246, 1
  store i64 %247, ptr %13, align 8, !tbaa !9
  %248 = load i64, ptr %13, align 8, !tbaa !9
  %249 = load i64, ptr %17, align 8, !tbaa !9
  %250 = icmp sge i64 %248, %249
  br i1 %250, label %251, label %252

251:                                              ; preds = %241
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %252

252:                                              ; preds = %251, %241
  %253 = load ptr, ptr %22, align 8, !tbaa !5
  %254 = load ptr, ptr %23, align 8, !tbaa !5
  %255 = load i64, ptr %8, align 8, !tbaa !9
  %256 = getelementptr inbounds i64, ptr %254, i64 %255
  %257 = load i64, ptr %256, align 8, !tbaa !9
  %258 = getelementptr inbounds i8, ptr %253, i64 %257
  store i8 1, ptr %258, align 1, !tbaa !15
  br label %259

259:                                              ; preds = %252, %234
  br label %260

260:                                              ; preds = %259, %207
  br label %261

261:                                              ; preds = %260, %185
  br label %262

262:                                              ; preds = %261
  %263 = load i64, ptr %8, align 8, !tbaa !9
  %264 = add nsw i64 %263, 1
  store i64 %264, ptr %8, align 8, !tbaa !9
  br label %164, !llvm.loop !16

265:                                              ; preds = %164
  %266 = load i64, ptr %12, align 8, !tbaa !9
  %267 = load ptr, ptr %23, align 8, !tbaa !5
  %268 = load i64, ptr %8, align 8, !tbaa !9
  %269 = getelementptr inbounds i64, ptr %267, i64 %268
  store i64 %266, ptr %269, align 8, !tbaa !9
  %270 = load ptr, ptr %22, align 8, !tbaa !5
  %271 = load i64, ptr %12, align 8, !tbaa !9
  %272 = getelementptr inbounds i8, ptr %270, i64 %271
  store i8 0, ptr %272, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %273 = load i64, ptr %17, align 8, !tbaa !9
  %274 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %273, i64 8)
  %275 = extractvalue { i64, i1 } %274, 1
  %276 = extractvalue { i64, i1 } %274, 0
  %277 = select i1 %275, i64 -1, i64 %276
  %278 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %277) #8
          to label %279 unwind label %346

279:                                              ; preds = %265
  store ptr %278, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  store i64 0, ptr %25, align 8, !tbaa !9
  %280 = load ptr, ptr %23, align 8, !tbaa !5
  %281 = getelementptr inbounds i64, ptr %280, i64 0
  %282 = load i64, ptr %281, align 8, !tbaa !9
  %283 = load ptr, ptr %24, align 8, !tbaa !5
  %284 = getelementptr inbounds i64, ptr %283, i64 0
  store i64 %282, ptr %284, align 8, !tbaa !9
  %285 = load ptr, ptr %23, align 8, !tbaa !5
  %286 = getelementptr inbounds i64, ptr %285, i64 1
  %287 = load i64, ptr %286, align 8, !tbaa !9
  %288 = load ptr, ptr %24, align 8, !tbaa !5
  %289 = getelementptr inbounds i64, ptr %288, i64 1
  store i64 %287, ptr %289, align 8, !tbaa !9
  store i64 2, ptr %25, align 8, !tbaa !9
  store i64 2, ptr %8, align 8, !tbaa !9
  br label %290

290:                                              ; preds = %500, %279
  %291 = load i64, ptr %8, align 8, !tbaa !9
  %292 = load i64, ptr %17, align 8, !tbaa !9
  %293 = sub nsw i64 %292, 1
  %294 = icmp slt i64 %291, %293
  br i1 %294, label %295, label %503

295:                                              ; preds = %290
  %296 = load ptr, ptr %23, align 8, !tbaa !5
  %297 = load i64, ptr %8, align 8, !tbaa !9
  %298 = getelementptr inbounds i64, ptr %296, i64 %297
  %299 = load i64, ptr %298, align 8, !tbaa !9
  store i64 %299, ptr %15, align 8, !tbaa !9
  %300 = load ptr, ptr %22, align 8, !tbaa !5
  %301 = load i64, ptr %15, align 8, !tbaa !9
  %302 = getelementptr inbounds i8, ptr %300, i64 %301
  %303 = load i8, ptr %302, align 1, !tbaa !15
  %304 = sext i8 %303 to i32
  %305 = load ptr, ptr %22, align 8, !tbaa !5
  %306 = load ptr, ptr %24, align 8, !tbaa !5
  %307 = load i64, ptr %25, align 8, !tbaa !9
  %308 = sub nsw i64 %307, 1
  %309 = getelementptr inbounds i64, ptr %306, i64 %308
  %310 = load i64, ptr %309, align 8, !tbaa !9
  %311 = getelementptr inbounds i8, ptr %305, i64 %310
  %312 = load i8, ptr %311, align 1, !tbaa !15
  %313 = sext i8 %312 to i32
  %314 = icmp ne i32 %304, %313
  br i1 %314, label %315, label %392

315:                                              ; preds = %295
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %316

316:                                              ; preds = %375, %315
  %317 = load i64, ptr %10, align 8, !tbaa !9
  %318 = load i64, ptr %25, align 8, !tbaa !9
  %319 = sub nsw i64 %318, 1
  %320 = icmp slt i64 %317, %319
  br i1 %320, label %321, label %378

321:                                              ; preds = %316
  %322 = load ptr, ptr %22, align 8, !tbaa !5
  %323 = load i64, ptr %15, align 8, !tbaa !9
  %324 = getelementptr inbounds i8, ptr %322, i64 %323
  %325 = load i8, ptr %324, align 1, !tbaa !15
  %326 = sext i8 %325 to i32
  %327 = icmp eq i32 %326, 1
  br i1 %327, label %328, label %354

328:                                              ; preds = %321
  %329 = load ptr, ptr %16, align 8, !tbaa !5
  %330 = load ptr, ptr %24, align 8, !tbaa !5
  %331 = load i64, ptr %10, align 8, !tbaa !9
  %332 = add nsw i64 %331, 1
  %333 = getelementptr inbounds i64, ptr %330, i64 %332
  %334 = load i64, ptr %333, align 8, !tbaa !9
  %335 = getelementptr inbounds %struct.TPPLPoint, ptr %329, i64 %334
  %336 = load ptr, ptr %16, align 8, !tbaa !5
  %337 = load ptr, ptr %24, align 8, !tbaa !5
  %338 = load i64, ptr %10, align 8, !tbaa !9
  %339 = getelementptr inbounds i64, ptr %337, i64 %338
  %340 = load i64, ptr %339, align 8, !tbaa !9
  %341 = getelementptr inbounds %struct.TPPLPoint, ptr %336, i64 %340
  %342 = load ptr, ptr %16, align 8, !tbaa !5
  %343 = load i64, ptr %15, align 8, !tbaa !9
  %344 = getelementptr inbounds %struct.TPPLPoint, ptr %342, i64 %343
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %18, ptr noundef nonnull align 8 dereferenceable(24) %335, ptr noundef nonnull align 8 dereferenceable(24) %341, ptr noundef nonnull align 8 dereferenceable(24) %344)
          to label %345 unwind label %350

345:                                              ; preds = %328
  br label %372

346:                                              ; preds = %265
  %347 = landingpad { ptr, i32 }
          cleanup
  %348 = extractvalue { ptr, i32 } %347, 0
  store ptr %348, ptr %19, align 8
  %349 = extractvalue { ptr, i32 } %347, 1
  store i32 %349, ptr %20, align 4
  br label %579

350:                                              ; preds = %560, %542, %524, %482, %465, %440, %423, %372, %354, %328
  %351 = landingpad { ptr, i32 }
          cleanup
  %352 = extractvalue { ptr, i32 } %351, 0
  store ptr %352, ptr %19, align 8
  %353 = extractvalue { ptr, i32 } %351, 1
  store i32 %353, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %579

354:                                              ; preds = %321
  %355 = load ptr, ptr %16, align 8, !tbaa !5
  %356 = load ptr, ptr %24, align 8, !tbaa !5
  %357 = load i64, ptr %10, align 8, !tbaa !9
  %358 = getelementptr inbounds i64, ptr %356, i64 %357
  %359 = load i64, ptr %358, align 8, !tbaa !9
  %360 = getelementptr inbounds %struct.TPPLPoint, ptr %355, i64 %359
  %361 = load ptr, ptr %16, align 8, !tbaa !5
  %362 = load ptr, ptr %24, align 8, !tbaa !5
  %363 = load i64, ptr %10, align 8, !tbaa !9
  %364 = add nsw i64 %363, 1
  %365 = getelementptr inbounds i64, ptr %362, i64 %364
  %366 = load i64, ptr %365, align 8, !tbaa !9
  %367 = getelementptr inbounds %struct.TPPLPoint, ptr %361, i64 %366
  %368 = load ptr, ptr %16, align 8, !tbaa !5
  %369 = load i64, ptr %15, align 8, !tbaa !9
  %370 = getelementptr inbounds %struct.TPPLPoint, ptr %368, i64 %369
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %18, ptr noundef nonnull align 8 dereferenceable(24) %360, ptr noundef nonnull align 8 dereferenceable(24) %367, ptr noundef nonnull align 8 dereferenceable(24) %370)
          to label %371 unwind label %350

371:                                              ; preds = %354
  br label %372

372:                                              ; preds = %371, %345
  %373 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %373, ptr noundef nonnull align 8 dereferenceable(17) %18)
          to label %374 unwind label %350

374:                                              ; preds = %372
  br label %375

375:                                              ; preds = %374
  %376 = load i64, ptr %10, align 8, !tbaa !9
  %377 = add nsw i64 %376, 1
  store i64 %377, ptr %10, align 8, !tbaa !9
  br label %316, !llvm.loop !17

378:                                              ; preds = %316
  %379 = load ptr, ptr %23, align 8, !tbaa !5
  %380 = load i64, ptr %8, align 8, !tbaa !9
  %381 = sub nsw i64 %380, 1
  %382 = getelementptr inbounds i64, ptr %379, i64 %381
  %383 = load i64, ptr %382, align 8, !tbaa !9
  %384 = load ptr, ptr %24, align 8, !tbaa !5
  %385 = getelementptr inbounds i64, ptr %384, i64 0
  store i64 %383, ptr %385, align 8, !tbaa !9
  %386 = load ptr, ptr %23, align 8, !tbaa !5
  %387 = load i64, ptr %8, align 8, !tbaa !9
  %388 = getelementptr inbounds i64, ptr %386, i64 %387
  %389 = load i64, ptr %388, align 8, !tbaa !9
  %390 = load ptr, ptr %24, align 8, !tbaa !5
  %391 = getelementptr inbounds i64, ptr %390, i64 1
  store i64 %389, ptr %391, align 8, !tbaa !9
  store i64 2, ptr %25, align 8, !tbaa !9
  br label %499

392:                                              ; preds = %295
  %393 = load i64, ptr %25, align 8, !tbaa !9
  %394 = add nsw i64 %393, -1
  store i64 %394, ptr %25, align 8, !tbaa !9
  br label %395

395:                                              ; preds = %489, %392
  %396 = load i64, ptr %25, align 8, !tbaa !9
  %397 = icmp sgt i64 %396, 0
  br i1 %397, label %398, label %490

398:                                              ; preds = %395
  %399 = load ptr, ptr %22, align 8, !tbaa !5
  %400 = load i64, ptr %15, align 8, !tbaa !9
  %401 = getelementptr inbounds i8, ptr %399, i64 %400
  %402 = load i8, ptr %401, align 1, !tbaa !15
  %403 = sext i8 %402 to i32
  %404 = icmp eq i32 %403, 1
  br i1 %404, label %405, label %447

405:                                              ; preds = %398
  %406 = load ptr, ptr %16, align 8, !tbaa !5
  %407 = load i64, ptr %15, align 8, !tbaa !9
  %408 = getelementptr inbounds %struct.TPPLPoint, ptr %406, i64 %407
  %409 = load ptr, ptr %16, align 8, !tbaa !5
  %410 = load ptr, ptr %24, align 8, !tbaa !5
  %411 = load i64, ptr %25, align 8, !tbaa !9
  %412 = sub nsw i64 %411, 1
  %413 = getelementptr inbounds i64, ptr %410, i64 %412
  %414 = load i64, ptr %413, align 8, !tbaa !9
  %415 = getelementptr inbounds %struct.TPPLPoint, ptr %409, i64 %414
  %416 = load ptr, ptr %16, align 8, !tbaa !5
  %417 = load ptr, ptr %24, align 8, !tbaa !5
  %418 = load i64, ptr %25, align 8, !tbaa !9
  %419 = getelementptr inbounds i64, ptr %417, i64 %418
  %420 = load i64, ptr %419, align 8, !tbaa !9
  %421 = getelementptr inbounds %struct.TPPLPoint, ptr %416, i64 %420
  %422 = call noundef zeroext i1 @_ZN13TPPLPartition8IsConvexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 8 dereferenceable(24) %408, ptr noundef nonnull align 8 dereferenceable(24) %415, ptr noundef nonnull align 8 dereferenceable(24) %421)
  br i1 %422, label %423, label %445

423:                                              ; preds = %405
  %424 = load ptr, ptr %16, align 8, !tbaa !5
  %425 = load i64, ptr %15, align 8, !tbaa !9
  %426 = getelementptr inbounds %struct.TPPLPoint, ptr %424, i64 %425
  %427 = load ptr, ptr %16, align 8, !tbaa !5
  %428 = load ptr, ptr %24, align 8, !tbaa !5
  %429 = load i64, ptr %25, align 8, !tbaa !9
  %430 = sub nsw i64 %429, 1
  %431 = getelementptr inbounds i64, ptr %428, i64 %430
  %432 = load i64, ptr %431, align 8, !tbaa !9
  %433 = getelementptr inbounds %struct.TPPLPoint, ptr %427, i64 %432
  %434 = load ptr, ptr %16, align 8, !tbaa !5
  %435 = load ptr, ptr %24, align 8, !tbaa !5
  %436 = load i64, ptr %25, align 8, !tbaa !9
  %437 = getelementptr inbounds i64, ptr %435, i64 %436
  %438 = load i64, ptr %437, align 8, !tbaa !9
  %439 = getelementptr inbounds %struct.TPPLPoint, ptr %434, i64 %438
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %18, ptr noundef nonnull align 8 dereferenceable(24) %426, ptr noundef nonnull align 8 dereferenceable(24) %433, ptr noundef nonnull align 8 dereferenceable(24) %439)
          to label %440 unwind label %350

440:                                              ; preds = %423
  %441 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %441, ptr noundef nonnull align 8 dereferenceable(17) %18)
          to label %442 unwind label %350

442:                                              ; preds = %440
  %443 = load i64, ptr %25, align 8, !tbaa !9
  %444 = add nsw i64 %443, -1
  store i64 %444, ptr %25, align 8, !tbaa !9
  br label %446

445:                                              ; preds = %405
  br label %490

446:                                              ; preds = %442
  br label %489

447:                                              ; preds = %398
  %448 = load ptr, ptr %16, align 8, !tbaa !5
  %449 = load i64, ptr %15, align 8, !tbaa !9
  %450 = getelementptr inbounds %struct.TPPLPoint, ptr %448, i64 %449
  %451 = load ptr, ptr %16, align 8, !tbaa !5
  %452 = load ptr, ptr %24, align 8, !tbaa !5
  %453 = load i64, ptr %25, align 8, !tbaa !9
  %454 = getelementptr inbounds i64, ptr %452, i64 %453
  %455 = load i64, ptr %454, align 8, !tbaa !9
  %456 = getelementptr inbounds %struct.TPPLPoint, ptr %451, i64 %455
  %457 = load ptr, ptr %16, align 8, !tbaa !5
  %458 = load ptr, ptr %24, align 8, !tbaa !5
  %459 = load i64, ptr %25, align 8, !tbaa !9
  %460 = sub nsw i64 %459, 1
  %461 = getelementptr inbounds i64, ptr %458, i64 %460
  %462 = load i64, ptr %461, align 8, !tbaa !9
  %463 = getelementptr inbounds %struct.TPPLPoint, ptr %457, i64 %462
  %464 = call noundef zeroext i1 @_ZN13TPPLPartition8IsConvexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 8 dereferenceable(24) %450, ptr noundef nonnull align 8 dereferenceable(24) %456, ptr noundef nonnull align 8 dereferenceable(24) %463)
  br i1 %464, label %465, label %487

465:                                              ; preds = %447
  %466 = load ptr, ptr %16, align 8, !tbaa !5
  %467 = load i64, ptr %15, align 8, !tbaa !9
  %468 = getelementptr inbounds %struct.TPPLPoint, ptr %466, i64 %467
  %469 = load ptr, ptr %16, align 8, !tbaa !5
  %470 = load ptr, ptr %24, align 8, !tbaa !5
  %471 = load i64, ptr %25, align 8, !tbaa !9
  %472 = getelementptr inbounds i64, ptr %470, i64 %471
  %473 = load i64, ptr %472, align 8, !tbaa !9
  %474 = getelementptr inbounds %struct.TPPLPoint, ptr %469, i64 %473
  %475 = load ptr, ptr %16, align 8, !tbaa !5
  %476 = load ptr, ptr %24, align 8, !tbaa !5
  %477 = load i64, ptr %25, align 8, !tbaa !9
  %478 = sub nsw i64 %477, 1
  %479 = getelementptr inbounds i64, ptr %476, i64 %478
  %480 = load i64, ptr %479, align 8, !tbaa !9
  %481 = getelementptr inbounds %struct.TPPLPoint, ptr %475, i64 %480
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %18, ptr noundef nonnull align 8 dereferenceable(24) %468, ptr noundef nonnull align 8 dereferenceable(24) %474, ptr noundef nonnull align 8 dereferenceable(24) %481)
          to label %482 unwind label %350

482:                                              ; preds = %465
  %483 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %483, ptr noundef nonnull align 8 dereferenceable(17) %18)
          to label %484 unwind label %350

484:                                              ; preds = %482
  %485 = load i64, ptr %25, align 8, !tbaa !9
  %486 = add nsw i64 %485, -1
  store i64 %486, ptr %25, align 8, !tbaa !9
  br label %488

487:                                              ; preds = %447
  br label %490

488:                                              ; preds = %484
  br label %489

489:                                              ; preds = %488, %446
  br label %395, !llvm.loop !18

490:                                              ; preds = %487, %445, %395
  %491 = load i64, ptr %25, align 8, !tbaa !9
  %492 = add nsw i64 %491, 1
  store i64 %492, ptr %25, align 8, !tbaa !9
  %493 = load i64, ptr %15, align 8, !tbaa !9
  %494 = load ptr, ptr %24, align 8, !tbaa !5
  %495 = load i64, ptr %25, align 8, !tbaa !9
  %496 = getelementptr inbounds i64, ptr %494, i64 %495
  store i64 %493, ptr %496, align 8, !tbaa !9
  %497 = load i64, ptr %25, align 8, !tbaa !9
  %498 = add nsw i64 %497, 1
  store i64 %498, ptr %25, align 8, !tbaa !9
  br label %499

499:                                              ; preds = %490, %378
  br label %500

500:                                              ; preds = %499
  %501 = load i64, ptr %8, align 8, !tbaa !9
  %502 = add nsw i64 %501, 1
  store i64 %502, ptr %8, align 8, !tbaa !9
  br label %290, !llvm.loop !19

503:                                              ; preds = %290
  %504 = load ptr, ptr %23, align 8, !tbaa !5
  %505 = load i64, ptr %8, align 8, !tbaa !9
  %506 = getelementptr inbounds i64, ptr %504, i64 %505
  %507 = load i64, ptr %506, align 8, !tbaa !9
  store i64 %507, ptr %15, align 8, !tbaa !9
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %508

508:                                              ; preds = %563, %503
  %509 = load i64, ptr %10, align 8, !tbaa !9
  %510 = load i64, ptr %25, align 8, !tbaa !9
  %511 = sub nsw i64 %510, 1
  %512 = icmp slt i64 %509, %511
  br i1 %512, label %513, label %566

513:                                              ; preds = %508
  %514 = load ptr, ptr %22, align 8, !tbaa !5
  %515 = load ptr, ptr %24, align 8, !tbaa !5
  %516 = load i64, ptr %10, align 8, !tbaa !9
  %517 = add nsw i64 %516, 1
  %518 = getelementptr inbounds i64, ptr %515, i64 %517
  %519 = load i64, ptr %518, align 8, !tbaa !9
  %520 = getelementptr inbounds i8, ptr %514, i64 %519
  %521 = load i8, ptr %520, align 1, !tbaa !15
  %522 = sext i8 %521 to i32
  %523 = icmp eq i32 %522, 1
  br i1 %523, label %524, label %542

524:                                              ; preds = %513
  %525 = load ptr, ptr %16, align 8, !tbaa !5
  %526 = load ptr, ptr %24, align 8, !tbaa !5
  %527 = load i64, ptr %10, align 8, !tbaa !9
  %528 = getelementptr inbounds i64, ptr %526, i64 %527
  %529 = load i64, ptr %528, align 8, !tbaa !9
  %530 = getelementptr inbounds %struct.TPPLPoint, ptr %525, i64 %529
  %531 = load ptr, ptr %16, align 8, !tbaa !5
  %532 = load ptr, ptr %24, align 8, !tbaa !5
  %533 = load i64, ptr %10, align 8, !tbaa !9
  %534 = add nsw i64 %533, 1
  %535 = getelementptr inbounds i64, ptr %532, i64 %534
  %536 = load i64, ptr %535, align 8, !tbaa !9
  %537 = getelementptr inbounds %struct.TPPLPoint, ptr %531, i64 %536
  %538 = load ptr, ptr %16, align 8, !tbaa !5
  %539 = load i64, ptr %15, align 8, !tbaa !9
  %540 = getelementptr inbounds %struct.TPPLPoint, ptr %538, i64 %539
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %18, ptr noundef nonnull align 8 dereferenceable(24) %530, ptr noundef nonnull align 8 dereferenceable(24) %537, ptr noundef nonnull align 8 dereferenceable(24) %540)
          to label %541 unwind label %350

541:                                              ; preds = %524
  br label %560

542:                                              ; preds = %513
  %543 = load ptr, ptr %16, align 8, !tbaa !5
  %544 = load ptr, ptr %24, align 8, !tbaa !5
  %545 = load i64, ptr %10, align 8, !tbaa !9
  %546 = add nsw i64 %545, 1
  %547 = getelementptr inbounds i64, ptr %544, i64 %546
  %548 = load i64, ptr %547, align 8, !tbaa !9
  %549 = getelementptr inbounds %struct.TPPLPoint, ptr %543, i64 %548
  %550 = load ptr, ptr %16, align 8, !tbaa !5
  %551 = load ptr, ptr %24, align 8, !tbaa !5
  %552 = load i64, ptr %10, align 8, !tbaa !9
  %553 = getelementptr inbounds i64, ptr %551, i64 %552
  %554 = load i64, ptr %553, align 8, !tbaa !9
  %555 = getelementptr inbounds %struct.TPPLPoint, ptr %550, i64 %554
  %556 = load ptr, ptr %16, align 8, !tbaa !5
  %557 = load i64, ptr %15, align 8, !tbaa !9
  %558 = getelementptr inbounds %struct.TPPLPoint, ptr %556, i64 %557
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %18, ptr noundef nonnull align 8 dereferenceable(24) %549, ptr noundef nonnull align 8 dereferenceable(24) %555, ptr noundef nonnull align 8 dereferenceable(24) %558)
          to label %559 unwind label %350

559:                                              ; preds = %542
  br label %560

560:                                              ; preds = %559, %541
  %561 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %561, ptr noundef nonnull align 8 dereferenceable(17) %18)
          to label %562 unwind label %350

562:                                              ; preds = %560
  br label %563

563:                                              ; preds = %562
  %564 = load i64, ptr %10, align 8, !tbaa !9
  %565 = add nsw i64 %564, 1
  store i64 %565, ptr %10, align 8, !tbaa !9
  br label %508, !llvm.loop !20

566:                                              ; preds = %508
  %567 = load ptr, ptr %23, align 8, !tbaa !5
  %568 = icmp eq ptr %567, null
  br i1 %568, label %570, label %569

569:                                              ; preds = %566
  call void @_ZdaPv(ptr noundef %567) #9
  br label %570

570:                                              ; preds = %569, %566
  %571 = load ptr, ptr %22, align 8, !tbaa !5
  %572 = icmp eq ptr %571, null
  br i1 %572, label %574, label %573

573:                                              ; preds = %570
  call void @_ZdaPv(ptr noundef %571) #9
  br label %574

574:                                              ; preds = %573, %570
  %575 = load ptr, ptr %24, align 8, !tbaa !5
  %576 = icmp eq ptr %575, null
  br i1 %576, label %578, label %577

577:                                              ; preds = %574
  call void @_ZdaPv(ptr noundef %575) #9
  br label %578

578:                                              ; preds = %577, %574
  store i32 1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %582

579:                                              ; preds = %350, %346
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %580

580:                                              ; preds = %579, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %581

581:                                              ; preds = %580, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %583

582:                                              ; preds = %578, %121, %97, %42
  call void @_ZN8TPPLPolyD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %584

583:                                              ; preds = %581, %43
  call void @_ZN8TPPLPolyD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %586

584:                                              ; preds = %582, %29
  %585 = load i32, ptr %4, align 4
  ret i32 %585

586:                                              ; preds = %583
  %587 = load ptr, ptr %19, align 8
  %588 = load i32, ptr %20, align 4
  %589 = insertvalue { ptr, i32 } poison, ptr %587, 0
  %590 = insertvalue { ptr, i32 } %589, i32 %588, 1
  resume { ptr, i32 } %590
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8TPPLPoly9GetPointsEv(ptr noundef nonnull align 8 dereferenceable(17)) #5 align 2

declare void @_ZN8TPPLPolyC1Ev(ptr)

declare void @_ZN8TPPLPolyD1Ev(ptr)

attributes #0 = { nobuiltin 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


; 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.TPPLPoly = type <{ ptr, i64, i8, [7 x i8] }>
%struct.TPPLPoint = type { double, double, i32 }

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8TPPLPoly5ValidEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN13TPPLPartition19TriangulateMonotoneEP8TPPLPolyPNSt7__cxx114listIS0_SaIS0_EEE(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull %1, ptr noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.TPPLPoly, align 8
  %5 = tail call noundef zeroext i1 @_ZNK8TPPLPoly5ValidEv(ptr noundef nonnull align 8 dereferenceable(17) %1)
  br i1 %5, label %6, label %144

6:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @_ZN8TPPLPolyC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %4)
  %7 = call noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %1)
  %8 = call noundef ptr @_ZN8TPPLPoly9GetPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %1)
  %9 = icmp eq i64 %7, 3
  br i1 %9, label %11, label %.preheader284

.preheader284:                                    ; preds = %6
  %10 = icmp sgt i64 %7, 1
  br i1 %10, label %.lr.ph, label %.preheader282

11:                                               ; preds = %6
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(17) %1)
          to label %.loopexit281 unwind label %12

12:                                               ; preds = %11
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.preheader282:                                    ; preds = %.lr.ph, %.preheader284
  %.0253.lcssa = phi i64 [ 0, %.preheader284 ], [ %.1254, %.lr.ph ]
  %.0251.lcssa = phi i64 [ 0, %.preheader284 ], [ %spec.select, %.lr.ph ]
  br label %20

.lr.ph:                                           ; preds = %.preheader284, %.lr.ph
  %.0230293 = phi i64 [ %19, %.lr.ph ], [ 1, %.preheader284 ]
  %.0251292 = phi i64 [ %spec.select, %.lr.ph ], [ 0, %.preheader284 ]
  %.0253291 = phi i64 [ %.1254, %.lr.ph ], [ 0, %.preheader284 ]
  %14 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.0230293
  %15 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.0251292
  %16 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %15)
  %spec.select = select i1 %16, i64 %.0230293, i64 %.0251292
  %17 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.0253291
  %18 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %14)
  %.1254 = select i1 %18, i64 %.0230293, i64 %.0253291
  %19 = add nuw nsw i64 %.0230293, 1
  %exitcond.not = icmp eq i64 %19, %7
  br i1 %exitcond.not, label %.preheader282, label %.lr.ph, !llvm.loop !5

20:                                               ; preds = %.preheader282, %21
  %.1231 = phi i64 [ %spec.store.select, %21 ], [ %.0253.lcssa, %.preheader282 ]
  %.not = icmp eq i64 %.1231, %.0251.lcssa
  br i1 %.not, label %.preheader280, label %21

21:                                               ; preds = %20
  %22 = add nsw i64 %.1231, 1
  %.not270 = icmp slt i64 %22, %7
  %spec.store.select = select i1 %.not270, i64 %22, i64 0
  %23 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %spec.store.select
  %24 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.1231
  %25 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %24)
  br i1 %25, label %20, label %.loopexit281, !llvm.loop !7

.preheader280:                                    ; preds = %20, %26
  %.2232 = phi i64 [ %spec.store.select1, %26 ], [ %.0251.lcssa, %20 ]
  %.not261 = icmp eq i64 %.2232, %.0253.lcssa
  br i1 %.not261, label %31, label %26

26:                                               ; preds = %.preheader280
  %27 = add nsw i64 %.2232, 1
  %.not269 = icmp slt i64 %27, %7
  %spec.store.select1 = select i1 %.not269, i64 %27, i64 0
  %28 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.2232
  %29 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %spec.store.select1
  %30 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(24) %29)
  br i1 %30, label %.preheader280, label %.loopexit281, !llvm.loop !8

31:                                               ; preds = %.preheader280
  %32 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %7) #8
          to label %33 unwind label %44

33:                                               ; preds = %31
  %34 = icmp ugt i64 %7, 2305843009213693951
  %35 = shl nuw i64 %7, 3
  %36 = select i1 %34, i64 -1, i64 %35
  %37 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %36) #8
          to label %38 unwind label %46

38:                                               ; preds = %33
  store i64 %.0253.lcssa, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %32, i64 %.0253.lcssa
  store i8 0, ptr %39, align 1, !tbaa !13
  %40 = add i64 %7, -1
  %41 = icmp sgt i64 %7, 2
  br i1 %41, label %.lr.ph298.preheader, label %._crit_edge

.lr.ph298.preheader:                              ; preds = %38
  %42 = icmp slt i64 %.0253.lcssa, 1
  %spec.select273 = select i1 %42, i64 %7, i64 %.0253.lcssa
  %.0244 = add nsw i64 %spec.select273, -1
  %43 = add nsw i64 %.0253.lcssa, 1
  %.not262 = icmp slt i64 %43, %7
  %spec.store.select2 = select i1 %.not262, i64 %43, i64 0
  br label %.lr.ph298

44:                                               ; preds = %31
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

46:                                               ; preds = %33
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.lr.ph298:                                        ; preds = %.lr.ph298.preheader, %68
  %.3233297 = phi i64 [ %70, %68 ], [ 1, %.lr.ph298.preheader ]
  %.1245296 = phi i64 [ %.4248, %68 ], [ %.0244, %.lr.ph298.preheader ]
  %.0249295 = phi i64 [ %.1250, %68 ], [ %spec.store.select2, %.lr.ph298.preheader ]
  %48 = icmp eq i64 %.0249295, %.0251.lcssa
  br i1 %48, label %49, label %53

49:                                               ; preds = %.lr.ph298
  %50 = getelementptr inbounds i64, ptr %37, i64 %.3233297
  store i64 %.1245296, ptr %50, align 8, !tbaa !9
  %51 = add nsw i64 %.1245296, -1
  %52 = icmp slt i64 %.1245296, 1
  %spec.select274 = select i1 %52, i64 %40, i64 %51
  br label %68

53:                                               ; preds = %.lr.ph298
  %54 = icmp eq i64 %.1245296, %.0251.lcssa
  br i1 %54, label %55, label %58

55:                                               ; preds = %53
  %56 = getelementptr inbounds i64, ptr %37, i64 %.3233297
  store i64 %.0249295, ptr %56, align 8, !tbaa !9
  %57 = add nsw i64 %.0249295, 1
  %.not268 = icmp slt i64 %57, %7
  %spec.store.select3 = select i1 %.not268, i64 %57, i64 0
  br label %68

58:                                               ; preds = %53
  %59 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.0249295
  %60 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.1245296
  %61 = call noundef zeroext i1 @_ZN13TPPLPartition5BelowER9TPPLPointS1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 8 dereferenceable(24) %60)
  %62 = getelementptr inbounds i64, ptr %37, i64 %.3233297
  br i1 %61, label %63, label %66

63:                                               ; preds = %58
  store i64 %.1245296, ptr %62, align 8, !tbaa !9
  %64 = add nsw i64 %.1245296, -1
  %65 = icmp slt i64 %.1245296, 1
  %spec.select275 = select i1 %65, i64 %40, i64 %64
  br label %68

66:                                               ; preds = %58
  store i64 %.0249295, ptr %62, align 8, !tbaa !9
  %67 = add nsw i64 %.0249295, 1
  %.not267 = icmp slt i64 %67, %7
  %spec.store.select4 = select i1 %.not267, i64 %67, i64 0
  br label %68

68:                                               ; preds = %49, %63, %66, %55
  %.1245296.sink = phi i64 [ %.1245296, %49 ], [ %.1245296, %63 ], [ %.0249295, %66 ], [ %.0249295, %55 ]
  %.sink = phi i8 [ -1, %49 ], [ -1, %63 ], [ 1, %66 ], [ 1, %55 ]
  %.1250 = phi i64 [ %.0251.lcssa, %49 ], [ %.0249295, %63 ], [ %spec.store.select4, %66 ], [ %spec.store.select3, %55 ]
  %.4248 = phi i64 [ %spec.select274, %49 ], [ %spec.select275, %63 ], [ %.1245296, %66 ], [ %.0251.lcssa, %55 ]
  %69 = getelementptr inbounds i8, ptr %32, i64 %.1245296.sink
  store i8 %.sink, ptr %69, align 1, !tbaa !13
  %70 = add nuw nsw i64 %.3233297, 1
  %exitcond326.not = icmp eq i64 %70, %40
  br i1 %exitcond326.not, label %._crit_edge, label %.lr.ph298, !llvm.loop !14

._crit_edge:                                      ; preds = %68, %38
  %.3233.lcssa = phi i64 [ 1, %38 ], [ %40, %68 ]
  %71 = getelementptr inbounds i64, ptr %37, i64 %.3233.lcssa
  store i64 %.0251.lcssa, ptr %71, align 8, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %32, i64 %.0251.lcssa
  store i8 0, ptr %72, align 1, !tbaa !13
  %73 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %36) #8
          to label %74 unwind label %97

74:                                               ; preds = %._crit_edge
  %75 = getelementptr i8, ptr %73, i64 8
  %76 = load <2 x i64>, ptr %37, align 8, !tbaa !9
  store <2 x i64> %76, ptr %73, align 8, !tbaa !9
  %77 = icmp sgt i64 %7, 3
  br i1 %77, label %.lr.ph320, label %._crit_edge321

.lr.ph320:                                        ; preds = %74, %125
  %.0318 = phi i64 [ %.3, %125 ], [ 2, %74 ]
  %.4317 = phi i64 [ %126, %125 ], [ 2, %74 ]
  %78 = getelementptr inbounds i64, ptr %37, i64 %.4317
  %79 = load i64, ptr %78, align 8, !tbaa !9
  %80 = getelementptr inbounds i8, ptr %32, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !13
  %82 = add nsw i64 %.0318, -1
  %83 = getelementptr inbounds i64, ptr %73, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = getelementptr inbounds i8, ptr %32, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !13
  %.not263 = icmp eq i8 %81, %86
  %87 = icmp sgt i64 %.0318, 1
  br i1 %.not263, label %.preheader, label %.preheader279

.preheader279:                                    ; preds = %.lr.ph320
  br i1 %87, label %.lr.ph302, label %._crit_edge303

.lr.ph302:                                        ; preds = %.preheader279
  %88 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %79
  %89 = icmp eq i8 %81, 1
  br label %.invoke333

.preheader:                                       ; preds = %.lr.ph320
  br i1 %87, label %.lr.ph307, label %._crit_edge308

.lr.ph307:                                        ; preds = %.preheader
  %90 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %79
  %91 = icmp eq i8 %81, 1
  br label %104

.invoke333:                                       ; preds = %.lr.ph302, %100
  %.0242301 = phi i64 [ 0, %.lr.ph302 ], [ %101, %100 ]
  %92 = getelementptr inbounds i64, ptr %73, i64 %.0242301
  %93 = getelementptr inbounds i8, ptr %92, i64 8
  %. = select i1 %89, ptr %92, ptr %93
  %.340 = select i1 %89, ptr %93, ptr %92
  %.pn = load i64, ptr %.340, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.pn
  %95 = load i64, ptr %., align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %95
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %4, ptr noundef nonnull align 8 dereferenceable(24) %94, ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 8 dereferenceable(24) %88)
          to label %99 unwind label %.loopexit.split-lp.loopexit.split-lp

97:                                               ; preds = %._crit_edge
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit:                                        ; preds = %.invoke, %142
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %.invoke337, %.invoke332
  %lpad.loopexit276 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %.invoke333, %99
  %lpad.loopexit.split-lp277 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

99:                                               ; preds = %.invoke333
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(17) %4)
          to label %100 unwind label %.loopexit.split-lp.loopexit.split-lp

100:                                              ; preds = %99
  %101 = add nuw nsw i64 %.0242301, 1
  %exitcond327.not = icmp eq i64 %101, %82
  br i1 %exitcond327.not, label %._crit_edge303, label %.invoke333, !llvm.loop !15

._crit_edge303:                                   ; preds = %100, %.preheader279
  %102 = getelementptr i8, ptr %78, i64 -8
  %103 = load i64, ptr %102, align 8, !tbaa !9
  store i64 %103, ptr %73, align 8, !tbaa !9
  store i64 %79, ptr %75, align 8, !tbaa !9
  br label %125

104:                                              ; preds = %.lr.ph307, %122
  %.1306 = phi i64 [ %82, %.lr.ph307 ], [ %.1, %122 ]
  %.1.in305 = phi i64 [ %.0318, %.lr.ph307 ], [ %.1306, %122 ]
  %105 = getelementptr i64, ptr %73, i64 %.1306
  br i1 %91, label %106, label %113

106:                                              ; preds = %104
  %107 = getelementptr i8, ptr %105, i64 -8
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %108
  %110 = load i64, ptr %105, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %110
  %112 = call noundef zeroext i1 @_ZN13TPPLPartition8IsConvexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %90, ptr noundef nonnull align 8 dereferenceable(24) %109, ptr noundef nonnull align 8 dereferenceable(24) %111)
  br i1 %112, label %.invoke337, label %._crit_edge308

113:                                              ; preds = %104
  %114 = load i64, ptr %105, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %114
  %116 = getelementptr i8, ptr %105, i64 -8
  %117 = load i64, ptr %116, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %117
  %119 = call noundef zeroext i1 @_ZN13TPPLPartition8IsConvexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %90, ptr noundef nonnull align 8 dereferenceable(24) %115, ptr noundef nonnull align 8 dereferenceable(24) %118)
  br i1 %119, label %.invoke337, label %._crit_edge308

.invoke337:                                       ; preds = %113, %106
  %120 = phi ptr [ %109, %106 ], [ %115, %113 ]
  %121 = phi ptr [ %111, %106 ], [ %118, %113 ]
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %4, ptr noundef nonnull align 8 dereferenceable(24) %90, ptr noundef nonnull align 8 dereferenceable(24) %120, ptr noundef nonnull align 8 dereferenceable(24) %121)
          to label %.invoke332 unwind label %.loopexit.split-lp.loopexit

.invoke332:                                       ; preds = %.invoke337
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(17) %4)
          to label %122 unwind label %.loopexit.split-lp.loopexit

122:                                              ; preds = %.invoke332
  %.1 = add nsw i64 %.1306, -1
  %123 = icmp ugt i64 %.1306, 1
  br i1 %123, label %104, label %._crit_edge308, !llvm.loop !16

._crit_edge308:                                   ; preds = %122, %106, %113, %.preheader
  %.1.in.lcssa = phi i64 [ %.0318, %.preheader ], [ %.1.in305, %113 ], [ %.1.in305, %106 ], [ 1, %122 ]
  %.1.lcssa = phi i64 [ %82, %.preheader ], [ %.1306, %113 ], [ %.1306, %106 ], [ 0, %122 ]
  %gep = getelementptr i64, ptr %75, i64 %.1.lcssa
  store i64 %79, ptr %gep, align 8, !tbaa !9
  %124 = add nsw i64 %.1.in.lcssa, 1
  br label %125

125:                                              ; preds = %._crit_edge303, %._crit_edge308
  %.3 = phi i64 [ 2, %._crit_edge303 ], [ %124, %._crit_edge308 ]
  %126 = add nuw nsw i64 %.4317, 1
  %exitcond328.not = icmp eq i64 %126, %40
  br i1 %exitcond328.not, label %._crit_edge321.loopexit, label %.lr.ph320, !llvm.loop !17

._crit_edge321.loopexit:                          ; preds = %125
  %127 = add nsw i64 %.3, -1
  br label %._crit_edge321

._crit_edge321:                                   ; preds = %._crit_edge321.loopexit, %74
  %.4.lcssa = phi i64 [ 2, %74 ], [ %40, %._crit_edge321.loopexit ]
  %.0.lcssa = phi i64 [ 1, %74 ], [ %127, %._crit_edge321.loopexit ]
  %128 = getelementptr inbounds i64, ptr %37, i64 %.4.lcssa
  %129 = load i64, ptr %128, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %129
  %smax = call i64 @llvm.smax.i64(i64 %.0.lcssa, i64 0)
  br label %131

131:                                              ; preds = %142, %._crit_edge321
  %.1243 = phi i64 [ 0, %._crit_edge321 ], [ %132, %142 ]
  %exitcond329.not = icmp eq i64 %.1243, %smax
  br i1 %exitcond329.not, label %143, label %.invoke

.invoke:                                          ; preds = %131
  %132 = add nuw nsw i64 %.1243, 1
  %133 = getelementptr inbounds i64, ptr %73, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !9
  %135 = getelementptr inbounds i8, ptr %32, i64 %134
  %136 = load i8, ptr %135, align 1, !tbaa !13
  %137 = icmp eq i8 %136, 1
  %138 = getelementptr inbounds i64, ptr %73, i64 %.1243
  %139 = load i64, ptr %138, align 8, !tbaa !9
  %.341 = select i1 %137, i64 %134, i64 %139
  %.342 = select i1 %137, i64 %139, i64 %134
  %140 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.342
  %141 = getelementptr inbounds %struct.TPPLPoint, ptr %8, i64 %.341
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %4, ptr noundef nonnull align 8 dereferenceable(24) %140, ptr noundef nonnull align 8 dereferenceable(24) %141, ptr noundef nonnull align 8 dereferenceable(24) %130)
          to label %142 unwind label %.loopexit

142:                                              ; preds = %.invoke
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(17) %4)
          to label %131 unwind label %.loopexit, !llvm.loop !18

143:                                              ; preds = %131
  call void @_ZdaPv(ptr noundef nonnull %37) #9
  call void @_ZdaPv(ptr noundef nonnull %32) #9
  call void @_ZdaPv(ptr noundef nonnull %73) #9
  br label %.loopexit281

.loopexit281:                                     ; preds = %21, %26, %11, %143
  %.0228 = phi i32 [ 1, %143 ], [ 1, %11 ], [ 0, %26 ], [ 0, %21 ]
  call void @_ZN8TPPLPolyD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %144

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %44, %97, %46, %12
  %.pn271 = phi { ptr, i32 } [ %13, %12 ], [ %45, %44 ], [ %47, %46 ], [ %98, %97 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit276, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp277, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN8TPPLPolyD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn271

144:                                              ; preds = %3, %.loopexit281
  %.1229 = phi i32 [ %.0228, %.loopexit281 ], [ 0, %3 ]
  ret i32 %.1229
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8TPPLPoly9GetPointsEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #4 align 2

declare void @_ZN8TPPLPolyC1Ev(ptr) local_unnamed_addr

declare void @_ZN8TPPLPolyD1Ev(ptr) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6

attributes #0 = { nobuiltin 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 #1 = { nobuiltin allocsize(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 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!11, !11, i64 0}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}


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