; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Renderer (CpuRenderer)

; 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.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.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.19" = type { %"class.std::__shared_ptr.20" }
%"class.std::__shared_ptr.20" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.82" = type { %"class.std::__shared_ptr.83" }
%"class.std::__shared_ptr.83" = type { ptr, %"class.std::__shared_count" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair.157" = type { %"class.std::__cxx11::basic_string", %"class.std::shared_ptr.135" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::shared_ptr.135" = type { %"class.std::__shared_ptr.136" }
%"class.std::__shared_ptr.136" = type { ptr, %"class.std::__shared_count" }
%"class.imp::CpuRenderer" = type { %"class.imp::SceneRenderer.base", [7 x i8], %"class.imp::GeometryRenderer" }
%"class.imp::SceneRenderer.base" = type <{ %"class.imp::Object", i8, [5 x i8], [2 x i8], %"class.std::shared_ptr.0", %"class.std::shared_ptr.3", i32, [4 x i8], %"class.imp::Vec4", i32, i32, i32, i32, float, float, i8 }>
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.3" = type { %"class.std::__shared_ptr.4" }
%"class.std::__shared_ptr.4" = type { ptr, %"class.std::__shared_count" }
%"class.imp::GeometryRenderer" = type <{ %"class.imp::Object", %"class.std::map", %"class.std::map.6", %"struct.imp::UniformMap", %"class.std::shared_ptr.22", %"class.std::shared_ptr.25", %"class.imp::Rasterizer", %"class.imp::Matrix4", %"class.imp::Matrix4", %"class.imp::Matrix4", %"class.imp::Vec4", i32, [4 x i8], %"class.std::shared_ptr.31", i8, [7 x i8] }>
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::shared_ptr<imp::Image>>, std::_Select1st<std::pair<const int, std::shared_ptr<imp::Image>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::shared_ptr<imp::Image>>, std::_Select1st<std::pair<const int, std::shared_ptr<imp::Image>>>, std::less<int>>::_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 }
%"class.std::map.6" = type { %"class.std::_Rb_tree.7" }
%"class.std::_Rb_tree.7" = type { %"struct.std::_Rb_tree<int, std::pair<const int, imp::Vec4>, std::_Select1st<std::pair<const int, imp::Vec4>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, imp::Vec4>, std::_Select1st<std::pair<const int, imp::Vec4>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.imp::UniformMap" = type { %"class.std::map.11", %"class.imp::Matrix3", %"class.imp::Matrix4", %"class.imp::Vec3", %"class.imp::Vec4", %"class.std::shared_ptr.19" }
%"class.std::map.11" = type { %"class.std::_Rb_tree.12" }
%"class.std::_Rb_tree.12" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<imp::Uniform>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<imp::Uniform>>>, 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>, std::shared_ptr<imp::Uniform>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<imp::Uniform>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.imp::Matrix3" = type { %"class.imp::Matrix.base", [4 x i8] }
%"class.imp::Matrix.base" = type <{ %"class.imp::Object", [9 x float] }>
%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.std::shared_ptr.22" = type { %"class.std::__shared_ptr.23" }
%"class.std::__shared_ptr.23" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.25" = type { %"class.std::__shared_ptr.26" }
%"class.std::__shared_ptr.26" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Rasterizer" = type { %"class.imp::Object", %"class.std::map", %"class.std::vector", %"class.std::vector", %"struct.imp::UniformMap", %"class.imp::Vec4", %"class.std::shared_ptr.25" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<imp::Varyings, std::allocator<imp::Varyings>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Varyings, std::allocator<imp::Varyings>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Varyings, std::allocator<imp::Varyings>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Varyings, std::allocator<imp::Varyings>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.imp::Matrix4" = type { %"class.imp::Matrix.17" }
%"class.imp::Matrix.17" = type { %"class.imp::Object", [16 x float] }
%"class.std::shared_ptr.31" = type { %"class.std::__shared_ptr.32" }
%"class.std::__shared_ptr.32" = type { ptr, %"class.std::__shared_count" }
%"class.imp::SceneRenderer" = type <{ %"class.imp::Object", i8, [5 x i8], [2 x i8], %"class.std::shared_ptr.0", %"class.std::shared_ptr.3", i32, [4 x i8], %"class.imp::Vec4", i32, i32, i32, i32, float, float, i8, [7 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

declare void @_ZN3imp16GeometryRenderer11setViewportERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(1249), ptr noundef nonnull align 8 dereferenceable(40)) #1

declare void @_ZN3imp16GeometryRenderer9setTargetEiRSt10shared_ptrINS_5ImageEENS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(1249), i32 noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp11CpuRenderer10applyStateERKSt10shared_ptrINS_5StateEE(ptr noundef nonnull align 8 dereferenceable(1400) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.imp::Vec4", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::shared_ptr.19", align 8
  %10 = alloca %"class.imp::Vec4", align 8
  %11 = alloca %"class.std::shared_ptr.82", align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::pair.157", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  %20 = call noundef i32 @_ZNK3imp5State18getFaceCullingModeEv(ptr noundef nonnull align 8 dereferenceable(306) %19)
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %24

22:                                               ; preds = %2
  %23 = getelementptr inbounds %"class.imp::CpuRenderer", ptr %17, i32 0, i32 2
  call void @_ZN3imp16GeometryRenderer11setCullModeENS0_4CullE(ptr noundef nonnull align 8 dereferenceable(1249) %23, i32 noundef 0)
  br label %40

24:                                               ; preds = %2
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %25) #5
  %27 = call noundef i32 @_ZNK3imp5State18getFaceCullingModeEv(ptr noundef nonnull align 8 dereferenceable(306) %26)
  %28 = icmp eq i32 %27, 1
  br i1 %28, label %29, label %31

29:                                               ; preds = %24
  %30 = getelementptr inbounds %"class.imp::CpuRenderer", ptr %17, i32 0, i32 2
  call void @_ZN3imp16GeometryRenderer11setCullModeENS0_4CullE(ptr noundef nonnull align 8 dereferenceable(1249) %30, i32 noundef 1)
  br label %39

31:                                               ; preds = %24
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %32) #5
  %34 = call noundef i32 @_ZNK3imp5State18getFaceCullingModeEv(ptr noundef nonnull align 8 dereferenceable(306) %33)
  %35 = icmp eq i32 %34, 2
  br i1 %35, label %36, label %38

36:                                               ; preds = %31
  %37 = getelementptr inbounds %"class.imp::CpuRenderer", ptr %17, i32 0, i32 2
  call void @_ZN3imp16GeometryRenderer11setCullModeENS0_4CullE(ptr noundef nonnull align 8 dereferenceable(1249) %37, i32 noundef 2)
  br label %38

38:                                               ; preds = %36, %31
  br label %39

39:                                               ; preds = %38, %29
  br label %40

40:                                               ; preds = %39, %22
  %41 = getelementptr inbounds %"class.imp::CpuRenderer", ptr %17, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #5
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %42) #5
  call void @_ZNK3imp5State11getViewportEv(ptr dead_on_unwind writable sret(%"class.imp::Vec4") align 8 %5, ptr noundef nonnull align 8 dereferenceable(306) %43)
  invoke void @_ZN3imp16GeometryRenderer11setViewportERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(1249) %41, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %44 unwind label %56

