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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp5Image6resizeEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp5Image4copyERKSt10shared_ptrIS0_ERKSt6vectorIiSaIiEEb(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i1 noundef zeroext %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %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::Vec4", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.imp::Vec4", align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %19 = zext i1 %3 to i8
  store i8 %19, ptr %8, align 1, !tbaa !9
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr %9, align 4, !tbaa !11
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %24) #3
  %26 = call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %25)
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %27) #3
  %29 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %28)
  %30 = load i32, ptr %9, align 4, !tbaa !11
  call void @_ZN3imp5Image6resizeEiii(ptr noundef nonnull align 8 dereferenceable(88) %20, i32 noundef %26, i32 noundef %29, i32 noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %31

31:                                               ; preds = %110, %4
  %32 = load i32, ptr %10, align 4, !tbaa !11
  %33 = call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %20)
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %113

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %37

37:                                               ; preds = %103, %36
  %38 = load i32, ptr %12, align 4, !tbaa !11
  %39 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %20)
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #3
  %43 = load i32, ptr %10, align 4, !tbaa !11
  %44 = sitofp i32 %43 to float
  %45 = load i32, ptr %12, align 4, !tbaa !11
  %46 = sitofp i32 %45 to float
  call void @_ZN3imp4Vec2C2Eff(ptr noundef nonnull align 8 dereferenceable(32) %13, float noundef %44, float noundef %46)
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #3
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %47) #3
  invoke void @_ZNK3imp5Image8getPixelERKNS_4Vec2E(ptr dead_on_unwind writable sret(%"class.imp::Vec4") align 8 %14, ptr noundef nonnull align 8 dereferenceable(88) %48, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %49 unwind label %56

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 40, ptr %17) #3
  invoke void @_ZN3imp4Vec4C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %50 unwind label %60

50:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %51

51:                                               ; preds = %76, %50
  %52 = load i32, ptr %18, align 4, !tbaa !11
  %53 = load i32, ptr %9, align 4, !tbaa !11
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %64, label %55

55:                                               ; preds = %51
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %83

56:                                               ; preds = %42
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %15, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %16, align 4
  br label %108

60:                                               ; preds = %49
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %15, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %16, align 4
  br label %107

64:                                               ; preds = %51
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load i32, ptr %18, align 4, !tbaa !11
  %67 = sext i32 %66 to i64
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %67) #3
  %69 = load i32, ptr %68, align 4, !tbaa !11
  %70 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi4EfEixEj(ptr noundef nonnull align 8 dereferenceable(40) %14, i32 noundef %69)
          to label %71 unwind label %79

71:                                               ; preds = %64
  %72 = load float, ptr %70, align 4, !tbaa !13
  %73 = load i32, ptr %18, align 4, !tbaa !11
  %74 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi4EfEixEj(ptr noundef nonnull align 8 dereferenceable(40) %17, i32 noundef %73)
          to label %75 unwind label %79

75:                                               ; preds = %71
  store float %72, ptr %74, align 4, !tbaa !13
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %18, align 4, !tbaa !11
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %18, align 4, !tbaa !11
  br label %51, !llvm.loop !15

79:                                               ; preds = %71, %64
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %15, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %106

83:                                               ; preds = %55
  %84 = load i8, ptr %8, align 1, !tbaa !9, !range !17, !noundef !18
  %85 = trunc i8 %84 to i1
  br i1 %85, label %86, label %101

86:                                               ; preds = %83
  %87 = invoke noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %20)
          to label %88 unwind label %97

88:                                               ; preds = %86
  %89 = sub nsw i32 %87, 1
  %90 = sitofp i32 %89 to float
  %91 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %13, i32 noundef 1)
          to label %92 unwind label %97

92:                                               ; preds = %88
  %93 = load float, ptr %91, align 4, !tbaa !13
  %94 = fsub float %90, %93
  %95 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %13, i32 noundef 1)
          to label %96 unwind label %97

96:                                               ; preds = %92
  store float %94, ptr %95, align 4, !tbaa !13
  br label %101

97:                                               ; preds = %101, %92, %88, %86
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %15, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %16, align 4
  br label %106

101:                                              ; preds = %96, %83
  invoke void @_ZN3imp5Image8setPixelERKNS_4Vec2ERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %20, ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %102 unwind label %97

