; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Graphics/Sampler.ll (ZN3imp12ImageSampler3setERKNS_4Vec2ERKNS_4Vec4E)

; 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::Vec.7" = 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.std::__shared_count" = type { ptr }
%"class.imp::Vec" = type { %"class.imp::Object", [2 x float] }
%"class.imp::Vec2" = type { %"class.imp::Vec" }
%"class.imp::Vec4" = type { %"class.imp::Vec.7" }
%"class.imp::ImageSampler" = type <{ %"class.imp::Sampler.base", [2 x i8], %"class.std::shared_ptr", i32, [4 x i8], %"class.imp::Vec2", i8, [7 x i8] }>
%"class.imp::Sampler.base" = type <{ %"class.imp::Object", i32, i8, i8 }>
%"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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec.7") 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3imp13applyWrappingERfNS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp12ImageSampler3setERKNS_4Vec2ERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(40) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.imp::Vec2", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.imp::Vec2", align 8
  %12 = alloca %"class.imp::Vec", align 8
  %13 = alloca %"class.imp::Vec4", align 8
  %14 = alloca %"class.imp::Vec.7", align 8
  %15 = alloca %"class.imp::Vec.7", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  %17 = getelementptr inbounds %"class.imp::ImageSampler", ptr %16, i32 0, i32 2
  %18 = call noundef zeroext i1 @_ZSteqIN3imp5ImageEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr null) #6
  br i1 %18, label %19, label %20

19:                                               ; preds = %3
  br label %63

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3imp4Vec2C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %37, %20
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = icmp slt i32 %23, 2
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %44

26:                                               ; preds = %22
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %27)
          to label %29 unwind label %40

29:                                               ; preds = %26
  %30 = getelementptr inbounds %"class.imp::ImageSampler", ptr %16, i32 0, i32 3
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = invoke noundef float @_ZN3imp13applyWrappingERfNS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 4 dereferenceable(4) %28, i32 noundef %31)
          to label %33 unwind label %40

33:                                               ; preds = %29
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %34)
          to label %36 unwind label %40

36:                                               ; preds = %33
  store float %32, ptr %35, align 4, !tbaa !25
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %8, align 4, !tbaa !9
  br label %22, !llvm.loop !27

40:                                               ; preds = %33, %29, %26
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %9, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %93

44:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  %45 = getelementptr inbounds %"class.imp::ImageSampler", ptr %16, i32 0, i32 5
  invoke void @_ZNK3imp3VecILi2EfEmlERKS1_(ptr dead_on_unwind writable sret(%"class.imp::Vec") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %45)
          to label %46 unwind label %64

46:                                               ; preds = %44
  invoke void @_ZN3imp4Vec2C2ILi2EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %12, float noundef 1.000000e+00)
          to label %47 unwind label %68

47:                                               ; preds = %46
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #6
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3imp8dotClampILi4EfEENS_3VecIXT_ET0_EERKS3_S2_S2_(ptr dead_on_unwind writable sret(%"class.imp::Vec.7") align 8 %15, ptr noundef nonnull align 8 dereferenceable(40) %48, float noundef 0.000000e+00, float noundef 1.000000e+00)
          to label %49 unwind label %73

49:                                               ; preds = %47
  invoke void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind writable sret(%"class.imp::Vec.7") align 8 %14, ptr noundef nonnull align 8 dereferenceable(40) %15, float noundef 2.550000e+02)
          to label %50 unwind label %77

50:                                               ; preds = %49
  invoke void @_ZN3imp4Vec4C2ILi4EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(40) %13, ptr noundef nonnull align 8 dereferenceable(40) %14, float noundef 1.000000e+00)
          to label %51 unwind label %81

51:                                               ; preds = %50
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #6
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #6
  %52 = getelementptr inbounds %"class.imp::ImageSampler", ptr %16, i32 0, i32 2
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %52) #6
  %54 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 0)
          to label %55 unwind label %87

55:                                               ; preds = %51
  %56 = load float, ptr %54, align 4, !tbaa !25
  %57 = fptosi float %56 to i32
  %58 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 1)
          to label %59 unwind label %87

59:                                               ; preds = %55
  %60 = load float, ptr %58, align 4, !tbaa !25
  %61 = fptosi float %60 to i32
  invoke void @_ZN3imp5Image8setPixelEiiRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %53, i32 noundef %57, i32 noundef %61, ptr noundef nonnull align 8 dereferenceable(40) %13)
          to label %62 unwind label %87

62:                                               ; preds = %59
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #6
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  br label %63

63:                                               ; preds = %62, %19
  ret void

64:                                               ; preds = %44
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %9, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %10, align 4
  br label %72

68:                                               ; preds = %46
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %9, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %10, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  br label %72

72:                                               ; preds = %68, %64
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  br label %92

73:                                               ; preds = %47
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %9, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %10, align 4
  br label %86

77:                                               ; preds = %49
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %9, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %10, align 4
  br label %85

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

85:                                               ; preds = %81, %77
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #6
  br label %86

86:                                               ; preds = %85, %73
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #6
  br label %91

87:                                               ; preds = %59, %55, %51
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %9, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %10, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #6
  br label %91

91:                                               ; preds = %87, %86
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #6
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  br label %92

92:                                               ; preds = %91, %72
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  br label %93

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

94:                                               ; preds = %93
  %95 = load ptr, ptr %9, align 8
  %96 = load i32, ptr %10, align 4
  %97 = insertvalue { ptr, i32 } poison, ptr %95, 0
  %98 = insertvalue { ptr, i32 } %97, i32 %96, 1
  resume { ptr, i32 } %98
}

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

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

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

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 = { 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 = !{!12, !22, i64 48}
!12 = !{!"_ZTSN3imp12ImageSamplerE", !13, i64 0, !20, i64 32, !22, i64 48, !23, i64 56, !19, i64 88}
!13 = !{!"_ZTSN3imp7SamplerINS_4Vec2ENS_4Vec4EEE", !14, i64 0, !18, i64 24, !19, i64 28, !19, i64 29}
!14 = !{!"_ZTSN3imp6ObjectE", !15, i64 8}
!15 = !{!"_ZTSSt10shared_ptrIN3imp6ObjectEE", !16, i64 0}
!16 = !{!"_ZTSSt12__shared_ptrIN3imp6ObjectELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!18 = !{!"_ZTSN3imp7SamplerINS_4Vec2ENS_4Vec4EE9FilteringE", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSSt10shared_ptrIN3imp5ImageEE", !21, i64 0}
!21 = !{!"_ZTSSt12__shared_ptrIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !17, i64 8}
!22 = !{!"_ZTSN3imp7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE", !7, i64 0}
!23 = !{!"_ZTSN3imp4Vec2E", !24, i64 0}
!24 = !{!"_ZTSN3imp3VecILi2EfEE", !14, i64 0, !7, i64 24}
!25 = !{!26, !26, i64 0}
!26 = !{!"float", !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"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::Vec.7" = 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.std::__shared_count" = type { ptr }
%"class.imp::Vec" = type { %"class.imp::Object", [2 x float] }
%"class.imp::Vec2" = type { %"class.imp::Vec" }
%"class.imp::Vec4" = type { %"class.imp::Vec.7" }

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 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec.7") 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3imp13applyWrappingERfNS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp12ImageSampler3setERKNS_4Vec2ERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(40) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.imp::Vec2", align 8
  %5 = alloca %"class.imp::Vec2", align 8
  %6 = alloca %"class.imp::Vec", align 8
  %7 = alloca %"class.imp::Vec4", align 8
  %8 = alloca %"class.imp::Vec.7", align 8
  %9 = alloca %"class.imp::Vec.7", align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = tail call noundef zeroext i1 @_ZSteqIN3imp5ImageEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr null) #6
  br i1 %11, label %40, label %12

12:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @_ZN3imp4Vec2C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 0)
  %15 = load i32, ptr %13, align 8, !tbaa !5
  %16 = invoke noundef float @_ZN3imp13applyWrappingERfNS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 4 dereferenceable(4) %14, i32 noundef %15)
          to label %17 unwind label %25

