; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/code/PostProcessing (SplitLargeMeshes)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<aiMesh *, unsigned int>, std::allocator<std::pair<aiMesh *, unsigned int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<aiMesh *, unsigned int>, std::allocator<std::pair<aiMesh *, unsigned int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<aiMesh *, unsigned int>, std::allocator<std::pair<aiMesh *, unsigned int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<aiMesh *, unsigned int>, std::allocator<std::pair<aiMesh *, unsigned int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Assimp::SplitLargeMeshesProcess_Vertex" = type <{ %"class.Assimp::BaseProcess", i32, [4 x i8] }>
%"class.Assimp::BaseProcess" = type { ptr, ptr, ptr }
%struct.aiScene = type { i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, %struct.aiString, i32, ptr, ptr }
%struct.aiString = type { i32, [1024 x i8] }
%struct.aiMesh = type { i32, i32, i32, ptr, ptr, ptr, ptr, [8 x ptr], [8 x ptr], [8 x i32], ptr, i32, ptr, i32, %struct.aiString, i32, ptr, i32, %struct.aiAABB, ptr }
%struct.aiAABB = type { %class.aiVector3t, %class.aiVector3t }
%class.aiVector3t = type { float, float, float }
%"struct.std::pair" = type <{ ptr, i32, [4 x i8] }>

@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [65 x i8], align 1

declare noundef ptr @_ZN6Assimp13DefaultLogger3getEv() #0

declare void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) #0

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #3

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

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

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

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

declare void @_ZN6Assimp6Logger4infoEPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Assimp30SplitLargeMeshesProcess_Vertex7ExecuteEP7aiScene(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef %1) unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  %13 = getelementptr inbounds %"class.Assimp::SplitLargeMeshesProcess_Vertex", ptr %12, i32 0, i32 1
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = icmp eq i32 -1, %14
  br i1 %15, label %19, label %16

16:                                               ; preds = %2
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = icmp eq ptr null, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %16, %2
  br label %139

20:                                               ; preds = %16
  %21 = call noundef ptr @_ZN6Assimp13DefaultLogger3getEv()
  call void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12) %21, ptr noundef @.str.5)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #7
  call void @_ZNSt6vectorISt4pairIP6aiMeshjESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !13
  br label %22

22:                                               ; preds = %42, %20
  %23 = load i32, ptr %6, align 4, !tbaa !13
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.aiScene, ptr %24, i32 0, i32 2
  %26 = load i32, ptr %25, align 8, !tbaa !14
  %27 = icmp ult i32 %23, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  store i32 2, ptr %7, align 4
  br label %45

29:                                               ; preds = %22
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.aiScene, ptr %30, i32 0, i32 3
  %32 = load ptr, ptr %31, align 8, !tbaa !17
  %33 = load i32, ptr %6, align 4, !tbaa !13
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds ptr, ptr %32, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.aiMesh, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !18
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %40, label %41

40:                                               ; preds = %29
  store i32 1, ptr %7, align 4
  br label %45

41:                                               ; preds = %29
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %6, align 4, !tbaa !13
  %44 = add i32 %43, 1
  store i32 %44, ptr %6, align 4, !tbaa !13
  br label %22, !llvm.loop !24

45:                                               ; preds = %40, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %46 = load i32, ptr %7, align 4
  switch i32 %46, label %137 [
    i32 2, label %47
  ]

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %48

48:                                               ; preds = %65, %47
  %49 = load i32, ptr %8, align 4, !tbaa !13
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.aiScene, ptr %50, i32 0, i32 2
  %52 = load i32, ptr %51, align 8, !tbaa !14
  %53 = icmp ult i32 %49, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %48
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %72

55:                                               ; preds = %48
  %56 = load i32, ptr %8, align 4, !tbaa !13
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.aiScene, ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !17
  %60 = load i32, ptr %8, align 4, !tbaa !13
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds ptr, ptr %59, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  invoke void @_ZN6Assimp30SplitLargeMeshesProcess_Vertex9SplitMeshEjP6aiMeshRSt6vectorISt4pairIS2_jESaIS5_EE(ptr noundef nonnull align 8 dereferenceable(28) %12, i32 noundef %56, ptr noundef %63, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %64 unwind label %68

64:                                               ; preds = %55
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %8, align 4, !tbaa !13
  %67 = add i32 %66, 1
  store i32 %67, ptr %8, align 4, !tbaa !13
  br label %48, !llvm.loop !26

68:                                               ; preds = %55
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %9, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %140

72:                                               ; preds = %54
  %73 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.aiScene, ptr %74, i32 0, i32 2
  %76 = load i32, ptr %75, align 8, !tbaa !14
  %77 = zext i32 %76 to i64
  %78 = icmp ne i64 %73, %77
  br i1 %78, label %79, label %132

79:                                               ; preds = %72
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.aiScene, ptr %80, i32 0, i32 3
  %82 = load ptr, ptr %81, align 8, !tbaa !17
  %83 = icmp eq ptr %82, null
  br i1 %83, label %85, label %84

84:                                               ; preds = %79
  call void @_ZdaPv(ptr noundef %82) #8
  br label %85

85:                                               ; preds = %84, %79
  %86 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %87 = trunc i64 %86 to i32
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.aiScene, ptr %88, i32 0, i32 2
  store i32 %87, ptr %89, align 8, !tbaa !14
  %90 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %91 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %90, i64 8)
  %92 = extractvalue { i64, i1 } %91, 1
  %93 = extractvalue { i64, i1 } %91, 0
  %94 = select i1 %92, i64 -1, i64 %93
  %95 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %94) #9
          to label %96 unwind label %105

96:                                               ; preds = %85
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.aiScene, ptr %97, i32 0, i32 3
  store ptr %95, ptr %98, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !13
  br label %99

99:                                               ; preds = %121, %96
  %100 = load i32, ptr %11, align 4, !tbaa !13
  %101 = zext i32 %100 to i64
  %102 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %103 = icmp ult i64 %101, %102
  br i1 %103, label %109, label %104

104:                                              ; preds = %99
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %124

105:                                              ; preds = %134, %132, %130, %128, %124, %85
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %9, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %10, align 4
  br label %140

109:                                              ; preds = %99
  %110 = load i32, ptr %11, align 4, !tbaa !13
  %111 = zext i32 %110 to i64
  %112 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIP6aiMeshjESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %111) #7
  %113 = getelementptr inbounds %"struct.std::pair", ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !27
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.aiScene, ptr %115, i32 0, i32 3
  %117 = load ptr, ptr %116, align 8, !tbaa !17
  %118 = load i32, ptr %11, align 4, !tbaa !13
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds ptr, ptr %117, i64 %119
  store ptr %114, ptr %120, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %109
  %122 = load i32, ptr %11, align 4, !tbaa !13
  %123 = add i32 %122, 1
  store i32 %123, ptr %11, align 4, !tbaa !13
  br label %99, !llvm.loop !29

124:                                              ; preds = %104
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.aiScene, ptr %125, i32 0, i32 1
  %127 = load ptr, ptr %126, align 8, !tbaa !30
  invoke void @_ZN6Assimp32SplitLargeMeshesProcess_Triangle10UpdateNodeEP6aiNodeRKSt6vectorISt4pairIP6aiMeshjESaIS7_EE(ptr noundef %127, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %128 unwind label %105

128:                                              ; preds = %124
  %129 = invoke noundef ptr @_ZN6Assimp13DefaultLogger3getEv()
          to label %130 unwind label %105

130:                                              ; preds = %128
  invoke void @_ZN6Assimp6Logger4infoEPKc(ptr noundef nonnull align 8 dereferenceable(12) %129, ptr noundef @.str.6)
          to label %131 unwind label %105

131:                                              ; preds = %130
  br label %136

132:                                              ; preds = %72
  %133 = invoke noundef ptr @_ZN6Assimp13DefaultLogger3getEv()
          to label %134 unwind label %105

134:                                              ; preds = %132
  invoke void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12) %133, ptr noundef @.str.7)
          to label %135 unwind label %105

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135, %131
  store i32 0, ptr %7, align 4
  br label %137

137:                                              ; preds = %136, %45
  call void @_ZNSt6vectorISt4pairIP6aiMeshjESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  %138 = load i32, ptr %7, align 4
  switch i32 %138, label %146 [
    i32 0, label %139
    i32 1, label %139
  ]

139:                                              ; preds = %137, %137, %19
  ret void

140:                                              ; preds = %105, %68
  call void @_ZNSt6vectorISt4pairIP6aiMeshjESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %9, align 8
  %143 = load i32, ptr %10, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145

146:                                              ; preds = %137
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Assimp30SplitLargeMeshesProcess_Vertex9SplitMeshEjP6aiMeshRSt6vectorISt4pairIS2_jESaIS5_EE(ptr noundef nonnull align 8 dereferenceable(28), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #6 align 2

attributes #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 = { 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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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 = { nounwind }
attributes #8 = { builtin nounwind }
attributes #9 = { builtin allocsize(0) }

!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, !12, i64 24}
!10 = !{!"_ZTSN6Assimp30SplitLargeMeshesProcess_VertexE", !11, i64 0, !12, i64 24}
!11 = !{!"_ZTSN6Assimp11BaseProcessE", !6, i64 8, !6, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!15, !12, i64 16}
!15 = !{!"_ZTS7aiScene", !12, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !12, i64 32, !6, i64 40, !12, i64 48, !6, i64 56, !12, i64 64, !6, i64 72, !12, i64 80, !6, i64 88, !12, i64 96, !6, i64 104, !6, i64 112, !16, i64 120, !12, i64 1148, !6, i64 1152, !6, i64 1160}
!16 = !{!"_ZTS8aiString", !12, i64 0, !7, i64 4}
!17 = !{!15, !6, i64 24}
!18 = !{!19, !12, i64 0}
!19 = !{!"_ZTS6aiMesh", !12, i64 0, !12, i64 4, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !7, i64 48, !7, i64 112, !7, i64 176, !6, i64 208, !12, i64 216, !6, i64 224, !12, i64 232, !16, i64 236, !12, i64 1264, !6, i64 1272, !20, i64 1280, !21, i64 1284, !6, i64 1312}
!20 = !{!"_ZTS16aiMorphingMethod", !7, i64 0}
!21 = !{!"_ZTS6aiAABB", !22, i64 0, !22, i64 12}
!22 = !{!"_ZTS10aiVector3tIfE", !23, i64 0, !23, i64 4, !23, i64 8}
!23 = !{!"float", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = !{!28, !6, i64 0}
!28 = !{!"_ZTSSt4pairIP6aiMeshjE", !6, i64 0, !12, i64 8}
!29 = distinct !{!29, !25}
!30 = !{!15, !6, i64 8}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<aiMesh *, unsigned int>, std::allocator<std::pair<aiMesh *, unsigned int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<aiMesh *, unsigned int>, std::allocator<std::pair<aiMesh *, unsigned int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<aiMesh *, unsigned int>, std::allocator<std::pair<aiMesh *, unsigned int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<aiMesh *, unsigned int>, std::allocator<std::pair<aiMesh *, unsigned int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [65 x i8], align 1

declare noundef ptr @_ZN6Assimp13DefaultLogger3getEv() local_unnamed_addr #0

declare void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) local_unnamed_addr #0

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

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

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

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

declare void @_ZN6Assimp6Logger4infoEPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Assimp30SplitLargeMeshesProcess_Vertex7ExecuteEP7aiScene(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef %1) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp eq i32 %5, -1
  %7 = icmp eq ptr %1, null
  %or.cond = or i1 %7, %6
  br i1 %or.cond, label %68, label %8

8:                                                ; preds = %2
  %9 = tail call noundef ptr @_ZN6Assimp13DefaultLogger3getEv()
  tail call void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12) %9, ptr noundef nonnull @.str.5)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNSt6vectorISt4pairIP6aiMeshjESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !12
  %.not37.not = icmp eq i32 %11, 0
  br i1 %.not37.not, label %.critedge._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8
  %12 = getelementptr inbounds i8, ptr %1, i64 24
  %13 = load ptr, ptr %12, align 8, !tbaa !15
  %wide.trip.count = zext i32 %11 to i64
  br label %16

14:                                               ; preds = %16
  %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 %.critedge.preheader, label %16, !llvm.loop !16

.critedge.preheader:                              ; preds = %14
  br i1 %.not37.not, label %.critedge._crit_edge, label %.lr.ph40

.lr.ph40:                                         ; preds = %.critedge.preheader
  %15 = getelementptr inbounds i8, ptr %1, i64 24
  br label %24

16:                                               ; preds = %.lr.ph, %14
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %14 ]
  %17 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv
  %18 = load ptr, ptr %17, align 8, !tbaa !18
  %19 = load i32, ptr %18, align 8, !tbaa !19
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %.loopexit, label %14

.critedge._crit_edge:                             ; preds = %.critedge, %8, %.critedge.preheader
  %21 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %22 = load i32, ptr %10, align 8, !tbaa !12
  %23 = zext i32 %22 to i64
  %.not34 = icmp eq i64 %21, %23
  br i1 %.not34, label %65, label %34

24:                                               ; preds = %.lr.ph40, %.critedge
  %indvars.iv46 = phi i64 [ 0, %.lr.ph40 ], [ %indvars.iv.next47, %.critedge ]
  %25 = load ptr, ptr %15, align 8, !tbaa !15
  %26 = getelementptr inbounds ptr, ptr %25, i64 %indvars.iv46
  %27 = load ptr, ptr %26, align 8, !tbaa !18
  %28 = trunc nuw i64 %indvars.iv46 to i32
  invoke void @_ZN6Assimp30SplitLargeMeshesProcess_Vertex9SplitMeshEjP6aiMeshRSt6vectorISt4pairIS2_jESaIS5_EE(ptr noundef nonnull align 8 dereferenceable(28) %0, i32 noundef %28, ptr noundef %27, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %.critedge unwind label %32

.critedge:                                        ; preds = %24
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %29 = load i32, ptr %10, align 8, !tbaa !12
  %30 = zext i32 %29 to i64
  %31 = icmp ult i64 %indvars.iv.next47, %30
  br i1 %31, label %24, label %.critedge._crit_edge, !llvm.loop !25

32:                                               ; preds = %24
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %69

34:                                               ; preds = %.critedge._crit_edge
  %35 = getelementptr inbounds i8, ptr %1, i64 24
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %37 = icmp eq ptr %36, null
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @_ZdaPv(ptr noundef nonnull %36) #7
  br label %39

39:                                               ; preds = %38, %34
  %40 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %41 = trunc i64 %40 to i32
  store i32 %41, ptr %10, align 8, !tbaa !12
  %42 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %43 = icmp ugt i64 %42, 2305843009213693951
  %44 = shl nuw i64 %42, 3
  %45 = select i1 %43, i64 -1, i64 %44
  %46 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %45) #8
          to label %47 unwind label %51

47:                                               ; preds = %39
  store ptr %46, ptr %35, align 8, !tbaa !15
  %48 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %.not44 = icmp eq i64 %48, 0
  br i1 %.not44, label %._crit_edge, label %.lr.ph42

._crit_edge:                                      ; preds = %.lr.ph42, %47
  %49 = getelementptr inbounds i8, ptr %1, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !26
  invoke void @_ZN6Assimp32SplitLargeMeshesProcess_Triangle10UpdateNodeEP6aiNodeRKSt6vectorISt4pairIP6aiMeshjESaIS7_EE(ptr noundef %50, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %62 unwind label %51

51:                                               ; preds = %67, %65, %64, %62, %._crit_edge, %39
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %69

.lr.ph42:                                         ; preds = %47, %.lr.ph42
  %53 = phi i64 [ %59, %.lr.ph42 ], [ 0, %47 ]
  %.041 = phi i32 [ %58, %.lr.ph42 ], [ 0, %47 ]
  %54 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIP6aiMeshjESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %53) #6
  %55 = load ptr, ptr %54, align 8, !tbaa !27
  %56 = load ptr, ptr %35, align 8, !tbaa !15
  %57 = getelementptr inbounds ptr, ptr %56, i64 %53
  store ptr %55, ptr %57, align 8, !tbaa !18
  %58 = add i32 %.041, 1
  %59 = zext i32 %58 to i64
  %60 = call noundef i64 @_ZNKSt6vectorISt4pairIP6aiMeshjESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %61 = icmp ugt i64 %60, %59
  br i1 %61, label %.lr.ph42, label %._crit_edge, !llvm.loop !29

62:                                               ; preds = %._crit_edge
  %63 = invoke noundef ptr @_ZN6Assimp13DefaultLogger3getEv()
          to label %64 unwind label %51

64:                                               ; preds = %62
  invoke void @_ZN6Assimp6Logger4infoEPKc(ptr noundef nonnull align 8 dereferenceable(12) %63, ptr noundef nonnull @.str.6)
          to label %.loopexit unwind label %51

65:                                               ; preds = %.critedge._crit_edge
  %66 = invoke noundef ptr @_ZN6Assimp13DefaultLogger3getEv()
          to label %67 unwind label %51

67:                                               ; preds = %65
  invoke void @_ZN6Assimp6Logger5debugEPKc(ptr noundef nonnull align 8 dereferenceable(12) %66, ptr noundef nonnull @.str.7)
          to label %.loopexit unwind label %51

.loopexit:                                        ; preds = %16, %64, %67
  call void @_ZNSt6vectorISt4pairIP6aiMeshjESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  br label %68

68:                                               ; preds = %2, %.loopexit
  ret void

69:                                               ; preds = %51, %32
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %52, %51 ]
  call void @_ZNSt6vectorISt4pairIP6aiMeshjESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Assimp30SplitLargeMeshesProcess_Vertex9SplitMeshEjP6aiMeshRSt6vectorISt4pairIS2_jESaIS5_EE(ptr noundef nonnull align 8 dereferenceable(28), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

attributes #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 = { 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 = { 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 #4 = { 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 #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 = { nounwind }
attributes #7 = { builtin nounwind }
attributes #8 = { builtin allocsize(0) }

!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, !11, i64 24}
!6 = !{!"_ZTSN6Assimp30SplitLargeMeshesProcess_VertexE", !7, i64 0, !11, i64 24}
!7 = !{!"_ZTSN6Assimp11BaseProcessE", !8, i64 8, !8, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!13, !11, i64 16}
!13 = !{!"_ZTS7aiScene", !11, i64 0, !8, i64 8, !11, i64 16, !8, i64 24, !11, i64 32, !8, i64 40, !11, i64 48, !8, i64 56, !11, i64 64, !8, i64 72, !11, i64 80, !8, i64 88, !11, i64 96, !8, i64 104, !8, i64 112, !14, i64 120, !11, i64 1148, !8, i64 1152, !8, i64 1160}
!14 = !{!"_ZTS8aiString", !11, i64 0, !9, i64 4}
!15 = !{!13, !8, i64 24}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !11, i64 0}
!20 = !{!"_ZTS6aiMesh", !11, i64 0, !11, i64 4, !11, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !9, i64 48, !9, i64 112, !9, i64 176, !8, i64 208, !11, i64 216, !8, i64 224, !11, i64 232, !14, i64 236, !11, i64 1264, !8, i64 1272, !21, i64 1280, !22, i64 1284, !8, i64 1312}
!21 = !{!"_ZTS16aiMorphingMethod", !9, i64 0}
!22 = !{!"_ZTS6aiAABB", !23, i64 0, !23, i64 12}
!23 = !{!"_ZTS10aiVector3tIfE", !24, i64 0, !24, i64 4, !24, i64 8}
!24 = !{!"float", !9, i64 0}
!25 = distinct !{!25, !17}
!26 = !{!13, !8, i64 8}
!27 = !{!28, !8, i64 0}
!28 = !{!"_ZTSSt4pairIP6aiMeshjE", !8, i64 0, !11, i64 8}
!29 = distinct !{!29, !17}


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