; LLVM IR from Lut1n/ImpGears :: src/OGLPlugin/FrameBuffer.ll (ZN3imp11FrameBuffer5buildEiiib)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<imp::Texture>, std::allocator<std::shared_ptr<imp::Texture>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<imp::Texture>, std::allocator<std::shared_ptr<imp::Texture>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<imp::Texture>, std::allocator<std::shared_ptr<imp::Texture>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<imp::Texture>, std::allocator<std::shared_ptr<imp::Texture>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.16" = type { %"class.std::__shared_ptr.17" }
%"class.std::__shared_ptr.17" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.imp::FrameBuffer" = type { %"class.imp::Object", i32, i32, i32, i32, i8, i8, i32, i32, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5", %"class.std::shared_ptr.10" }
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<imp::Vec4, std::allocator<imp::Vec4>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Vec4, std::allocator<imp::Vec4>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Vec4, std::allocator<imp::Vec4>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Vec4, std::allocator<imp::Vec4>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.10" = type { %"class.std::__shared_ptr.11" }
%"class.std::__shared_ptr.11" = type { ptr, %"class.std::__shared_count" }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp11FrameBuffer5buildERKSt6vectorISt10shared_ptrINS_7TextureEESaIS4_EEb(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext) #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp11FrameBuffer5buildEiiib(ptr noundef nonnull align 8 dereferenceable(144) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext %4) #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::shared_ptr.16", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  %16 = zext i1 %4 to i8
  store i8 %16, ptr %10, align 1, !tbaa !11
  %17 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  call void @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  invoke void @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %19)
          to label %20 unwind label %30

20:                                               ; preds = %5
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = getelementptr inbounds %"class.imp::FrameBuffer", ptr %17, i32 0, i32 7
  store i32 %21, ptr %22, align 4, !tbaa !13
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = getelementptr inbounds %"class.imp::FrameBuffer", ptr %17, i32 0, i32 8
  store i32 %23, ptr %24, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %54, %20
  %26 = load i32, ptr %14, align 4, !tbaa !9
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %34, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %66

30:                                               ; preds = %66, %5
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %12, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %13, align 4
  br label %70

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  invoke void @_ZN3imp7Texture6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.16") align 8 %15)
          to label %35 unwind label %57

35:                                               ; preds = %34
  %36 = load i32, ptr %14, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %37) #4
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3imp7TextureEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  call void @_ZNSt12__shared_ptrIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  %40 = load i32, ptr %14, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %41) #4
  %43 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %42) #4
  %44 = getelementptr inbounds %"class.imp::FrameBuffer", ptr %17, i32 0, i32 7
  %45 = load i32, ptr %44, align 4, !tbaa !13
  %46 = getelementptr inbounds %"class.imp::FrameBuffer", ptr %17, i32 0, i32 8
  %47 = load i32, ptr %46, align 8, !tbaa !33
  invoke void @_ZN3imp7Texture14loadFromMemoryEPhjji(ptr noundef nonnull align 8 dereferenceable(80) %43, ptr noundef null, i32 noundef %45, i32 noundef %47, i32 noundef 4)
          to label %48 unwind label %61

48:                                               ; preds = %35
  %49 = load i32, ptr %14, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %50) #4
  %52 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %51) #4
  invoke void @_ZN3imp7Texture6updateEv(ptr noundef nonnull align 8 dereferenceable(80) %52)
          to label %53 unwind label %61

53:                                               ; preds = %48
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %14, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %14, align 4, !tbaa !9
  br label %25, !llvm.loop !34

57:                                               ; preds = %34
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %12, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  br label %65

61:                                               ; preds = %48, %35
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %12, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %13, align 4
  br label %65

65:                                               ; preds = %61, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %70

66:                                               ; preds = %29
  %67 = load i8, ptr %10, align 1, !tbaa !11, !range !36, !noundef !37
  %68 = trunc i8 %67 to i1
  invoke void @_ZN3imp11FrameBuffer5buildERKSt6vectorISt10shared_ptrINS_7TextureEESaIS4_EEb(ptr noundef nonnull align 8 dereferenceable(144) %17, ptr noundef nonnull align 8 dereferenceable(24) %11, i1 noundef zeroext %68)
          to label %69 unwind label %30

69:                                               ; preds = %66
  call void @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  ret void

70:                                               ; preds = %65, %30
  call void @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %12, align 8
  %73 = load i32, ptr %13, align 4
  %74 = insertvalue { ptr, i32 } poison, ptr %72, 0
  %75 = insertvalue { ptr, i32 } %74, i32 %73, 1
  resume { ptr, i32 } %75
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp7Texture6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.16") align 8) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3imp7TextureEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

