; LLVM IR from mackorone/mms :: old/v2/src/lib/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"

%struct.TPPLPoint = type { double, double }
%"struct.TPPLPartition::PartitionVertex" = type { i8, i8, i8, %struct.TPPLPoint, double, ptr, ptr }

; 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) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZNK9TPPLPointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #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(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) #3 align 2 {
  %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 ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.TPPLPoint, align 8
  %13 = alloca %struct.TPPLPoint, align 8
  %14 = alloca %struct.TPPLPoint, align 8
  %15 = alloca %struct.TPPLPoint, align 8
  %16 = alloca %struct.TPPLPoint, align 8
  %17 = alloca %struct.TPPLPoint, 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
  store i64 %3, ptr %8, align 8, !tbaa !9
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %19, i32 0, i32 5
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  store ptr %21, ptr %10, align 8, !tbaa !5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %22, i32 0, i32 6
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  store ptr %24, ptr %11, align 8, !tbaa !5
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %25, i32 0, i32 3
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %27, i32 0, i32 3
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %29, i32 0, i32 3
  %31 = call noundef zeroext i1 @_ZN13TPPLPartition8IsConvexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %30)
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %32, i32 0, i32 1
  %34 = zext i1 %31 to i8
  store i8 %34, ptr %33, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %35, i32 0, i32 3
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %37, i32 0, i32 3
  %39 = call { double, double } @_ZNK9TPPLPointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(16) %38)
  %40 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %41 = extractvalue { double, double } %39, 0
  store double %41, ptr %40, align 8
  %42 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %43 = extractvalue { double, double } %39, 1
  store double %43, ptr %42, align 8
  %44 = call { double, double } @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %45 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %46 = extractvalue { double, double } %44, 0
  store double %46, ptr %45, align 8
  %47 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %48 = extractvalue { double, double } %44, 1
  store double %48, ptr %47, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %14, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %49, i32 0, i32 3
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %51, i32 0, i32 3
  %53 = call { double, double } @_ZNK9TPPLPointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 8 dereferenceable(16) %52)
  %54 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %55 = extractvalue { double, double } %53, 0
  store double %55, ptr %54, align 8
  %56 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %57 = extractvalue { double, double } %53, 1
  store double %57, ptr %56, align 8
  %58 = call { double, double } @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 8 dereferenceable(16) %17)
  %59 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %60 = extractvalue { double, double } %58, 0
  store double %60, ptr %59, align 8
  %61 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %62 = extractvalue { double, double } %58, 1
  store double %62, ptr %61, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  %63 = getelementptr inbounds %struct.TPPLPoint, ptr %12, i32 0, i32 0
  %64 = load double, ptr %63, align 8, !tbaa !20
  %65 = getelementptr inbounds %struct.TPPLPoint, ptr %13, i32 0, i32 0
  %66 = load double, ptr %65, align 8, !tbaa !20
  %67 = getelementptr inbounds %struct.TPPLPoint, ptr %12, i32 0, i32 1
  %68 = load double, ptr %67, align 8, !tbaa !21
  %69 = getelementptr inbounds %struct.TPPLPoint, ptr %13, i32 0, i32 1
  %70 = load double, ptr %69, align 8, !tbaa !21
  %71 = fmul double %68, %70
  %72 = call double @llvm.fmuladd.f64(double %64, double %66, double %71)
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %73, i32 0, i32 4
  store double %72, ptr %74, align 8, !tbaa !22
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %75, i32 0, i32 1
  %77 = load i8, ptr %76, align 1, !tbaa !17, !range !23, !noundef !24
  %78 = trunc i8 %77 to i1
  br i1 %78, label %79, label %181

79:                                               ; preds = %4
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %80, i32 0, i32 2
  store i8 1, ptr %81, align 2, !tbaa !25
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %82

