; LLVM IR from sbischoff-ai/simple-molecular-dynamics :: SimpleMolecularDynamics/SimpleMolecularDynamics/mat.ll (ZN3matC2EP3veci)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.vec = type <{ ptr, i32, [4 x i8] }>
%class.mat = type { ptr, i32, i32 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [62 x i8], align 1

; 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 speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

declare void @_ZN3vecC1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3vecD1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #5

declare noundef nonnull align 8 dereferenceable(12) ptr @_ZN3vecaSERKS_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3matC2EP3veci(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %class.vec, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %12 = load i32, ptr %6, align 4, !tbaa !9
  %13 = getelementptr inbounds %class.mat, ptr %11, i32 0, i32 1
  store i32 %12, ptr %13, align 8, !tbaa !11
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %class.vec, ptr %14, i64 1
  %16 = call noundef i32 @_ZN3vec7get_dimEv(ptr noundef nonnull align 8 dereferenceable(12) %15)
  %17 = getelementptr inbounds %class.mat, ptr %11, i32 0, i32 2
  store i32 %16, ptr %17, align 4, !tbaa !13
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %19, i64 16)
  %21 = extractvalue { i64, i1 } %20, 1
  %22 = extractvalue { i64, i1 } %20, 0
  %23 = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %22, i64 8)
  %24 = extractvalue { i64, i1 } %23, 1
  %25 = or i1 %21, %24
  %26 = extractvalue { i64, i1 } %23, 0
  %27 = select i1 %25, i64 -1, i64 %26
  %28 = call noalias noundef nonnull ptr @_Znam(i64 noundef %27) #9
  store i64 %19, ptr %28, align 16
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = icmp eq i64 %19, 0
  br i1 %30, label %38, label %31

31:                                               ; preds = %3
  %32 = getelementptr inbounds %class.vec, ptr %29, i64 %19
  br label %33

33:                                               ; preds = %35, %31
  %34 = phi ptr [ %29, %31 ], [ %36, %35 ]
  invoke void @_ZN3vecC1Ev(ptr noundef nonnull align 8 dereferenceable(12) %34)
          to label %35 unwind label %72

35:                                               ; preds = %33
  %36 = getelementptr inbounds %class.vec, ptr %34, i64 1
  %37 = icmp eq ptr %36, %32
  br i1 %37, label %38, label %33

38:                                               ; preds = %35, %3
  %39 = getelementptr inbounds %class.mat, ptr %11, i32 0, i32 0
  store ptr %29, ptr %39, align 8, !tbaa !14
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %98, %38
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %44, label %101

44:                                               ; preds = %40
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %47, label %86

47:                                               ; preds = %44
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %class.vec, ptr %48, i64 %50
  %52 = call noundef i32 @_ZN3vec7get_dimEv(ptr noundef nonnull align 8 dereferenceable(12) %51)
  %53 = getelementptr inbounds %class.mat, ptr %11, i32 0, i32 2
  %54 = load i32, ptr %53, align 4, !tbaa !13
  %55 = icmp ne i32 %52, %54
  br i1 %55, label %56, label %86

56:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %class.vec, ptr %57, i64 %60
  %62 = call noundef i32 @_ZN3vec7get_dimEv(ptr noundef nonnull align 8 dereferenceable(12) %61)
  call void @_ZN3vecC1Ei(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %62)
  %63 = getelementptr inbounds %class.mat, ptr %11, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !14
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %class.vec, ptr %64, i64 %66
  %68 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZN3vecaSERKS_(ptr noundef nonnull align 8 dereferenceable(12) %67, ptr noundef nonnull align 8 dereferenceable(12) %10)
          to label %69 unwind label %82

69:                                               ; preds = %56
  call void @_ZN3vecD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %97

72:                                               ; preds = %33
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %8, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %9, align 4
  %76 = icmp eq ptr %29, %34
  br i1 %76, label %81, label %77

