; 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.TPPLPartition::PartitionVertex" = type { i8, i8, i8, %struct.TPPLPoint, double, ptr, ptr }
%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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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) #5

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

; 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)) #6 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN13TPPLPartition14Triangulate_ECEP8TPPLPolyPNSt7__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 ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %class.TPPLPoly, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  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
  %18 = load ptr, ptr %5, align 8
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call noundef zeroext i1 @_ZNK8TPPLPoly5ValidEv(ptr noundef nonnull align 8 dereferenceable(17) %19)
  br i1 %20, label %22, label %21

21:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  br label %297

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #8
  call void @_ZN8TPPLPolyC1Ev(ptr noundef nonnull align 8 dereferenceable(17) %11)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #8
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = invoke noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %23)
          to label %25 unwind label %28

25:                                               ; preds = %22
  %26 = icmp slt i64 %24, 3
  br i1 %26, label %27, label %32

27:                                               ; preds = %25
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %295

28:                                               ; preds = %283, %266, %244, %238, %214, %203, %132, %65, %44, %41, %37, %32, %22
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %15, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %16, align 4
  br label %296

32:                                               ; preds = %25
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = invoke noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %33)
          to label %35 unwind label %28

35:                                               ; preds = %32
  %36 = icmp eq i64 %34, 3
  br i1 %36, label %37, label %41

37:                                               ; preds = %35
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 8 dereferenceable(17) %39)
          to label %40 unwind label %28

40:                                               ; preds = %37
  store i32 1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %295

41:                                               ; preds = %35
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = invoke noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %42)
          to label %44 unwind label %28

44:                                               ; preds = %41
  store i64 %43, ptr %8, align 8, !tbaa !9
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %45, i64 56)
  %47 = extractvalue { i64, i1 } %46, 1
  %48 = extractvalue { i64, i1 } %46, 0
  %49 = select i1 %47, i64 -1, i64 %48
  %50 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %49) #9
          to label %51 unwind label %28

51:                                               ; preds = %44
  %52 = icmp eq i64 %45, 0
  br i1 %52, label %60, label %53

53:                                               ; preds = %51
  %54 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %50, i64 %45
  br label %55

55:                                               ; preds = %57, %53
  %56 = phi ptr [ %50, %53 ], [ %58, %57 ]
  invoke void @_ZN13TPPLPartition15PartitionVertexC1Ev(ptr noundef nonnull align 8 dereferenceable(56) %56)
          to label %57 unwind label %89

57:                                               ; preds = %55
  %58 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %56, i64 1
  %59 = icmp eq ptr %58, %54
  br i1 %59, label %60, label %55

60:                                               ; preds = %57, %51
  store ptr %50, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %124, %60
  %62 = load i64, ptr %12, align 8, !tbaa !9
  %63 = load i64, ptr %8, align 8, !tbaa !9
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %65, label %127

65:                                               ; preds = %61
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = load i64, ptr %12, align 8, !tbaa !9
  %68 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %66, i64 %67
  %69 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %68, i32 0, i32 0
  store i8 1, ptr %69, align 8, !tbaa !11
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load i64, ptr %12, align 8, !tbaa !9
  %72 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8TPPLPoly8GetPointEl(ptr noundef nonnull align 8 dereferenceable(17) %70, i64 noundef %71)
          to label %73 unwind label %28

73:                                               ; preds = %65
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = load i64, ptr %12, align 8, !tbaa !9
  %76 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %74, i64 %75
  %77 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %76, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %77, ptr align 8 %72, i64 24, i1 false), !tbaa.struct !17
  %78 = load i64, ptr %12, align 8, !tbaa !9
  %79 = load i64, ptr %8, align 8, !tbaa !9
  %80 = sub nsw i64 %79, 1
  %81 = icmp eq i64 %78, %80
  br i1 %81, label %82, label %93

82:                                               ; preds = %73
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %83, i64 0
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = load i64, ptr %12, align 8, !tbaa !9
  %87 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %85, i64 %86
  %88 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %87, i32 0, i32 6
  store ptr %84, ptr %88, align 8, !tbaa !20
  br label %102

89:                                               ; preds = %55
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %15, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %16, align 4
  call void @_ZdaPvm(ptr noundef %50, i64 noundef %49) #10
  br label %296

93:                                               ; preds = %73
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = load i64, ptr %12, align 8, !tbaa !9
  %96 = add nsw i64 %95, 1
  %97 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %94, i64 %96
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load i64, ptr %12, align 8, !tbaa !9
  %100 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %98, i64 %99
  %101 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %100, i32 0, i32 6
  store ptr %97, ptr %101, align 8, !tbaa !20
  br label %102

102:                                              ; preds = %93, %82
  %103 = load i64, ptr %12, align 8, !tbaa !9
  %104 = icmp eq i64 %103, 0
  br i1 %104, label %105, label %114

