; LLVM IR from Lut1n/ImpGears :: src/OGLPlugin (RenderToCubeMap)

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

%"struct.std::pair" = type <{ %"class.std::shared_ptr", i32, [4 x i8] }>
%"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.15" = type { %"class.std::__shared_ptr.16" }
%"class.std::__shared_ptr.16" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Vec4" = type { %"class.imp::Vec.24" }
%"class.imp::Vec.24" = type { %"class.imp::Object", [4 x float] }
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr.0" }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.imp::RenderToCubeMap" = type <{ %"class.imp::Object", ptr, %"class.std::shared_ptr.3", %"class.std::shared_ptr.6", %"class.std::shared_ptr", %"class.imp::Matrix4", %"class.std::shared_ptr.9", %"class.std::shared_ptr.12", [6 x %"class.imp::Vec3"], [6 x %"class.imp::Vec3"], [6 x %"class.std::shared_ptr.15"], %"class.imp::Vec2", float, [4 x i8] }>
%"class.std::shared_ptr.3" = type { %"class.std::__shared_ptr.4" }
%"class.std::__shared_ptr.4" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.6" = type { %"class.std::__shared_ptr.7" }
%"class.std::__shared_ptr.7" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Matrix4" = type { %"class.imp::Matrix" }
%"class.imp::Matrix" = type { %"class.imp::Object", [16 x float] }
%"class.std::shared_ptr.9" = type { %"class.std::__shared_ptr.10" }
%"class.std::__shared_ptr.10" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.12" = type { %"class.std::__shared_ptr.13" }
%"class.std::__shared_ptr.13" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.imp::Vec2" = type { %"class.imp::Vec.18" }
%"class.imp::Vec.18" = type { %"class.imp::Object", [2 x float] }

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 uwtable
define dso_local void @_ZN3imp15RenderToCubeMap10setCubeMapESt10shared_ptrINS_14CubeMapSamplerEE(ptr noundef nonnull align 8 dereferenceable(812) %0, ptr noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i1, align 1
  %12 = alloca %"class.std::shared_ptr.15", align 8
  %13 = alloca %"class.imp::Vec4", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  %15 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  br i1 %15, label %16, label %19

16:                                               ; preds = %2
  %17 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %14, i32 0, i32 4
  %18 = call noundef zeroext i1 @_ZSteqIN3imp14CubeMapSamplerES1_EbRKSt10shared_ptrIT_ERKS2_IT0_E(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  br i1 %18, label %19, label %20

19:                                               ; preds = %16, %2
  br label %107

20:                                               ; preds = %16
  %21 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %14, i32 0, i32 4
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3imp14CubeMapSamplerEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %103, %20
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = icmp slt i32 %24, 6
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %107

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  call void @_ZSt9make_pairIRSt10shared_ptrIN3imp14CubeMapSamplerEERiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS7_INS8_IT0_E4typeEE6__typeEEOS9_OSE_(ptr dead_on_unwind writable sret(%"struct.std::pair") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %28 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %14, i32 0, i32 10
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %28, i64 0, i64 %30
  %32 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %31) #6
  store i1 false, ptr %8, align 1
  store i1 false, ptr %11, align 1
  br i1 %32, label %33, label %42

33:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  store i1 true, ptr %8, align 1
  %34 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %14, i32 0, i32 10
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %34, i64 0, i64 %36
  %38 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %37) #6
  invoke void @_ZN3imp12RenderTarget7getFaceEv(ptr dead_on_unwind writable sret(%"struct.std::pair") align 8 %7, ptr noundef nonnull align 8 dereferenceable(99) %38)
          to label %39 unwind label %70

39:                                               ; preds = %33
  store i1 true, ptr %11, align 1
  %40 = invoke noundef zeroext i1 @_ZStneISt10shared_ptrIN3imp14CubeMapSamplerEEiEbRKSt4pairIT_T0_ES9_(ptr noundef nonnull align 8 dereferenceable(20) %7, ptr noundef nonnull align 8 dereferenceable(20) %6)
          to label %41 unwind label %74

41:                                               ; preds = %39
  br label %42

42:                                               ; preds = %41, %27
  %43 = phi i1 [ true, %27 ], [ %40, %41 ]
  %44 = load i1, ptr %11, align 1
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  call void @_ZNSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #6
  br label %46

46:                                               ; preds = %45, %42
  %47 = load i1, ptr %8, align 1
  br i1 %47, label %48, label %49

48:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  br label %49

49:                                               ; preds = %48, %46
  br i1 %43, label %50, label %102

50:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  invoke void @_ZN3imp12RenderTarget6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.15") align 8 %12)
          to label %51 unwind label %85

51:                                               ; preds = %50
  %52 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %14, i32 0, i32 10
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %52, i64 0, i64 %54
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3imp12RenderTargetEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  %57 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %14, i32 0, i32 10
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %57, i64 0, i64 %59
  %61 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %60) #6
  invoke void @_ZN3imp12RenderTarget5buildERKSt4pairISt10shared_ptrINS_14CubeMapSamplerEEiEb(ptr noundef nonnull align 8 dereferenceable(99) %61, ptr noundef nonnull align 8 dereferenceable(20) %6, i1 noundef zeroext true)
          to label %62 unwind label %89