44:                                               ; preds = %40
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #5
  %45 = getelementptr inbounds %"class.imp::SceneRenderer", ptr %17, i32 0, i32 1
  %46 = load i8, ptr %45, align 8, !tbaa !9, !range !25, !noundef !26
  %47 = trunc i8 %46 to i1
  br i1 %47, label %84, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !27
  br label %49

49:                                               ; preds = %71, %48
  %50 = load i32, ptr %8, align 4, !tbaa !27
  %51 = getelementptr inbounds %"class.imp::SceneRenderer", ptr %17, i32 0, i32 4
  %52 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %51) #5
  %53 = call noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99) %52)
  %54 = icmp slt i32 %50, %53
  br i1 %54, label %60, label %55

55:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %83

56:                                               ; preds = %40
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %6, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %7, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #5
  br label %132

60:                                               ; preds = %49
  %61 = getelementptr inbounds %"class.imp::CpuRenderer", ptr %17, i32 0, i32 2
  %62 = load i32, ptr %8, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %63 = getelementptr inbounds %"class.imp::SceneRenderer", ptr %17, i32 0, i32 4
  %64 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %63) #5
  %65 = load i32, ptr %8, align 4, !tbaa !27
  call void @_ZN3imp12RenderTarget3getEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.19") align 8 %9, ptr noundef nonnull align 8 dereferenceable(99) %64, i32 noundef %65)
  %66 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12ImageSamplerELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  %67 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN3imp12ImageSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(89) %66)
          to label %68 unwind label %74

68:                                               ; preds = %60
  invoke void @_ZN3imp4Vec4C2Ef(ptr noundef nonnull align 8 dereferenceable(40) %10, float noundef 0.000000e+00)
          to label %69 unwind label %74

69:                                               ; preds = %68
  invoke void @_ZN3imp16GeometryRenderer9setTargetEiRSt10shared_ptrINS_5ImageEENS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(1249) %61, i32 noundef %62, ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef %10)
          to label %70 unwind label %78

70:                                               ; preds = %69
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #5
  call void @_ZNSt12__shared_ptrIN3imp12ImageSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %8, align 4, !tbaa !27
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %8, align 4, !tbaa !27
  br label %49, !llvm.loop !28

74:                                               ; preds = %68, %60
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %6, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %7, align 4
  br label %82

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

82:                                               ; preds = %78, %74
  call void @_ZNSt12__shared_ptrIN3imp12ImageSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %132

83:                                               ; preds = %55
  br label %84

84:                                               ; preds = %83, %44
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %85) #5
  call void @_ZN3imp5State12getReflexionEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.82") align 8 %11, ptr noundef nonnull align 8 dereferenceable(306) %86)
  %87 = getelementptr inbounds %"class.imp::CpuRenderer", ptr %17, i32 0, i32 2
  %88 = invoke noundef i32 @_ZN3imp16prepareReflexionERNS_16GeometryRendererERSt10shared_ptrINS_14ReflexionModelEE(ptr noundef nonnull align 8 dereferenceable(1249) %87, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %89 unwind label %104

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %90) #5
  %92 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZN3imp5State11getUniformsB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(306) %91)
          to label %93 unwind label %108

93:                                               ; preds = %89
  store ptr %92, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %94, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = call ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEESt4lessIS5_ESaISt4pairIKS5_S9_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %95) #5
  %97 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %96, ptr %97, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = call ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEESt4lessIS5_ESaISt4pairIKS5_S9_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %98) #5
  %100 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  br label %101

101:                                              ; preds = %118, %93
  %102 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEESF_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %102, label %112, label %103

103:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %129

104:                                              ; preds = %84
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %6, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %7, align 4
  br label %131

108:                                              ; preds = %89
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %6, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %7, align 4
  br label %130

112:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 48, ptr %16) #5
  %113 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  invoke void @_ZNSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEC2ERKSB_(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull align 8 dereferenceable(48) %113)
          to label %114 unwind label %120

114:                                              ; preds = %112
  %115 = getelementptr inbounds %"class.imp::CpuRenderer", ptr %17, i32 0, i32 2
  %116 = getelementptr inbounds %"struct.std::pair.157", ptr %16, i32 0, i32 1
  invoke void @_ZN3imp13updateUniformERNS_16GeometryRendererERSt10shared_ptrINS_7UniformEE(ptr noundef nonnull align 8 dereferenceable(1249) %115, ptr noundef nonnull align 8 dereferenceable(16) %116)
          to label %117 unwind label %124

117:                                              ; preds = %114
  call void @_ZNSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #5
  br label %118

118:                                              ; preds = %117
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br label %101

120:                                              ; preds = %112
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %6, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %7, align 4
  br label %128

124:                                              ; preds = %114
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %6, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %7, align 4
  call void @_ZNSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #5
  br label %128

128:                                              ; preds = %124, %120
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %130

129:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @_ZNSt12__shared_ptrIN3imp14ReflexionModelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  ret void

130:                                              ; preds = %128, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %131

131:                                              ; preds = %130, %104
  call void @_ZNSt12__shared_ptrIN3imp14ReflexionModelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br label %132

