; LLVM IR from artvns/SimpleFvm :: simplefvm/src/MeshLoader/DomainDecomposition/PartsCellsNumsExtraction/PureInteri_5647900c (EE)

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

%"class.meshloader::PureInteriorNums" = type { ptr, ptr, ptr, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10meshloader16PureInteriorNums8findNumsERSt6vectorImSaImEERKS1_IS3_SaIS3_EE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %13 = load ptr, ptr %4, align 8
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10meshloader16PureInteriorNums14uniteFacesNumsERKSt6vectorIS1_ImSaImEESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(24) %14)
  %15 = getelementptr inbounds %"class.meshloader::PureInteriorNums", ptr %13, i32 0, i32 3
  call void @_ZN10meshloader16PureInteriorNums10sortVectorERSt6vectorImSaImEE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(24) %15)
  %16 = getelementptr inbounds %"class.meshloader::PureInteriorNums", ptr %13, i32 0, i32 3
  call void @_ZN10meshloader16PureInteriorNums22removeDuplicatedValuesERSt6vectorImSaImEE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %17 = getelementptr inbounds %"class.meshloader::PureInteriorNums", ptr %13, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = call noundef i64 @_ZNK10meshloader10BaseMatrix13getRowsAmountEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  store i64 %19, ptr %7, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %20 = getelementptr inbounds %"class.meshloader::PureInteriorNums", ptr %13, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call noundef i64 @_ZNK10meshloader10BaseMatrix13getColsAmountEv(ptr noundef nonnull align 8 dereferenceable(40) %21)
  store i64 %22, ptr %8, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store i64 0, ptr %9, align 8, !tbaa !15
  br label %23

23:                                               ; preds = %57, %3
  %24 = load i64, ptr %9, align 8, !tbaa !15
  %25 = load i64, ptr %7, align 8, !tbaa !15
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %60

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store i64 0, ptr %11, align 8, !tbaa !15
  br label %29

29:                                               ; preds = %53, %28
  %30 = load i64, ptr %11, align 8, !tbaa !15
  %31 = load i64, ptr %8, align 8, !tbaa !15
  %32 = icmp ult i64 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %56

34:                                               ; preds = %29
  %35 = load i64, ptr %9, align 8, !tbaa !15
  %36 = load i64, ptr %11, align 8, !tbaa !15
  %37 = call noundef zeroext i1 @_ZN10meshloader16PureInteriorNums6isCellEmm(ptr noundef nonnull align 8 dereferenceable(48) %13, i64 noundef %35, i64 noundef %36)
  %38 = zext i1 %37 to i32
  %39 = load i64, ptr %9, align 8, !tbaa !15
  %40 = load i64, ptr %11, align 8, !tbaa !15
  %41 = call noundef i64 @_ZN10meshloader16PureInteriorNums10takeNumberEmm(ptr noundef nonnull align 8 dereferenceable(48) %13, i64 noundef %39, i64 noundef %40)
  %42 = call noundef zeroext i1 @_ZN10meshloader16PureInteriorNums9isFaceNumEm(ptr noundef nonnull align 8 dereferenceable(48) %13, i64 noundef %41)
  %43 = xor i1 %42, true
  %44 = zext i1 %43 to i32
  %45 = and i32 %38, %44
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %52

47:                                               ; preds = %34
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %49 = load i64, ptr %9, align 8, !tbaa !15
  %50 = load i64, ptr %11, align 8, !tbaa !15
  %51 = call noundef i64 @_ZN10meshloader16PureInteriorNums10takeNumberEmm(ptr noundef nonnull align 8 dereferenceable(48) %13, i64 noundef %49, i64 noundef %50)
  store i64 %51, ptr %12, align 8, !tbaa !15
  call void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %52

52:                                               ; preds = %47, %34
  br label %53

53:                                               ; preds = %52
  %54 = load i64, ptr %11, align 8, !tbaa !15
  %55 = add i64 %54, 1
  store i64 %55, ptr %11, align 8, !tbaa !15
  br label %29, !llvm.loop !17

56:                                               ; preds = %33
  br label %57

57:                                               ; preds = %56
  %58 = load i64, ptr %9, align 8, !tbaa !15
  %59 = add i64 %58, 1
  store i64 %59, ptr %9, align 8, !tbaa !15
  br label %23, !llvm.loop !19

