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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.StreamFormat = type { i32, i32, i8, i64, i32 }
%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 }
%struct.Stream = type { i32, i32, i32, ptr, %"class.std::vector.43" }
%"class.std::vector.43" = type { %"struct.std::_Vector_base.44" }
%"struct.std::_Vector_base.44" = type { %"struct.std::_Vector_base<Attr, std::allocator<Attr>>::_Vector_impl" }
%"struct.std::_Vector_base<Attr, std::allocator<Attr>>::_Vector_impl" = type { %"struct.std::_Vector_base<Attr, std::allocator<Attr>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Attr, std::allocator<Attr>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Settings = type { i32, i32, i32, i32, i8, i8, i8, i8, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, float, float, i8, i8, i8, float, i32, i8, i8, i8, i8, i8, [4 x float], [4 x i32], [4 x i32], [4 x i32], i32, i8, i8, i8, i8, i32 }
%struct.BufferView = type { i32, i32, i32, i64, i32, %"class.std::__cxx11::basic_string", i64 }

@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z13attributeType20cgltf_attribute_type(i32 noundef) #0

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local 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 %5, ptr noundef nonnull align 4 dereferenceable(28) %6, ptr noundef nonnull align 4 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(148) %8) #2 personality ptr @__gxx_personality_v0 {
  %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 i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca %struct.StreamFormat, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca [3 x float], align 4
  %30 = alloca [3 x float], align 4
  %31 = alloca i64, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store ptr %4, ptr %14, align 8, !tbaa !5
  store i32 %5, ptr %15, align 4, !tbaa !9
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store i64 0, ptr %20, align 8, !tbaa !11
  br label %32

32:                                               ; preds = %206, %9
  %33 = load i64, ptr %20, align 8, !tbaa !11
  %34 = load ptr, ptr %14, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.Mesh, ptr %34, i32 0, i32 7
  %36 = call noundef i64 @_ZNKSt6vectorI6StreamSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #5
  %37 = icmp ult i64 %33, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %32
  store i32 2, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %212

39:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.Mesh, ptr %40, i32 0, i32 7
  %42 = load i64, ptr %20, align 8, !tbaa !11
  %43 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorI6StreamSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %42) #5
  store ptr %43, ptr %22, align 8, !tbaa !5
  %44 = load ptr, ptr %22, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.Stream, ptr %44, i32 0, i32 2
  %46 = load i32, ptr %45, align 8, !tbaa !13
  %47 = load i32, ptr %15, align 4, !tbaa !9
  %48 = icmp ne i32 %46, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %39
  store i32 4, ptr %21, align 4
  br label %203

50:                                               ; preds = %39
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #5
  %51 = load ptr, ptr %22, align 8, !tbaa !5
  %52 = load ptr, ptr %16, align 8, !tbaa !5
  %53 = load ptr, ptr %17, align 8, !tbaa !5
  %54 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @_Z17writeVertexStreamRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERK6StreamRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr dead_on_unwind writable sret(%struct.StreamFormat) align 8 %23, ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(48) %51, ptr noundef nonnull align 4 dereferenceable(28) %52, ptr noundef nonnull align 4 dereferenceable(24) %53, ptr noundef nonnull align 4 dereferenceable(148) %54)
          to label %55 unwind label %113

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %56 = load ptr, ptr %18, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.Settings, ptr %56, i32 0, i32 38
  %58 = load i8, ptr %57, align 1, !tbaa !20, !range !24, !noundef !25
  %59 = trunc i8 %58 to i1
  %60 = zext i1 %59 to i64
  %61 = select i1 %59, i32 0, i32 -1
  store i32 %61, ptr %26, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.StreamFormat, ptr %23, i32 0, i32 4
  %64 = load i32, ptr %63, align 8, !tbaa !28
  %65 = load i32, ptr %26, align 4, !tbaa !26
  %66 = getelementptr inbounds %struct.StreamFormat, ptr %23, i32 0, i32 3
  %67 = load i64, ptr %66, align 8, !tbaa !33
  %68 = load ptr, ptr %22, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.Stream, ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !34
  %71 = invoke noundef i64 @_Z13getBufferViewRSt6vectorI10BufferViewSaIS0_EENS0_4KindEN12StreamFormat6FilterENS0_11CompressionEmi(ptr noundef nonnull align 8 dereferenceable(24) %62, i32 noundef 0, i32 noundef %64, i32 noundef %65, i64 noundef %67, i32 noundef %70)
          to label %72 unwind label %117

