; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Renderer/RenderTarget.ll (ZN3imp12RenderTarget12clearTargetsEv)

; 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::shared_ptr.5" = type { %"class.std::__shared_ptr.6" }
%"class.std::__shared_ptr.6" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.imp::Vec4" = type { %"class.imp::Vec" }
%"class.imp::Vec" = type { %"class.imp::Object", [4 x float] }
%"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.imp::RenderTarget" = type <{ %"class.imp::Object", %"class.std::vector", %"class.std::vector.0", %"struct.std::pair", i8, i8, i8, [5 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<imp::ImageSampler>, std::allocator<std::shared_ptr<imp::ImageSampler>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<imp::ImageSampler>, std::allocator<std::shared_ptr<imp::ImageSampler>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<imp::ImageSampler>, std::allocator<std::shared_ptr<imp::ImageSampler>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<imp::ImageSampler>, std::allocator<std::shared_ptr<imp::ImageSampler>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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 }
%"struct.std::pair" = type <{ %"class.std::shared_ptr.5", i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp12RenderTarget12clearTargetsEv(ptr noundef nonnull align 8 dereferenceable(99) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::shared_ptr.5", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.imp::Vec4", align 8
  %8 = alloca %"class.imp::Vec", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.imp::Vec4", align 8
  %11 = alloca %"class.imp::Vec", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  %13 = getelementptr inbounds %"class.imp::RenderTarget", ptr %12, i32 0, i32 4
  %14 = load i8, ptr %13, align 8, !tbaa !9, !range !28, !noundef !29
  %15 = trunc i8 %14 to i1
  br i1 %15, label %16, label %53

16:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #4
  %17 = getelementptr inbounds %"class.imp::RenderTarget", ptr %12, i32 0, i32 3
  %18 = getelementptr inbounds %"struct.std::pair", ptr %17, i32 0, i32 0
  call void @_ZNSt10shared_ptrIN3imp14CubeMapSamplerEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %19 = getelementptr inbounds %"class.imp::RenderTarget", ptr %12, i32 0, i32 3
  %20 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %21 = load i32, ptr %20, align 8, !tbaa !30
  store i32 %21, ptr %4, align 4, !tbaa !31
  %22 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #4
  %23 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3imp14CubeMapSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(96) %22)
          to label %24 unwind label %34

24:                                               ; preds = %16
  %25 = load i32, ptr %4, align 4, !tbaa !31
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3imp5ImageEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %26) #4
  %28 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %27) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #4
  %29 = getelementptr inbounds %"class.imp::RenderTarget", ptr %12, i32 0, i32 2
  %30 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3imp4Vec4ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef 0) #4
  invoke void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind writable sret(%"class.imp::Vec") align 8 %8, ptr noundef nonnull align 8 dereferenceable(40) %30, float noundef 2.550000e+02)
          to label %31 unwind label %38

31:                                               ; preds = %24
  invoke void @_ZN3imp4Vec4C2ILi4EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(40) %8, float noundef 1.000000e+00)
          to label %32 unwind label %42

32:                                               ; preds = %31
  invoke void @_ZN3imp5Image4fillERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %28, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %33 unwind label %46

33:                                               ; preds = %32
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @_ZNSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  br label %86

34:                                               ; preds = %16
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %5, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %6, align 4
  br label %52

38:                                               ; preds = %24
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %5, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %6, align 4
  br label %51

42:                                               ; preds = %31
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %5, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %6, align 4
  br label %50

46:                                               ; preds = %32
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  br label %50

50:                                               ; preds = %46, %42
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #4
  br label %51

51:                                               ; preds = %50, %38
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #4
  br label %52

52:                                               ; preds = %51, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @_ZNSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  br label %87

53:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !31
  br label %54

54:                                               ; preds = %73, %53
  %55 = load i32, ptr %9, align 4, !tbaa !31
  %56 = call noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99) %12)
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %85