105:                                              ; preds = %102
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = load i64, ptr %8, align 8, !tbaa !9
  %108 = sub nsw i64 %107, 1
  %109 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %106, i64 %108
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = load i64, ptr %12, align 8, !tbaa !9
  %112 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %110, i64 %111
  %113 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %112, i32 0, i32 5
  store ptr %109, ptr %113, align 8, !tbaa !21
  br label %123

114:                                              ; preds = %102
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load i64, ptr %12, align 8, !tbaa !9
  %117 = sub nsw i64 %116, 1
  %118 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %115, i64 %117
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = load i64, ptr %12, align 8, !tbaa !9
  %121 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %119, i64 %120
  %122 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %121, i32 0, i32 5
  store ptr %118, ptr %122, align 8, !tbaa !21
  br label %123

123:                                              ; preds = %114, %105
  br label %124

124:                                              ; preds = %123
  %125 = load i64, ptr %12, align 8, !tbaa !9
  %126 = add nsw i64 %125, 1
  store i64 %126, ptr %12, align 8, !tbaa !9
  br label %61, !llvm.loop !22

127:                                              ; preds = %61
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %128

128:                                              ; preds = %139, %127
  %129 = load i64, ptr %12, align 8, !tbaa !9
  %130 = load i64, ptr %8, align 8, !tbaa !9
  %131 = icmp slt i64 %129, %130
  br i1 %131, label %132, label %142

132:                                              ; preds = %128
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = load i64, ptr %12, align 8, !tbaa !9
  %135 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %133, i64 %134
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = load i64, ptr %8, align 8, !tbaa !9
  invoke void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef %135, ptr noundef %136, i64 noundef %137)
          to label %138 unwind label %28

138:                                              ; preds = %132
  br label %139

139:                                              ; preds = %138
  %140 = load i64, ptr %12, align 8, !tbaa !9
  %141 = add nsw i64 %140, 1
  store i64 %141, ptr %12, align 8, !tbaa !9
  br label %128, !llvm.loop !24

142:                                              ; preds = %128
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %143

143:                                              ; preds = %251, %142
  %144 = load i64, ptr %12, align 8, !tbaa !9
  %145 = load i64, ptr %8, align 8, !tbaa !9
  %146 = sub nsw i64 %145, 3
  %147 = icmp slt i64 %144, %146
  br i1 %147, label %148, label %254

148:                                              ; preds = %143
  store i8 0, ptr %14, align 1, !tbaa !25
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %149

149:                                              ; preds = %192, %148
  %150 = load i64, ptr %13, align 8, !tbaa !9
  %151 = load i64, ptr %8, align 8, !tbaa !9
  %152 = icmp slt i64 %150, %151
  br i1 %152, label %153, label %195

153:                                              ; preds = %149
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = load i64, ptr %13, align 8, !tbaa !9
  %156 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %154, i64 %155
  %157 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %156, i32 0, i32 0
  %158 = load i8, ptr %157, align 8, !tbaa !11, !range !26, !noundef !27
  %159 = trunc i8 %158 to i1
  br i1 %159, label %161, label %160

160:                                              ; preds = %153
  br label %192

161:                                              ; preds = %153
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = load i64, ptr %13, align 8, !tbaa !9
  %164 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %162, i64 %163
  %165 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %164, i32 0, i32 2
  %166 = load i8, ptr %165, align 2, !tbaa !28, !range !26, !noundef !27
  %167 = trunc i8 %166 to i1
  br i1 %167, label %169, label %168

168:                                              ; preds = %161
  br label %192

169:                                              ; preds = %161
  %170 = load i8, ptr %14, align 1, !tbaa !25, !range !26, !noundef !27
  %171 = trunc i8 %170 to i1
  br i1 %171, label %176, label %172

172:                                              ; preds = %169
  store i8 1, ptr %14, align 1, !tbaa !25
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  %174 = load i64, ptr %13, align 8, !tbaa !9
  %175 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %173, i64 %174
  store ptr %175, ptr %10, align 8, !tbaa !5
  br label %191

176:                                              ; preds = %169
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = load i64, ptr %13, align 8, !tbaa !9
  %179 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %177, i64 %178
  %180 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %179, i32 0, i32 4
  %181 = load double, ptr %180, align 8, !tbaa !29
  %182 = load ptr, ptr %10, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %182, i32 0, i32 4
  %184 = load double, ptr %183, align 8, !tbaa !29
  %185 = fcmp ogt double %181, %184
  br i1 %185, label %186, label %190

186:                                              ; preds = %176
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = load i64, ptr %13, align 8, !tbaa !9
  %189 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %187, i64 %188
  store ptr %189, ptr %10, align 8, !tbaa !5
  br label %190

190:                                              ; preds = %186, %176
  br label %191