17:                                               ; preds = %12
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 0)
  store float %16, ptr %18, align 4, !tbaa !22
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 1)
  %20 = load i32, ptr %13, align 8, !tbaa !5
  %21 = invoke noundef float @_ZN3imp13applyWrappingERfNS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 4 dereferenceable(4) %19, i32 noundef %20)
          to label %22 unwind label %25

22:                                               ; preds = %17
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 1)
  store float %21, ptr %23, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %24 = getelementptr inbounds i8, ptr %0, i64 56
  invoke void @_ZNK3imp3VecILi2EfEmlERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %24)
          to label %27 unwind label %41

25:                                               ; preds = %17, %12
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %58

27:                                               ; preds = %22
  invoke void @_ZN3imp4Vec2C2ILi2EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %6, float noundef 1.000000e+00)
          to label %28 unwind label %43

28:                                               ; preds = %27
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #6
  invoke void @_ZN3imp8dotClampILi4EfEENS_3VecIXT_ET0_EERKS3_S2_S2_(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec.7") align 8 %9, ptr noundef nonnull align 8 dereferenceable(40) %2, float noundef 0.000000e+00, float noundef 1.000000e+00)
          to label %29 unwind label %46

29:                                               ; preds = %28
  invoke void @_ZNK3imp3VecILi4EfEmlEf(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec.7") align 8 %8, ptr noundef nonnull align 8 dereferenceable(40) %9, float noundef 2.550000e+02)
          to label %30 unwind label %48

30:                                               ; preds = %29
  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 %31 unwind label %50

31:                                               ; preds = %30
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #6
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #6
  %32 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 0)
  %34 = load float, ptr %33, align 4, !tbaa !22
  %35 = fptosi float %34 to i32
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 1)
  %37 = load float, ptr %36, align 4, !tbaa !22
  %38 = fptosi float %37 to i32
  invoke void @_ZN3imp5Image8setPixelEiiRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %32, i32 noundef %35, i32 noundef %38, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %39 unwind label %54

39:                                               ; preds = %31
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #6
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  br label %40

40:                                               ; preds = %3, %39
  ret void

41:                                               ; preds = %22
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %45

43:                                               ; preds = %27
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br label %45

45:                                               ; preds = %43, %41
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %57

46:                                               ; preds = %28
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %53

48:                                               ; preds = %29
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %30
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #6
  br label %52

52:                                               ; preds = %50, %48
  %.pn16 = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  br label %53

53:                                               ; preds = %52, %46
  %.pn16.pn = phi { ptr, i32 } [ %.pn16, %52 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #6
  br label %56

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

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

57:                                               ; preds = %56, %45
  %.pn19.pn = phi { ptr, i32 } [ %.pn19, %56 ], [ %.pn, %45 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %58

58:                                               ; preds = %57, %25
  %.pn22 = phi { ptr, i32 } [ %26, %25 ], [ %.pn19.pn, %57 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn22
}

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

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

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

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 = { 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, !19, i64 48}
!6 = !{!"_ZTSN3imp12ImageSamplerE", !7, i64 0, !17, i64 32, !19, i64 48, !20, i64 56, !16, i64 88}
!7 = !{!"_ZTSN3imp7SamplerINS_4Vec2ENS_4Vec4EEE", !8, i64 0, !15, i64 24, !16, i64 28, !16, i64 29}
!8 = !{!"_ZTSN3imp6ObjectE", !9, i64 8}
!9 = !{!"_ZTSSt10shared_ptrIN3imp6ObjectEE", !10, i64 0}
!10 = !{!"_ZTSSt12__shared_ptrIN3imp6ObjectELN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0, !14, i64 8}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0}
!15 = !{!"_ZTSN3imp7SamplerINS_4Vec2ENS_4Vec4EE9FilteringE", !12, i64 0}
!16 = !{!"bool", !12, i64 0}
!17 = !{!"_ZTSSt10shared_ptrIN3imp5ImageEE", !18, i64 0}
!18 = !{!"_ZTSSt12__shared_ptrIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0, !14, i64 8}
!19 = !{!"_ZTSN3imp7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE", !12, i64 0}
!20 = !{!"_ZTSN3imp4Vec2E", !21, i64 0}
!21 = !{!"_ZTSN3imp3VecILi2EfEE", !8, i64 0, !12, i64 24}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !12, i64 0}


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