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

; 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 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 uwtable
define dso_local void @_ZN13TPPLPartition5TypeAElllPNS_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
  %22 = alloca %"struct.std::_List_iterator.5", align 8
  %23 = 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
  %24 = 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
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = load i64, ptr %8, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %25, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = load i64, ptr %9, align 8, !tbaa !9
  %30 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %28, i64 %29
  %31 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %30, i32 0, i32 0
  %32 = load i8, ptr %31, align 8, !tbaa !11, !range !19, !noundef !20
  %33 = trunc i8 %32 to i1
  br i1 %33, label %35, label %34

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

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

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

59:                                               ; preds = %49
  store i32 1, ptr %18, align 4
  br label %157

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

72:                                               ; preds = %60, %35
  %73 = load i64, ptr %9, align 8, !tbaa !9
  %74 = load i64, ptr %8, align 8, !tbaa !9
  %75 = sub nsw i64 %73, %74
  %76 = icmp sgt i64 %75, 1
  br i1 %76, label %77, label %150

77:                                               ; preds = %72
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = load i64, ptr %8, align 8, !tbaa !9
  %80 = getelementptr inbounds ptr, ptr %78, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = load i64, ptr %9, align 8, !tbaa !9
  %83 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %81, i64 %82
  %84 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %83, i32 0, i32 2
  store ptr %84, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %85) #4
  %87 = getelementptr inbounds %"struct.std::_List_iterator.5", ptr %19, i32 0, i32 0
  store ptr %86, ptr %87, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #4
  %90 = getelementptr inbounds %"struct.std::_List_iterator.5", ptr %20, i32 0, i32 0
  store ptr %89, ptr %90, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %20, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %91

91:                                               ; preds = %116, %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #4
  %94 = getelementptr inbounds %"struct.std::_List_iterator.5", ptr %21, i32 0, i32 0
  store ptr %93, ptr %94, align 8
  %95 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN13TPPLPartition8DiagonalEES4_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br i1 %95, label %96, label %117

96:                                               ; preds = %91
  %97 = call ptr @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 0) #4
  %98 = getelementptr inbounds %"struct.std::_List_iterator.5", ptr %22, i32 0, i32 0
  store ptr %97, ptr %98, align 8
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %101 = getelementptr inbounds %"struct.TPPLPartition::Diagonal", ptr %100, i32 0, i32 1
  %102 = load i64, ptr %101, align 8, !tbaa !23
  %103 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %99, i64 %102
  %104 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %103, i32 0, i32 3
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load i64, ptr %9, align 8, !tbaa !9
  %107 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %105, i64 %106
  %108 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %107, i32 0, i32 3
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = load i64, ptr %10, align 8, !tbaa !9
  %111 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %109, i64 %110
  %112 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %111, i32 0, i32 3
  %113 = call noundef zeroext i1 @_ZN13TPPLPartition8IsReflexER9TPPLPointS1_S1_(ptr noundef nonnull align 1 dereferenceable(1) %24, ptr noundef nonnull align 8 dereferenceable(24) %104, ptr noundef nonnull align 8 dereferenceable(24) %108, ptr noundef nonnull align 8 dereferenceable(24) %112)
  br i1 %113, label %115, label %114

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

115:                                              ; preds = %96
  br label %117

116:                                              ; preds = %114
  br label %91, !llvm.loop !25

117:                                              ; preds = %115, %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %118) #4
  %120 = getelementptr inbounds %"struct.std::_List_iterator.5", ptr %23, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  %121 = call noundef zeroext i1 @_ZSteqRKSt14_List_iteratorIN13TPPLPartition8DiagonalEES4_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  br i1 %121, label %122, label %125

122:                                              ; preds = %117
  %123 = load i64, ptr %17, align 8, !tbaa !9
  %124 = add nsw i64 %123, 1
  store i64 %124, ptr %17, align 8, !tbaa !9
  br label %149

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

141:                                              ; preds = %125
  %142 = load i64, ptr %17, align 8, !tbaa !9
  %143 = add nsw i64 %142, 1
  store i64 %143, ptr %17, align 8, !tbaa !9
  br label %148

144:                                              ; preds = %125
  %145 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  %146 = getelementptr inbounds %"struct.TPPLPartition::Diagonal", ptr %145, i32 0, i32 0
  %147 = load i64, ptr %146, align 8, !tbaa !27
  store i64 %147, ptr %16, align 8, !tbaa !9
  br label %148

148:                                              ; preds = %144, %141
  br label %149

149:                                              ; preds = %148, %122
  br label %150

150:                                              ; preds = %149, %72
  %151 = load i64, ptr %8, align 8, !tbaa !9
  %152 = load i64, ptr %10, align 8, !tbaa !9
  %153 = load i64, ptr %17, align 8, !tbaa !9
  %154 = load i64, ptr %16, align 8, !tbaa !9
  %155 = load i64, ptr %9, align 8, !tbaa !9
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN13TPPLPartition11UpdateStateElllllPPNS_8DPState2E(ptr noundef nonnull align 1 dereferenceable(1) %24, i64 noundef %151, i64 noundef %152, i64 noundef %153, i64 noundef %154, i64 noundef %155, ptr noundef %156)
  store i32 0, ptr %18, align 4
  br label %157

157:                                              ; preds = %150, %59, %34
  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
  %158 = load i32, ptr %18, align 4
  switch i32 %158, label %160 [
    i32 0, label %159
    i32 1, label %159
  ]

159:                                              ; preds = %157, %157
  ret void

160:                                              ; preds = %157
  unreachable
}

; 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 nounwind uwtable
declare dso_local ptr @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEmmEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqRKSt14_List_iteratorIN13TPPLPartition8DiagonalEES4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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 8}
!24 = !{!"_ZTSN13TPPLPartition8DiagonalE", !10, i64 0, !10, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!24, !10, i64 0}


; 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 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 uwtable
define dso_local void @_ZN13TPPLPartition5TypeAElllPNS_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
  %10 = 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
  %11 = getelementptr inbounds ptr, ptr %5, i64 %1
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %12, i64 %2
  %14 = load i8, ptr %13, align 8, !tbaa !9, !range !18, !noundef !19
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %16, label %72

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

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

27:                                               ; preds = %21
  %28 = getelementptr inbounds i8, ptr %24, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !20
  %30 = add i64 %18, 1
  %31 = add i64 %30, %29
  br label %32

32:                                               ; preds = %27, %16
  %.045 = phi i64 [ %31, %27 ], [ %18, %16 ]
  %33 = sub nsw i64 %2, %1
  %34 = icmp sgt i64 %33, 1
  br i1 %34, label %35, label %71

35:                                               ; preds = %32
  %36 = getelementptr inbounds %"struct.TPPLPartition::DPState2", ptr %12, i64 %2, i32 2
  %37 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #3
  store ptr %37, ptr %7, align 8, !tbaa !5
  %38 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #3
  %39 = ptrtoint ptr %38 to i64
  store i64 %39, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %40 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #3
  store ptr %40, ptr %9, align 8
  %41 = 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 %41, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %35
  %42 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %4, i64 %2, i32 3
  %43 = getelementptr inbounds %"struct.TPPLPartition::PartitionVertex", ptr %4, i64 %3, i32 3
  br label %44

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

51:                                               ; preds = %44
  %52 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %52, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %53 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #3
  store ptr %53, ptr %9, align 8
  %54 = 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 %54, label %44, label %._crit_edge, !llvm.loop !23

._crit_edge:                                      ; preds = %51, %44, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %55 = call ptr @_ZNSt7__cxx114listIN13TPPLPartition8DiagonalESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #3
  store ptr %55, ptr %10, align 8
  %56 = call noundef zeroext i1 @_ZSteqRKSt14_List_iteratorIN13TPPLPartition8DiagonalEES4_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  br i1 %56, label %57, label %59

57:                                               ; preds = %._crit_edge
  %58 = add nsw i64 %.045, 1
  br label %71

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

66:                                               ; preds = %59
  %67 = add nsw i64 %.045, 1
  br label %71

68:                                               ; preds = %59
  %69 = call noundef ptr @_ZNKSt14_List_iteratorIN13TPPLPartition8DiagonalEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  %70 = load i64, ptr %69, align 8, !tbaa !25
  br label %71

71:                                               ; preds = %57, %68, %66, %32
  %.1 = phi i64 [ %58, %57 ], [ %67, %66 ], [ %.045, %68 ], [ %.045, %32 ]
  %.0 = phi i64 [ %2, %57 ], [ %2, %66 ], [ %70, %68 ], [ %2, %32 ]
  call void @_ZN13TPPLPartition11UpdateStateElllllPPNS_8DPState2E(ptr noundef nonnull align 1 dereferenceable(1) %0, i64 noundef %1, i64 noundef %3, i64 noundef %.1, i64 noundef %.0, i64 noundef %2, ptr noundef %5)
  br label %72

72:                                               ; preds = %21, %6, %71
  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 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 nounwind uwtable
declare dso_local ptr @_ZNSt14_List_iteratorIN13TPPLPartition8DiagonalEEmmEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

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

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 8}
!22 = !{!"_ZTSN13TPPLPartition8DiagonalE", !12, i64 0, !12, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!22, !12, i64 0}


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