191:                                              ; preds = %190, %172
  br label %192

192:                                              ; preds = %191, %168, %160
  %193 = load i64, ptr %13, align 8, !tbaa !9
  %194 = add nsw i64 %193, 1
  store i64 %194, ptr %13, align 8, !tbaa !9
  br label %149, !llvm.loop !30

195:                                              ; preds = %149
  %196 = load i8, ptr %14, align 1, !tbaa !25, !range !26, !noundef !27
  %197 = trunc i8 %196 to i1
  br i1 %197, label %203, label %198

198:                                              ; preds = %195
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  %200 = icmp eq ptr %199, null
  br i1 %200, label %202, label %201

201:                                              ; preds = %198
  call void @_ZdaPv(ptr noundef %199) #10
  br label %202

202:                                              ; preds = %201, %198
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %295

203:                                              ; preds = %195
  %204 = load ptr, ptr %10, align 8, !tbaa !5
  %205 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %204, i32 0, i32 5
  %206 = load ptr, ptr %205, align 8, !tbaa !21
  %207 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %206, i32 0, i32 3
  %208 = load ptr, ptr %10, align 8, !tbaa !5
  %209 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %208, i32 0, i32 3
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %210, i32 0, i32 6
  %212 = load ptr, ptr %211, align 8, !tbaa !20
  %213 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %212, i32 0, i32 3
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %11, ptr noundef nonnull align 8 dereferenceable(24) %207, ptr noundef nonnull align 8 dereferenceable(24) %209, ptr noundef nonnull align 8 dereferenceable(24) %213)
          to label %214 unwind label %28

214:                                              ; preds = %203
  %215 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %215, ptr noundef nonnull align 8 dereferenceable(17) %11)
          to label %216 unwind label %28

216:                                              ; preds = %214
  %217 = load ptr, ptr %10, align 8, !tbaa !5
  %218 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %217, i32 0, i32 0
  store i8 0, ptr %218, align 8, !tbaa !11
  %219 = load ptr, ptr %10, align 8, !tbaa !5
  %220 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %219, i32 0, i32 6
  %221 = load ptr, ptr %220, align 8, !tbaa !20
  %222 = load ptr, ptr %10, align 8, !tbaa !5
  %223 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %222, i32 0, i32 5
  %224 = load ptr, ptr %223, align 8, !tbaa !21
  %225 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %224, i32 0, i32 6
  store ptr %221, ptr %225, align 8, !tbaa !20
  %226 = load ptr, ptr %10, align 8, !tbaa !5
  %227 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %226, i32 0, i32 5
  %228 = load ptr, ptr %227, align 8, !tbaa !21
  %229 = load ptr, ptr %10, align 8, !tbaa !5
  %230 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %229, i32 0, i32 6
  %231 = load ptr, ptr %230, align 8, !tbaa !20
  %232 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %231, i32 0, i32 5
  store ptr %228, ptr %232, align 8, !tbaa !21
  %233 = load i64, ptr %12, align 8, !tbaa !9
  %234 = load i64, ptr %8, align 8, !tbaa !9
  %235 = sub nsw i64 %234, 4
  %236 = icmp eq i64 %233, %235
  br i1 %236, label %237, label %238

237:                                              ; preds = %216
  br label %254

238:                                              ; preds = %216
  %239 = load ptr, ptr %10, align 8, !tbaa !5
  %240 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %239, i32 0, i32 5
  %241 = load ptr, ptr %240, align 8, !tbaa !21
  %242 = load ptr, ptr %9, align 8, !tbaa !5
  %243 = load i64, ptr %8, align 8, !tbaa !9
  invoke void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef %241, ptr noundef %242, i64 noundef %243)
          to label %244 unwind label %28

244:                                              ; preds = %238
  %245 = load ptr, ptr %10, align 8, !tbaa !5
  %246 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %245, i32 0, i32 6
  %247 = load ptr, ptr %246, align 8, !tbaa !20
  %248 = load ptr, ptr %9, align 8, !tbaa !5
  %249 = load i64, ptr %8, align 8, !tbaa !9
  invoke void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef %247, ptr noundef %248, i64 noundef %249)
          to label %250 unwind label %28

250:                                              ; preds = %244
  br label %251

251:                                              ; preds = %250
  %252 = load i64, ptr %12, align 8, !tbaa !9
  %253 = add nsw i64 %252, 1
  store i64 %253, ptr %12, align 8, !tbaa !9
  br label %143, !llvm.loop !31

254:                                              ; preds = %237, %143
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %255

255:                                              ; preds = %287, %254
  %256 = load i64, ptr %12, align 8, !tbaa !9
  %257 = load i64, ptr %8, align 8, !tbaa !9
  %258 = icmp slt i64 %256, %257
  br i1 %258, label %259, label %290

