; LLVM IR from INMOST-DEV/INMOST-FEM :: anifem++/fem/fem_space.ll (ZNK3Ani14VectorFemSpace25interpolateByDOFs_mem_reqEj)

; 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.Ani::DofT::DofIterator" = type { %"struct.Ani::DofT::LocalOrder", ptr }
%"struct.Ani::DofT::LocalOrder" = type { i32, i32, i8, i8, i8, i8 }
%"struct.Ani::PlainMemoryX" = type { ptr, ptr, ptr, i64, i64, i64 }
%"struct.Ani::BaseFemSpace" = type { ptr, %"struct.Ani::DofT::DofMap" }
%"struct.Ani::DofT::DofMap" = type { %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.Ani::DofT::VectorDofMap" = type <{ %"struct.Ani::DofT::BaseDofMap", %"class.std::shared_ptr", i32, [4 x i8] }>
%"struct.Ani::DofT::BaseDofMap" = type { ptr }
%"struct.Ani::VectorFemSpace" = type { %"struct.Ani::BaseFemSpace", %"class.std::shared_ptr.21" }
%"class.std::shared_ptr.21" = type { %"class.std::__shared_ptr.22" }
%"class.std::__shared_ptr.22" = type { ptr, %"class.std::__shared_count" }

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3Ani4DofT6DofMap5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.Ani::DofT::DofIterator") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3Ani4DofT6DofMap3endEv(ptr dead_on_unwind noalias writable sret(%"struct.Ani::DofT::DofIterator") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3Ani14VectorFemSpace25interpolateByDOFs_mem_reqEj(ptr dead_on_unwind noalias writable sret(%"struct.Ani::PlainMemoryX") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %1, i32 noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.Ani::DofT::DofIterator", align 8
  %9 = alloca %"struct.Ani::DofT::DofIterator", align 8
  %10 = alloca %"struct.Ani::PlainMemoryX", align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store i32 %2, ptr %5, align 4, !tbaa !9
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %14 = getelementptr inbounds %"struct.Ani::BaseFemSpace", ptr %13, i32 0, i32 1
  %15 = call noundef ptr @_ZNK3Ani4DofT6DofMap6targetINS0_12VectorDofMapEEEPKT_v(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %16 = getelementptr inbounds %"struct.Ani::DofT::VectorDofMap", ptr %15, i32 0, i32 2
  %17 = load i32, ptr %16, align 8, !tbaa !11
  store i32 %17, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %18 = getelementptr inbounds %"struct.Ani::VectorFemSpace", ptr %13, i32 0, i32 1
  %19 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %21 = getelementptr inbounds ptr, ptr %20, i64 3
  %22 = load ptr, ptr %21, align 8
  %23 = call noundef i32 %22(ptr noundef nonnull align 8 dereferenceable(24) %19)
  store i32 %23, ptr %7, align 4, !tbaa !9
  call void @_ZN3Ani12PlainMemoryXIdiEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  %24 = getelementptr inbounds %"struct.Ani::VectorFemSpace", ptr %13, i32 0, i32 1
  %25 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %24) #5
  %26 = getelementptr inbounds %"struct.Ani::BaseFemSpace", ptr %25, i32 0, i32 1
  call void @_ZNK3Ani4DofT6DofMap5beginEv(ptr dead_on_unwind writable sret(%"struct.Ani::DofT::DofIterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(16) %26)
  br label %27

27:                                               ; preds = %44, %3
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %28 = getelementptr inbounds %"struct.Ani::VectorFemSpace", ptr %13, i32 0, i32 1
  %29 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %28) #5
  %30 = getelementptr inbounds %"struct.Ani::BaseFemSpace", ptr %29, i32 0, i32 1
  call void @_ZNK3Ani4DofT6DofMap3endEv(ptr dead_on_unwind writable sret(%"struct.Ani::DofT::DofIterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %30)
  %31 = call noundef zeroext i1 @_ZNK3Ani4DofT11DofIteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  br label %46

33:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #5
  %34 = getelementptr inbounds %"struct.Ani::VectorFemSpace", ptr %13, i32 0, i32 1
  %35 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %34) #5
  %36 = call noundef ptr @_ZNK3Ani4DofT11DofIteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %37 = getelementptr inbounds %"struct.Ani::DofT::LocalOrder", ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 4, !tbaa !19
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = load ptr, ptr %35, align 8, !tbaa !17
  %42 = getelementptr inbounds ptr, ptr %41, i64 7
  %43 = load ptr, ptr %42, align 8
  call void %43(ptr dead_on_unwind writable sret(%"struct.Ani::PlainMemoryX") align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %35, i32 noundef %38, i32 noundef %39, i32 noundef %40)
  call void @_ZN3Ani12PlainMemoryXIdiE11extend_sizeIdiEEvRKNS0_IT_T0_EE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %10)
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #5
  br label %44

44:                                               ; preds = %33
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3Ani4DofT11DofIteratorppEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  br label %27, !llvm.loop !21

46:                                               ; preds = %32
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = mul i32 %47, %48
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds %"struct.Ani::PlainMemoryX", ptr %0, i32 0, i32 3
  %52 = load i64, ptr %51, align 8, !tbaa !23
  %53 = add i64 %52, %50
  store i64 %53, ptr %51, align 8, !tbaa !23
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = mul i64 16, %55
  %57 = udiv i64 %56, 32
  %58 = add i64 %57, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 1, ptr %11, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !26
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %60 = load i64, ptr %59, align 8, !tbaa !26
  %61 = add i64 %58, %60
  %62 = getelementptr inbounds %"struct.Ani::PlainMemoryX", ptr %0, i32 0, i32 5
  %63 = load i64, ptr %62, align 8, !tbaa !27
  %64 = add i64 %63, %61
  store i64 %64, ptr %62, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Ani12PlainMemoryXIdiE11extend_sizeIdiEEvRKNS0_IT_T0_EE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { inlinehint 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 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTSN3Ani4DofT12VectorDofMapE", !13, i64 0, !14, i64 8, !10, i64 24}
!13 = !{!"_ZTSN3Ani4DofT10BaseDofMapE"}
!14 = !{!"_ZTSSt10shared_ptrIN3Ani4DofT10BaseDofMapEE", !15, i64 0}
!15 = !{!"_ZTSSt12__shared_ptrIN3Ani4DofT10BaseDofMapELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !16, i64 8}
!16 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTSN3Ani4DofT10LocalOrderE", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !25, i64 24}
!24 = !{!"_ZTSN3Ani12PlainMemoryXIdiEE", !6, i64 0, !6, i64 8, !6, i64 16, !25, i64 24, !25, i64 32, !25, i64 40}
!25 = !{!"long", !7, i64 0}
!26 = !{!25, !25, i64 0}
!27 = !{!24, !25, i64 40}


; 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.Ani::DofT::DofIterator" = type { %"struct.Ani::DofT::LocalOrder", ptr }
%"struct.Ani::DofT::LocalOrder" = type { i32, i32, i8, i8, i8, i8 }
%"struct.Ani::PlainMemoryX" = type { ptr, ptr, ptr, i64, i64, i64 }

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3Ani12PlainMemoryXIdiEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3Ani4DofT6DofMap5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.Ani::DofT::DofIterator") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3Ani4DofT6DofMap3endEv(ptr dead_on_unwind noalias writable sret(%"struct.Ani::DofT::DofIterator") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3Ani14VectorFemSpace25interpolateByDOFs_mem_reqEj(ptr dead_on_unwind noalias writable sret(%"struct.Ani::PlainMemoryX") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %1, i32 noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca %"struct.Ani::DofT::DofIterator", align 8
  %5 = alloca %"struct.Ani::DofT::DofIterator", align 8
  %6 = alloca %"struct.Ani::PlainMemoryX", align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = tail call noundef ptr @_ZNK3Ani4DofT6DofMap6targetINS0_12VectorDofMapEEEPKT_v(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %11 = getelementptr inbounds i8, ptr %10, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %15, i64 24
  %17 = load ptr, ptr %16, align 8
  %18 = tail call noundef i32 %17(ptr noundef nonnull align 8 dereferenceable(24) %14)
  tail call void @_ZN3Ani12PlainMemoryXIdiEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %19 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  call void @_ZNK3Ani4DofT6DofMap5beginEv(ptr dead_on_unwind nonnull writable sret(%"struct.Ani::DofT::DofIterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %21 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  call void @_ZNK3Ani4DofT6DofMap3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.Ani::DofT::DofIterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %22)
  %23 = call noundef zeroext i1 @_ZNK3Ani4DofT11DofIteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br i1 %23, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  %24 = mul i32 %18, %12
  %25 = zext i32 %24 to i64
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  %27 = load i64, ptr %26, align 8, !tbaa !17
  %28 = add i64 %27, %25
  store i64 %28, ptr %26, align 8, !tbaa !17
  %29 = sext i32 %12 to i64
  %30 = lshr i64 %29, 1
  %31 = and i64 %30, 576460752303423487
  %32 = add nuw nsw i64 %31, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  store i64 1, ptr %7, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store i64 0, ptr %8, align 8, !tbaa !20
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %34 = load i64, ptr %33, align 8, !tbaa !20
  %35 = add i64 %32, %34
  %36 = getelementptr inbounds i8, ptr %0, i64 40
  %37 = load i64, ptr %36, align 8, !tbaa !21
  %38 = add i64 %35, %37
  store i64 %38, ptr %36, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  ret void

.lr.ph:                                           ; preds = %3, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #5
  %39 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  %40 = call noundef ptr @_ZNK3Ani4DofT11DofIteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %41 = load i32, ptr %40, align 4, !tbaa !22
  %42 = load ptr, ptr %39, align 8, !tbaa !15
  %43 = getelementptr inbounds i8, ptr %42, i64 56
  %44 = load ptr, ptr %43, align 8
  call void %44(ptr dead_on_unwind nonnull writable sret(%"struct.Ani::PlainMemoryX") align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %39, i32 noundef %41, i32 noundef %12, i32 noundef %2)
  call void @_ZN3Ani12PlainMemoryXIdiE11extend_sizeIdiEEvRKNS0_IT_T0_EE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %6)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3Ani4DofT11DofIteratorppEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %46 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3Ani12BaseFemSpaceELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  call void @_ZNK3Ani4DofT6DofMap3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.Ani::DofT::DofIterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(16) %47)
  %48 = call noundef zeroext i1 @_ZNK3Ani4DofT11DofIteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br i1 %48, label %.lr.ph, label %._crit_edge, !llvm.loop !24
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Ani12PlainMemoryXIdiE11extend_sizeIdiEEvRKNS0_IT_T0_EE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { inlinehint 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 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, !14, i64 24}
!6 = !{!"_ZTSN3Ani4DofT12VectorDofMapE", !7, i64 0, !8, i64 8, !14, i64 24}
!7 = !{!"_ZTSN3Ani4DofT10BaseDofMapE"}
!8 = !{!"_ZTSSt10shared_ptrIN3Ani4DofT10BaseDofMapEE", !9, i64 0}
!9 = !{!"_ZTSSt12__shared_ptrIN3Ani4DofT10BaseDofMapELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !13, i64 8}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0}
!14 = !{!"int", !11, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !12, i64 0}
!17 = !{!18, !19, i64 24}
!18 = !{!"_ZTSN3Ani12PlainMemoryXIdiEE", !10, i64 0, !10, i64 8, !10, i64 16, !19, i64 24, !19, i64 32, !19, i64 40}
!19 = !{!"long", !11, i64 0}
!20 = !{!19, !19, i64 0}
!21 = !{!18, !19, i64 40}
!22 = !{!23, !14, i64 0}
!23 = !{!"_ZTSN3Ani4DofT10LocalOrderE", !14, i64 0, !14, i64 4, !11, i64 8, !11, i64 9, !11, i64 10, !11, i64 11}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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