62:                                               ; preds = %51
  %63 = getelementptr inbounds %"class.imp::RenderToCubeMap", ptr %14, i32 0, i32 10
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %63, i64 0, i64 %65
  %67 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %66) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #6
  invoke void @_ZN3imp4Vec4C2Ef(ptr noundef nonnull align 8 dereferenceable(40) %13, float noundef 1.000000e+00)
          to label %68 unwind label %93

68:                                               ; preds = %62
  invoke void @_ZN3imp12RenderTarget13setClearColorEiRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(99) %67, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(40) %13)
          to label %69 unwind label %97

69:                                               ; preds = %68
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #6
  br label %102

70:                                               ; preds = %33
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %9, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %10, align 4
  br label %81

74:                                               ; preds = %39
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %9, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %10, align 4
  %78 = load i1, ptr %11, align 1
  br i1 %78, label %79, label %80

79:                                               ; preds = %74
  call void @_ZNSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #6
  br label %80

80:                                               ; preds = %79, %74
  br label %81

81:                                               ; preds = %80, %70
  %82 = load i1, ptr %8, align 1
  br i1 %82, label %83, label %84

83:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  br label %84

84:                                               ; preds = %83, %81
  br label %106

85:                                               ; preds = %50
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %9, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %106

89:                                               ; preds = %51
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %9, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %10, align 4
  br label %106

93:                                               ; preds = %62
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %9, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %10, align 4
  br label %101

97:                                               ; preds = %68
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %9, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %10, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #6
  br label %101

101:                                              ; preds = %97, %93
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #6
  br label %106

102:                                              ; preds = %69, %49
  call void @_ZNSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %5, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %5, align 4, !tbaa !9
  br label %23, !llvm.loop !11

106:                                              ; preds = %101, %89, %85, %84
  call void @_ZNSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %108

107:                                              ; preds = %26, %19
  ret void

108:                                              ; preds = %106
  %109 = load ptr, ptr %9, align 8
  %110 = load i32, ptr %10, align 4
  %111 = insertvalue { ptr, i32 } poison, ptr %109, 0
  %112 = insertvalue { ptr, i32 } %111, i32 %110, 1
  resume { ptr, i32 } %112
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRSt10shared_ptrIN3imp14CubeMapSamplerEERiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS7_INS8_IT0_E4typeEE6__typeEEOS9_OSE_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStneISt10shared_ptrIN3imp14CubeMapSamplerEEiEbRKSt4pairIT_T0_ES9_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(20)) #4

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

declare void @_ZN3imp12RenderTarget7getFaceEv(ptr dead_on_unwind writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(99)) #5

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

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

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

declare void @_ZN3imp12RenderTarget5buildERKSt4pairISt10shared_ptrINS_14CubeMapSamplerEEiEb(ptr noundef nonnull align 8 dereferenceable(99), ptr noundef nonnull align 8 dereferenceable(20), i1 noundef zeroext) #5

declare void @_ZN3imp12RenderTarget13setClearColorEiRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(99), i32 noundef, ptr noundef nonnull align 8 dereferenceable(40)) #5

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

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

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

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


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