102:                                              ; preds = %101
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #3
  br label %103

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

106:                                              ; preds = %97, %79
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #3
  br label %107

107:                                              ; preds = %106, %60
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #3
  br label %108

108:                                              ; preds = %107, %56
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %114

109:                                              ; preds = %41
  br label %110

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

113:                                              ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void

114:                                              ; preds = %108
  %115 = load ptr, ptr %15, align 8
  %116 = load i32, ptr %16, align 4
  %117 = insertvalue { ptr, i32 } poison, ptr %115, 0
  %118 = insertvalue { ptr, i32 } %117, i32 %116, 1
  resume { ptr, i32 } %118
}

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 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) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp5Image8setPixelERKNS_4Vec2ERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) #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

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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !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.7" }
%"class.imp::Vec.7" = type { %"class.imp::Object", [2 x float] }
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.imp::Vec4" = type { %"class.imp::Vec" }
%"class.imp::Vec" = type { %"class.imp::Object", [4 x float] }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp5Image6resizeEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp5Image4copyERKSt10shared_ptrIS0_ERKSt6vectorIiSaIiEEb(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i1 noundef zeroext %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.imp::Vec2", align 8
  %6 = alloca %"class.imp::Vec4", align 8
  %7 = alloca %"class.imp::Vec4", align 8
  %8 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %9 = trunc i64 %8 to i32
  %10 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #3
  %11 = tail call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %10)
  %12 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #3
  %13 = tail call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %12)
  tail call void @_ZN3imp5Image6resizeEiii(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %11, i32 noundef %13, i32 noundef %9)
  %14 = tail call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader27.lr.ph, label %._crit_edge

.preheader27.lr.ph:                               ; preds = %4
  %16 = icmp sgt i32 %9, 0
  br i1 %16, label %.preheader27.lr.ph.split.us, label %.preheader27

.preheader27.lr.ph.split.us:                      ; preds = %.preheader27.lr.ph
  %wide.trip.count54 = and i64 %8, 2147483647
  br i1 %3, label %.preheader27.us.us, label %.preheader27.us

.preheader27.us.us:                               ; preds = %.preheader27.lr.ph.split.us, %._crit_edge31.split.us.us.split.us.us
  %.02438.us.us = phi i32 [ %19, %._crit_edge31.split.us.us.split.us.us ], [ 0, %.preheader27.lr.ph.split.us ]
  %17 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph30.us.us, label %._crit_edge31.split.us.us.split.us.us

._crit_edge31.split.us.us.split.us.us:            ; preds = %34, %.preheader27.us.us
  %19 = add nuw nsw i32 %.02438.us.us, 1
  %20 = call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.preheader27.us.us, label %._crit_edge, !llvm.loop !5

.lr.ph30.us.us:                                   ; preds = %.preheader27.us.us
  %22 = uitofp nneg i32 %.02438.us.us to float
  br label %23

23:                                               ; preds = %34, %.lr.ph30.us.us
  %.02329.us.us.us.us = phi i32 [ 0, %.lr.ph30.us.us ], [ %35, %34 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  %24 = uitofp nneg i32 %.02329.us.us.us.us to float
  call void @_ZN3imp4Vec2C2Eff(ptr noundef nonnull align 8 dereferenceable(32) %5, float noundef %22, float noundef %24)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #3
  %25 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #3
  invoke void @_ZNK3imp5Image8getPixelERKNS_4Vec2E(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec4") align 8 %6, ptr noundef nonnull align 8 dereferenceable(88) %25, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %26 unwind label %.split.us.split.us.split.us.split.us

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #3
  invoke void @_ZN3imp4Vec4C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %.preheader.us.us.us.us unwind label %.split33.us.split.us.split.us.split.us

27:                                               ; preds = %._crit_edge.us.us.us.us
  %28 = add nsw i32 %44, -1
  %29 = sitofp i32 %28 to float
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 1)
  %31 = load float, ptr %30, align 4, !tbaa !7
  %32 = fsub float %29, %31
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 1)
  store float %32, ptr %33, align 4, !tbaa !7
  invoke void @_ZN3imp5Image8setPixelERKNS_4Vec2ERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %34 unwind label %.split36.us.split.us.split.us.split.us

34:                                               ; preds = %27
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  %35 = add nuw nsw i32 %.02329.us.us.us.us, 1
  %36 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %23, label %._crit_edge31.split.us.us.split.us.us, !llvm.loop !11

.preheader.us.us.us.us:                           ; preds = %26, %.preheader.us.us.us.us
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.preheader.us.us.us.us ], [ 0, %26 ]
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv51) #3
  %39 = load i32, ptr %38, align 4, !tbaa !12
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi4EfEixEj(ptr noundef nonnull align 8 dereferenceable(40) %6, i32 noundef %39)
  %41 = load float, ptr %40, align 4, !tbaa !7
  %42 = trunc nuw nsw i64 %indvars.iv51 to i32
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi4EfEixEj(ptr noundef nonnull align 8 dereferenceable(40) %7, i32 noundef %42)
  store float %41, ptr %43, align 4, !tbaa !7
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count54
  br i1 %exitcond55.not, label %._crit_edge.us.us.us.us, label %.preheader.us.us.us.us, !llvm.loop !14

._crit_edge.us.us.us.us:                          ; preds = %.preheader.us.us.us.us
  %44 = invoke noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
          to label %27 unwind label %.split36.us.split.us.split.us.split.us

.split.us.split.us.split.us.split.us:             ; preds = %23
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.split33.us.split.us.split.us.split.us:           ; preds = %26
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %.split33.us

.split36.us.split.us.split.us.split.us:           ; preds = %._crit_edge.us.us.us.us, %27
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %.split36.us

.preheader27.us:                                  ; preds = %.preheader27.lr.ph.split.us, %._crit_edge31.split.us.us.split
  %.02438.us = phi i32 [ %50, %._crit_edge31.split.us.us.split ], [ 0, %.preheader27.lr.ph.split.us ]
  %48 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.lr.ph30.us, label %._crit_edge31.split.us.us.split

._crit_edge31.split.us.us.split:                  ; preds = %58, %.preheader27.us
  %50 = add nuw nsw i32 %.02438.us, 1
  %51 = call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.preheader27.us, label %._crit_edge, !llvm.loop !5

.lr.ph30.us:                                      ; preds = %.preheader27.us
  %53 = uitofp nneg i32 %.02438.us to float
  br label %54