259:                                              ; preds = %255
  %260 = load ptr, ptr %9, align 8, !tbaa !5
  %261 = load i64, ptr %12, align 8, !tbaa !9
  %262 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %260, i64 %261
  %263 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %262, i32 0, i32 0
  %264 = load i8, ptr %263, align 8, !tbaa !11, !range !26, !noundef !27
  %265 = trunc i8 %264 to i1
  br i1 %265, label %266, label %286

266:                                              ; preds = %259
  %267 = load ptr, ptr %9, align 8, !tbaa !5
  %268 = load i64, ptr %12, align 8, !tbaa !9
  %269 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %267, i64 %268
  %270 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %269, i32 0, i32 5
  %271 = load ptr, ptr %270, align 8, !tbaa !21
  %272 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %271, i32 0, i32 3
  %273 = load ptr, ptr %9, align 8, !tbaa !5
  %274 = load i64, ptr %12, align 8, !tbaa !9
  %275 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %273, i64 %274
  %276 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %275, i32 0, i32 3
  %277 = load ptr, ptr %9, align 8, !tbaa !5
  %278 = load i64, ptr %12, align 8, !tbaa !9
  %279 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %277, i64 %278
  %280 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %279, i32 0, i32 6
  %281 = load ptr, ptr %280, align 8, !tbaa !20
  %282 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %281, i32 0, i32 3
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %11, ptr noundef nonnull align 8 dereferenceable(24) %272, ptr noundef nonnull align 8 dereferenceable(24) %276, ptr noundef nonnull align 8 dereferenceable(24) %282)
          to label %283 unwind label %28

283:                                              ; preds = %266
  %284 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %284, ptr noundef nonnull align 8 dereferenceable(17) %11)
          to label %285 unwind label %28

285:                                              ; preds = %283
  br label %290

286:                                              ; preds = %259
  br label %287

287:                                              ; preds = %286
  %288 = load i64, ptr %12, align 8, !tbaa !9
  %289 = add nsw i64 %288, 1
  store i64 %289, ptr %12, align 8, !tbaa !9
  br label %255, !llvm.loop !32

290:                                              ; preds = %285, %255
  %291 = load ptr, ptr %9, align 8, !tbaa !5
  %292 = icmp eq ptr %291, null
  br i1 %292, label %294, label %293

293:                                              ; preds = %290
  call void @_ZdaPv(ptr noundef %291) #10
  br label %294

294:                                              ; preds = %293, %290
  store i32 1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %295

295:                                              ; preds = %294, %202, %40, %27
  call void @llvm.lifetime.end.p0(i64 1, 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 @_ZN8TPPLPolyD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %11) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %297

296:                                              ; preds = %89, %28
  call void @llvm.lifetime.end.p0(i64 1, 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 @_ZN8TPPLPolyD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %11) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %299

297:                                              ; preds = %295, %21
  %298 = load i32, ptr %4, align 4
  ret i32 %298

299:                                              ; preds = %296
  %300 = load ptr, ptr %15, align 8
  %301 = load i32, ptr %16, align 4
  %302 = insertvalue { ptr, i32 } poison, ptr %300, 0
  %303 = insertvalue { ptr, i32 } %302, i32 %301, 1
  resume { ptr, i32 } %303
}

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #0

declare void @_ZN8TPPLPolyC1Ev(ptr)

declare void @_ZN8TPPLPolyD1Ev(ptr)

declare void @_ZN13TPPLPartition15PartitionVertexC1Ev(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 nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { 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 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN13TPPLPartition15PartitionVertexE", !13, i64 0, !13, i64 1, !13, i64 2, !14, i64 8, !15, i64 32, !6, i64 40, !6, i64 48}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTS9TPPLPoint", !15, i64 0, !15, i64 8, !16, i64 16}
!15 = !{!"double", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{i64 0, i64 8, !18, i64 8, i64 8, !18, i64 16, i64 4, !19}
!18 = !{!15, !15, i64 0}
!19 = !{!16, !16, i64 0}
!20 = !{!12, !6, i64 48}
!21 = !{!12, !6, i64 40}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!13, !13, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!12, !13, i64 2}
!29 = !{!12, !15, i64 32}
!30 = distinct !{!30, !23}
!31 = distinct !{!31, !23}
!32 = distinct !{!32, !23}


; 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.TPPLPartition::PartitionVertex" = type { i8, i8, i8, %struct.TPPLPoint, double, ptr, ptr }
%struct.TPPLPoint = type { double, double, i32 }

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

; Function Attrs: mustprogress 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) local_unnamed_addr #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)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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) #5

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

; 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 #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN13TPPLPartition14Triangulate_ECEP8TPPLPolyPNSt7__cxx114listIS0_SaIS0_EEE(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull %1, ptr noundef %2) local_unnamed_addr #3 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 %146

6:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  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 = icmp slt i64 %7, 3
  br i1 %8, label %145, label %9

.loopexit109:                                     ; preds = %111, %119, %126, %127
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

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

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

9:                                                ; preds = %6
  %10 = call noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %1)
  %11 = icmp eq i64 %10, 3
  br i1 %11, label %12, label %13

12:                                               ; preds = %9
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(17) %1)
          to label %145 unwind label %.loopexit.split-lp.loopexit.split-lp

13:                                               ; preds = %9
  %14 = call noundef i64 @_ZNK8TPPLPoly12GetNumPointsEv(ptr noundef nonnull align 8 dereferenceable(17) %1)
  %15 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %14, i64 56)
  %16 = extractvalue { i64, i1 } %15, 1
  %17 = extractvalue { i64, i1 } %15, 0
  %18 = select i1 %16, i64 -1, i64 %17
  %19 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %18) #9
          to label %20 unwind label %.loopexit.split-lp.loopexit.split-lp

20:                                               ; preds = %13
  %21 = icmp eq i64 %14, 0
  br i1 %21, label %.sink.split, label %22

22:                                               ; preds = %20
  %23 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i64 %14
  br label %24

24:                                               ; preds = %26, %22
  %25 = phi ptr [ %19, %22 ], [ %27, %26 ]
  invoke void @_ZN13TPPLPartition15PartitionVertexC1Ev(ptr noundef nonnull align 8 dereferenceable(56) %25)
          to label %26 unwind label %50

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %25, i64 56
  %28 = icmp eq ptr %27, %23
  br i1 %28, label %.loopexit114, label %24

.loopexit114:                                     ; preds = %26
  %29 = icmp sgt i64 %14, 0
  br i1 %29, label %.lr.ph, label %.sink.split

.lr.ph:                                           ; preds = %.loopexit114
  %30 = add nsw i64 %14, -1
  %31 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i64 %30
  store i8 1, ptr %19, align 8, !tbaa !5
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8TPPLPoly8GetPointEl(ptr noundef nonnull align 8 dereferenceable(17) %1, i64 noundef 0)
  %33 = getelementptr inbounds i8, ptr %19, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(24) %32, i64 24, i1 false), !tbaa.struct !14
  %34 = icmp eq i64 %30, 0
  br i1 %34, label %.preheader110.thread140, label %.peel.next

.preheader110.thread140:                          ; preds = %.lr.ph
  %35 = getelementptr inbounds i8, ptr %19, i64 48
  store ptr %19, ptr %35, align 8
  %36 = getelementptr inbounds i8, ptr %19, i64 40
  store ptr %31, ptr %36, align 8
  br label %.lr.ph117.preheader

.peel.next:                                       ; preds = %.lr.ph
  %37 = getelementptr inbounds i8, ptr %19, i64 56
  %38 = getelementptr inbounds i8, ptr %19, i64 48
  store ptr %37, ptr %38, align 8
  %39 = getelementptr inbounds i8, ptr %19, i64 40
  store ptr %31, ptr %39, align 8
  br label %40

.preheader110:                                    ; preds = %40
  br i1 %29, label %.lr.ph117.preheader, label %.preheader108

.lr.ph117.preheader:                              ; preds = %.preheader110.thread140, %.preheader110
  br label %.lr.ph117

40:                                               ; preds = %.peel.next, %40
  %.097115 = phi i64 [ 1, %.peel.next ], [ %49, %40 ]
  %41 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i64 %.097115
  store i8 1, ptr %41, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8TPPLPoly8GetPointEl(ptr noundef nonnull align 8 dereferenceable(17) %1, i64 noundef %.097115)
  %43 = getelementptr inbounds i8, ptr %41, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 8 dereferenceable(24) %42, i64 24, i1 false), !tbaa.struct !14
  %44 = icmp eq i64 %.097115, %30
  %45 = getelementptr inbounds i8, ptr %41, i64 56
  %spec.select = select i1 %44, ptr %19, ptr %45
  %46 = getelementptr inbounds i8, ptr %41, i64 48
  store ptr %spec.select, ptr %46, align 8
  %47 = getelementptr i8, ptr %41, i64 -56
  %48 = getelementptr inbounds i8, ptr %41, i64 40
  store ptr %47, ptr %48, align 8
  %49 = add nuw nsw i64 %.097115, 1
  %exitcond.not = icmp eq i64 %49, %14
  br i1 %exitcond.not, label %.preheader110, label %40, !llvm.loop !17

50:                                               ; preds = %24
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdaPvm(ptr noundef nonnull %19, i64 noundef %18) #10
  br label %.loopexit.split-lp

.preheader108:                                    ; preds = %57, %.preheader110
  %52 = phi i1 [ false, %.preheader110 ], [ true, %57 ]
  %53 = icmp sgt i64 %14, 3
  br i1 %53, label %.preheader.lr.ph, label %._crit_edge125