77:                                               ; preds = %77, %72
  %78 = phi ptr [ %34, %72 ], [ %79, %77 ]
  %79 = getelementptr inbounds %class.vec, ptr %78, i64 -1
  call void @_ZN3vecD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %79) #8
  %80 = icmp eq ptr %79, %29
  br i1 %80, label %81, label %77

81:                                               ; preds = %77, %72
  call void @_ZdaPvm(ptr noundef %28, i64 noundef %27) #10
  br label %102

82:                                               ; preds = %56
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %8, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %9, align 4
  call void @_ZN3vecD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  br label %102

86:                                               ; preds = %47, %44
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %class.vec, ptr %87, i64 %89
  %91 = getelementptr inbounds %class.mat, ptr %11, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !14
  %93 = load i32, ptr %7, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds %class.vec, ptr %92, i64 %94
  %96 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZN3vecaSERKS_(ptr noundef nonnull align 8 dereferenceable(12) %95, ptr noundef nonnull align 8 dereferenceable(12) %90)
  br label %97

97:                                               ; preds = %86, %69
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %7, align 4, !tbaa !9
  br label %40, !llvm.loop !15

101:                                              ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret void

102:                                              ; preds = %82, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %8, align 8
  %105 = load i32, ptr %9, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

declare noundef i32 @_ZN3vec7get_dimEv(ptr noundef nonnull align 8 dereferenceable(12)) #3