59:                                               ; preds = %54
  %60 = getelementptr inbounds %"class.imp::RenderTarget", ptr %12, i32 0, i32 1
  %61 = load i32, ptr %9, align 4, !tbaa !31
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62) #4
  %64 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12ImageSamplerELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %63) #4
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3imp12ImageSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(89) %64)
  %66 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %65) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #4
  %67 = getelementptr inbounds %"class.imp::RenderTarget", ptr %12, i32 0, i32 2
  %68 = load i32, ptr %9, align 4, !tbaa !31
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3imp4Vec4ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %69) #4
  call void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind writable sret(%"class.imp::Vec") align 8 %11, ptr noundef nonnull align 8 dereferenceable(40) %70, float noundef 2.550000e+02)
  invoke void @_ZN3imp4Vec4C2ILi4EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef nonnull align 8 dereferenceable(40) %11, float noundef 1.000000e+00)
          to label %71 unwind label %76

71:                                               ; preds = %59
  invoke void @_ZN3imp5Image4fillERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %66, ptr noundef nonnull align 8 dereferenceable(40) %10)
          to label %72 unwind label %80

72:                                               ; preds = %71
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #4
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %9, align 4, !tbaa !31
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %9, align 4, !tbaa !31
  br label %54, !llvm.loop !32

76:                                               ; preds = %59
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %5, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %6, align 4
  br label %84

80:                                               ; preds = %71
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %5, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %6, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #4
  br label %84

84:                                               ; preds = %80, %76
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %87

85:                                               ; preds = %58
  br label %86

86:                                               ; preds = %85, %33
  ret void

87:                                               ; preds = %84, %52
  %88 = load ptr, ptr %5, align 8
  %89 = load i32, ptr %6, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrIN3imp14CubeMapSamplerEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3imp14CubeMapSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(96)) #3

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

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

declare void @_ZN3imp5Image4fillERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(40)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec") align 8, ptr noundef nonnull align 8 dereferenceable(40), float noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec4C2ILi4EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40), float noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99)) #1 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN3imp12ImageSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(89)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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, !27, i64 96}
!10 = !{!"_ZTSN3imp12RenderTargetE", !11, i64 0, !15, i64 24, !19, i64 48, !23, i64 72, !27, i64 96, !27, i64 97, !27, i64 98}
!11 = !{!"_ZTSN3imp6ObjectE", !12, i64 8}
!12 = !{!"_ZTSSt10shared_ptrIN3imp6ObjectEE", !13, i64 0}
!13 = !{!"_ZTSSt12__shared_ptrIN3imp6ObjectELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !14, i64 8}
!14 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!15 = !{!"_ZTSSt6vectorISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt6vectorIN3imp4Vec4ESaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIN3imp4Vec4ESaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN3imp4Vec4ESaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN3imp4Vec4ESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiE", !24, i64 0, !26, i64 16}
!24 = !{!"_ZTSSt10shared_ptrIN3imp14CubeMapSamplerEE", !25, i64 0}
!25 = !{!"_ZTSSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !14, i64 8}
!26 = !{!"int", !7, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!10, !26, i64 88}
!31 = !{!26, !26, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"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::shared_ptr.5" = type { %"class.std::__shared_ptr.6" }
%"class.std::__shared_ptr.6" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.imp::Vec4" = type { %"class.imp::Vec" }
%"class.imp::Vec" = type { %"class.imp::Object", [4 x float] }
%"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" }

declare i32 @__gxx_personality_v0(...)

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

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp12RenderTarget12clearTargetsEv(ptr noundef nonnull align 8 dereferenceable(99) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::shared_ptr.5", align 8
  %3 = alloca %"class.imp::Vec4", align 8
  %4 = alloca %"class.imp::Vec", align 8
  %5 = alloca %"class.imp::Vec4", align 8
  %6 = alloca %"class.imp::Vec", align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  %8 = load i8, ptr %7, align 8, !tbaa !5, !range !27, !noundef !28
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %14, label %.preheader

.preheader:                                       ; preds = %1
  %10 = tail call noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99) %0)
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  br label %40

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #4
  %15 = getelementptr inbounds i8, ptr %0, i64 72
  call void @_ZNSt10shared_ptrIN3imp14CubeMapSamplerEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  %16 = getelementptr inbounds i8, ptr %0, i64 88
  %17 = load i32, ptr %16, align 8, !tbaa !29
  %18 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  %19 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3imp14CubeMapSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(96) %18)
          to label %20 unwind label %29