%"struct.std::pair" = type <{ %"class.std::shared_ptr", i32, [4 x i8] }>
%"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.15" = type { %"class.std::__shared_ptr.16" }
%"class.std::__shared_ptr.16" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Vec4" = type { %"class.imp::Vec.24" }
%"class.imp::Vec.24" = type { %"class.imp::Object", [4 x float] }
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr.0" }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = 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 uwtable
define dso_local void @_ZN3imp15RenderToCubeMap10setCubeMapESt10shared_ptrINS_14CubeMapSamplerEE(ptr noundef nonnull align 8 dereferenceable(812) %0, ptr noundef nonnull %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"class.std::shared_ptr.15", align 8
  %7 = alloca %"class.imp::Vec4", align 8
  %8 = tail call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  br i1 %8, label %9, label %63

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  %11 = tail call noundef zeroext i1 @_ZSteqIN3imp14CubeMapSamplerES1_EbRKSt10shared_ptrIT_ERKS2_IT0_E(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  br i1 %11, label %63, label %12

12:                                               ; preds = %9
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3imp14CubeMapSamplerEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 680
  br label %16

15:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %63

16:                                               ; preds = %12, %58
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZSt9make_pairIRSt10shared_ptrIN3imp14CubeMapSamplerEERiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS7_INS8_IT0_E4typeEE6__typeEEOS9_OSE_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %14, i64 0, i64 %18
  %20 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  br i1 %20, label %21, label %.critedge.thread

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %14, i64 0, i64 %23
  %25 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %24) #6
  invoke void @_ZN3imp12RenderTarget7getFaceEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair") align 8 %5, ptr noundef nonnull align 8 dereferenceable(99) %25)
          to label %26 unwind label %44

26:                                               ; preds = %21
  %27 = invoke noundef zeroext i1 @_ZStneISt10shared_ptrIN3imp14CubeMapSamplerEEiEbRKSt4pairIT_T0_ES9_(ptr noundef nonnull align 8 dereferenceable(20) %5, ptr noundef nonnull align 8 dereferenceable(20) %4)
          to label %.critedge unwind label %46

.critedge:                                        ; preds = %26
  call void @_ZNSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br i1 %27, label %.critedge.thread, label %58

.critedge.thread:                                 ; preds = %16, %.critedge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  invoke void @_ZN3imp12RenderTarget6createIJEEESt10shared_ptrIS0_EDpOT_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.15") align 8 %6)
          to label %28 unwind label %49

28:                                               ; preds = %.critedge.thread
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %14, i64 0, i64 %30
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrIN3imp12RenderTargetEEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @_ZNSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %14, i64 0, i64 %34
  %36 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %35) #6
  invoke void @_ZN3imp12RenderTarget5buildERKSt4pairISt10shared_ptrINS_14CubeMapSamplerEEiEb(ptr noundef nonnull align 8 dereferenceable(99) %36, ptr noundef nonnull align 8 dereferenceable(20) %4, i1 noundef zeroext true)
          to label %37 unwind label %51

37:                                               ; preds = %28
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [6 x %"class.std::shared_ptr.15"], ptr %14, i64 0, i64 %39
  %41 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %40) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #6
  invoke void @_ZN3imp4Vec4C2Ef(ptr noundef nonnull align 8 dereferenceable(40) %7, float noundef 1.000000e+00)
          to label %42 unwind label %53

42:                                               ; preds = %37
  invoke void @_ZN3imp12RenderTarget13setClearColorEiRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(99) %41, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %43 unwind label %55

43:                                               ; preds = %42
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #6
  br label %58

44:                                               ; preds = %21
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %48

46:                                               ; preds = %26
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #6
  br label %48

48:                                               ; preds = %44, %46
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %62

49:                                               ; preds = %.critedge.thread
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %62

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

53:                                               ; preds = %37
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %57

55:                                               ; preds = %42
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #6
  br label %57

57:                                               ; preds = %55, %53
  %.pn12 = phi { ptr, i32 } [ %56, %55 ], [ %54, %53 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #6
  br label %62

58:                                               ; preds = %43, %.critedge
  call void @_ZNSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !5
  %61 = icmp slt i32 %59, 5
  br i1 %61, label %16, label %15, !llvm.loop !9

62:                                               ; preds = %48, %57, %51, %49
  %.pn12.pn = phi { ptr, i32 } [ %.pn12, %57 ], [ %52, %51 ], [ %50, %49 ], [ %.pn, %48 ]
  call void @_ZNSt4pairISt10shared_ptrIN3imp14CubeMapSamplerEEiED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn12.pn

63:                                               ; preds = %2, %9, %15
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt12__shared_ptrIN3imp14CubeMapSamplerELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRSt10shared_ptrIN3imp14CubeMapSamplerEERiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS7_INS8_IT0_E4typeEE6__typeEEOS9_OSE_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt12__shared_ptrIN3imp12RenderTargetELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStneISt10shared_ptrIN3imp14CubeMapSamplerEEiEbRKSt4pairIT_T0_ES9_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #4

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

declare void @_ZN3imp12RenderTarget7getFaceEv(ptr dead_on_unwind writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(99)) local_unnamed_addr #5

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

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

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

declare void @_ZN3imp12RenderTarget5buildERKSt4pairISt10shared_ptrINS_14CubeMapSamplerEEiEb(ptr noundef nonnull align 8 dereferenceable(99), ptr noundef nonnull align 8 dereferenceable(20), i1 noundef zeroext) local_unnamed_addr #5

declare void @_ZN3imp12RenderTarget13setClearColorEiRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(99), i32 noundef, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5

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

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

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

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


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