82:                                               ; preds = %177, %79
  %83 = load i64, ptr %9, align 8, !tbaa !9
  %84 = load i64, ptr %8, align 8, !tbaa !9
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %86, label %180

86:                                               ; preds = %82
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = load i64, ptr %9, align 8, !tbaa !9
  %89 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %87, i64 %88
  %90 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %89, i32 0, i32 3
  %91 = getelementptr inbounds %struct.TPPLPoint, ptr %90, i32 0, i32 0
  %92 = load double, ptr %91, align 8, !tbaa !26
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %93, i32 0, i32 3
  %95 = getelementptr inbounds %struct.TPPLPoint, ptr %94, i32 0, i32 0
  %96 = load double, ptr %95, align 8, !tbaa !26
  %97 = fcmp oeq double %92, %96
  br i1 %97, label %98, label %111

98:                                               ; preds = %86
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = load i64, ptr %9, align 8, !tbaa !9
  %101 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %99, i64 %100
  %102 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %101, i32 0, i32 3
  %103 = getelementptr inbounds %struct.TPPLPoint, ptr %102, i32 0, i32 1
  %104 = load double, ptr %103, align 8, !tbaa !27
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %105, i32 0, i32 3
  %107 = getelementptr inbounds %struct.TPPLPoint, ptr %106, i32 0, i32 1
  %108 = load double, ptr %107, align 8, !tbaa !27
  %109 = fcmp oeq double %104, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %98
  br label %177

111:                                              ; preds = %98, %86
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = load i64, ptr %9, align 8, !tbaa !9
  %114 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %112, i64 %113
  %115 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %114, i32 0, i32 3
  %116 = getelementptr inbounds %struct.TPPLPoint, ptr %115, i32 0, i32 0
  %117 = load double, ptr %116, align 8, !tbaa !26
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %118, i32 0, i32 3
  %120 = getelementptr inbounds %struct.TPPLPoint, ptr %119, i32 0, i32 0
  %121 = load double, ptr %120, align 8, !tbaa !26
  %122 = fcmp oeq double %117, %121
  br i1 %122, label %123, label %136

123:                                              ; preds = %111
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load i64, ptr %9, align 8, !tbaa !9
  %126 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %124, i64 %125
  %127 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %126, i32 0, i32 3
  %128 = getelementptr inbounds %struct.TPPLPoint, ptr %127, i32 0, i32 1
  %129 = load double, ptr %128, align 8, !tbaa !27
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %130, i32 0, i32 3
  %132 = getelementptr inbounds %struct.TPPLPoint, ptr %131, i32 0, i32 1
  %133 = load double, ptr %132, align 8, !tbaa !27
  %134 = fcmp oeq double %129, %133
  br i1 %134, label %135, label %136

135:                                              ; preds = %123
  br label %177

136:                                              ; preds = %123, %111
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = load i64, ptr %9, align 8, !tbaa !9
  %139 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %137, i64 %138
  %140 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %139, i32 0, i32 3
  %141 = getelementptr inbounds %struct.TPPLPoint, ptr %140, i32 0, i32 0
  %142 = load double, ptr %141, align 8, !tbaa !26
  %143 = load ptr, ptr %11, align 8, !tbaa !5
  %144 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %143, i32 0, i32 3
  %145 = getelementptr inbounds %struct.TPPLPoint, ptr %144, i32 0, i32 0
  %146 = load double, ptr %145, align 8, !tbaa !26
  %147 = fcmp oeq double %142, %146
  br i1 %147, label %148, label %161

148:                                              ; preds = %136
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = load i64, ptr %9, align 8, !tbaa !9
  %151 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %149, i64 %150
  %152 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %151, i32 0, i32 3
  %153 = getelementptr inbounds %struct.TPPLPoint, ptr %152, i32 0, i32 1
  %154 = load double, ptr %153, align 8, !tbaa !27
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %155, i32 0, i32 3
  %157 = getelementptr inbounds %struct.TPPLPoint, ptr %156, i32 0, i32 1
  %158 = load double, ptr %157, align 8, !tbaa !27
  %159 = fcmp oeq double %154, %158
  br i1 %159, label %160, label %161