.preheader.lr.ph:                                 ; preds = %.preheader108
  %54 = add nsw i64 %14, -4
  %xtraiter = and i64 %14, 1
  %55 = icmp eq i64 %30, 0
  %unroll_iter = and i64 %14, 9223372036854775806
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph121.preheader

.lr.ph117:                                        ; preds = %.lr.ph117.preheader, %57
  %.198116 = phi i64 [ %58, %57 ], [ 0, %.lr.ph117.preheader ]
  %56 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i64 %.198116
  invoke void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull %56, ptr noundef nonnull %19, i64 noundef %14)
          to label %57 unwind label %.loopexit.split-lp.loopexit

57:                                               ; preds = %.lr.ph117
  %58 = add nuw nsw i64 %.198116, 1
  %exitcond132.not = icmp eq i64 %58, %14
  br i1 %exitcond132.not, label %.preheader108, label %.lr.ph117, !llvm.loop !20

.lr.ph121.preheader:                              ; preds = %.preheader.lr.ph, %129
  %.2124 = phi i64 [ 0, %.preheader.lr.ph ], [ %130, %129 ]
  %.099123 = phi ptr [ null, %.preheader.lr.ph ], [ %.2101.lcssa, %129 ]
  br i1 %55, label %._crit_edge.unr-lcssa, label %.lr.ph121

.lr.ph121:                                        ; preds = %.lr.ph121.preheader, %92
  %.095120 = phi i8 [ %.1.1, %92 ], [ 0, %.lr.ph121.preheader ]
  %.096119 = phi i64 [ %93, %92 ], [ 0, %.lr.ph121.preheader ]
  %.1100118 = phi ptr [ %.2101.1, %92 ], [ %.099123, %.lr.ph121.preheader ]
  %niter = phi i64 [ %niter.next.1, %92 ], [ 0, %.lr.ph121.preheader ]
  %59 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i64 %.096119
  %60 = load i8, ptr %59, align 8, !tbaa !5, !range !21, !noundef !22
  %61 = trunc nuw i8 %60 to i1
  br i1 %61, label %62, label %.lr.ph121.1

62:                                               ; preds = %.lr.ph121
  %63 = getelementptr inbounds i8, ptr %59, i64 2
  %64 = load i8, ptr %63, align 2, !tbaa !23, !range !21, !noundef !22
  %65 = trunc nuw i8 %64 to i1
  br i1 %65, label %66, label %.lr.ph121.1

66:                                               ; preds = %62
  %67 = trunc nuw i8 %.095120 to i1
  br i1 %67, label %68, label %.lr.ph121.1

68:                                               ; preds = %66
  %69 = getelementptr inbounds i8, ptr %59, i64 32
  %70 = load double, ptr %69, align 8, !tbaa !24
  %71 = getelementptr inbounds i8, ptr %.1100118, i64 32
  %72 = load double, ptr %71, align 8, !tbaa !24
  %73 = fcmp ogt double %70, %72
  br i1 %73, label %74, label %.lr.ph121.1

74:                                               ; preds = %68
  br label %.lr.ph121.1

.lr.ph121.1:                                      ; preds = %66, %74, %68, %62, %.lr.ph121
  %.2101 = phi ptr [ %59, %74 ], [ %.1100118, %68 ], [ %.1100118, %62 ], [ %.1100118, %.lr.ph121 ], [ %59, %66 ]
  %.1 = phi i8 [ %.095120, %74 ], [ %.095120, %68 ], [ %.095120, %62 ], [ %.095120, %.lr.ph121 ], [ 1, %66 ]
  %75 = or disjoint i64 %.096119, 1
  %76 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i64 %75
  %77 = load i8, ptr %76, align 8, !tbaa !5, !range !21, !noundef !22
  %78 = trunc nuw i8 %77 to i1
  br i1 %78, label %79, label %92

79:                                               ; preds = %.lr.ph121.1
  %80 = getelementptr inbounds i8, ptr %76, i64 2
  %81 = load i8, ptr %80, align 2, !tbaa !23, !range !21, !noundef !22
  %82 = trunc nuw i8 %81 to i1
  br i1 %82, label %83, label %92

83:                                               ; preds = %79
  %84 = trunc nuw i8 %.1 to i1
  br i1 %84, label %85, label %92

85:                                               ; preds = %83
  %86 = getelementptr inbounds i8, ptr %76, i64 32
  %87 = load double, ptr %86, align 8, !tbaa !24
  %88 = getelementptr inbounds i8, ptr %.2101, i64 32
  %89 = load double, ptr %88, align 8, !tbaa !24
  %90 = fcmp ogt double %87, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %85
  br label %92