72:                                               ; preds = %55
  store i64 %71, ptr %27, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = load i64, ptr %27, align 8, !tbaa !11
  %75 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6vectorI10BufferViewSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %74) #5
  %76 = getelementptr inbounds %struct.BufferView, ptr %75, i32 0, i32 5
  %77 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %76) #5
  store i64 %77, ptr %28, align 8, !tbaa !11
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = load i64, ptr %27, align 8, !tbaa !11
  %80 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6vectorI10BufferViewSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %79) #5
  %81 = getelementptr inbounds %struct.BufferView, ptr %80, i32 0, i32 5
  %82 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %81, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %83 unwind label %121

83:                                               ; preds = %72
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_Z5commaRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %84)
          to label %85 unwind label %121

85:                                               ; preds = %83
  %86 = load ptr, ptr %22, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Stream, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !34
  %89 = icmp eq i32 %88, 1
  br i1 %89, label %90, label %129

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #5
  call void @llvm.memset.p0.i64(ptr align 4 %29, i8 0, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #5
  call void @llvm.memset.p0.i64(ptr align 4 %30, i8 0, i64 12, i1 false)
  %91 = getelementptr inbounds [3 x float], ptr %29, i64 0, i64 0
  %92 = getelementptr inbounds [3 x float], ptr %30, i64 0, i64 0
  %93 = load ptr, ptr %22, align 8, !tbaa !5
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  %95 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @_Z17getPositionBoundsPfS_RK6StreamRK20QuantizationPositionRK8Settings(ptr noundef %91, ptr noundef %92, ptr noundef nonnull align 8 dereferenceable(48) %93, ptr noundef nonnull align 4 dereferenceable(28) %94, ptr noundef nonnull align 4 dereferenceable(148) %95)
          to label %96 unwind label %125

96:                                               ; preds = %90
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = load i64, ptr %27, align 8, !tbaa !11
  %99 = load i64, ptr %28, align 8, !tbaa !11
  %100 = getelementptr inbounds %struct.StreamFormat, ptr %23, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !35
  %102 = getelementptr inbounds %struct.StreamFormat, ptr %23, i32 0, i32 1
  %103 = load i32, ptr %102, align 4, !tbaa !36
  %104 = getelementptr inbounds %struct.StreamFormat, ptr %23, i32 0, i32 2
  %105 = load i8, ptr %104, align 8, !tbaa !37, !range !24, !noundef !25
  %106 = trunc i8 %105 to i1
  %107 = load ptr, ptr %22, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Stream, ptr %107, i32 0, i32 4
  %109 = call noundef i64 @_ZNKSt6vectorI4AttrSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #5
  %110 = getelementptr inbounds [3 x float], ptr %29, i64 0, i64 0
  %111 = getelementptr inbounds [3 x float], ptr %30, i64 0, i64 0
  invoke void @_ZL13writeAccessorRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm10cgltf_type20cgltf_component_typebmPKfS9_m(ptr noundef nonnull align 8 dereferenceable(32) %97, i64 noundef %98, i64 noundef %99, i32 noundef %101, i32 noundef %103, i1 noundef zeroext %106, i64 noundef %109, ptr noundef %110, ptr noundef %111, i64 noundef 3)
          to label %112 unwind label %125

112:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #5
  br label %144

113:                                              ; preds = %50
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %24, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %25, align 4
  br label %211

117:                                              ; preds = %55
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %24, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %25, align 4
  br label %210

121:                                              ; preds = %129, %83, %72
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %24, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %25, align 4
  br label %209

125:                                              ; preds = %96, %90
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %24, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #5
  br label %209

129:                                              ; preds = %85
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = load i64, ptr %27, align 8, !tbaa !11
  %132 = load i64, ptr %28, align 8, !tbaa !11
  %133 = getelementptr inbounds %struct.StreamFormat, ptr %23, i32 0, i32 0
  %134 = load i32, ptr %133, align 8, !tbaa !35
  %135 = getelementptr inbounds %struct.StreamFormat, ptr %23, i32 0, i32 1
  %136 = load i32, ptr %135, align 4, !tbaa !36
  %137 = getelementptr inbounds %struct.StreamFormat, ptr %23, i32 0, i32 2
  %138 = load i8, ptr %137, align 8, !tbaa !37, !range !24, !noundef !25
  %139 = trunc i8 %138 to i1
  %140 = load ptr, ptr %22, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.Stream, ptr %140, i32 0, i32 4
  %142 = call noundef i64 @_ZNKSt6vectorI4AttrSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %141) #5
  invoke void @_ZL13writeAccessorRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm10cgltf_type20cgltf_component_typebmPKfS9_m(ptr noundef nonnull align 8 dereferenceable(32) %130, i64 noundef %131, i64 noundef %132, i32 noundef %134, i32 noundef %136, i1 noundef zeroext %139, i64 noundef %142, ptr noundef null, ptr noundef null, i64 noundef 0)
          to label %143 unwind label %121

143:                                              ; preds = %129
  br label %144

144:                                              ; preds = %143, %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  %146 = load i64, ptr %145, align 8, !tbaa !11
  %147 = add i64 %146, 1
  store i64 %147, ptr %145, align 8, !tbaa !11
  store i64 %146, ptr %31, align 8, !tbaa !11
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_Z5commaRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %148)
          to label %149 unwind label %162

149:                                              ; preds = %144
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %150, ptr noundef @.str.15)
          to label %151 unwind label %162

151:                                              ; preds = %149
  %152 = load ptr, ptr %22, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.Stream, ptr %152, i32 0, i32 3
  %154 = load ptr, ptr %153, align 8, !tbaa !38
  %155 = icmp ne ptr %154, null
  br i1 %155, label %156, label %166

156:                                              ; preds = %151
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = load ptr, ptr %22, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.Stream, ptr %158, i32 0, i32 3
  %160 = load ptr, ptr %159, align 8, !tbaa !38
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %157, ptr noundef %160)
          to label %161 unwind label %162

161:                                              ; preds = %156
  br label %197

162:                                              ; preds = %199, %197, %189, %187, %166, %156, %149, %144
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %24, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %209

166:                                              ; preds = %151
  %167 = load ptr, ptr %10, align 8, !tbaa !5
  %168 = load ptr, ptr %22, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.Stream, ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 8, !tbaa !34
  %171 = call noundef ptr @_Z13attributeType20cgltf_attribute_type(i32 noundef %170)
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %167, ptr noundef %171)
          to label %172 unwind label %162

172:                                              ; preds = %166
  %173 = load ptr, ptr %22, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.Stream, ptr %173, i32 0, i32 0
  %175 = load i32, ptr %174, align 8, !tbaa !34
  %176 = icmp ne i32 %175, 1
  br i1 %176, label %177, label %196

177:                                              ; preds = %172
  %178 = load ptr, ptr %22, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.Stream, ptr %178, i32 0, i32 0
  %180 = load i32, ptr %179, align 8, !tbaa !34
  %181 = icmp ne i32 %180, 2
  br i1 %181, label %182, label %196