54:                                               ; preds = %58, %.lr.ph30.us
  %.02329.us.us = phi i32 [ 0, %.lr.ph30.us ], [ %59, %58 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  %55 = uitofp nneg i32 %.02329.us.us to float
  call void @_ZN3imp4Vec2C2Eff(ptr noundef nonnull align 8 dereferenceable(32) %5, float noundef %53, float noundef %55)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #3
  %56 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #3
  invoke void @_ZNK3imp5Image8getPixelERKNS_4Vec2E(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec4") align 8 %6, ptr noundef nonnull align 8 dereferenceable(88) %56, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %57 unwind label %.split.us.split.us.split

57:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #3
  invoke void @_ZN3imp4Vec4C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %.preheader.us.us unwind label %.split33.us.split.us.split

58:                                               ; preds = %._crit_edge.us.us
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  %59 = add nuw nsw i32 %.02329.us.us, 1
  %60 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %54, label %._crit_edge31.split.us.us.split, !llvm.loop !11

.preheader.us.us:                                 ; preds = %57, %.preheader.us.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader.us.us ], [ 0, %57 ]
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %63 = load i32, ptr %62, align 4, !tbaa !12
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi4EfEixEj(ptr noundef nonnull align 8 dereferenceable(40) %6, i32 noundef %63)
  %65 = load float, ptr %64, align 4, !tbaa !7
  %66 = trunc nuw nsw i64 %indvars.iv to i32
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi4EfEixEj(ptr noundef nonnull align 8 dereferenceable(40) %7, i32 noundef %66)
  store float %65, ptr %67, align 4, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count54
  br i1 %exitcond.not, label %._crit_edge.us.us, label %.preheader.us.us, !llvm.loop !14

._crit_edge.us.us:                                ; preds = %.preheader.us.us
  invoke void @_ZN3imp5Image8setPixelERKNS_4Vec2ERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %58 unwind label %.split36.us.split.us.split

.split.us.split.us.split:                         ; preds = %54
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.split33.us.split.us.split:                       ; preds = %57
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %.split33.us

.split36.us.split.us.split:                       ; preds = %._crit_edge.us.us
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %.split36.us

.preheader27:                                     ; preds = %.preheader27.lr.ph, %._crit_edge31.split
  %.02438 = phi i32 [ %74, %._crit_edge31.split ], [ 0, %.preheader27.lr.ph ]
  %71 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.lr.ph30, label %._crit_edge31.split

.lr.ph30:                                         ; preds = %.preheader27
  %73 = uitofp nneg i32 %.02438 to float
  br label %77

._crit_edge:                                      ; preds = %._crit_edge31.split, %._crit_edge31.split.us.us.split, %._crit_edge31.split.us.us.split.us.us, %4
  ret void

._crit_edge31.split:                              ; preds = %94, %.preheader27
  %74 = add nuw nsw i32 %.02438, 1
  %75 = call noundef i32 @_ZNK3imp5Image5widthEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %.preheader27, label %._crit_edge, !llvm.loop !5

77:                                               ; preds = %.lr.ph30, %94
  %.02329 = phi i32 [ 0, %.lr.ph30 ], [ %95, %94 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  %78 = uitofp nneg i32 %.02329 to float
  call void @_ZN3imp4Vec2C2Eff(ptr noundef nonnull align 8 dereferenceable(32) %5, float noundef %73, float noundef %78)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #3
  %79 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #3
  invoke void @_ZNK3imp5Image8getPixelERKNS_4Vec2E(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec4") align 8 %6, ptr noundef nonnull align 8 dereferenceable(88) %79, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %80 unwind label %.split

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #3
  invoke void @_ZN3imp4Vec4C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %.preheader unwind label %.split33

.preheader:                                       ; preds = %80
  br i1 %3, label %83, label %93

.split:                                           ; preds = %77
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.split33:                                         ; preds = %80
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %.split33.us

83:                                               ; preds = %.preheader
  %84 = invoke noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
          to label %85 unwind label %.split36

85:                                               ; preds = %83
  %86 = add nsw i32 %84, -1
  %87 = sitofp i32 %86 to float
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 1)
  %89 = load float, ptr %88, align 4, !tbaa !7
  %90 = fsub float %87, %89
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 1)
  store float %90, ptr %91, align 4, !tbaa !7
  br label %93

.split36:                                         ; preds = %93, %83
  %92 = landingpad { ptr, i32 }
          cleanup
  br label %.split36.us

.split36.us:                                      ; preds = %.split36.us.split.us.split.us.split.us, %.split36.us.split.us.split, %.split36
  %.us-phi37 = phi { ptr, i32 } [ %92, %.split36 ], [ %70, %.split36.us.split.us.split ], [ %47, %.split36.us.split.us.split.us.split.us ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #3
  br label %.split33.us

93:                                               ; preds = %85, %.preheader
  invoke void @_ZN3imp5Image8setPixelERKNS_4Vec2ERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %94 unwind label %.split36

94:                                               ; preds = %93
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  %95 = add nuw nsw i32 %.02329, 1
  %96 = call noundef i32 @_ZNK3imp5Image6heightEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %77, label %._crit_edge31.split, !llvm.loop !11

.split33.us:                                      ; preds = %.split33, %.split33.us.split.us.split, %.split33.us.split.us.split.us.split.us, %.split36.us
  %.pn = phi { ptr, i32 } [ %.us-phi37, %.split36.us ], [ %82, %.split33 ], [ %69, %.split33.us.split.us.split ], [ %46, %.split33.us.split.us.split.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #3
  br label %.split.us

.split.us:                                        ; preds = %.split, %.split.us.split.us.split, %.split.us.split.us.split.us.split.us, %.split33.us
  %.pn.pn = phi { ptr, i32 } [ %.pn, %.split33.us ], [ %81, %.split ], [ %68, %.split.us.split.us.split ], [ %45, %.split.us.split.us.split.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #3
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 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 #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp5Image8setPixelERKNS_4Vec2ERKNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) local_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

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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = distinct !{!14, !6}


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