92:                                               ; preds = %91, %85, %83, %79, %.lr.ph121.1
  %.2101.1 = phi ptr [ %76, %91 ], [ %.2101, %85 ], [ %.2101, %79 ], [ %.2101, %.lr.ph121.1 ], [ %76, %83 ]
  %.1.1 = phi i8 [ %.1, %91 ], [ %.1, %85 ], [ %.1, %79 ], [ %.1, %.lr.ph121.1 ], [ 1, %83 ]
  %93 = add nuw nsw i64 %.096119, 2
  %niter.next.1 = add nuw nsw i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa, label %.lr.ph121, !llvm.loop !25

._crit_edge.unr-lcssa:                            ; preds = %92, %.lr.ph121.preheader
  %.2101.lcssa.ph = phi ptr [ poison, %.lr.ph121.preheader ], [ %.2101.1, %92 ]
  %.1.lcssa.ph = phi i8 [ poison, %.lr.ph121.preheader ], [ %.1.1, %92 ]
  %.095120.unr = phi i8 [ 0, %.lr.ph121.preheader ], [ %.1.1, %92 ]
  %.096119.unr = phi i64 [ 0, %.lr.ph121.preheader ], [ %93, %92 ]
  %.1100118.unr = phi ptr [ %.099123, %.lr.ph121.preheader ], [ %.2101.1, %92 ]
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph121.epil

.lr.ph121.epil:                                   ; preds = %._crit_edge.unr-lcssa
  %94 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i64 %.096119.unr
  %95 = load i8, ptr %94, align 8, !tbaa !5, !range !21, !noundef !22
  %96 = trunc nuw i8 %95 to i1
  br i1 %96, label %97, label %._crit_edge

97:                                               ; preds = %.lr.ph121.epil
  %98 = getelementptr inbounds i8, ptr %94, i64 2
  %99 = load i8, ptr %98, align 2, !tbaa !23, !range !21, !noundef !22
  %100 = trunc nuw i8 %99 to i1
  br i1 %100, label %101, label %._crit_edge

101:                                              ; preds = %97
  %102 = trunc nuw i8 %.095120.unr to i1
  br i1 %102, label %103, label %._crit_edge

103:                                              ; preds = %101
  %104 = getelementptr inbounds i8, ptr %94, i64 32
  %105 = load double, ptr %104, align 8, !tbaa !24
  %106 = getelementptr inbounds i8, ptr %.1100118.unr, i64 32
  %107 = load double, ptr %106, align 8, !tbaa !24
  %108 = fcmp ogt double %105, %107
  br i1 %108, label %109, label %._crit_edge

109:                                              ; preds = %103
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph121.epil, %97, %101, %103, %109, %._crit_edge.unr-lcssa
  %.2101.lcssa = phi ptr [ %.2101.lcssa.ph, %._crit_edge.unr-lcssa ], [ %94, %109 ], [ %.1100118.unr, %103 ], [ %.1100118.unr, %97 ], [ %.1100118.unr, %.lr.ph121.epil ], [ %94, %101 ]
  %.1.lcssa = phi i8 [ %.1.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.095120.unr, %109 ], [ %.095120.unr, %103 ], [ %.095120.unr, %97 ], [ %.095120.unr, %.lr.ph121.epil ], [ 1, %101 ]
  %110 = trunc nuw i8 %.1.lcssa to i1
  br i1 %110, label %111, label %.sink.split

111:                                              ; preds = %._crit_edge
  %112 = getelementptr inbounds i8, ptr %.2101.lcssa, i64 40
  %113 = load ptr, ptr %112, align 8, !tbaa !26
  %114 = getelementptr inbounds i8, ptr %113, i64 8
  %115 = getelementptr inbounds i8, ptr %.2101.lcssa, i64 8
  %116 = getelementptr inbounds i8, ptr %.2101.lcssa, i64 48
  %117 = load ptr, ptr %116, align 8, !tbaa !27
  %118 = getelementptr inbounds i8, ptr %117, i64 8
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %4, ptr noundef nonnull align 8 dereferenceable(24) %114, ptr noundef nonnull align 8 dereferenceable(24) %115, ptr noundef nonnull align 8 dereferenceable(24) %118)
          to label %119 unwind label %.loopexit109

119:                                              ; preds = %111
  invoke void @_ZNSt7__cxx114listI8TPPLPolySaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(17) %4)
          to label %120 unwind label %.loopexit109

120:                                              ; preds = %119
  store i8 0, ptr %.2101.lcssa, align 8, !tbaa !5
  %121 = load ptr, ptr %116, align 8, !tbaa !27
  %122 = load ptr, ptr %112, align 8, !tbaa !26
  %123 = getelementptr inbounds i8, ptr %122, i64 48
  store ptr %121, ptr %123, align 8, !tbaa !27
  %124 = getelementptr inbounds i8, ptr %121, i64 40
  store ptr %122, ptr %124, align 8, !tbaa !26
  %125 = icmp eq i64 %.2124, %54
  br i1 %125, label %._crit_edge125, label %126