60:                                               ; preds = %27
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN10meshloader16PureInteriorNums10sortVectorERSt6vectorImSaImEE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(24) %61)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

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

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

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

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

declare noundef i64 @_ZNK10meshloader10BaseMatrix13getRowsAmountEv(ptr noundef nonnull align 8 dereferenceable(40)) #2

declare noundef i64 @_ZNK10meshloader10BaseMatrix13getColsAmountEv(ptr noundef nonnull align 8 dereferenceable(40)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10meshloader16PureInteriorNums6isCellEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10meshloader16PureInteriorNums9isFaceNumEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN10meshloader16PureInteriorNums10takeNumberEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) #0 align 2

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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, !6, i64 0}
!10 = !{!"_ZTSN10meshloader16PureInteriorNumsE", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!11 = !{!"_ZTSSt6vectorImSaImEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseImSaImEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10meshloader16PureInteriorNums8findNumsERSt6vectorImSaImEERKS1_IS3_SaIS3_EE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #0 align 2 {
  %4 = alloca i64, align 8
  tail call void @_ZN10meshloader16PureInteriorNums14uniteFacesNumsERKSt6vectorIS1_ImSaImEESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %2)
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @_ZN10meshloader16PureInteriorNums10sortVectorERSt6vectorImSaImEE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %5)
  tail call void @_ZN10meshloader16PureInteriorNums22removeDuplicatedValuesERSt6vectorImSaImEE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %6 = load ptr, ptr %0, align 8, !tbaa !5
  %7 = tail call noundef i64 @_ZNK10meshloader10BaseMatrix13getRowsAmountEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %9 = tail call noundef i64 @_ZNK10meshloader10BaseMatrix13getColsAmountEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  %.not = icmp eq i64 %7, 0
  %.not19 = icmp eq i64 %9, 0
  %or.cond = or i1 %.not, %.not19
  br i1 %or.cond, label %._crit_edge18, label %.preheader.us

.preheader.us:                                    ; preds = %3, %._crit_edge.us
  %.01517.us = phi i64 [ %20, %._crit_edge.us ], [ 0, %3 ]
  br label %10

10:                                               ; preds = %.preheader.us, %18
  %.016.us = phi i64 [ 0, %.preheader.us ], [ %19, %18 ]
  %11 = call noundef zeroext i1 @_ZN10meshloader16PureInteriorNums6isCellEmm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %.01517.us, i64 noundef %.016.us)
  %12 = call noundef i64 @_ZN10meshloader16PureInteriorNums10takeNumberEmm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %.01517.us, i64 noundef %.016.us)
  %13 = call noundef zeroext i1 @_ZN10meshloader16PureInteriorNums9isFaceNumEm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %12)
  %14 = xor i1 %13, true
  %15 = and i1 %11, %14
  br i1 %15, label %16, label %18

16:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %17 = call noundef i64 @_ZN10meshloader16PureInteriorNums10takeNumberEmm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %.01517.us, i64 noundef %.016.us)
  store i64 %17, ptr %4, align 8, !tbaa !14
  call void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %18

18:                                               ; preds = %16, %10
  %19 = add nuw i64 %.016.us, 1
  %exitcond.not = icmp eq i64 %19, %9
  br i1 %exitcond.not, label %._crit_edge.us, label %10, !llvm.loop !16

._crit_edge.us:                                   ; preds = %18
  %20 = add nuw i64 %.01517.us, 1
  %exitcond21.not = icmp eq i64 %20, %7
  br i1 %exitcond21.not, label %._crit_edge18, label %.preheader.us, !llvm.loop !18

._crit_edge18:                                    ; preds = %._crit_edge.us, %3
  call void @_ZN10meshloader16PureInteriorNums10sortVectorERSt6vectorImSaImEE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %1)
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10meshloader16PureInteriorNums22removeDuplicatedValuesERSt6vectorImSaImEE(ptr noundef nonnull align 8 dereferenceable(48), 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.start.p0(i64 immarg, ptr nocapture) #1

declare noundef i64 @_ZNK10meshloader10BaseMatrix13getRowsAmountEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2

declare noundef i64 @_ZNK10meshloader10BaseMatrix13getColsAmountEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10meshloader16PureInteriorNums6isCellEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10meshloader16PureInteriorNums9isFaceNumEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN10meshloader16PureInteriorNums10takeNumberEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorImSaImEE9push_backEOm(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) 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) #1

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


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