; LLVM IR from zeux/meshoptimizer :: gltf (write)

; 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 { i32, %"class.std::vector.8", %"class.std::vector.13", ptr, ptr, %struct.cgltf_extras, i32, %"class.std::vector.18", %"class.std::vector.23", i8, [2 x i64], i64, %"class.std::vector.28", %"class.std::vector.33", %"class.std::vector.38" }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<cgltf_node *, std::allocator<cgltf_node *>>::_Vector_impl" }
%"struct.std::_Vector_base<cgltf_node *, std::allocator<cgltf_node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgltf_node *, std::allocator<cgltf_node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgltf_node *, std::allocator<cgltf_node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<Transform, std::allocator<Transform>>::_Vector_impl" }
%"struct.std::_Vector_base<Transform, std::allocator<Transform>>::_Vector_impl" = type { %"struct.std::_Vector_base<Transform, std::allocator<Transform>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Transform, std::allocator<Transform>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.cgltf_extras = type { i64, i64, ptr }
%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<Stream, std::allocator<Stream>>::_Vector_impl" }
%"struct.std::_Vector_base<Stream, std::allocator<Stream>>::_Vector_impl" = type { %"struct.std::_Vector_base<Stream, std::allocator<Stream>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Stream, std::allocator<Stream>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.23" = type { %"struct.std::_Vector_base.24" }
%"struct.std::_Vector_base.24" = 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 }
%"class.std::vector.28" = type { %"struct.std::_Vector_base.29" }
%"struct.std::_Vector_base.29" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = type { %"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl" }
%"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.38" = type { %"struct.std::_Vector_base.39" }
%"struct.std::_Vector_base.39" = type { %"struct.std::_Vector_base<cgltf_material_mapping, std::allocator<cgltf_material_mapping>>::_Vector_impl" }
%"struct.std::_Vector_base<cgltf_material_mapping, std::allocator<cgltf_material_mapping>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgltf_material_mapping, std::allocator<cgltf_material_mapping>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgltf_material_mapping, std::allocator<cgltf_material_mapping>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [12 x i8], align 1

declare void @_Z5commaRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #0

declare void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32), 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z19writeMeshAttributesRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI10BufferViewSaIS7_EES5_RmRK4MeshiRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(256), i32 noundef, ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(148)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z16writeMeshIndicesRSt6vectorI10BufferViewSaIS0_EERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERmRKS_IjSaIjEE20cgltf_primitive_typeRK8Settings(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 4 dereferenceable(148)) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17writeMeshGeometryRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI10BufferViewSaIS7_EES5_RmRK4MeshRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(256) %4, ptr noundef nonnull align 4 dereferenceable(28) %5, ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(148) %7) #2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef @.str.60)
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = load ptr, ptr %12, align 8, !tbaa !5
  %24 = load ptr, ptr %13, align 8, !tbaa !5
  %25 = load ptr, ptr %14, align 8, !tbaa !5
  %26 = load ptr, ptr %15, align 8, !tbaa !5
  %27 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_Z19writeMeshAttributesRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI10BufferViewSaIS7_EES5_RmRK4MeshiRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(256) %24, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(28) %25, ptr noundef nonnull align 4 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(148) %27)
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef @.str.26)
  %29 = load ptr, ptr %13, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.Mesh, ptr %29, i32 0, i32 6
  %31 = load i32, ptr %30, align 8, !tbaa !9
  %32 = icmp ne i32 %31, 5
  br i1 %32, label %33, label %41

33:                                               ; preds = %8
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %34, ptr noundef @.str.61)
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Mesh, ptr %36, i32 0, i32 6
  %38 = load i32, ptr %37, align 8, !tbaa !9
  %39 = sub nsw i32 %38, 1
  %40 = sext i32 %39 to i64
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32) %35, i64 noundef %40)
  br label %41

41:                                               ; preds = %33, %8
  %42 = load ptr, ptr %13, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.Mesh, ptr %42, i32 0, i32 11
  %44 = load i64, ptr %43, align 8, !tbaa !44
  %45 = icmp ne i64 %44, 0
  br i1 %45, label %46, label %75

46:                                               ; preds = %41
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef @.str.62)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store i64 0, ptr %17, align 8, !tbaa !45
  br label %48

48:                                               ; preds = %70, %46
  %49 = load i64, ptr %17, align 8, !tbaa !45
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Mesh, ptr %50, i32 0, i32 11
  %52 = load i64, ptr %51, align 8, !tbaa !44
  %53 = icmp ult i64 %49, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %73

55:                                               ; preds = %48
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z5commaRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %56)
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %57, ptr noundef @.str.63)
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = load i64, ptr %17, align 8, !tbaa !45
  %64 = add i64 1, %63
  %65 = trunc i64 %64 to i32
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = load ptr, ptr %15, align 8, !tbaa !5
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_Z19writeMeshAttributesRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI10BufferViewSaIS7_EES5_RmRK4MeshiRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr noundef nonnull align 8 dereferenceable(32) %58, ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 8 dereferenceable(32) %60, ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull align 8 dereferenceable(256) %62, i32 noundef %65, ptr noundef nonnull align 4 dereferenceable(28) %66, ptr noundef nonnull align 4 dereferenceable(24) %67, ptr noundef nonnull align 4 dereferenceable(148) %68)
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %69, ptr noundef @.str.26)
  br label %70

70:                                               ; preds = %55
  %71 = load i64, ptr %17, align 8, !tbaa !45
  %72 = add i64 %71, 1
  store i64 %72, ptr %17, align 8, !tbaa !45
  br label %48, !llvm.loop !46

73:                                               ; preds = %54
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %74, ptr noundef @.str.64)
  br label %75

75:                                               ; preds = %73, %41
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.Mesh, ptr %76, i32 0, i32 8
  %78 = call noundef zeroext i1 @_ZNKSt6vectorIjSaIjEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #4
  br i1 %78, label %93, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Mesh, ptr %83, i32 0, i32 8
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Mesh, ptr %85, i32 0, i32 6
  %87 = load i32, ptr %86, align 8, !tbaa !9
  %88 = load ptr, ptr %16, align 8, !tbaa !5
  %89 = call noundef i64 @_Z16writeMeshIndicesRSt6vectorI10BufferViewSaIS0_EERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERmRKS_IjSaIjEE20cgltf_primitive_typeRK8Settings(ptr noundef nonnull align 8 dereferenceable(24) %80, ptr noundef nonnull align 8 dereferenceable(32) %81, ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull align 8 dereferenceable(24) %84, i32 noundef %87, ptr noundef nonnull align 4 dereferenceable(148) %88)
  store i64 %89, ptr %18, align 8, !tbaa !45
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %90, ptr noundef @.str.65)
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = load i64, ptr %18, align 8, !tbaa !45
  call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32) %91, i64 noundef %92)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %93

93:                                               ; preds = %79, %75
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIjSaIjEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { 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, !22, i64 96}
!10 = !{!"_ZTS4Mesh", !11, i64 0, !12, i64 8, !16, i64 32, !6, i64 56, !6, i64 64, !20, i64 72, !22, i64 96, !23, i64 104, !27, i64 128, !31, i64 152, !7, i64 160, !21, i64 176, !32, i64 184, !36, i64 208, !40, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIP10cgltf_nodeSaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIP10cgltf_nodeSaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIP10cgltf_nodeSaIS1_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIP10cgltf_nodeSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSSt6vectorI9TransformSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseI9TransformSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI9TransformSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI9TransformSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTS12cgltf_extras", !21, i64 0, !21, i64 8, !6, i64 16}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTS20cgltf_primitive_type", !7, i64 0}
!23 = !{!"_ZTSSt6vectorI6StreamSaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseI6StreamSaIS0_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseI6StreamSaIS0_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseI6StreamSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSSt6vectorIjSaIjEE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"bool", !7, i64 0}
!32 = !{!"_ZTSSt6vectorIfSaIfEE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"_ZTSSt6vectorIPKcSaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseIPKcSaIS1_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!"_ZTSSt6vectorI22cgltf_material_mappingSaIS0_EE", !41, i64 0}
!41 = !{!"_ZTSSt12_Vector_baseI22cgltf_material_mappingSaIS0_EE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseI22cgltf_material_mappingSaIS0_EE12_Vector_implE", !43, i64 0}
!43 = !{!"_ZTSNSt12_Vector_baseI22cgltf_material_mappingSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!44 = !{!10, !21, i64 176}
!45 = !{!21, !21, i64 0}
!46 = distinct !{!46, !47}
!47 = !{!"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"

@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [12 x i8], align 1

declare void @_Z5commaRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

declare void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #0

declare void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z19writeMeshAttributesRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI10BufferViewSaIS7_EES5_RmRK4MeshiRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(256), i32 noundef, ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(148)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z16writeMeshIndicesRSt6vectorI10BufferViewSaIS0_EERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERmRKS_IjSaIjEE20cgltf_primitive_typeRK8Settings(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 4 dereferenceable(148)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17writeMeshGeometryRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI10BufferViewSaIS7_EES5_RmRK4MeshRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(256) %4, ptr noundef nonnull align 4 dereferenceable(28) %5, ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(148) %7) local_unnamed_addr #1 {
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.60)
  tail call void @_Z19writeMeshAttributesRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI10BufferViewSaIS7_EES5_RmRK4MeshiRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(256) %4, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(28) %5, ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(148) %7)
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.26)
  %9 = getelementptr inbounds i8, ptr %4, i64 96
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %.not = icmp eq i32 %10, 5
  br i1 %.not, label %15, label %11

11:                                               ; preds = %8
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.61)
  %12 = load i32, ptr %9, align 8, !tbaa !5
  %13 = add nsw i32 %12, -1
  %14 = sext i32 %13 to i64
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %14)
  br label %15

15:                                               ; preds = %11, %8
  %16 = getelementptr inbounds i8, ptr %4, i64 176
  %17 = load i64, ptr %16, align 8, !tbaa !43
  %.not41 = icmp eq i64 %17, 0
  br i1 %.not41, label %24, label %18

18:                                               ; preds = %15
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.62)
  %19 = load i64, ptr %16, align 8, !tbaa !43
  %.not43 = icmp eq i64 %19, 0
  br i1 %.not43, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %18
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.64)
  br label %24

.lr.ph:                                           ; preds = %18, %.lr.ph
  %.042 = phi i64 [ %20, %.lr.ph ], [ 0, %18 ]
  tail call void @_Z5commaRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %0)
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.63)
  %20 = add nuw i64 %.042, 1
  %21 = trunc i64 %20 to i32
  tail call void @_Z19writeMeshAttributesRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI10BufferViewSaIS7_EES5_RmRK4MeshiRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(256) %4, i32 noundef %21, ptr noundef nonnull align 4 dereferenceable(28) %5, ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(148) %7)
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.26)
  %22 = load i64, ptr %16, align 8, !tbaa !43
  %23 = icmp ult i64 %20, %22
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !44

24:                                               ; preds = %._crit_edge, %15
  %25 = getelementptr inbounds i8, ptr %4, i64 128
  %26 = tail call noundef zeroext i1 @_ZNKSt6vectorIjSaIjEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #3
  br i1 %26, label %30, label %27

27:                                               ; preds = %24
  %28 = load i32, ptr %9, align 8, !tbaa !5
  %29 = tail call noundef i64 @_Z16writeMeshIndicesRSt6vectorI10BufferViewSaIS0_EERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERmRKS_IjSaIjEE20cgltf_primitive_typeRK8Settings(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(24) %25, i32 noundef %28, ptr noundef nonnull align 4 dereferenceable(148) %7)
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.65)
  tail call void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %29)
  br label %30

30:                                               ; preds = %27, %24
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIjSaIjEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 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 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 = { 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, !21, i64 96}
!6 = !{!"_ZTS4Mesh", !7, i64 0, !10, i64 8, !15, i64 32, !14, i64 56, !14, i64 64, !19, i64 72, !21, i64 96, !22, i64 104, !26, i64 128, !30, i64 152, !8, i64 160, !20, i64 176, !31, i64 184, !35, i64 208, !39, i64 232}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIP10cgltf_nodeSaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIP10cgltf_nodeSaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIP10cgltf_nodeSaIS1_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIP10cgltf_nodeSaIS1_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"_ZTSSt6vectorI9TransformSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseI9TransformSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI9TransformSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI9TransformSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!19 = !{!"_ZTS12cgltf_extras", !20, i64 0, !20, i64 8, !14, i64 16}
!20 = !{!"long", !8, i64 0}
!21 = !{!"_ZTS20cgltf_primitive_type", !8, i64 0}
!22 = !{!"_ZTSSt6vectorI6StreamSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseI6StreamSaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI6StreamSaIS0_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseI6StreamSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!26 = !{!"_ZTSSt6vectorIjSaIjEE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!30 = !{!"bool", !8, i64 0}
!31 = !{!"_ZTSSt6vectorIfSaIfEE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!35 = !{!"_ZTSSt6vectorIPKcSaIS1_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIPKcSaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!39 = !{!"_ZTSSt6vectorI22cgltf_material_mappingSaIS0_EE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseI22cgltf_material_mappingSaIS0_EE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseI22cgltf_material_mappingSaIS0_EE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseI22cgltf_material_mappingSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!43 = !{!6, !20, i64 176}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}


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