126:                                              ; preds = %120
  invoke void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull %122, ptr noundef nonnull %19, i64 noundef %14)
          to label %127 unwind label %.loopexit109

127:                                              ; preds = %126
  %128 = load ptr, ptr %116, align 8, !tbaa !27
  invoke void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef %128, ptr noundef nonnull %19, i64 noundef %14)
          to label %129 unwind label %.loopexit109

129:                                              ; preds = %127
  %130 = add nuw nsw i64 %.2124, 1
  br label %.lr.ph121.preheader

._crit_edge125:                                   ; preds = %120, %.preheader108
  br i1 %52, label %.lr.ph129, label %.sink.split

131:                                              ; preds = %.lr.ph129
  %132 = add nuw nsw i64 %.3127, 1
  %exitcond134.not = icmp eq i64 %132, %14
  br i1 %exitcond134.not, label %.sink.split, label %.lr.ph129, !llvm.loop !28

.lr.ph129:                                        ; preds = %._crit_edge125, %131
  %.3127 = phi i64 [ %132, %131 ], [ 0, %._crit_edge125 ]
  %133 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i64 %.3127
  %134 = load i8, ptr %133, align 8, !tbaa !5, !range !21, !noundef !22
  %135 = trunc nuw i8 %134 to i1
  br i1 %135, label %136, label %131

136:                                              ; preds = %.lr.ph129
  %137 = getelementptr inbounds i8, ptr %133, i64 40
  %138 = load ptr, ptr %137, align 8, !tbaa !26
  %139 = getelementptr inbounds i8, ptr %138, i64 8
  %140 = getelementptr inbounds i8, ptr %133, i64 8
  %141 = getelementptr inbounds i8, ptr %133, i64 48
  %142 = load ptr, ptr %141, align 8, !tbaa !27
  %143 = getelementptr inbounds i8, ptr %142, i64 8
  invoke void @_ZN8TPPLPoly8TriangleER9TPPLPointS1_S1_(ptr noundef nonnull align 8 dereferenceable(17) %4, ptr noundef nonnull align 8 dereferenceable(24) %139, ptr noundef nonnull align 8 dereferenceable(24) %140, ptr noundef nonnull align 8 dereferenceable(24) %143)
          to label %144 unwind label %.loopexit.split-lp.loopexit.split-lp

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

.sink.split:                                      ; preds = %._crit_edge, %131, %144, %._crit_edge125, %.loopexit114, %20
  %.0102.ph = phi i32 [ 1, %20 ], [ 1, %.loopexit114 ], [ 1, %._crit_edge125 ], [ 1, %144 ], [ 1, %131 ], [ 0, %._crit_edge ]
  call void @_ZdaPv(ptr noundef nonnull %19) #10
  br label %145

145:                                              ; preds = %.sink.split, %12, %6
  %.0102 = phi i32 [ 0, %6 ], [ 1, %12 ], [ %.0102.ph, %.sink.split ]
  call void @_ZN8TPPLPolyD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  br label %146

.loopexit.split-lp:                               ; preds = %.loopexit109, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %50
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %lpad.loopexit, %.loopexit109 ], [ %lpad.loopexit111, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp112, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN8TPPLPolyD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn

146:                                              ; preds = %3, %145
  %.1103 = phi i32 [ %.0102, %145 ], [ 0, %3 ]
  ret i32 %.1103
}

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

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

declare void @_ZN8TPPLPolyC1Ev(ptr) local_unnamed_addr

declare void @_ZN8TPPLPolyD1Ev(ptr) local_unnamed_addr

declare void @_ZN13TPPLPartition15PartitionVertexC1Ev(ptr) local_unnamed_addr

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 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { 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, !7, i64 0}
!6 = !{!"_ZTSN13TPPLPartition15PartitionVertexE", !7, i64 0, !7, i64 1, !7, i64 2, !10, i64 8, !11, i64 32, !13, i64 40, !13, i64 48}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS9TPPLPoint", !11, i64 0, !11, i64 8, !12, i64 16}
!11 = !{!"double", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{i64 0, i64 8, !15, i64 8, i64 8, !15, i64 16, i64 4, !16}
!15 = !{!11, !11, i64 0}
!16 = !{!12, !12, i64 0}
!17 = distinct !{!17, !18, !19}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.peeled.count", i32 1}
!20 = distinct !{!20, !18}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!6, !7, i64 2}
!24 = !{!6, !11, i64 32}
!25 = distinct !{!25, !18}
!26 = !{!6, !13, i64 40}
!27 = !{!6, !13, i64 48}
!28 = distinct !{!28, !18}


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