20:                                               ; preds = %14
  %21 = sext i32 %17 to i64
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3imp5ImageEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %21) #4
  %23 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #4
  %24 = getelementptr inbounds i8, ptr %0, i64 48
  %25 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3imp4Vec4ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef 0) #4
  invoke void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec") align 8 %4, ptr noundef nonnull align 8 dereferenceable(40) %25, float noundef 2.550000e+02)
          to label %26 unwind label %31

26:                                               ; preds = %20
  invoke void @_ZN3imp4Vec4C2ILi4EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(40) %3, ptr noundef nonnull align 8 dereferenceable(40) %4, float noundef 1.000000e+00)
          to label %27 unwind label %33

27:                                               ; preds = %26
  invoke void @_ZN3imp5Image4fillERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %23, ptr noundef nonnull align 8 dereferenceable(40) %3)
          to label %28 unwind label %35

28:                                               ; preds = %27
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  call void @_ZNSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  br label %.loopexit

29:                                               ; preds = %14
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %39

31:                                               ; preds = %20
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %38

33:                                               ; preds = %26
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %37

35:                                               ; preds = %27
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #4
  br label %37

37:                                               ; preds = %35, %33
  %.pn14 = phi { ptr, i32 } [ %36, %35 ], [ %34, %33 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #4
  br label %38

38:                                               ; preds = %37, %31
  %.pn14.pn = phi { ptr, i32 } [ %.pn14, %37 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  br label %39

39:                                               ; preds = %38, %29
  %.pn14.pn.pn = phi { ptr, i32 } [ %.pn14.pn, %38 ], [ %30, %29 ]
  call void @_ZNSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  br label %56

40:                                               ; preds = %.lr.ph, %47
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %47 ]
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %indvars.iv) #4
  %42 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12ImageSamplerELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %41) #4
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3imp12ImageSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(89) %42)
  %44 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %43) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #4
  %45 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN3imp4Vec4ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv) #4
  call void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec") align 8 %6, ptr noundef nonnull align 8 dereferenceable(40) %45, float noundef 2.550000e+02)
  invoke void @_ZN3imp4Vec4C2ILi4EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull align 8 dereferenceable(40) %6, float noundef 1.000000e+00)
          to label %46 unwind label %51

46:                                               ; preds = %40
  invoke void @_ZN3imp5Image4fillERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %44, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %47 unwind label %53

47:                                               ; preds = %46
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = call noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99) %0)
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next, %49
  br i1 %50, label %40, label %.loopexit, !llvm.loop !30

51:                                               ; preds = %40
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %55

53:                                               ; preds = %46
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #4
  br label %55

55:                                               ; preds = %53, %51
  %.pn = phi { ptr, i32 } [ %54, %53 ], [ %52, %51 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #4
  br label %56

.loopexit:                                        ; preds = %47, %.preheader, %28
  ret void

56:                                               ; preds = %55, %39
  %.pn14.pn.pn.pn = phi { ptr, i32 } [ %.pn14.pn.pn, %39 ], [ %.pn, %55 ]
  resume { ptr, i32 } %.pn14.pn.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrIN3imp14CubeMapSamplerEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3imp14CubeMapSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3

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

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

declare void @_ZN3imp5Image4fillERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec") align 8, ptr noundef nonnull align 8 dereferenceable(40), float noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec4C2ILi4EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40), float noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99)) local_unnamed_addr #1 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN3imp12ImageSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(89)) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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, !26, i64 96}
!6 = !{!"_ZTSN3imp12RenderTargetE", !7, i64 0, !14, i64 24, !18, i64 48, !22, i64 72, !26, i64 96, !26, i64 97, !26, i64 98}
!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 = !{!"_ZTSSt6vectorISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3imp12ImageSamplerEESaIS3_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!18 = !{!"_ZTSSt6vectorIN3imp4Vec4ESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN3imp4Vec4ESaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN3imp4Vec4ESaIS1_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN3imp4Vec4ESaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!22 = !{!"_ZTSSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiE", !23, i64 0, !25, i64 16}
!23 = !{!"_ZTSSt10shared_ptrIN3imp14CubeMapSamplerEE", !24, i64 0}
!24 = !{!"_ZTSSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !13, i64 8}
!25 = !{!"int", !11, i64 0}
!26 = !{!"bool", !11, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!6, !25, i64 88}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


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