; 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.std::_List_iterator.5" = type { ptr }
%"struct.TPPLPartition::DPState2" = type { i8, i64, %"class.std::__cxx11::list.0" }
%"class.std::__cxx11::list.0" = type { %"class.std::__cxx11::_List_base.1" }
%"class.std::__cxx11::_List_base.1" = type { %"struct.std::__cxx11::_List_base<TPPLPartition::Diagonal, std::allocator<TPPLPartition::Diagonal>>::_List_impl" }
%"struct.std::__cxx11::_List_base<TPPLPartition::Diagonal, std::allocator<TPPLPartition::Diagonal>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"struct.TPPLPartition::PartitionVertex" = type { i8, i8, i8, %struct.TPPLPoint, double, ptr, ptr }
%struct.TPPLPoint = type { double, double, i32 }
%"struct.TPPLPartition::Diagonal" = type { i64, i64 }

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_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)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13TPPLPartition5TypeBElllPNS_15PartitionVertexEPPNS_8DPState2E(ptr noundef nonnull align 1 dereferenceable(1) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5) #3 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.std::_List_iterator.5", align 8
  %15 = alloca %"struct.std::_List_iterator.5", align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::_List_iterator.5", align 8
  %20 = alloca %"struct.std::_List_iterator.5", align 8
  %21 = alloca %"struct.std::_List_iterator.5", align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store i64 %2, ptr %9, align 8, !tbaa !9
  store i64 %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %23 = load ptr, ptr %12, align 8, !tbaa !5
  %24 = load i64, ptr %9, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %23, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = load i64, ptr %10, align 8, !tbaa !9
  %28 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %26, i64 %27
  %29 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %28, i32 0, i32 0
  %30 = load i8, ptr %29, align 8, !tbaa !11, !range !19, !noundef !20
  %31 = trunc i8 %30 to i1
  br i1 %31, label %33, label %32

32:                                               ; preds = %6
  store i32 1, ptr %18, align 4
  br label %166

33:                                               ; preds = %6
  %34 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %34, ptr %16, align 8, !tbaa !9
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = load i64, ptr %9, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %35, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = load i64, ptr %10, align 8, !tbaa !9
  %40 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %38, i64 %39
  %41 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %40, i32 0, i32 1
  %42 = load i64, ptr %41, align 8, !tbaa !21
  store i64 %42, ptr %17, align 8, !tbaa !9
  %43 = load i64, ptr %9, align 8, !tbaa !9
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = sub nsw i64 %43, %44
  %46 = icmp sgt i64 %45, 1
  br i1 %46, label %47, label %70

47:                                               ; preds = %33
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = load i64, ptr %8, align 8, !tbaa !9
  %50 = getelementptr inbounds ptr, ptr %48, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = load i64, ptr %9, align 8, !tbaa !9
  %53 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %51, i64 %52
  %54 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %53, i32 0, i32 0
  %55 = load i8, ptr %54, align 8, !tbaa !11, !range !19, !noundef !20
  %56 = trunc i8 %55 to i1
  br i1 %56, label %58, label %57

57:                                               ; preds = %47
  store i32 1, ptr %18, align 4
  br label %166

58:                                               ; preds = %47
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = load i64, ptr %8, align 8, !tbaa !9
  %61 = getelementptr inbounds ptr, ptr %59, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = load i64, ptr %9, align 8, !tbaa !9
  %64 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %62, i64 %63
  %65 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %64, i32 0, i32 1
  %66 = load i64, ptr %65, align 8, !tbaa !21
  %67 = add nsw i64 %66, 1
  %68 = load i64, ptr %17, align 8, !tbaa !9
  %69 = add nsw i64 %68, %67
  store i64 %69, ptr %17, align 8, !tbaa !9
  br label %70

70:                                               ; preds = %58, %33
  %71 = load i64, ptr %10, align 8, !tbaa !9
  %72 = load i64, ptr %9, align 8, !tbaa !9
  %73 = sub nsw i64 %71, %72
  %74 = icmp sgt i64 %73, 1
  br i1 %74, label %75, label %159

75:                                               ; preds = %70
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = load i64, ptr %9, align 8, !tbaa !9
  %78 = getelementptr inbounds ptr, ptr %76, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = load i64, ptr %10, align 8, !tbaa !9
  %81 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %79, i64 %80
  %82 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %81, i32 0, i32 2
  store ptr %82, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #4
  %85 = getelementptr inbounds %"struct.std::_List_iterator.5", ptr %19, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = call noundef zeroext i1 @_ZNKSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #4
  br i1 %87, label %155, label %88

88:                                               ; preds = %75
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load i64, ptr %8, align 8, !tbaa !9
  %91 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %89, i64 %90
  %92 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %91, i32 0, i32 3
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = load i64, ptr %9, align 8, !tbaa !9
  %95 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %93, i64 %94
  %96 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %99 = getelementptr inbounds %"struct.TPPLPartition::Diagonal", ptr %98, i32 0, i32 0
  %100 = load i64, ptr %99, align 8, !tbaa !23
  %101 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %97, i64 %100
  %102 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %101, i32 0, i32 3
  %103 = call noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %22, ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 8 dereferenceable(24) %102)
  br i1 %103, label %155, label %104

104:                                              ; preds = %88
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %14, i64 8, i1 false), !tbaa.struct !22
  br label %105

105:                                              ; preds = %130, %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %106) #4
  %108 = getelementptr inbounds %"struct.std::_List_iterator.5", ptr %20, i32 0, i32 0
  store ptr %107, ptr %108, align 8
  %109 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN13TPPLPartition8DiagonalEES4_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br i1 %109, label %110, label %131

110:                                              ; preds = %105
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load i64, ptr %8, align 8, !tbaa !9
  %113 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %111, i64 %112
  %114 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %113, i32 0, i32 3
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = load i64, ptr %9, align 8, !tbaa !9
  %117 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %115, i64 %116
  %118 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %117, i32 0, i32 3
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %121 = getelementptr inbounds %"struct.TPPLPartition::Diagonal", ptr %120, i32 0, i32 0
  %122 = load i64, ptr %121, align 8, !tbaa !23
  %123 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %119, i64 %122
  %124 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %123, i32 0, i32 3
  %125 = call noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %22, ptr noundef nonnull align 8 dereferenceable(24) %114, ptr noundef nonnull align 8 dereferenceable(24) %118, ptr noundef nonnull align 8 dereferenceable(24) %124)
  br i1 %125, label %129, label %126

126:                                              ; preds = %110
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %14, i64 8, i1 false), !tbaa.struct !22
  %127 = call ptr @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 0) #4
  %128 = getelementptr inbounds %"struct.std::_List_iterator.5", ptr %21, i32 0, i32 0
  store ptr %127, ptr %128, align 8
  br label %130

129:                                              ; preds = %110
  br label %131

130:                                              ; preds = %126
  br label %105, !llvm.loop !25

131:                                              ; preds = %129, %105
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  %134 = getelementptr inbounds %"struct.TPPLPartition::Diagonal", ptr %133, i32 0, i32 1
  %135 = load i64, ptr %134, align 8, !tbaa !27
  %136 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %132, i64 %135
  %137 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %136, i32 0, i32 3
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = load i64, ptr %10, align 8, !tbaa !9
  %140 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %138, i64 %139
  %141 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %140, i32 0, i32 3
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = load i64, ptr %8, align 8, !tbaa !9
  %144 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %142, i64 %143
  %145 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %144, i32 0, i32 3
  %146 = call noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %22, ptr noundef nonnull align 8 dereferenceable(24) %137, ptr noundef nonnull align 8 dereferenceable(24) %141, ptr noundef nonnull align 8 dereferenceable(24) %145)
  br i1 %146, label %147, label %150

147:                                              ; preds = %131
  %148 = load i64, ptr %17, align 8, !tbaa !9
  %149 = add nsw i64 %148, 1
  store i64 %149, ptr %17, align 8, !tbaa !9
  br label %154

150:                                              ; preds = %131
  %151 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  %152 = getelementptr inbounds %"struct.TPPLPartition::Diagonal", ptr %151, i32 0, i32 1
  %153 = load i64, ptr %152, align 8, !tbaa !27
  store i64 %153, ptr %16, align 8, !tbaa !9
  br label %154

154:                                              ; preds = %150, %147
  br label %158

155:                                              ; preds = %88, %75
  %156 = load i64, ptr %17, align 8, !tbaa !9
  %157 = add nsw i64 %156, 1
  store i64 %157, ptr %17, align 8, !tbaa !9
  br label %158

158:                                              ; preds = %155, %154
  br label %159

159:                                              ; preds = %158, %70
  %160 = load i64, ptr %8, align 8, !tbaa !9
  %161 = load i64, ptr %10, align 8, !tbaa !9
  %162 = load i64, ptr %17, align 8, !tbaa !9
  %163 = load i64, ptr %9, align 8, !tbaa !9
  %164 = load i64, ptr %16, align 8, !tbaa !9
  %165 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN13TPPLPartition11UpdateStateElllllPPNS_8DPState2E(ptr noundef nonnull align 1 dereferenceable(1) %22, i64 noundef %160, i64 noundef %161, i64 noundef %162, i64 noundef %163, i64 noundef %164, ptr noundef %165)
  store i32 0, ptr %18, align 4
  br label %166

166:                                              ; preds = %159, %57, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  %167 = load i32, ptr %18, align 4
  switch i32 %167, label %169 [
    i32 0, label %168
    i32 1, label %168
  ]

168:                                              ; preds = %166, %166
  ret void

169:                                              ; preds = %166
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = !{!"_ZTSN13TPPLPartition8DPState2E", !13, i64 0, !10, i64 8, !14, i64 16}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EEE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1110_List_baseIN13TPPLPartition8DiagonalESaIS2_EEE", !16, i64 0}
!16 = !{!"_ZTSNSt7__cxx1110_List_baseIN13TPPLPartition8DiagonalESaIS2_EE10_List_implE", !17, i64 0}
!17 = !{!"_ZTSNSt8__detail17_List_node_headerE", !18, i64 0, !10, i64 16}
!18 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!12, !10, i64 8}
!22 = !{i64 0, i64 8, !5}
!23 = !{!24, !10, i64 0}
!24 = !{!"_ZTSN13TPPLPartition8DiagonalE", !10, i64 0, !10, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!24, !10, i64 8}


; 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.std::_List_iterator.5" = type { ptr }
%"struct.TPPLPartition::DPState2" = type { i8, i64, %"class.std::__cxx11::list.0" }
%"class.std::__cxx11::list.0" = type { %"class.std::__cxx11::_List_base.1" }
%"class.std::__cxx11::_List_base.1" = type { %"struct.std::__cxx11::_List_base<TPPLPartition::Diagonal, std::allocator<TPPLPartition::Diagonal>>::_List_impl" }
%"struct.std::__cxx11::_List_base<TPPLPartition::Diagonal, std::allocator<TPPLPartition::Diagonal>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"struct.TPPLPartition::PartitionVertex" = type { i8, i8, i8, %struct.TPPLPoint, double, ptr, ptr }
%struct.TPPLPoint = type { double, double, i32 }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_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 #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13TPPLPartition5TypeBElllPNS_15PartitionVertexEPPNS_8DPState2E(ptr noundef nonnull align 1 dereferenceable(1) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #2 align 2 {
  %7 = alloca %"struct.std::_List_iterator.5", align 8
  %8 = alloca %"struct.std::_List_iterator.5", align 8
  %9 = alloca %"struct.std::_List_iterator.5", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  %10 = getelementptr inbounds ptr, ptr %5, i64 %2
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %11, i64 %3
  %13 = load i8, ptr %12, align 8, !tbaa !9, !range !18, !noundef !19
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %15, label %73

15:                                               ; preds = %6
  %16 = getelementptr inbounds i8, ptr %12, i64 8
  %17 = load i64, ptr %16, align 8, !tbaa !20
  %18 = sub nsw i64 %2, %1
  %19 = icmp sgt i64 %18, 1
  br i1 %19, label %20, label %31

20:                                               ; preds = %15
  %21 = getelementptr inbounds ptr, ptr %5, i64 %1
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %22, i64 %2
  %24 = load i8, ptr %23, align 8, !tbaa !9, !range !18, !noundef !19
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %73

26:                                               ; preds = %20
  %27 = getelementptr inbounds i8, ptr %23, i64 8
  %28 = load i64, ptr %27, align 8, !tbaa !20
  %29 = add i64 %17, 1
  %30 = add i64 %29, %28
  br label %31

31:                                               ; preds = %26, %15
  %.048 = phi i64 [ %30, %26 ], [ %17, %15 ]
  %32 = sub nsw i64 %3, %2
  %33 = icmp sgt i64 %32, 1
  br i1 %33, label %34, label %72

34:                                               ; preds = %31
  %35 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %11, i64 %3, i32 2
  %36 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #3
  store ptr %36, ptr %7, align 8, !tbaa !5
  %37 = call noundef zeroext i1 @_ZNKSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #3
  br i1 %37, label %70, label %38

38:                                               ; preds = %34
  %39 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %4, i64 %1, i32 3
  %40 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %4, i64 %2, i32 3
  %41 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  %42 = load i64, ptr %41, align 8, !tbaa !21
  %43 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %4, i64 %42, i32 3
  %44 = call noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(24) %43)
  br i1 %44, label %70, label %45

45:                                               ; preds = %38
  %46 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %46, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %47 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #3
  store ptr %47, ptr %9, align 8
  %48 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN13TPPLPartition8DiagonalEES4_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  br i1 %48, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %45, %53
  %49 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  %50 = load i64, ptr %49, align 8, !tbaa !21
  %51 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %4, i64 %50, i32 3
  %52 = call noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(24) %51)
  br i1 %52, label %._crit_edge, label %53

53:                                               ; preds = %.lr.ph
  %54 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %54, ptr %8, align 8, !tbaa !5
  %55 = call ptr @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %56 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #3
  store ptr %56, ptr %9, align 8
  %57 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN13TPPLPartition8DiagonalEES4_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  br i1 %57, label %.lr.ph, label %._crit_edge, !llvm.loop !23

._crit_edge:                                      ; preds = %53, %.lr.ph, %45
  %58 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load i64, ptr %59, align 8, !tbaa !25
  %61 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %4, i64 %60, i32 3
  %62 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %4, i64 %3, i32 3
  %63 = call noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 8 dereferenceable(24) %39)
  br i1 %63, label %64, label %66

64:                                               ; preds = %._crit_edge
  %65 = add nsw i64 %.048, 1
  br label %72

66:                                               ; preds = %._crit_edge
  %67 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %69 = load i64, ptr %68, align 8, !tbaa !25
  br label %72

70:                                               ; preds = %38, %34
  %71 = add nsw i64 %.048, 1
  br label %72

72:                                               ; preds = %70, %66, %64, %31
  %.1 = phi i64 [ %71, %70 ], [ %65, %64 ], [ %.048, %66 ], [ %.048, %31 ]
  %.0 = phi i64 [ %2, %70 ], [ %2, %64 ], [ %69, %66 ], [ %2, %31 ]
  call void @_ZN13TPPLPartition11UpdateStateElllllPPNS_8DPState2E(ptr noundef nonnull align 1 dereferenceable(1) %0, i64 noundef %1, i64 noundef %3, i64 noundef %.1, i64 noundef %2, i64 noundef %.0, ptr noundef %5)
  br label %73

73:                                               ; preds = %20, %6, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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, !11, i64 0}
!10 = !{!"_ZTSN13TPPLPartition8DPState2E", !11, i64 0, !12, i64 8, !13, i64 16}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EEE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1110_List_baseIN13TPPLPartition8DiagonalESaIS2_EEE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1110_List_baseIN13TPPLPartition8DiagonalESaIS2_EE10_List_implE", !16, i64 0}
!16 = !{!"_ZTSNSt8__detail17_List_node_headerE", !17, i64 0, !12, i64 16}
!17 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!10, !12, i64 8}
!21 = !{!22, !12, i64 0}
!22 = !{!"_ZTSN13TPPLPartition8DiagonalE", !12, i64 0, !12, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!22, !12, i64 8}


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