132:                                              ; preds = %131, %82, %56
  %133 = load ptr, ptr %6, align 8
  %134 = load i32, ptr %7, align 4
  %135 = insertvalue { ptr, i32 } poison, ptr %133, 0
  %136 = insertvalue { ptr, i32 } %135, i32 %134, 1
  resume { ptr, i32 } %136
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3imp16prepareReflexionERNS_16GeometryRendererERSt10shared_ptrINS_14ReflexionModelEE(ptr noundef nonnull align 8 dereferenceable(1249), ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp13updateUniformERNS_16GeometryRendererERSt10shared_ptrINS_7UniformEE(ptr noundef nonnull align 8 dereferenceable(1249), ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3imp5State18getFaceCullingModeEv(ptr noundef nonnull align 8 dereferenceable(306)) #3 align 2

declare void @_ZN3imp16GeometryRenderer11setCullModeENS0_4CullE(ptr noundef nonnull align 8 dereferenceable(1249), i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK3imp5State11getViewportEv(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec4") align 8, ptr noundef nonnull align 8 dereferenceable(306)) #3 align 2

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

declare noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99)) #1

declare void @_ZN3imp12RenderTarget3getEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.19") align 8, ptr noundef nonnull align 8 dereferenceable(99), i32 noundef) #1

; 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)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp5State12getReflexionEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.82") align 8, ptr noundef nonnull align 8 dereferenceable(306)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZN3imp5State11getUniformsB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(306)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !15, i64 24}
!10 = !{!"_ZTSN3imp13SceneRendererE", !11, i64 0, !15, i64 24, !7, i64 25, !16, i64 32, !18, i64 48, !20, i64 64, !21, i64 72, !23, i64 112, !23, i64 116, !23, i64 120, !23, i64 124, !24, i64 128, !24, i64 132, !15, i64 136}
!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 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSSt10shared_ptrIN3imp12RenderTargetEE", !17, i64 0}
!17 = !{!"_ZTSSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !14, i64 8}
!18 = !{!"_ZTSSt10shared_ptrIN3imp13RenderVisitorEE", !19, i64 0}
!19 = !{!"_ZTSSt12__shared_ptrIN3imp13RenderVisitorELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !14, i64 8}
!20 = !{!"_ZTSN3imp13SceneRenderer11RenderFrameE", !7, i64 0}
!21 = !{!"_ZTSN3imp4Vec4E", !22, i64 0}
!22 = !{!"_ZTSN3imp3VecILi4EfEE", !11, i64 0, !7, i64 24}
!23 = !{!"int", !7, i64 0}
!24 = !{!"float", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!23, !23, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"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.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.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.19" = type { %"class.std::__shared_ptr.20" }
%"class.std::__shared_ptr.20" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.82" = type { %"class.std::__shared_ptr.83" }
%"class.std::__shared_ptr.83" = type { ptr, %"class.std::__shared_count" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair.157" = type { %"class.std::__cxx11::basic_string", %"class.std::shared_ptr.135" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::shared_ptr.135" = type { %"class.std::__shared_ptr.136" }
%"class.std::__shared_ptr.136" = 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

declare void @_ZN3imp16GeometryRenderer11setViewportERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(1249), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

declare void @_ZN3imp16GeometryRenderer9setTargetEiRSt10shared_ptrINS_5ImageEENS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(1249), i32 noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp11CpuRenderer10applyStateERKSt10shared_ptrINS_5StateEE(ptr noundef nonnull align 8 dereferenceable(1400) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.imp::Vec4", align 8
  %4 = alloca %"class.std::shared_ptr.19", align 8
  %5 = alloca %"class.imp::Vec4", align 8
  %6 = alloca %"class.std::shared_ptr.82", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::pair.157", align 8
  %10 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %11 = tail call noundef i32 @_ZNK3imp5State18getFaceCullingModeEv(ptr noundef nonnull align 8 dereferenceable(306) %10)
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %.sink.split, label %13

13:                                               ; preds = %2
  %14 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %15 = tail call noundef i32 @_ZNK3imp5State18getFaceCullingModeEv(ptr noundef nonnull align 8 dereferenceable(306) %14)
  %16 = icmp eq i32 %15, 1
  br i1 %16, label %.sink.split, label %17

17:                                               ; preds = %13
  %18 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %19 = tail call noundef i32 @_ZNK3imp5State18getFaceCullingModeEv(ptr noundef nonnull align 8 dereferenceable(306) %18)
  %20 = icmp eq i32 %19, 2
  br i1 %20, label %.sink.split, label %22

.sink.split:                                      ; preds = %17, %13, %2
  %.sink27 = phi i32 [ 0, %2 ], [ 1, %13 ], [ 2, %17 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 144
  tail call void @_ZN3imp16GeometryRenderer11setCullModeENS0_4CullE(ptr noundef nonnull align 8 dereferenceable(1249) %21, i32 noundef %.sink27)
  br label %22

22:                                               ; preds = %.sink.split, %17
  %23 = getelementptr inbounds i8, ptr %0, i64 144
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #5
  %24 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  call void @_ZNK3imp5State11getViewportEv(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec4") align 8 %3, ptr noundef nonnull align 8 dereferenceable(306) %24)
  invoke void @_ZN3imp16GeometryRenderer11setViewportERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(1249) %23, ptr noundef nonnull align 8 dereferenceable(40) %3)
          to label %25 unwind label %33

25:                                               ; preds = %22
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #5
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  %27 = load i8, ptr %26, align 8, !tbaa !5, !range !24, !noundef !25
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 32
  %30 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  %31 = call noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99) %30)
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph, label %.loopexit

33:                                               ; preds = %22
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #5
  br label %73

.lr.ph:                                           ; preds = %.preheader, %40
  %.01925 = phi i32 [ %41, %40 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %35 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  call void @_ZN3imp12RenderTarget3getEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.19") align 8 %4, ptr noundef nonnull align 8 dereferenceable(99) %35, i32 noundef %.01925)
  %36 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12ImageSamplerELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  %37 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN3imp12ImageSampler9getSourceEv(ptr noundef nonnull align 8 dereferenceable(89) %36)
          to label %38 unwind label %45

38:                                               ; preds = %.lr.ph
  invoke void @_ZN3imp4Vec4C2Ef(ptr noundef nonnull align 8 dereferenceable(40) %5, float noundef 0.000000e+00)
          to label %39 unwind label %45

39:                                               ; preds = %38
  invoke void @_ZN3imp16GeometryRenderer9setTargetEiRSt10shared_ptrINS_5ImageEENS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(1249) %23, i32 noundef %.01925, ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull %5)
          to label %40 unwind label %47

40:                                               ; preds = %39
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  call void @_ZNSt12__shared_ptrIN3imp12ImageSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %41 = add nuw nsw i32 %.01925, 1
  %42 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  %43 = call noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99) %42)
  %44 = icmp slt i32 %41, %43
  br i1 %44, label %.lr.ph, label %.loopexit, !llvm.loop !26

45:                                               ; preds = %38, %.lr.ph
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %39
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  br label %49

49:                                               ; preds = %47, %45
  %.pn = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @_ZNSt12__shared_ptrIN3imp12ImageSamplerELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %73

.loopexit:                                        ; preds = %40, %.preheader, %25
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %50 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  call void @_ZN3imp5State12getReflexionEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.82") align 8 %6, ptr noundef nonnull align 8 dereferenceable(306) %50)
  %51 = invoke noundef i32 @_ZN3imp16prepareReflexionERNS_16GeometryRendererERSt10shared_ptrINS_14ReflexionModelEE(ptr noundef nonnull align 8 dereferenceable(1249) %23, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %52 unwind label %59

52:                                               ; preds = %.loopexit
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5StateELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %54 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN3imp5State11getUniformsB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(306) %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %55 = call ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEESt4lessIS5_ESaISt4pairIKS5_S9_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %54) #5
  store ptr %55, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %56 = call ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEESt4lessIS5_ESaISt4pairIKS5_S9_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %54) #5
  store ptr %56, ptr %8, align 8
  %57 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEESF_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %57, label %.lr.ph26, label %._crit_edge

.lr.ph26:                                         ; preds = %52
  %58 = getelementptr inbounds i8, ptr %9, i64 32
  br label %61

._crit_edge:                                      ; preds = %64, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @_ZNSt12__shared_ptrIN3imp14ReflexionModelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  ret void

59:                                               ; preds = %.loopexit
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %72

61:                                               ; preds = %.lr.ph26, %64
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #5
  %62 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  invoke void @_ZNSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEC2ERKSB_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(48) %62)
          to label %63 unwind label %67

63:                                               ; preds = %61
  invoke void @_ZN3imp13updateUniformERNS_16GeometryRendererERSt10shared_ptrINS_7UniformEE(ptr noundef nonnull align 8 dereferenceable(1249) %23, ptr noundef nonnull align 8 dereferenceable(16) %58)
          to label %64 unwind label %69

64:                                               ; preds = %63
  call void @_ZNSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #5
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %66 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEESF_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %66, label %61, label %._crit_edge

67:                                               ; preds = %61
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %71

69:                                               ; preds = %63
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  br label %71

71:                                               ; preds = %69, %67
  %.pn21 = phi { ptr, i32 } [ %70, %69 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %72

72:                                               ; preds = %71, %59
  %.pn21.pn = phi { ptr, i32 } [ %.pn21, %71 ], [ %60, %59 ]
  call void @_ZNSt12__shared_ptrIN3imp14ReflexionModelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %73

73:                                               ; preds = %72, %49, %33
  %.pn21.pn.pn = phi { ptr, i32 } [ %.pn21.pn, %72 ], [ %.pn, %49 ], [ %34, %33 ]
  resume { ptr, i32 } %.pn21.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3imp16prepareReflexionERNS_16GeometryRendererERSt10shared_ptrINS_14ReflexionModelEE(ptr noundef nonnull align 8 dereferenceable(1249), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp13updateUniformERNS_16GeometryRendererERSt10shared_ptrINS_7UniformEE(ptr noundef nonnull align 8 dereferenceable(1249), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3imp5State18getFaceCullingModeEv(ptr noundef nonnull align 8 dereferenceable(306)) local_unnamed_addr #3 align 2

declare void @_ZN3imp16GeometryRenderer11setCullModeENS0_4CullE(ptr noundef nonnull align 8 dereferenceable(1249), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK3imp5State11getViewportEv(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec4") align 8, ptr noundef nonnull align 8 dereferenceable(306)) local_unnamed_addr #3 align 2

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

declare noundef i32 @_ZNK3imp12RenderTarget5countEv(ptr noundef nonnull align 8 dereferenceable(99)) local_unnamed_addr #1

declare void @_ZN3imp12RenderTarget3getEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.19") align 8, ptr noundef nonnull align 8 dereferenceable(99), i32 noundef) local_unnamed_addr #1

; 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 #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp5State12getReflexionEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.82") align 8, ptr noundef nonnull align 8 dereferenceable(306)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZN3imp5State11getUniformsB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(306)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEEESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10shared_ptrIN3imp7UniformEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp6ObjectD2Ev(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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !14, i64 24}
!6 = !{!"_ZTSN3imp13SceneRendererE", !7, i64 0, !14, i64 24, !11, i64 25, !15, i64 32, !17, i64 48, !19, i64 64, !20, i64 72, !22, i64 112, !22, i64 116, !22, i64 120, !22, i64 124, !23, i64 128, !23, i64 132, !14, i64 136}
!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 = !{!"bool", !11, i64 0}
!15 = !{!"_ZTSSt10shared_ptrIN3imp12RenderTargetEE", !16, i64 0}
!16 = !{!"_ZTSSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !13, i64 8}
!17 = !{!"_ZTSSt10shared_ptrIN3imp13RenderVisitorEE", !18, i64 0}
!18 = !{!"_ZTSSt12__shared_ptrIN3imp13RenderVisitorELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !13, i64 8}
!19 = !{!"_ZTSN3imp13SceneRenderer11RenderFrameE", !11, i64 0}
!20 = !{!"_ZTSN3imp4Vec4E", !21, i64 0}
!21 = !{!"_ZTSN3imp3VecILi4EfEE", !7, i64 0, !11, i64 24}
!22 = !{!"int", !11, i64 0}
!23 = !{!"float", !11, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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