declare void @_ZN3vecC1Ei(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef) unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #7

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { "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 "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 = { nobuiltin nounwind "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 #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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 8}
!12 = !{!"_ZTS3mat", !6, i64 0, !10, i64 8, !10, i64 12}
!13 = !{!12, !10, i64 12}
!14 = !{!12, !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.vec = type <{ ptr, i32, [4 x i8] }>

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [62 x i8], align 1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

declare void @_ZN3vecC1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3vecD1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(12) ptr @_ZN3vecaSERKS_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #2

; 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 uwtable
define dso_local void @_ZN3matC2EP3veci(ptr nocapture noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.vec, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %2, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = tail call noundef i32 @_ZN3vec7get_dimEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
  %8 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %7, ptr %8, align 4, !tbaa !11
  %9 = sext i32 %2 to i64
  %10 = icmp slt i32 %2, 0
  %11 = shl nsw i64 %9, 4
  %12 = or disjoint i64 %11, 8
  %13 = select i1 %10, i64 -1, i64 %12
  %14 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %13) #7
  store i64 %9, ptr %14, align 16
  %.ptr23 = getelementptr inbounds i8, ptr %14, i64 8
  %15 = icmp eq i32 %2, 0
  br i1 %15, label %.loopexit30.thread, label %16

.loopexit30.thread:                               ; preds = %3
  store ptr %.ptr23, ptr %0, align 8, !tbaa !12
  br label %._crit_edge

16:                                               ; preds = %3
  %17 = getelementptr inbounds %class.vec, ptr %.ptr23, i64 %9
  br label %18

18:                                               ; preds = %19, %16
  %.idx = phi i64 [ 8, %16 ], [ %.add, %19 ]
  %.ptr.ptr = getelementptr inbounds i8, ptr %14, i64 %.idx
  invoke void @_ZN3vecC1Ev(ptr noundef nonnull align 8 dereferenceable(12) %.ptr.ptr)
          to label %19 unwind label %36

19:                                               ; preds = %18
  %.add = add nuw nsw i64 %.idx, 16
  %.ptr22 = getelementptr inbounds i8, ptr %14, i64 %.add
  %20 = icmp eq ptr %.ptr22, %17
  br i1 %20, label %.loopexit30, label %18

.loopexit30:                                      ; preds = %19
  store ptr %.ptr23, ptr %0, align 8, !tbaa !12
  %21 = icmp sgt i32 %2, 0
  br i1 %21, label %22, label %._crit_edge

22:                                               ; preds = %.loopexit30
  %wide.trip.count = zext nneg i32 %2 to i64
  %23 = tail call noundef nonnull align 8 dereferenceable(12) ptr @_ZN3vecaSERKS_(ptr noundef nonnull align 8 dereferenceable(12) %.ptr23, ptr noundef nonnull align 8 dereferenceable(12) %1)
  %exitcond.peel.not = icmp eq i32 %2, 1
  br i1 %exitcond.peel.not, label %._crit_edge, label %.lr.ph.peel.next

.lr.ph.peel.next:                                 ; preds = %22, %46
  %indvars.iv = phi i64 [ %indvars.iv.next, %46 ], [ 1, %22 ]
  %24 = getelementptr inbounds %class.vec, ptr %1, i64 %indvars.iv
  %25 = call noundef i32 @_ZN3vec7get_dimEv(ptr noundef nonnull align 8 dereferenceable(12) %24)
  %26 = load i32, ptr %8, align 4, !tbaa !11
  %.not28 = icmp eq i32 %25, %26
  br i1 %.not28, label %41, label %27

27:                                               ; preds = %.lr.ph.peel.next
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  %28 = getelementptr i8, ptr %24, i64 -16
  %29 = call noundef i32 @_ZN3vec7get_dimEv(ptr noundef nonnull align 8 dereferenceable(12) %28)
  call void @_ZN3vecC1Ei(ptr noundef nonnull align 8 dereferenceable(12) %4, i32 noundef %29)
  %30 = load ptr, ptr %0, align 8, !tbaa !12
  %31 = getelementptr inbounds %class.vec, ptr %30, i64 %indvars.iv
  %32 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZN3vecaSERKS_(ptr noundef nonnull align 8 dereferenceable(12) %31, ptr noundef nonnull align 8 dereferenceable(12) %4)
          to label %33 unwind label %40

33:                                               ; preds = %27
  call void @_ZN3vecD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %46

36:                                               ; preds = %18
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = icmp eq i64 %.idx, 8
  br i1 %38, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %36, %.preheader
  %.idx24 = phi i64 [ %.add25, %.preheader ], [ %.idx, %36 ]
  %.add25 = add nsw i64 %.idx24, -16
  %.ptr27 = getelementptr inbounds i8, ptr %14, i64 %.add25
  tail call void @_ZN3vecD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %.ptr27) #8
  %39 = icmp eq i64 %.add25, 8
  br i1 %39, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %36
  tail call void @_ZdaPvm(ptr noundef nonnull %14, i64 noundef %13) #9
  br label %47

40:                                               ; preds = %27
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3vecD1Ev(ptr noundef nonnull align 8 dereferenceable(12) %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  br label %47

41:                                               ; preds = %.lr.ph.peel.next
  %42 = getelementptr inbounds %class.vec, ptr %1, i64 %indvars.iv
  %43 = load ptr, ptr %0, align 8, !tbaa !12
  %44 = getelementptr inbounds %class.vec, ptr %43, i64 %indvars.iv
  %45 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZN3vecaSERKS_(ptr noundef nonnull align 8 dereferenceable(12) %44, ptr noundef nonnull align 8 dereferenceable(12) %42)
  br label %46

46:                                               ; preds = %33, %41
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.peel.next, !llvm.loop !13

._crit_edge:                                      ; preds = %46, %22, %.loopexit30.thread, %.loopexit30
  ret void

47:                                               ; preds = %40, %.loopexit
  %.pn = phi { ptr, i32 } [ %lpad.loopexit, %40 ], [ %37, %.loopexit ]
  resume { ptr, i32 } %.pn
}

declare noundef i32 @_ZN3vec7get_dimEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #2

declare void @_ZN3vecC1Ei(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef) unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { "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 "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 = { nobuiltin nounwind "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 = { 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 #6 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { builtin 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, !10, i64 8}
!6 = !{!"_ZTS3mat", !7, i64 0, !10, i64 8, !10, i64 12}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 12}
!12 = !{!6, !7, i64 0}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass