; LLVM IR from drohmer/cgp :: library/cgp/20_format_parser/mesh_loader/obj_advanced (obj_advanced)

; 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.cgp::opengl_shader_structure" = type { i32 }
%"struct.cgp::opengl_texture_image_structure" = type { i32, i32, i32, i32, i32 }
%"class.std::vector.107" = type { %"struct.std::_Vector_base.108" }
%"struct.std::_Vector_base.108" = type { %"struct.std::_Vector_base<cgp::mesh_drawable, std::allocator<cgp::mesh_drawable>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::mesh_drawable, std::allocator<cgp::mesh_drawable>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::mesh_drawable, std::allocator<cgp::mesh_drawable>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::mesh_drawable, std::allocator<cgp::mesh_drawable>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cgp::mesh" = type { %"struct.cgp::numarray", %"struct.cgp::numarray", %"struct.cgp::numarray", %"struct.cgp::numarray.122", %"struct.cgp::numarray.128" }
%"struct.cgp::numarray" = type { %"class.std::vector.117" }
%"class.std::vector.117" = type { %"struct.std::_Vector_base.118" }
%"struct.std::_Vector_base.118" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cgp::numarray.122" = type { %"class.std::vector.123" }
%"class.std::vector.123" = type { %"struct.std::_Vector_base.124" }
%"struct.std::_Vector_base.124" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 2>, std::allocator<cgp::numarray_stack<float, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 2>, std::allocator<cgp::numarray_stack<float, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 2>, std::allocator<cgp::numarray_stack<float, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 2>, std::allocator<cgp::numarray_stack<float, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cgp::numarray.128" = type { %"class.std::vector.129" }
%"class.std::vector.129" = type { %"struct.std::_Vector_base.130" }
%"struct.std::_Vector_base.130" = type { %"struct.std::_Vector_base<cgp::numarray_stack<unsigned int, 3>, std::allocator<cgp::numarray_stack<unsigned int, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::numarray_stack<unsigned int, 3>, std::allocator<cgp::numarray_stack<unsigned int, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::numarray_stack<unsigned int, 3>, std::allocator<cgp::numarray_stack<unsigned int, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::numarray_stack<unsigned int, 3>, std::allocator<cgp::numarray_stack<unsigned int, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cgp::mesh_obj_advanced_loader::shape_element_node" = type <{ %"struct.cgp::mesh", %"struct.cgp::opengl_texture_image_structure", [4 x i8] }>
%"struct.cgp::mesh_drawable" = type <{ %"struct.cgp::opengl_shader_structure", %"struct.cgp::opengl_texture_image_structure", %"class.std::map.134", %"struct.cgp::opengl_vbo_structure", %"struct.cgp::opengl_vbo_structure", %"struct.cgp::opengl_vbo_structure", %"struct.cgp::opengl_vbo_structure", %"class.std::vector.139", %"struct.cgp::opengl_ebo_structure", i32, %"struct.cgp::affine", %"struct.cgp::affine_rts", %"struct.cgp::matrix_stack", %"struct.cgp::material_mesh_drawable_phong", [4 x i8] }>
%"class.std::map.134" = type { %"class.std::_Rb_tree.135" }
%"class.std::_Rb_tree.135" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, cgp::opengl_texture_image_structure>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, cgp::opengl_texture_image_structure>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, cgp::opengl_texture_image_structure>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, cgp::opengl_texture_image_structure>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.cgp::opengl_vbo_structure" = type { %"struct.cgp::opengl_gpu_buffer", i32 }
%"struct.cgp::opengl_gpu_buffer" = type { i32, i32, i32, %"struct.cgp::opengl_gpu_buffer_details" }
%"struct.cgp::opengl_gpu_buffer_details" = type { i32, i32, i32 }
%"class.std::vector.139" = type { %"struct.std::_Vector_base.140" }
%"struct.std::_Vector_base.140" = type { %"struct.std::_Vector_base<cgp::opengl_vbo_structure, std::allocator<cgp::opengl_vbo_structure>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::opengl_vbo_structure, std::allocator<cgp::opengl_vbo_structure>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::opengl_vbo_structure, std::allocator<cgp::opengl_vbo_structure>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::opengl_vbo_structure, std::allocator<cgp::opengl_vbo_structure>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cgp::opengl_ebo_structure" = type { %"struct.cgp::opengl_gpu_buffer" }
%"struct.cgp::affine" = type { %"struct.cgp::rotation_transform", %"struct.cgp::numarray_stack.144", float, %"struct.cgp::numarray_stack.144" }
%"struct.cgp::rotation_transform" = type { %"struct.cgp::quaternion" }
%"struct.cgp::quaternion" = type { %"struct.cgp::numarray_stack" }
%"struct.cgp::numarray_stack" = type { float, float, float, float }
%"struct.cgp::numarray_stack.144" = type { float, float, float }
%"struct.cgp::affine_rts" = type { %"struct.cgp::rotation_transform", %"struct.cgp::numarray_stack.144", float }
%"struct.cgp::matrix_stack" = type { %"struct.cgp::numarray_stack.145" }
%"struct.cgp::numarray_stack.145" = type { %"struct.cgp::numarray_stack", %"struct.cgp::numarray_stack", %"struct.cgp::numarray_stack", %"struct.cgp::numarray_stack" }
%"struct.cgp::material_mesh_drawable_phong" = type <{ %"struct.cgp::numarray_stack.144", float, %"struct.cgp::phong_parameters", %"struct.cgp::texture_settings_parameters", i8 }>
%"struct.cgp::phong_parameters" = type { float, float, float, float }
%"struct.cgp::texture_settings_parameters" = type { i8, i8, i8 }

@_ZN3cgp13mesh_drawable14default_shaderE = external global %"struct.cgp::opengl_shader_structure", align 4
@_ZN3cgp13mesh_drawable15default_textureE = external global %"struct.cgp::opengl_texture_image_structure", align 4

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

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) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3cgp24mesh_obj_advanced_loader24convert_to_mesh_drawableERKSt6vectorINS0_18shape_element_nodeESaIS2_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.107") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.cgp::mesh", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = call noundef i64 @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  %13 = trunc i64 %12 to i32
  store i32 %13, ptr %5, align 4, !tbaa !9
  store i1 false, ptr %6, align 1
  call void @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = sext i32 %14 to i64
  invoke void @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %15)
          to label %16 unwind label %24

16:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %50, %16
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = call noundef i64 @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #7
  %22 = icmp ult i64 %19, %21
  br i1 %22, label %28, label %23

23:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %62

24:                                               ; preds = %2
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %7, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %8, align 4
  br label %66

28:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 120, ptr %10) #7
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(140) ptr @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %31) #7
  %33 = getelementptr inbounds %"struct.cgp::mesh_obj_advanced_loader::shape_element_node", ptr %32, i32 0, i32 0
  invoke void @_ZN3cgp4meshC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(120) %10, ptr noundef nonnull align 8 dereferenceable(120) %33)
          to label %34 unwind label %53

34:                                               ; preds = %28
  %35 = invoke noundef nonnull align 8 dereferenceable(120) ptr @_ZN3cgp4mesh16fill_empty_fieldEv(ptr noundef nonnull align 8 dereferenceable(120) %10)
          to label %36 unwind label %57

36:                                               ; preds = %34
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %38) #7
  invoke void @_ZN3cgp13mesh_drawable22initialize_data_on_gpuERKNS_4meshERKNS_23opengl_shader_structureERKNS_30opengl_texture_image_structureE(ptr noundef nonnull align 8 dereferenceable(412) %39, ptr noundef nonnull align 8 dereferenceable(120) %10, ptr noundef nonnull align 4 dereferenceable(4) @_ZN3cgp13mesh_drawable14default_shaderE, ptr noundef nonnull align 4 dereferenceable(20) @_ZN3cgp13mesh_drawable15default_textureE)
          to label %40 unwind label %57

40:                                               ; preds = %36
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 8 dereferenceable(140) ptr @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %43) #7
  %45 = getelementptr inbounds %"struct.cgp::mesh_obj_advanced_loader::shape_element_node", ptr %44, i32 0, i32 1
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %47) #7
  %49 = getelementptr inbounds %"struct.cgp::mesh_drawable", ptr %48, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %49, ptr align 8 %45, i64 20, i1 false), !tbaa.struct !11
  call void @_ZN3cgp4meshD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %10) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr %10) #7
  br label %50

50:                                               ; preds = %40
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %9, align 4, !tbaa !9
  br label %17, !llvm.loop !12

53:                                               ; preds = %28
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %7, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %8, align 4
  br label %61

57:                                               ; preds = %36, %34
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %7, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %8, align 4
  call void @_ZN3cgp4meshD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %10) #7
  br label %61

61:                                               ; preds = %57, %53
  call void @llvm.lifetime.end.p0(i64 120, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %66

62:                                               ; preds = %23
  store i1 true, ptr %6, align 1
  %63 = load i1, ptr %6, align 1
  br i1 %63, label %65, label %64

64:                                               ; preds = %62
  call void @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %65

65:                                               ; preds = %64, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret void

66:                                               ; preds = %61, %24
  call void @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %67

67:                                               ; preds = %66
  %68 = load ptr, ptr %7, align 8
  %69 = load i32, ptr %8, align 4
  %70 = insertvalue { ptr, i32 } poison, ptr %68, 0
  %71 = insertvalue { ptr, i32 } %70, i32 %69, 1
  resume { ptr, i32 } %71
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3cgp4meshC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(120) ptr @_ZN3cgp4mesh16fill_empty_fieldEv(ptr noundef nonnull align 8 dereferenceable(120)) #5

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

declare void @_ZN3cgp13mesh_drawable22initialize_data_on_gpuERKNS_4meshERKNS_23opengl_shader_structureERKNS_30opengl_texture_image_structureE(ptr noundef nonnull align 8 dereferenceable(412), ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(20)) #5

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress 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 #7 = { 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 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4, !9}
!12 = distinct !{!12, !13}
!13 = !{!"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"

%"struct.cgp::opengl_shader_structure" = type { i32 }
%"struct.cgp::opengl_texture_image_structure" = type { i32, i32, i32, i32, i32 }
%"class.std::vector.107" = type { %"struct.std::_Vector_base.108" }
%"struct.std::_Vector_base.108" = type { %"struct.std::_Vector_base<cgp::mesh_drawable, std::allocator<cgp::mesh_drawable>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::mesh_drawable, std::allocator<cgp::mesh_drawable>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::mesh_drawable, std::allocator<cgp::mesh_drawable>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::mesh_drawable, std::allocator<cgp::mesh_drawable>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cgp::mesh" = type { %"struct.cgp::numarray", %"struct.cgp::numarray", %"struct.cgp::numarray", %"struct.cgp::numarray.122", %"struct.cgp::numarray.128" }
%"struct.cgp::numarray" = type { %"class.std::vector.117" }
%"class.std::vector.117" = type { %"struct.std::_Vector_base.118" }
%"struct.std::_Vector_base.118" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cgp::numarray.122" = type { %"class.std::vector.123" }
%"class.std::vector.123" = type { %"struct.std::_Vector_base.124" }
%"struct.std::_Vector_base.124" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 2>, std::allocator<cgp::numarray_stack<float, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 2>, std::allocator<cgp::numarray_stack<float, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 2>, std::allocator<cgp::numarray_stack<float, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 2>, std::allocator<cgp::numarray_stack<float, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cgp::numarray.128" = type { %"class.std::vector.129" }
%"class.std::vector.129" = type { %"struct.std::_Vector_base.130" }
%"struct.std::_Vector_base.130" = type { %"struct.std::_Vector_base<cgp::numarray_stack<unsigned int, 3>, std::allocator<cgp::numarray_stack<unsigned int, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::numarray_stack<unsigned int, 3>, std::allocator<cgp::numarray_stack<unsigned int, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::numarray_stack<unsigned int, 3>, std::allocator<cgp::numarray_stack<unsigned int, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::numarray_stack<unsigned int, 3>, std::allocator<cgp::numarray_stack<unsigned int, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN3cgp13mesh_drawable14default_shaderE = external global %"struct.cgp::opengl_shader_structure", align 4
@_ZN3cgp13mesh_drawable15default_textureE = external global %"struct.cgp::opengl_texture_image_structure", align 4

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

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) #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3cgp24mesh_obj_advanced_loader24convert_to_mesh_drawableERKSt6vectorINS0_18shape_element_nodeESaIS2_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.107") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.cgp::mesh", align 8
  %4 = tail call noundef i64 @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  tail call void @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %sext = shl i64 %4, 32
  %5 = ashr exact i64 %sext, 32
  invoke void @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %5)
          to label %.preheader unwind label %7

.preheader:                                       ; preds = %2
  %6 = tail call noundef i64 @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

7:                                                ; preds = %2
  %8 = landingpad { ptr, i32 }
          cleanup
  br label %26

.lr.ph:                                           ; preds = %.preheader, %14
  %indvars.iv = phi i64 [ %indvars.iv.next, %14 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %3) #7
  %9 = call noundef nonnull align 8 dereferenceable(140) ptr @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #7
  invoke void @_ZN3cgp4meshC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(120) %3, ptr noundef nonnull align 8 dereferenceable(120) %9)
          to label %10 unwind label %21

10:                                               ; preds = %.lr.ph
  %11 = invoke noundef nonnull align 8 dereferenceable(120) ptr @_ZN3cgp4mesh16fill_empty_fieldEv(ptr noundef nonnull align 8 dereferenceable(120) %3)
          to label %12 unwind label %23

12:                                               ; preds = %10
  %13 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #7
  invoke void @_ZN3cgp13mesh_drawable22initialize_data_on_gpuERKNS_4meshERKNS_23opengl_shader_structureERKNS_30opengl_texture_image_structureE(ptr noundef nonnull align 8 dereferenceable(412) %13, ptr noundef nonnull align 8 dereferenceable(120) %3, ptr noundef nonnull align 4 dereferenceable(4) @_ZN3cgp13mesh_drawable14default_shaderE, ptr noundef nonnull align 4 dereferenceable(20) @_ZN3cgp13mesh_drawable15default_textureE)
          to label %14 unwind label %23

14:                                               ; preds = %12
  %15 = call noundef nonnull align 8 dereferenceable(140) ptr @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #7
  %16 = getelementptr inbounds i8, ptr %15, i64 120
  %17 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #7
  %18 = getelementptr inbounds i8, ptr %17, i64 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %18, ptr noundef nonnull align 8 dereferenceable(20) %16, i64 20, i1 false), !tbaa.struct !5
  call void @_ZN3cgp4meshD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %3) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %3) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = call noundef i64 @_ZNKSt6vectorIN3cgp24mesh_obj_advanced_loader18shape_element_nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %20 = icmp ugt i64 %19, %indvars.iv.next
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !10

21:                                               ; preds = %.lr.ph
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %25

23:                                               ; preds = %12, %10
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3cgp4meshD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %3) #7
  br label %25

25:                                               ; preds = %23, %21
  %.pn = phi { ptr, i32 } [ %24, %23 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %3) #7
  br label %26

._crit_edge:                                      ; preds = %14, %.preheader
  ret void

26:                                               ; preds = %25, %7
  %.pn.pn = phi { ptr, i32 } [ %.pn, %25 ], [ %8, %7 ]
  call void @_ZNSt6vectorIN3cgp13mesh_drawableESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3cgp4meshC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(120) ptr @_ZN3cgp4mesh16fill_empty_fieldEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #5

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

declare void @_ZN3cgp13mesh_drawable22initialize_data_on_gpuERKNS_4meshERKNS_23opengl_shader_structureERKNS_30opengl_texture_image_structureE(ptr noundef nonnull align 8 dereferenceable(412), ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #5

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress 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 #7 = { 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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !6, i64 16, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


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