160:                                              ; preds = %148
  br label %177

161:                                              ; preds = %148, %136
  %162 = load ptr, ptr %10, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %162, i32 0, i32 3
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %164, i32 0, i32 3
  %166 = load ptr, ptr %11, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %166, i32 0, i32 3
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = load i64, ptr %9, align 8, !tbaa !9
  %170 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %168, i64 %169
  %171 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %170, i32 0, i32 3
  %172 = call noundef zeroext i1 @_ZN13TPPLPartition8IsInsideER9TPPLPointS1_S1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 8 dereferenceable(16) %163, ptr noundef nonnull align 8 dereferenceable(16) %165, ptr noundef nonnull align 8 dereferenceable(16) %167, ptr noundef nonnull align 8 dereferenceable(16) %171)
  br i1 %172, label %173, label %176

173:                                              ; preds = %161
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %174, i32 0, i32 2
  store i8 0, ptr %175, align 2, !tbaa !25
  br label %180

176:                                              ; preds = %161
  br label %177

177:                                              ; preds = %176, %160, %135, %110
  %178 = load i64, ptr %9, align 8, !tbaa !9
  %179 = add nsw i64 %178, 1
  store i64 %179, ptr %9, align 8, !tbaa !9
  br label %82, !llvm.loop !28

180:                                              ; preds = %173, %82
  br label %184

181:                                              ; preds = %4
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %182, i32 0, i32 2
  store i8 0, ptr %183, align 2, !tbaa !25
  br label %184

184:                                              ; preds = %181, %180
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret void
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 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 = { 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, !6, i64 32}
!12 = !{!"_ZTSN13TPPLPartition15PartitionVertexE", !13, i64 0, !13, i64 1, !13, i64 2, !14, i64 8, !15, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTS9TPPLPoint", !15, i64 0, !15, i64 8}
!15 = !{!"double", !7, i64 0}
!16 = !{!12, !6, i64 40}
!17 = !{!12, !13, i64 1}
!18 = !{i64 0, i64 8, !19, i64 8, i64 8, !19}
!19 = !{!15, !15, i64 0}
!20 = !{!14, !15, i64 0}
!21 = !{!14, !15, i64 8}
!22 = !{!12, !15, i64 24}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!12, !13, i64 2}
!26 = !{!12, !15, i64 8}
!27 = !{!12, !15, i64 16}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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