182:                                              ; preds = %177
  %183 = load ptr, ptr %22, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.Stream, ptr %183, i32 0, i32 0
  %185 = load i32, ptr %184, align 8, !tbaa !34
  %186 = icmp ne i32 %185, 3
  br i1 %186, label %187, label %196

187:                                              ; preds = %182
  %188 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %188, ptr noundef @.str.58)
          to label %189 unwind label %162

189:                                              ; preds = %187
  %190 = load ptr, ptr %10, align 8, !tbaa !5
  %191 = load ptr, ptr %22, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.Stream, ptr %191, i32 0, i32 1
  %193 = load i32, ptr %192, align 4, !tbaa !39
  %194 = sext i32 %193 to i64
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32) %190, i64 noundef %194)
          to label %195 unwind label %162

195:                                              ; preds = %189
  br label %196

196:                                              ; preds = %195, %182, %177, %172
  br label %197

197:                                              ; preds = %196, %161
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %198, ptr noundef @.str.59)
          to label %199 unwind label %162

199:                                              ; preds = %197
  %200 = load ptr, ptr %10, align 8, !tbaa !5
  %201 = load i64, ptr %31, align 8, !tbaa !11
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32) %200, i64 noundef %201)
          to label %202 unwind label %162

202:                                              ; preds = %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #5
  store i32 0, ptr %21, align 4
  br label %203

203:                                              ; preds = %202, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %204 = load i32, ptr %21, align 4
  switch i32 %204, label %218 [
    i32 0, label %205
    i32 4, label %206
  ]

205:                                              ; preds = %203
  br label %206

206:                                              ; preds = %205, %203
  %207 = load i64, ptr %20, align 8, !tbaa !11
  %208 = add i64 %207, 1
  store i64 %208, ptr %20, align 8, !tbaa !11
  br label %32, !llvm.loop !40

209:                                              ; preds = %162, %125, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %210

210:                                              ; preds = %209, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %211

211:                                              ; preds = %210, %113
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  br label %213

212:                                              ; preds = %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  ret void

213:                                              ; preds = %211
  %214 = load ptr, ptr %24, align 8
  %215 = load i32, ptr %25, align 4
  %216 = insertvalue { ptr, i32 } poison, ptr %214, 0
  %217 = insertvalue { ptr, i32 } %216, i32 %215, 1
  resume { ptr, i32 } %217

218:                                              ; preds = %203
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

declare void @_Z17writeVertexStreamRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERK6StreamRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr dead_on_unwind writable sret(%struct.StreamFormat) align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(148)) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @_Z17getPositionBoundsPfS_RK6StreamRK20QuantizationPositionRK8Settings(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(148)) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL13writeAccessorRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm10cgltf_type20cgltf_component_typebmPKfS9_m(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef, i32 noundef, i32 noundef, i1 noundef zeroext, i64 noundef, ptr noundef, ptr noundef, i64 noundef) #2

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

attributes #0 = { 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 #1 = { "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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTS6Stream", !15, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !16, i64 24}
!15 = !{!"_ZTS20cgltf_attribute_type", !7, i64 0}
!16 = !{!"_ZTSSt6vectorI4AttrSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseI4AttrSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI4AttrSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI4AttrSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!21, !22, i64 141}
!21 = !{!"_ZTS8Settings", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !22, i64 16, !22, i64 17, !22, i64 18, !22, i64 19, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !22, i64 36, !22, i64 37, !22, i64 38, !22, i64 39, !22, i64 40, !22, i64 41, !22, i64 42, !22, i64 43, !23, i64 44, !23, i64 48, !22, i64 52, !22, i64 53, !22, i64 54, !23, i64 56, !10, i64 60, !22, i64 64, !22, i64 65, !22, i64 66, !22, i64 67, !22, i64 68, !7, i64 72, !7, i64 88, !7, i64 104, !7, i64 120, !10, i64 136, !22, i64 140, !22, i64 141, !22, i64 142, !22, i64 143, !10, i64 144}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!27, !27, i64 0}
!27 = !{!"_ZTSN10BufferView11CompressionE", !7, i64 0}
!28 = !{!29, !32, i64 24}
!29 = !{!"_ZTS12StreamFormat", !30, i64 0, !31, i64 4, !22, i64 8, !12, i64 16, !32, i64 24}
!30 = !{!"_ZTS10cgltf_type", !7, i64 0}
!31 = !{!"_ZTS20cgltf_component_type", !7, i64 0}
!32 = !{!"_ZTSN12StreamFormat6FilterE", !7, i64 0}
!33 = !{!29, !12, i64 16}
!34 = !{!14, !15, i64 0}
!35 = !{!29, !30, i64 0}
!36 = !{!29, !31, i64 4}
!37 = !{!29, !22, i64 8}
!38 = !{!14, !6, i64 16}
!39 = !{!14, !10, i64 4}
!40 = distinct !{!40, !41}
!41 = !{!"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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.StreamFormat = type { i32, i32, i8, i64, i32 }

@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z13attributeType20cgltf_attribute_type(i32 noundef) local_unnamed_addr #0

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local 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 nocapture noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(256) %4, i32 noundef %5, ptr noundef nonnull align 4 dereferenceable(28) %6, ptr noundef nonnull align 4 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(148) %8) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %struct.StreamFormat, align 8
  %12 = alloca [3 x float], align 4
  %13 = alloca [3 x float], align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  %14 = getelementptr inbounds i8, ptr %4, i64 104
  %15 = call noundef i64 @_ZNKSt6vectorI6StreamSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %.not64 = icmp eq i64 %15, 0
  br i1 %.not64, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %9
  %16 = getelementptr inbounds i8, ptr %8, i64 141
  %17 = getelementptr inbounds i8, ptr %11, i64 24
  %18 = getelementptr inbounds i8, ptr %11, i64 16
  %19 = getelementptr inbounds i8, ptr %11, i64 4
  %20 = getelementptr inbounds i8, ptr %11, i64 8
  br label %21

._crit_edge:                                      ; preds = %93, %9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  ret void

21:                                               ; preds = %.lr.ph, %93
  %.063 = phi i64 [ 0, %.lr.ph ], [ %94, %93 ]
  %22 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorI6StreamSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %.063) #5
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load i32, ptr %23, align 8, !tbaa !5
  %.not = icmp eq i32 %24, %5
  br i1 %.not, label %25, label %93

25:                                               ; preds = %21
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  invoke void @_Z17writeVertexStreamRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERK6StreamRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr dead_on_unwind nonnull writable sret(%struct.StreamFormat) align 8 %11, ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(48) %22, ptr noundef nonnull align 4 dereferenceable(28) %6, ptr noundef nonnull align 4 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(148) %8)
          to label %26 unwind label %55

26:                                               ; preds = %25
  %27 = load i8, ptr %16, align 1, !tbaa !16, !range !20, !noundef !21
  %28 = xor i8 %27, 1
  %29 = zext nneg i8 %28 to i32
  %30 = sub nsw i32 0, %29
  %31 = load i32, ptr %17, align 8, !tbaa !22
  %32 = load i64, ptr %18, align 8, !tbaa !28
  %33 = load i32, ptr %22, align 8, !tbaa !29
  %34 = invoke noundef i64 @_Z13getBufferViewRSt6vectorI10BufferViewSaIS0_EENS0_4KindEN12StreamFormat6FilterENS0_11CompressionEmi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 0, i32 noundef %31, i32 noundef %30, i64 noundef %32, i32 noundef %33)
          to label %35 unwind label %57

35:                                               ; preds = %26
  %36 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6vectorI10BufferViewSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %34) #5
  %37 = getelementptr inbounds i8, ptr %36, i64 32
  %38 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %37) #5
  %39 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNSt6vectorI10BufferViewSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %34) #5
  %40 = getelementptr inbounds i8, ptr %39, i64 32
  %41 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %40, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %42 unwind label %59

42:                                               ; preds = %35
  invoke void @_Z5commaRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %43 unwind label %59

43:                                               ; preds = %42
  %44 = load i32, ptr %22, align 8, !tbaa !29
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %46, label %63

46:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %12, i8 0, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %13, i8 0, i64 12, i1 false)
  invoke void @_Z17getPositionBoundsPfS_RK6StreamRK20QuantizationPositionRK8Settings(ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull align 8 dereferenceable(48) %22, ptr noundef nonnull align 4 dereferenceable(28) %6, ptr noundef nonnull align 4 dereferenceable(148) %8)
          to label %47 unwind label %61

47:                                               ; preds = %46
  %48 = load i32, ptr %11, align 8, !tbaa !30
  %49 = load i32, ptr %19, align 4, !tbaa !31
  %50 = load i8, ptr %20, align 8, !tbaa !32, !range !20, !noundef !21
  %51 = trunc nuw i8 %50 to i1
  %52 = getelementptr inbounds i8, ptr %22, i64 24
  %53 = call noundef i64 @_ZNKSt6vectorI4AttrSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #5
  invoke void @_ZL13writeAccessorRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm10cgltf_type20cgltf_component_typebmPKfS9_m(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %34, i64 noundef %38, i32 noundef %48, i32 noundef %49, i1 noundef zeroext %51, i64 noundef %53, ptr noundef nonnull %12, ptr noundef nonnull %13, i64 noundef 3)
          to label %54 unwind label %61

54:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #5
  br label %70

55:                                               ; preds = %25
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %97

57:                                               ; preds = %26
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %97

59:                                               ; preds = %63, %42, %35
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %97

61:                                               ; preds = %47, %46
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #5
  br label %97

63:                                               ; preds = %43
  %64 = load i32, ptr %11, align 8, !tbaa !30
  %65 = load i32, ptr %19, align 4, !tbaa !31
  %66 = load i8, ptr %20, align 8, !tbaa !32, !range !20, !noundef !21
  %67 = trunc nuw i8 %66 to i1
  %68 = getelementptr inbounds i8, ptr %22, i64 24
  %69 = call noundef i64 @_ZNKSt6vectorI4AttrSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %68) #5
  invoke void @_ZL13writeAccessorRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm10cgltf_type20cgltf_component_typebmPKfS9_m(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %34, i64 noundef %38, i32 noundef %64, i32 noundef %65, i1 noundef zeroext %67, i64 noundef %69, ptr noundef null, ptr noundef null, i64 noundef 0)
          to label %70 unwind label %59

70:                                               ; preds = %63, %54
  %71 = load i64, ptr %3, align 8, !tbaa !33
  %72 = add i64 %71, 1
  store i64 %72, ptr %3, align 8, !tbaa !33
  invoke void @_Z5commaRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %73 unwind label %78

73:                                               ; preds = %70
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.15)
          to label %74 unwind label %78

74:                                               ; preds = %73
  %75 = getelementptr inbounds i8, ptr %22, i64 16
  %76 = load ptr, ptr %75, align 8, !tbaa !34
  %.not56 = icmp eq ptr %76, null
  br i1 %.not56, label %80, label %77

77:                                               ; preds = %74
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %76)
          to label %90 unwind label %78

78:                                               ; preds = %91, %90, %86, %85, %80, %77, %73, %70
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %97

80:                                               ; preds = %74
  %81 = load i32, ptr %22, align 8, !tbaa !29
  %82 = call noundef ptr @_Z13attributeType20cgltf_attribute_type(i32 noundef %81)
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %82)
          to label %83 unwind label %78

83:                                               ; preds = %80
  %84 = load i32, ptr %22, align 8, !tbaa !29
  %.off = add i32 %84, -1
  %switch = icmp ult i32 %.off, 3
  br i1 %switch, label %90, label %85

85:                                               ; preds = %83
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.58)
          to label %86 unwind label %78

86:                                               ; preds = %85
  %87 = getelementptr inbounds i8, ptr %22, i64 4
  %88 = load i32, ptr %87, align 4, !tbaa !35
  %89 = sext i32 %88 to i64
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %89)
          to label %90 unwind label %78

90:                                               ; preds = %83, %86, %77
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.59)
          to label %91 unwind label %78

91:                                               ; preds = %90
  invoke void @_Z6appendRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %71)
          to label %92 unwind label %78

92:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  br label %93

93:                                               ; preds = %21, %92
  %94 = add nuw i64 %.063, 1
  %95 = call noundef i64 @_ZNKSt6vectorI6StreamSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %96 = icmp ult i64 %94, %95
  br i1 %96, label %21, label %._crit_edge, !llvm.loop !36

97:                                               ; preds = %57, %78, %61, %59, %55
  %.pn.pn.pn = phi { ptr, i32 } [ %56, %55 ], [ %58, %57 ], [ %79, %78 ], [ %62, %61 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

declare void @_Z17writeVertexStreamRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERK6StreamRK20QuantizationPositionRK19QuantizationTextureRK8Settings(ptr dead_on_unwind writable sret(%struct.StreamFormat) align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48), 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 nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @_Z17getPositionBoundsPfS_RK6StreamRK20QuantizationPositionRK8Settings(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(28), ptr noundef nonnull align 4 dereferenceable(148)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL13writeAccessorRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm10cgltf_type20cgltf_component_typebmPKfS9_m(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef, i32 noundef, i32 noundef, i1 noundef zeroext, i64 noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

attributes #0 = { 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 #1 = { "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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"_ZTS6Stream", !7, i64 0, !10, i64 4, !10, i64 8, !11, i64 16, !12, i64 24}
!7 = !{!"_ZTS20cgltf_attribute_type", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTSSt6vectorI4AttrSaIS0_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseI4AttrSaIS0_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseI4AttrSaIS0_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseI4AttrSaIS0_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!16 = !{!17, !18, i64 141}
!17 = !{!"_ZTS8Settings", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !18, i64 16, !18, i64 17, !18, i64 18, !18, i64 19, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !18, i64 36, !18, i64 37, !18, i64 38, !18, i64 39, !18, i64 40, !18, i64 41, !18, i64 42, !18, i64 43, !19, i64 44, !19, i64 48, !18, i64 52, !18, i64 53, !18, i64 54, !19, i64 56, !10, i64 60, !18, i64 64, !18, i64 65, !18, i64 66, !18, i64 67, !18, i64 68, !8, i64 72, !8, i64 88, !8, i64 104, !8, i64 120, !10, i64 136, !18, i64 140, !18, i64 141, !18, i64 142, !18, i64 143, !10, i64 144}
!18 = !{!"bool", !8, i64 0}
!19 = !{!"float", !8, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!23, !27, i64 24}
!23 = !{!"_ZTS12StreamFormat", !24, i64 0, !25, i64 4, !18, i64 8, !26, i64 16, !27, i64 24}
!24 = !{!"_ZTS10cgltf_type", !8, i64 0}
!25 = !{!"_ZTS20cgltf_component_type", !8, i64 0}
!26 = !{!"long", !8, i64 0}
!27 = !{!"_ZTSN12StreamFormat6FilterE", !8, i64 0}
!28 = !{!23, !26, i64 16}
!29 = !{!6, !7, i64 0}
!30 = !{!23, !24, i64 0}
!31 = !{!23, !25, i64 4}
!32 = !{!23, !18, i64 8}
!33 = !{!26, !26, i64 0}
!34 = !{!6, !11, i64 16}
!35 = !{!6, !10, i64 4}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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