declare void @_ZN3imp7Texture14loadFromMemoryEPhjji(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare void @_ZN3imp7Texture6updateEv(ptr noundef nonnull align 8 dereferenceable(80)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) 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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !10, i64 44}
!14 = !{!"_ZTSN3imp11FrameBufferE", !15, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !12, i64 40, !12, i64 41, !10, i64 44, !10, i64 48, !19, i64 56, !23, i64 80, !27, i64 104, !31, i64 128}
!15 = !{!"_ZTSN3imp6ObjectE", !16, i64 8}
!16 = !{!"_ZTSSt10shared_ptrIN3imp6ObjectEE", !17, i64 0}
!17 = !{!"_ZTSSt12__shared_ptrIN3imp6ObjectELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !18, i64 8}
!18 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!19 = !{!"_ZTSSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN3imp7TextureEESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3imp7TextureEESaIS3_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3imp7TextureEESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt6vectorIjSaIjEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSSt6vectorIN3imp4Vec4ESaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIN3imp4Vec4ESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN3imp4Vec4ESaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN3imp4Vec4ESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTSSt10shared_ptrIN3imp7CubeMapEE", !32, i64 0}
!32 = !{!"_ZTSSt12__shared_ptrIN3imp7CubeMapELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !18, i64 8}
!33 = !{!14, !10, i64 48}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{i8 0, i8 2}
!37 = !{}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<imp::Texture>, std::allocator<std::shared_ptr<imp::Texture>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<imp::Texture>, std::allocator<std::shared_ptr<imp::Texture>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<imp::Texture>, std::allocator<std::shared_ptr<imp::Texture>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<imp::Texture>, std::allocator<std::shared_ptr<imp::Texture>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr.16" = type { %"class.std::__shared_ptr.17" }
%"class.std::__shared_ptr.17" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp11FrameBuffer5buildEiiib(ptr noundef nonnull align 8 dereferenceable(144) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext %4) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::shared_ptr.16", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  call void @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %8 = sext i32 %3 to i64
  invoke void @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %8)
          to label %9 unwind label %13

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 %1, ptr %10, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 %2, ptr %11, align 8, !tbaa !30
  %12 = icmp sgt i32 %3, 0
  br i1 %12, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %9
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %25, %9
  invoke void @_ZN3imp11FrameBuffer5buildERKSt6vectorISt10shared_ptrINS_7TextureEESaIS4_EEb(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr noundef nonnull align 8 dereferenceable(24) %6, i1 noundef zeroext %4)
          to label %30 unwind label %13

13:                                               ; preds = %._crit_edge, %5
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %31

.lr.ph:                                           ; preds = %.lr.ph.preheader, %25
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %25 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  invoke void @_ZN3imp7Texture6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.16") align 8 %7)
          to label %15 unwind label %26

15:                                               ; preds = %.lr.ph
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv) #4
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3imp7TextureEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @_ZNSt12__shared_ptrIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv) #4
  %19 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #4
  %20 = load i32, ptr %10, align 4, !tbaa !5
  %21 = load i32, ptr %11, align 8, !tbaa !30
  invoke void @_ZN3imp7Texture14loadFromMemoryEPhjji(ptr noundef nonnull align 8 dereferenceable(80) %19, ptr noundef null, i32 noundef %20, i32 noundef %21, i32 noundef 4)
          to label %22 unwind label %28

22:                                               ; preds = %15
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv) #4
  %24 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  invoke void @_ZN3imp7Texture6updateEv(ptr noundef nonnull align 8 dereferenceable(80) %24)
          to label %25 unwind label %28

25:                                               ; preds = %22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !31

26:                                               ; preds = %.lr.ph
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %31

28:                                               ; preds = %22, %15
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %31

30:                                               ; preds = %._crit_edge
  call void @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  ret void

31:                                               ; preds = %26, %28, %13
  %.pn.pn = phi { ptr, i32 } [ %14, %13 ], [ %29, %28 ], [ %27, %26 ]
  call void @_ZNSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp7Texture6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.16") align 8) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3imp7TextureEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

declare void @_ZN3imp7Texture14loadFromMemoryEPhjji(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN3imp7Texture6updateEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN3imp7TextureELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) 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 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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, !14, i64 44}
!6 = !{!"_ZTSN3imp11FrameBufferE", !7, i64 0, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !15, i64 40, !15, i64 41, !14, i64 44, !14, i64 48, !16, i64 56, !20, i64 80, !24, i64 104, !28, i64 128}
!7 = !{!"_ZTSN3imp6ObjectE", !8, i64 8}
!8 = !{!"_ZTSSt10shared_ptrIN3imp6ObjectEE", !9, i64 0}
!9 = !{!"_ZTSSt12__shared_ptrIN3imp6ObjectELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !13, i64 8}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0}
!14 = !{!"int", !11, i64 0}
!15 = !{!"bool", !11, i64 0}
!16 = !{!"_ZTSSt6vectorISt10shared_ptrIN3imp7TextureEESaIS3_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN3imp7TextureEESaIS3_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3imp7TextureEESaIS3_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3imp7TextureEESaIS3_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!20 = !{!"_ZTSSt6vectorIjSaIjEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!24 = !{!"_ZTSSt6vectorIN3imp4Vec4ESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIN3imp4Vec4ESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN3imp4Vec4ESaIS1_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN3imp4Vec4ESaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!28 = !{!"_ZTSSt10shared_ptrIN3imp7CubeMapEE", !29, i64 0}
!29 = !{!"_ZTSSt12__shared_ptrIN3imp7CubeMapELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !13, i64 8}
!30 = !{!6, !14, i64 48}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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