%struct.TPPLPoint = type { double, double }
%"struct.TPPLPartition::PartitionVertex" = type { i8, i8, i8, %struct.TPPLPoint, double, ptr, ptr }

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZNK9TPPLPointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 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(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13TPPLPartition12UpdateVertexEPNS_15PartitionVertexES1_l(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %struct.TPPLPoint, align 8
  %6 = alloca %struct.TPPLPoint, align 8
  %7 = getelementptr inbounds i8, ptr %1, i64 32
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 40
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %8, i64 8
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = getelementptr inbounds i8, ptr %10, i64 8
  %14 = tail call noundef zeroext i1 @_ZN13TPPLPartition8IsConvexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %13)
  %15 = getelementptr inbounds i8, ptr %1, i64 1
  %16 = zext i1 %14 to i8
  store i8 %16, ptr %15, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  %17 = tail call { double, double } @_ZNK9TPPLPointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %18 = extractvalue { double, double } %17, 0
  store double %18, ptr %5, align 8
  %19 = getelementptr inbounds i8, ptr %5, i64 8
  %20 = extractvalue { double, double } %17, 1
  store double %20, ptr %19, align 8
  %21 = call { double, double } @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %22 = extractvalue { double, double } %21, 0
  %23 = extractvalue { double, double } %21, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %24 = call { double, double } @_ZNK9TPPLPointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %25 = extractvalue { double, double } %24, 0
  store double %25, ptr %6, align 8
  %26 = getelementptr inbounds i8, ptr %6, i64 8
  %27 = extractvalue { double, double } %24, 1
  store double %27, ptr %26, align 8
  %28 = call { double, double } @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %29 = extractvalue { double, double } %28, 0
  %30 = extractvalue { double, double } %28, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  %31 = fmul double %23, %30
  %32 = call double @llvm.fmuladd.f64(double %22, double %29, double %31)
  %33 = getelementptr inbounds i8, ptr %1, i64 24
  store double %32, ptr %33, align 8, !tbaa !15
  %34 = load i8, ptr %15, align 1, !tbaa !14, !range !16, !noundef !17
  %35 = trunc nuw i8 %34 to i1
  %36 = getelementptr inbounds i8, ptr %1, i64 2
  br i1 %35, label %37, label %.loopexit.sink.split

37:                                               ; preds = %4
  store i8 1, ptr %36, align 2, !tbaa !18
  %38 = icmp sgt i64 %3, 0
  br i1 %38, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %37
  %39 = getelementptr inbounds i8, ptr %1, i64 16
  %40 = getelementptr inbounds i8, ptr %8, i64 16
  %41 = getelementptr inbounds i8, ptr %10, i64 16
  br label %42

42:                                               ; preds = %.lr.ph, %70
  %.047 = phi i64 [ 0, %.lr.ph ], [ %71, %70 ]
  %43 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %2, i64 %.047, i32 3
  %44 = load double, ptr %43, align 8, !tbaa !19
  %45 = load double, ptr %12, align 8, !tbaa !19
  %46 = fcmp oeq double %44, %45
  br i1 %46, label %47, label %52

47:                                               ; preds = %42
  %48 = getelementptr inbounds i8, ptr %43, i64 8
  %49 = load double, ptr %48, align 8, !tbaa !20
  %50 = load double, ptr %39, align 8, !tbaa !20
  %51 = fcmp oeq double %49, %50
  br i1 %51, label %70, label %52

52:                                               ; preds = %47, %42
  %53 = load double, ptr %11, align 8, !tbaa !19
  %54 = fcmp oeq double %44, %53
  br i1 %54, label %55, label %60

55:                                               ; preds = %52
  %56 = getelementptr inbounds i8, ptr %43, i64 8
  %57 = load double, ptr %56, align 8, !tbaa !20
  %58 = load double, ptr %40, align 8, !tbaa !20
  %59 = fcmp oeq double %57, %58
  br i1 %59, label %70, label %60

60:                                               ; preds = %55, %52
  %61 = load double, ptr %13, align 8, !tbaa !19
  %62 = fcmp oeq double %44, %61
  br i1 %62, label %63, label %68

63:                                               ; preds = %60
  %64 = getelementptr inbounds i8, ptr %43, i64 8
  %65 = load double, ptr %64, align 8, !tbaa !20
  %66 = load double, ptr %41, align 8, !tbaa !20
  %67 = fcmp oeq double %65, %66
  br i1 %67, label %70, label %68

68:                                               ; preds = %63, %60
  %69 = call noundef zeroext i1 @_ZN13TPPLPartition8IsInsideER9TPPLPointS1_S1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %43)
  br i1 %69, label %.loopexit.sink.split, label %70

70:                                               ; preds = %68, %63, %55, %47
  %71 = add nuw nsw i64 %.047, 1
  %exitcond.not = icmp eq i64 %71, %3
  br i1 %exitcond.not, label %.loopexit, label %42, !llvm.loop !21

.loopexit.sink.split:                             ; preds = %68, %4
  store i8 0, ptr %36, align 2, !tbaa !18
  br label %.loopexit

.loopexit:                                        ; preds = %70, %.loopexit.sink.split, %37
  ret void
}

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass