; LLVM IR from VeloxChem/VeloxChem :: src/dft_func/GridPartitioner.ll (ZN16CGridPartitioner19partitionGridPointsEv)

; 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" = type { ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<CGridBox, std::allocator<CGridBox>>::_List_impl" }
%"struct.std::__cxx11::_List_base<CGridBox, std::allocator<CGridBox>>::_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.std::_List_const_iterator" = type { ptr }
%class.CGridPartitioner = type <{ %"class.std::__cxx11::list", i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16CGridPartitioner19partitionGridPointsEv(ptr noundef nonnull align 8 dereferenceable(28) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"struct.std::_List_iterator", align 8
  %4 = alloca %"struct.std::_List_iterator", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::list", align 8
  %7 = alloca %"struct.std::_List_const_iterator", align 8
  %8 = alloca %"struct.std::_List_iterator", align 8
  %9 = alloca %"struct.std::_List_iterator", align 8
  %10 = alloca %"struct.std::_List_iterator", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_List_iterator", align 8
  %14 = alloca %"struct.std::_List_iterator", align 8
  %15 = alloca %"struct.std::_List_const_iterator", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %17 = getelementptr inbounds %class.CGridPartitioner, ptr %16, i32 0, i32 0
  %18 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %19 = getelementptr inbounds %"struct.std::_List_iterator", ptr %3, i32 0, i32 0
  store ptr %18, ptr %19, align 8
  br label %20

20:                                               ; preds = %62, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %21 = getelementptr inbounds %class.CGridPartitioner, ptr %16, i32 0, i32 0
  %22 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = getelementptr inbounds %"struct.std::_List_iterator", ptr %4, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  %24 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI8CGridBoxES3_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br i1 %24, label %25, label %63

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %26 = call noundef ptr @_ZNKSt14_List_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %27 = call noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80) %26)
  store i32 %27, ptr %5, align 4, !tbaa !9
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = getelementptr inbounds %class.CGridPartitioner, ptr %16, i32 0, i32 1
  %30 = load i32, ptr %29, align 8, !tbaa !11
  %31 = icmp sgt i32 %28, %30
  br i1 %31, label %32, label %60

32:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #5
  %33 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt14_List_iteratorI8CGridBoxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @_ZNK16CGridPartitioner9bisectBoxB5cxx11ERK8CGridBox(ptr dead_on_unwind writable sret(%"class.std::__cxx11::list") align 8 %6, ptr noundef nonnull align 8 dereferenceable(28) %16, ptr noundef nonnull align 8 dereferenceable(80) %33)
  %34 = getelementptr inbounds %class.CGridPartitioner, ptr %16, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %35 = getelementptr inbounds %class.CGridPartitioner, ptr %16, i32 0, i32 0
  %36 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #5
  %37 = getelementptr inbounds %"struct.std::_List_iterator", ptr %8, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  call void @_ZNSt20_List_const_iteratorI8CGridBoxEC2ERKSt14_List_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %38 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %39 = getelementptr inbounds %"struct.std::_List_iterator", ptr %9, i32 0, i32 0
  store ptr %38, ptr %39, align 8
  %40 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %41 = getelementptr inbounds %"struct.std::_List_iterator", ptr %10, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  %42 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %7, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8
  %44 = getelementptr inbounds %"struct.std::_List_iterator", ptr %9, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8
  %46 = getelementptr inbounds %"struct.std::_List_iterator", ptr %10, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8
  %48 = invoke ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE6insertISt14_List_iteratorIS1_EvEES6_St20_List_const_iteratorIS1_ET_S9_(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr %43, ptr %45, ptr %47)
          to label %49 unwind label %56

49:                                               ; preds = %32
  %50 = getelementptr inbounds %"struct.std::_List_iterator", ptr %13, i32 0, i32 0
  store ptr %48, ptr %50, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %51 = getelementptr inbounds %class.CGridPartitioner, ptr %16, i32 0, i32 0
  call void @_ZNSt20_List_const_iteratorI8CGridBoxEC2ERKSt14_List_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %52 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %15, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE5eraseESt20_List_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr %53) #5
  %55 = getelementptr inbounds %"struct.std::_List_iterator", ptr %14, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %14, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @_ZNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  br label %62

56:                                               ; preds = %32
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %11, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @_ZNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %64

60:                                               ; preds = %25
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorI8CGridBoxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br label %62

62:                                               ; preds = %60, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %20, !llvm.loop !20

63:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void

64:                                               ; preds = %56
  %65 = load ptr, ptr %11, align 8
  %66 = load i32, ptr %12, align 4
  %67 = insertvalue { ptr, i32 } poison, ptr %65, 0
  %68 = insertvalue { ptr, i32 } %67, i32 %66, 1
  resume { ptr, i32 } %68
}

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

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

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

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

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

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

declare noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16CGridPartitioner9bisectBoxB5cxx11ERK8CGridBox(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::list") align 8, ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

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

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTS16CGridPartitioner", !13, i64 0, !10, i64 24}
!13 = !{!"_ZTSNSt7__cxx114listI8CGridBoxSaIS1_EEE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EEE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EE10_List_implE", !16, i64 0}
!16 = !{!"_ZTSNSt8__detail17_List_node_headerE", !17, i64 0, !18, i64 16}
!17 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!18 = !{!"long", !7, i64 0}
!19 = !{i64 0, i64 8, !5}
!20 = distinct !{!20, !21}
!21 = !{!"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.std::_List_iterator" = type { ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<CGridBox, std::allocator<CGridBox>>::_List_impl" }
%"struct.std::__cxx11::_List_base<CGridBox, std::allocator<CGridBox>>::_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.std::_List_const_iterator" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16CGridPartitioner19partitionGridPointsEv(ptr noundef nonnull align 8 dereferenceable(28) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.std::_List_iterator", align 8
  %3 = alloca %"struct.std::_List_iterator", align 8
  %4 = alloca %"class.std::__cxx11::list", align 8
  %5 = alloca %"struct.std::_List_const_iterator", align 8
  %6 = alloca %"struct.std::_List_iterator", align 8
  %7 = alloca %"struct.std::_List_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %8 = tail call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store ptr %8, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %9 = tail call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store ptr %9, ptr %3, align 8
  %10 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI8CGridBoxES3_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  br label %12

12:                                               ; preds = %.lr.ph, %31
  %13 = call noundef ptr @_ZNKSt14_List_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %14 = call noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
  %15 = load i32, ptr %11, align 8, !tbaa !5
  %16 = icmp sgt i32 %14, %15
  br i1 %16, label %17, label %29

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  %18 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt14_List_iteratorI8CGridBoxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @_ZNK16CGridPartitioner9bisectBoxB5cxx11ERK8CGridBox(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::list") align 8 %4, ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef nonnull align 8 dereferenceable(80) %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %19 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store ptr %19, ptr %6, align 8
  call void @_ZNSt20_List_const_iteratorI8CGridBoxEC2ERKSt14_List_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %20 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %21 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %22 = load ptr, ptr %5, align 8
  %23 = invoke ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE6insertISt14_List_iteratorIS1_EvEES6_St20_List_const_iteratorIS1_ET_S9_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %22, ptr %20, ptr %21)
          to label %24 unwind label %27

24:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @_ZNSt20_List_const_iteratorI8CGridBoxEC2ERKSt14_List_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %25 = load ptr, ptr %7, align 8
  %26 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE5eraseESt20_List_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %25) #4
  store ptr %26, ptr %2, align 8, !tbaa !17
  call void @_ZNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  br label %31

27:                                               ; preds = %17
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @_ZNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  resume { ptr, i32 } %28

29:                                               ; preds = %12
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorI8CGridBoxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  br label %31

31:                                               ; preds = %29, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %32 = call ptr @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store ptr %32, ptr %3, align 8
  %33 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI8CGridBoxES3_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br i1 %33, label %12, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %31, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret void
}

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

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

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

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

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

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

declare noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16CGridPartitioner9bisectBoxB5cxx11ERK8CGridBox(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::list") align 8, ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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, !16, i64 24}
!6 = !{!"_ZTS16CGridPartitioner", !7, i64 0, !16, i64 24}
!7 = !{!"_ZTSNSt7__cxx114listI8CGridBoxSaIS1_EEE", !8, i64 0}
!8 = !{!"_ZTSNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EEE", !9, i64 0}
!9 = !{!"_ZTSNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EE10_List_implE", !10, i64 0}
!10 = !{!"_ZTSNSt8__detail17_List_node_headerE", !11, i64 0, !15, i64 16}
!11 = !{!"_ZTSNSt8__detail15_List_node_baseE", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"long", !13, i64 0}
!16 = !{!"int", !13, i64 0}
!17 = !{!12, !12, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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