; LLVM IR from zeux/meshoptimizer :: tools/vcachetuner.ll (Z8gridmeshj)

; 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.Mesh = type { ptr, i64, %"class.std::vector", [2 x float] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [5 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8gridmeshj(ptr dead_on_unwind noalias writable sret(%struct.Mesh) align 8 %0, i32 noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store i32 %1, ptr %4, align 4, !tbaa !5
  store i1 false, ptr %5, align 1
  call void @_ZN4MeshC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  %17 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 0
  store ptr @.str, ptr %17, align 8, !tbaa !9
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = add i32 %18, 1
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = add i32 %20, 1
  %22 = mul i32 %19, %21
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 1
  store i64 %23, ptr %24, align 8, !tbaa !17
  %25 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 2
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = mul i32 %26, %27
  %29 = mul i32 %28, 6
  %30 = zext i32 %29 to i64
  invoke void @_ZNSt6vectorIjSaIjEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %30)
          to label %31 unwind label %37

31:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %137, %31
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = icmp ult i32 %33, %34
  br i1 %35, label %41, label %36

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

37:                                               ; preds = %2
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %6, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %7, align 4
  br label %144

41:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %108, %41
  %43 = load i32, ptr %10, align 4, !tbaa !5
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = icmp ult i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %136

47:                                               ; preds = %42
  %48 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = add i32 %49, 0
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = add i32 %51, 1
  %53 = mul i32 %50, %52
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = add i32 %54, 0
  %56 = add i32 %53, %55
  store i32 %56, ptr %11, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %57 unwind label %111

57:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  %58 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = add i32 %59, 0
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = add i32 %61, 1
  %63 = mul i32 %60, %62
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = add i32 %64, 1
  %66 = add i32 %63, %65
  store i32 %66, ptr %12, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %67 unwind label %115

67:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %68 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = add i32 %69, 1
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = add i32 %71, 1
  %73 = mul i32 %70, %72
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = add i32 %74, 0
  %76 = add i32 %73, %75
  store i32 %76, ptr %13, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %77 unwind label %119

77:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  %78 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = add i32 %79, 1
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = add i32 %81, 1
  %83 = mul i32 %80, %82
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = add i32 %84, 0
  %86 = add i32 %83, %85
  store i32 %86, ptr %14, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %87 unwind label %123

87:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %88 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = add i32 %89, 0
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = add i32 %91, 1
  %93 = mul i32 %90, %92
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = add i32 %94, 1
  %96 = add i32 %93, %95
  store i32 %96, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %88, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %97 unwind label %127

97:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  %98 = getelementptr inbounds %struct.Mesh, ptr %0, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = add i32 %99, 1
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = add i32 %101, 1
  %103 = mul i32 %100, %102
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = add i32 %104, 1
  %106 = add i32 %103, %105
  store i32 %106, ptr %16, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %98, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %107 unwind label %131

107:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = add i32 %109, 1
  store i32 %110, ptr %10, align 4, !tbaa !5
  br label %42, !llvm.loop !18

111:                                              ; preds = %47
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %6, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %135

115:                                              ; preds = %57
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %6, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %135

119:                                              ; preds = %67
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %6, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %135

123:                                              ; preds = %77
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %6, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %135

127:                                              ; preds = %87
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %6, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %135

131:                                              ; preds = %97
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %6, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %135

135:                                              ; preds = %131, %127, %123, %119, %115, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %144

136:                                              ; preds = %46
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %8, align 4, !tbaa !5
  %139 = add i32 %138, 1
  store i32 %139, ptr %8, align 4, !tbaa !5
  br label %32, !llvm.loop !20

140:                                              ; preds = %36
  store i1 true, ptr %5, align 1
  store i32 1, ptr %9, align 4
  %141 = load i1, ptr %5, align 1
  br i1 %141, label %143, label %142

142:                                              ; preds = %140
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  br label %143

143:                                              ; preds = %142, %140
  ret void

144:                                              ; preds = %135, %37
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  br label %145

145:                                              ; preds = %144
  %146 = load ptr, ptr %6, align 8
  %147 = load i32, ptr %7, align 4
  %148 = insertvalue { ptr, i32 } poison, ptr %146, 0
  %149 = insertvalue { ptr, i32 } %148, i32 %147, 1
  resume { ptr, i32 } %149
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS4Mesh", !11, i64 0, !12, i64 8, !13, i64 16, !7, i64 40}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSSt6vectorIjSaIjEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!17 = !{!10, !12, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; 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.Mesh = type { ptr, i64, %"class.std::vector", [2 x float] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [5 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: 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 @_Z8gridmeshj(ptr dead_on_unwind noalias nonnull writable sret(%struct.Mesh) align 8 %0, i32 noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  tail call void @_ZN4MeshC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  store ptr @.str, ptr %0, align 8, !tbaa !5
  %9 = add i32 %1, 1
  %10 = mul i32 %9, %9
  %11 = zext i32 %10 to i64
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %11, ptr %12, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = mul i32 %1, 6
  %15 = mul i32 %14, %1
  %16 = zext i32 %15 to i64
  invoke void @_ZNSt6vectorIjSaIjEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %16)
          to label %.preheader37 unwind label %20

.preheader37:                                     ; preds = %2
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %._crit_edge, label %.preheader

.preheader:                                       ; preds = %.preheader37, %22
  %.03039 = phi i32 [ %18, %22 ], [ 0, %.preheader37 ]
  %17 = mul i32 %.03039, %9
  %18 = add nuw i32 %.03039, 1
  %19 = mul i32 %18, %9
  br label %23

20:                                               ; preds = %2
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %47

22:                                               ; preds = %34
  %exitcond40.not = icmp eq i32 %18, %1
  br i1 %exitcond40.not, label %._crit_edge, label %.preheader, !llvm.loop !16

23:                                               ; preds = %.preheader, %34
  %.038 = phi i32 [ 0, %.preheader ], [ %26, %34 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %24 = add i32 %.038, %17
  store i32 %24, ptr %3, align 4, !tbaa !18
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %25 unwind label %35

25:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %26 = add nuw i32 %.038, 1
  %27 = add i32 %26, %17
  store i32 %27, ptr %4, align 4, !tbaa !18
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %28 unwind label %37

28:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %29 = add i32 %.038, %19
  store i32 %29, ptr %5, align 4, !tbaa !18
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %30 unwind label %39

30:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 %29, ptr %6, align 4, !tbaa !18
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %31 unwind label %41

31:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 %27, ptr %7, align 4, !tbaa !18
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %32 unwind label %43

32:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #3
  %33 = add i32 %26, %19
  store i32 %33, ptr %8, align 4, !tbaa !18
  invoke void @_ZNSt6vectorIjSaIjEE9push_backEOj(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %34 unwind label %45

34:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  %exitcond.not = icmp eq i32 %26, %1
  br i1 %exitcond.not, label %22, label %23, !llvm.loop !20

35:                                               ; preds = %23
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  br label %47

37:                                               ; preds = %25
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %47

39:                                               ; preds = %28
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br label %47

41:                                               ; preds = %30
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  br label %47

43:                                               ; preds = %31
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br label %47

45:                                               ; preds = %32
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  br label %47

._crit_edge:                                      ; preds = %22, %.preheader37
  ret void

47:                                               ; preds = %35, %37, %39, %41, %43, %45, %20
  %.pn.pn = phi { ptr, i32 } [ %21, %20 ], [ %46, %45 ], [ %44, %43 ], [ %42, %41 ], [ %40, %39 ], [ %38, %37 ], [ %36, %35 ]
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #3
  resume { ptr, i32 } %.pn.pn
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!"_ZTS4Mesh", !7, i64 0, !10, i64 8, !11, i64 16, !8, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIjSaIjEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!6, !10, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !8, i64 0}
!20 = distinct !{!20, !17}


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