; 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"

%struct.TPPLPoint = type { double, double, i32 }
%"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 void @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr dead_on_unwind noalias writable sret(%struct.TPPLPoint) align 8, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK9TPPLPointmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.TPPLPoint) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #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)) #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(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #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
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 24, 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 !17
  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(24) %26, ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(24) %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 !18
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 24, 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
  call void @_ZNK9TPPLPointmiERKS_(ptr dead_on_unwind writable sret(%struct.TPPLPoint) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(24) %38)
  call void @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr dead_on_unwind writable sret(%struct.TPPLPoint) align 8 %14, ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %14, i64 24, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #5
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %41, i32 0, i32 3
  call void @_ZNK9TPPLPointmiERKS_(ptr dead_on_unwind writable sret(%struct.TPPLPoint) align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(24) %42)
  call void @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr dead_on_unwind writable sret(%struct.TPPLPoint) align 8 %16, ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 8 dereferenceable(24) %17)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  %43 = getelementptr inbounds %struct.TPPLPoint, ptr %12, i32 0, i32 0
  %44 = load double, ptr %43, align 8, !tbaa !22
  %45 = getelementptr inbounds %struct.TPPLPoint, ptr %13, i32 0, i32 0
  %46 = load double, ptr %45, align 8, !tbaa !22
  %47 = getelementptr inbounds %struct.TPPLPoint, ptr %12, i32 0, i32 1
  %48 = load double, ptr %47, align 8, !tbaa !23
  %49 = getelementptr inbounds %struct.TPPLPoint, ptr %13, i32 0, i32 1
  %50 = load double, ptr %49, align 8, !tbaa !23
  %51 = fmul double %48, %50
  %52 = call double @llvm.fmuladd.f64(double %44, double %46, double %51)
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %53, i32 0, i32 4
  store double %52, ptr %54, align 8, !tbaa !24
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %55, i32 0, i32 1
  %57 = load i8, ptr %56, align 1, !tbaa !18, !range !25, !noundef !26
  %58 = trunc i8 %57 to i1
  br i1 %58, label %59, label %161

59:                                               ; preds = %4
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %60, i32 0, i32 2
  store i8 1, ptr %61, align 2, !tbaa !27
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %157, %59
  %63 = load i64, ptr %9, align 8, !tbaa !9
  %64 = load i64, ptr %8, align 8, !tbaa !9
  %65 = icmp slt i64 %63, %64
  br i1 %65, label %66, label %160

66:                                               ; preds = %62
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load i64, ptr %9, align 8, !tbaa !9
  %69 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %67, i64 %68
  %70 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %69, i32 0, i32 3
  %71 = getelementptr inbounds %struct.TPPLPoint, ptr %70, i32 0, i32 0
  %72 = load double, ptr %71, align 8, !tbaa !28
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %73, i32 0, i32 3
  %75 = getelementptr inbounds %struct.TPPLPoint, ptr %74, i32 0, i32 0
  %76 = load double, ptr %75, align 8, !tbaa !28
  %77 = fcmp oeq double %72, %76
  br i1 %77, label %78, label %91

78:                                               ; preds = %66
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load i64, ptr %9, align 8, !tbaa !9
  %81 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %79, i64 %80
  %82 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %81, i32 0, i32 3
  %83 = getelementptr inbounds %struct.TPPLPoint, ptr %82, i32 0, i32 1
  %84 = load double, ptr %83, align 8, !tbaa !29
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %85, i32 0, i32 3
  %87 = getelementptr inbounds %struct.TPPLPoint, ptr %86, i32 0, i32 1
  %88 = load double, ptr %87, align 8, !tbaa !29
  %89 = fcmp oeq double %84, %88
  br i1 %89, label %90, label %91

90:                                               ; preds = %78
  br label %157

91:                                               ; preds = %78, %66
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = load i64, ptr %9, align 8, !tbaa !9
  %94 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %92, i64 %93
  %95 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %94, i32 0, i32 3
  %96 = getelementptr inbounds %struct.TPPLPoint, ptr %95, i32 0, i32 0
  %97 = load double, ptr %96, align 8, !tbaa !28
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %98, i32 0, i32 3
  %100 = getelementptr inbounds %struct.TPPLPoint, ptr %99, i32 0, i32 0
  %101 = load double, ptr %100, align 8, !tbaa !28
  %102 = fcmp oeq double %97, %101
  br i1 %102, label %103, label %116

103:                                              ; preds = %91
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = load i64, ptr %9, align 8, !tbaa !9
  %106 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %104, i64 %105
  %107 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %106, i32 0, i32 3
  %108 = getelementptr inbounds %struct.TPPLPoint, ptr %107, i32 0, i32 1
  %109 = load double, ptr %108, align 8, !tbaa !29
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %110, i32 0, i32 3
  %112 = getelementptr inbounds %struct.TPPLPoint, ptr %111, i32 0, i32 1
  %113 = load double, ptr %112, align 8, !tbaa !29
  %114 = fcmp oeq double %109, %113
  br i1 %114, label %115, label %116

115:                                              ; preds = %103
  br label %157

116:                                              ; preds = %103, %91
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = load i64, ptr %9, align 8, !tbaa !9
  %119 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %117, i64 %118
  %120 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %119, i32 0, i32 3
  %121 = getelementptr inbounds %struct.TPPLPoint, ptr %120, i32 0, i32 0
  %122 = load double, ptr %121, align 8, !tbaa !28
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %123, i32 0, i32 3
  %125 = getelementptr inbounds %struct.TPPLPoint, ptr %124, i32 0, i32 0
  %126 = load double, ptr %125, align 8, !tbaa !28
  %127 = fcmp oeq double %122, %126
  br i1 %127, label %128, label %141

128:                                              ; preds = %116
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load i64, ptr %9, align 8, !tbaa !9
  %131 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %129, i64 %130
  %132 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %131, i32 0, i32 3
  %133 = getelementptr inbounds %struct.TPPLPoint, ptr %132, i32 0, i32 1
  %134 = load double, ptr %133, align 8, !tbaa !29
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %135, i32 0, i32 3
  %137 = getelementptr inbounds %struct.TPPLPoint, ptr %136, i32 0, i32 1
  %138 = load double, ptr %137, align 8, !tbaa !29
  %139 = fcmp oeq double %134, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %128
  br label %157

141:                                              ; preds = %128, %116
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %142, i32 0, i32 3
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %144, i32 0, i32 3
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %146, i32 0, i32 3
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = load i64, ptr %9, align 8, !tbaa !9
  %150 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %148, i64 %149
  %151 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %150, i32 0, i32 3
  %152 = call noundef zeroext i1 @_ZN13TPPLPartition8IsInsideER9TPPLPointS1_S1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 8 dereferenceable(24) %143, ptr noundef nonnull align 8 dereferenceable(24) %145, ptr noundef nonnull align 8 dereferenceable(24) %147, ptr noundef nonnull align 8 dereferenceable(24) %151)
  br i1 %152, label %153, label %156

153:                                              ; preds = %141
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %154, i32 0, i32 2
  store i8 0, ptr %155, align 2, !tbaa !27
  br label %160

156:                                              ; preds = %141
  br label %157

157:                                              ; preds = %156, %140, %115, %90
  %158 = load i64, ptr %9, align 8, !tbaa !9
  %159 = add nsw i64 %158, 1
  store i64 %159, ptr %9, align 8, !tbaa !9
  br label %62, !llvm.loop !30

160:                                              ; preds = %153, %62
  br label %164

161:                                              ; preds = %4
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %162, i32 0, i32 2
  store i8 0, ptr %163, align 2, !tbaa !27
  br label %164

164:                                              ; preds = %161, %160
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 24, 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 40}
!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 = !{!12, !6, i64 48}
!18 = !{!12, !13, i64 1}
!19 = !{i64 0, i64 8, !20, i64 8, i64 8, !20, i64 16, i64 4, !21}
!20 = !{!15, !15, i64 0}
!21 = !{!16, !16, i64 0}
!22 = !{!14, !15, i64 0}
!23 = !{!14, !15, i64 8}
!24 = !{!12, !15, i64 32}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!12, !13, i64 2}
!28 = !{!12, !15, i64 8}
!29 = !{!12, !15, i64 16}
!30 = distinct !{!30, !31}
!31 = !{!"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, i32 }
%"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 void @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr dead_on_unwind noalias writable sret(%struct.TPPLPoint) align 8, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK9TPPLPointmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.TPPLPoint) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) 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(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) 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(24), 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 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 = alloca %struct.TPPLPoint, align 8
  %8 = alloca %struct.TPPLPoint, align 8
  %9 = getelementptr inbounds i8, ptr %1, i64 40
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 48
  %12 = load ptr, ptr %11, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %10, i64 8
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = getelementptr inbounds i8, ptr %12, i64 8
  %16 = tail call noundef zeroext i1 @_ZN13TPPLPartition8IsConvexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %15)
  %17 = getelementptr inbounds i8, ptr %1, i64 1
  %18 = zext i1 %16 to i8
  store i8 %18, ptr %17, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  call void @_ZNK9TPPLPointmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.TPPLPoint) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr dead_on_unwind nonnull writable sret(%struct.TPPLPoint) align 8 %5, ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %.sroa.01.0.copyload = load double, ptr %5, align 8, !tbaa !16
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %.sroa.42.0.copyload = load double, ptr %.sroa.42.0..sroa_idx, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  call void @_ZNK9TPPLPointmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.TPPLPoint) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @_ZN13TPPLPartition9NormalizeERK9TPPLPoint(ptr dead_on_unwind nonnull writable sret(%struct.TPPLPoint) align 8 %7, ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %8)
  %.sroa.0.0.copyload = load double, ptr %7, align 8, !tbaa !16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  %.sroa.4.0.copyload = load double, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %19 = fmul double %.sroa.42.0.copyload, %.sroa.4.0.copyload
  %20 = call double @llvm.fmuladd.f64(double %.sroa.01.0.copyload, double %.sroa.0.0.copyload, double %19)
  %21 = getelementptr inbounds i8, ptr %1, i64 32
  store double %20, ptr %21, align 8, !tbaa !17
  %22 = load i8, ptr %17, align 1, !tbaa !15, !range !18, !noundef !19
  %23 = trunc nuw i8 %22 to i1
  %24 = getelementptr inbounds i8, ptr %1, i64 2
  br i1 %23, label %25, label %.loopexit.sink.split

25:                                               ; preds = %4
  store i8 1, ptr %24, align 2, !tbaa !20
  %26 = icmp sgt i64 %3, 0
  br i1 %26, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %25
  %27 = getelementptr inbounds i8, ptr %1, i64 16
  %28 = getelementptr inbounds i8, ptr %10, i64 16
  %29 = getelementptr inbounds i8, ptr %12, i64 16
  br label %30

30:                                               ; preds = %.lr.ph, %58
  %.044 = phi i64 [ 0, %.lr.ph ], [ %59, %58 ]
  %31 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %2, i64 %.044, i32 3
  %32 = load double, ptr %31, align 8, !tbaa !21
  %33 = load double, ptr %14, align 8, !tbaa !21
  %34 = fcmp oeq double %32, %33
  br i1 %34, label %35, label %40

35:                                               ; preds = %30
  %36 = getelementptr inbounds i8, ptr %31, i64 8
  %37 = load double, ptr %36, align 8, !tbaa !22
  %38 = load double, ptr %27, align 8, !tbaa !22
  %39 = fcmp oeq double %37, %38
  br i1 %39, label %58, label %40

40:                                               ; preds = %35, %30
  %41 = load double, ptr %13, align 8, !tbaa !21
  %42 = fcmp oeq double %32, %41
  br i1 %42, label %43, label %48

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %31, i64 8
  %45 = load double, ptr %44, align 8, !tbaa !22
  %46 = load double, ptr %28, align 8, !tbaa !22
  %47 = fcmp oeq double %45, %46
  br i1 %47, label %58, label %48

48:                                               ; preds = %43, %40
  %49 = load double, ptr %15, align 8, !tbaa !21
  %50 = fcmp oeq double %32, %49
  br i1 %50, label %51, label %56

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %31, i64 8
  %53 = load double, ptr %52, align 8, !tbaa !22
  %54 = load double, ptr %29, align 8, !tbaa !22
  %55 = fcmp oeq double %53, %54
  br i1 %55, label %58, label %56

56:                                               ; preds = %51, %48
  %57 = call noundef zeroext i1 @_ZN13TPPLPartition8IsInsideER9TPPLPointS1_S1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %31)
  br i1 %57, label %.loopexit.sink.split, label %58

58:                                               ; preds = %56, %51, %43, %35
  %59 = add nuw nsw i64 %.044, 1
  %exitcond.not = icmp eq i64 %59, %3
  br i1 %exitcond.not, label %.loopexit, label %30, !llvm.loop !23

.loopexit.sink.split:                             ; preds = %56, %4
  store i8 0, ptr %24, align 2, !tbaa !20
  br label %.loopexit

.loopexit:                                        ; preds = %58, %.loopexit.sink.split, %25
  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, !13, i64 40}
!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 = !{!6, !13, i64 48}
!15 = !{!6, !7, i64 1}
!16 = !{!11, !11, i64 0}
!17 = !{!6, !11, i64 32}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!6, !7, i64 2}
!21 = !{!6, !11, i64 8}
!22 = !{!6, !11, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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