; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Graphics (ImageOperation)

; 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::Vec2" = type { %"class.imp::Vec" }
%"class.imp::Vec" = type { %"class.imp::Object", [2 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::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" }
%"class.imp::Vec4" = type { %"class.imp::Vec.7" }
%"class.imp::Vec.7" = type { %"class.imp::Object", [4 x float] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp14ImageOperation7executeERSt10shared_ptrINS_5ImageEE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.imp::Vec2", align 8
  %6 = alloca %"class.imp::ImageSampler", align 8
  %7 = alloca %"class.std::shared_ptr", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.imp::Vec2", align 8
  %14 = alloca %"class.imp::Vec2", align 8
  %15 = alloca %"class.imp::Vec", align 8
  %16 = alloca %"class.imp::Vec4", 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 zeroext i1 @_ZSteqIN3imp5ImageEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr null) #5
  br i1 %19, label %20, label %21

20:                                               ; preds = %2
  br label %115

21:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #5
  %24 = call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %23)
  %25 = sitofp i32 %24 to float
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %26) #5
  %28 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %27)
  %29 = sitofp i32 %28 to float
  call void @_ZN3imp4Vec2C2Eff(ptr noundef nonnull align 8 dereferenceable(32) %5, float noundef %25, float noundef %29)
  call void @llvm.lifetime.start.p0(i64 96, ptr %6) #5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNSt10shared_ptrIN3imp5ImageEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %30) #5
  invoke void @_ZN3imp12ImageSamplerC1ESt10shared_ptrINS_5ImageEENS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 8 dereferenceable(89) %6, ptr noundef %7, i32 noundef 0)
          to label %31 unwind label %40

31:                                               ; preds = %21
  call void @_ZNSt12__shared_ptrIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %110, %31
  %33 = load i32, ptr %10, align 4, !tbaa !9
  %34 = sitofp i32 %33 to float
  %35 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 0)
          to label %36 unwind label %44

36:                                               ; preds = %32
  %37 = load float, ptr %35, align 4, !tbaa !11
  %38 = fcmp olt float %34, %37
  br i1 %38, label %48, label %39

39:                                               ; preds = %36
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %114

40:                                               ; preds = %21
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %8, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %9, align 4
  call void @_ZNSt12__shared_ptrIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  br label %116

44:                                               ; preds = %32
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %8, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %9, align 4
  br label %113

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

49:                                               ; preds = %81, %48
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = sitofp i32 %50 to float
  %52 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 1)
          to label %53 unwind label %57

53:                                               ; preds = %49
  %54 = load float, ptr %52, align 4, !tbaa !11
  %55 = fcmp olt float %51, %54
  br i1 %55, label %61, label %56

56:                                               ; preds = %53
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %109

57:                                               ; preds = %49
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %8, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %9, align 4
  br label %108

61:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = sitofp i32 %62 to float
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = sitofp i32 %64 to float
  invoke void @_ZN3imp4Vec2C2Eff(ptr noundef nonnull align 8 dereferenceable(32) %13, float noundef %63, float noundef %65)
          to label %66 unwind label %84

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  invoke void @_ZNK3imp3VecILi2EfEdvERKS1_(ptr dead_on_unwind writable sret(%"class.imp::Vec") align 8 %15, ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %67 unwind label %88

67:                                               ; preds = %66
  invoke void @_ZN3imp4Vec2C2ILi2EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(32) %15, float noundef 1.000000e+00)
          to label %68 unwind label %92

68:                                               ; preds = %67
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #5
  invoke void @_ZN3imp4Vec4C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16)
          to label %69 unwind label %97

69:                                               ; preds = %68
  %70 = load ptr, ptr %17, align 8, !tbaa !13
  %71 = getelementptr inbounds ptr, ptr %70, i64 3
  %72 = load ptr, ptr %71, align 8
  invoke void %72(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(40) %16)
          to label %73 unwind label %101

73:                                               ; preds = %69
  %74 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef 0)
          to label %75 unwind label %101

75:                                               ; preds = %73
  %76 = load float, ptr %74, align 4, !tbaa !11
  %77 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef 1)
          to label %78 unwind label %101

78:                                               ; preds = %75
  %79 = load float, ptr %77, align 4, !tbaa !11
  invoke void @_ZN3imp12ImageSampler3setEffRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(89) %6, float noundef %76, float noundef %79, ptr noundef nonnull align 8 dereferenceable(40) %16)
          to label %80 unwind label %101

80:                                               ; preds = %78
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %12, align 4, !tbaa !9
  br label %49, !llvm.loop !15

84:                                               ; preds = %61
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %8, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %9, align 4
  br label %107

88:                                               ; preds = %66
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %8, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %9, align 4
  br label %96

92:                                               ; preds = %67
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %8, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %9, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  br label %96

96:                                               ; preds = %92, %88
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  br label %106

97:                                               ; preds = %68
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %8, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %9, align 4
  br label %105

101:                                              ; preds = %78, %75, %73, %69
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %8, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %9, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #5
  br label %105

105:                                              ; preds = %101, %97
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  br label %106

106:                                              ; preds = %105, %96
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br label %107

107:                                              ; preds = %106, %84
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  br label %108

108:                                              ; preds = %107, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %113

109:                                              ; preds = %56
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %10, align 4, !tbaa !9
  br label %32, !llvm.loop !17

113:                                              ; preds = %108, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @_ZN3imp12ImageSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(89) %6) #5
  br label %116

114:                                              ; preds = %39
  call void @_ZN3imp12ImageSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(89) %6) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr %6) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  br label %115

115:                                              ; preds = %114, %20
  ret void

116:                                              ; preds = %113, %40
  call void @llvm.lifetime.end.p0(i64 96, ptr %6) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  br label %117

117:                                              ; preds = %116
  %118 = load ptr, ptr %8, align 8
  %119 = load i32, ptr %9, align 4
  %120 = insertvalue { ptr, i32 } poison, ptr %118, 0
  %121 = insertvalue { ptr, i32 } %120, i32 %119, 1
  resume { ptr, i32 } %121
}

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

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

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

declare noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88)) #4

declare noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88)) #4

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

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

declare void @_ZN3imp12ImageSamplerC1ESt10shared_ptrINS_5ImageEENS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 8 dereferenceable(89), ptr noundef, i32 noundef) unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi2EfEdvERKS1_(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)) #0 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 #0 align 2

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

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

declare void @_ZN3imp12ImageSampler3setEffRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(89), float noundef, float noundef, ptr noundef nonnull align 8 dereferenceable(40)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp12ImageSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(89)) 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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::Vec2" = type { %"class.imp::Vec" }
%"class.imp::Vec" = type { %"class.imp::Object", [2 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::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" }
%"class.imp::Vec4" = type { %"class.imp::Vec.7" }
%"class.imp::Vec.7" = type { %"class.imp::Object", [4 x float] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp14ImageOperation7executeERSt10shared_ptrINS_5ImageEE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.imp::Vec2", align 8
  %4 = alloca %"class.imp::ImageSampler", align 8
  %5 = alloca %"class.std::shared_ptr", align 8
  %6 = alloca %"class.imp::Vec2", align 8
  %7 = alloca %"class.imp::Vec2", align 8
  %8 = alloca %"class.imp::Vec", align 8
  %9 = alloca %"class.imp::Vec4", align 8
  %10 = tail call noundef zeroext i1 @_ZSteqIN3imp5ImageEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr null) #5
  br i1 %10, label %66, label %11

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %12 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %13 = tail call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %12)
  %14 = sitofp i32 %13 to float
  %15 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #5
  %16 = tail call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %15)
  %17 = sitofp i32 %16 to float
  call void @_ZN3imp4Vec2C2Eff(ptr noundef nonnull align 8 dereferenceable(32) %3, float noundef %14, float noundef %17)
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %4) #5
  call void @_ZNSt10shared_ptrIN3imp5ImageEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %1) #5
  invoke void @_ZN3imp12ImageSamplerC1ESt10shared_ptrINS_5ImageEENS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 8 dereferenceable(89) %4, ptr noundef nonnull %5, i32 noundef 0)
          to label %18 unwind label %26

18:                                               ; preds = %11
  call void @_ZNSt12__shared_ptrIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef 0)
  %20 = load float, ptr %19, align 4, !tbaa !5
  %21 = fcmp ogt float %20, 0.000000e+00
  br i1 %21, label %.preheader, label %._crit_edge29

.preheader:                                       ; preds = %18, %._crit_edge
  %22 = phi float [ %29, %._crit_edge ], [ 0.000000e+00, %18 ]
  %.01228 = phi i32 [ %28, %._crit_edge ], [ 0, %18 ]
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef 1)
  %24 = load float, ptr %23, align 4, !tbaa !5
  %25 = fcmp ogt float %24, 0.000000e+00
  br i1 %25, label %.lr.ph, label %._crit_edge

._crit_edge29:                                    ; preds = %._crit_edge, %18
  call void @_ZN3imp12ImageSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(89) %4) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br label %66

26:                                               ; preds = %11
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  br label %67

._crit_edge:                                      ; preds = %46, %.preheader
  %28 = add nuw nsw i32 %.01228, 1
  %29 = uitofp nneg i32 %28 to float
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef 0)
  %31 = load float, ptr %30, align 4, !tbaa !5
  %32 = fcmp ogt float %31, %29
  br i1 %32, label %.preheader, label %._crit_edge29, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader, %46
  %33 = phi float [ %48, %46 ], [ 0.000000e+00, %.preheader ]
  %.027 = phi i32 [ %47, %46 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  invoke void @_ZN3imp4Vec2C2Eff(ptr noundef nonnull align 8 dereferenceable(32) %6, float noundef %22, float noundef %33)
          to label %34 unwind label %52

34:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  invoke void @_ZNK3imp3VecILi2EfEdvERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %35 unwind label %54

35:                                               ; preds = %34
  invoke void @_ZN3imp4Vec2C2ILi2EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %8, float noundef 1.000000e+00)
          to label %36 unwind label %56

36:                                               ; preds = %35
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #5
  invoke void @_ZN3imp4Vec4C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %37 unwind label %59

37:                                               ; preds = %36
  %38 = load ptr, ptr %0, align 8, !tbaa !11
  %39 = getelementptr inbounds i8, ptr %38, i64 24
  %40 = load ptr, ptr %39, align 8
  invoke void %40(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %41 unwind label %61

41:                                               ; preds = %37
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 0)
  %43 = load float, ptr %42, align 4, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 1)
  %45 = load float, ptr %44, align 4, !tbaa !5
  invoke void @_ZN3imp12ImageSampler3setEffRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(89) %4, float noundef %43, float noundef %45, ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %46 unwind label %61

46:                                               ; preds = %41
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  %47 = add nuw nsw i32 %.027, 1
  %48 = uitofp nneg i32 %47 to float
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef 1)
  %50 = load float, ptr %49, align 4, !tbaa !5
  %51 = fcmp ogt float %50, %48
  br i1 %51, label %.lr.ph, label %._crit_edge, !llvm.loop !13

52:                                               ; preds = %.lr.ph
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %65

54:                                               ; preds = %34
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %58

56:                                               ; preds = %35
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %58

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

59:                                               ; preds = %36
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %63

61:                                               ; preds = %41, %37
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #5
  br label %63

63:                                               ; preds = %61, %59
  %.pn22 = phi { ptr, i32 } [ %62, %61 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  br label %64

64:                                               ; preds = %63, %58
  %.pn22.pn = phi { ptr, i32 } [ %.pn22, %63 ], [ %.pn, %58 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %65

65:                                               ; preds = %64, %52
  %.pn22.pn.pn = phi { ptr, i32 } [ %.pn22.pn, %64 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @_ZN3imp12ImageSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(89) %4) #5
  br label %67

66:                                               ; preds = %2, %._crit_edge29
  ret void

67:                                               ; preds = %65, %26
  %.pn22.pn.pn.pn = phi { ptr, i32 } [ %.pn22.pn.pn, %65 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn22.pn.pn.pn
}

; 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 #1

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

; Function Attrs: mustprogress 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 #3 align 2

declare noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #4

declare noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #4

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

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

declare void @_ZN3imp12ImageSamplerC1ESt10shared_ptrINS_5ImageEENS_7SamplerINS_4Vec2ENS_4Vec4EE8WrappingE(ptr noundef nonnull align 8 dereferenceable(89), ptr noundef, i32 noundef) unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi2EfEdvERKS1_(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 #0 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 #0 align 2

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

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

declare void @_ZN3imp12ImageSampler3setEffRKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(89), float noundef, float noundef, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp12ImageSamplerD2Ev(ptr noundef nonnull align 8 dereferenceable(89)) 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = distinct !{!13, !10}


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