; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Graphics/ImageOperation.ll (ZN3imp12FbmOperation5applyERKNS_4Vec2ERNS_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::Vec3" = type { %"class.imp::Vec.base.9", [4 x i8] }
%"class.imp::Vec.base.9" = type <{ %"class.imp::Object", [3 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::Vec4" = type { %"class.imp::Vec.7" }
%"class.imp::Vec.7" = type { %"class.imp::Object", [4 x float] }
%"class.imp::Vec2" = type { %"class.imp::Vec" }
%"class.imp::Vec" = type { %"class.imp::Object", [2 x float] }
%"struct.imp::FbmOperation" = type { %"struct.imp::ImageOperation", %"class.std::shared_ptr", float, i32, i32, float, i8, [7 x i8], %"struct.imp::NoiseOperation", %"struct.imp::VoronoiOperation" }
%"struct.imp::ImageOperation" = type { %"class.imp::Object" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"struct.imp::NoiseOperation" = type <{ %"struct.imp::ImageOperation", %"class.std::shared_ptr", float, [4 x i8] }>
%"struct.imp::VoronoiOperation" = type <{ %"struct.imp::ImageOperation", %"class.std::shared_ptr", float, [4 x i8] }>

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec2C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(36), float noundef) 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 uwtable
declare dso_local void @_ZN3imp16VoronoiOperation5applyERKNS_4Vec2ERNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp12FbmOperation5applyERKNS_4Vec2ERNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(40) %2) unnamed_addr #1 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::Vec3", align 8
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca %"class.imp::Vec4", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.imp::Vec2", align 8
  %16 = alloca %"class.imp::Vec2", 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
  %17 = load ptr, ptr %4, align 8
  %18 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 8
  %19 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 1
  call void @_ZN3imp14NoiseOperation10setHashmapERKSt10shared_ptrINS_5ImageEE(ptr noundef nonnull align 8 dereferenceable(44) %18, ptr noundef nonnull align 8 dereferenceable(16) %19)
  %20 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 9
  %21 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 1
  call void @_ZN3imp16VoronoiOperation10setHashmapERKSt10shared_ptrINS_5ImageEE(ptr noundef nonnull align 8 dereferenceable(44) %20, ptr noundef nonnull align 8 dereferenceable(16) %21)
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call noundef float @_ZNK3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %22, i32 noundef 0)
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call noundef float @_ZNK3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %24, i32 noundef 1)
  call void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %7, float noundef %23, float noundef %25, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %26 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 5
  %27 = load float, ptr %26, align 4, !tbaa !9
  store float %27, ptr %8, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %28 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 2
  %29 = load float, ptr %28, align 8, !tbaa !24
  store float %29, ptr %9, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store float 0.000000e+00, ptr %10, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #4
  invoke void @_ZN3imp4Vec4C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11)
          to label %30 unwind label %37

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

31:                                               ; preds = %100, %30
  %32 = load i32, ptr %14, align 4, !tbaa !25
  %33 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 4
  %34 = load i32, ptr %33, align 8, !tbaa !26
  %35 = icmp slt i32 %32, %34
  br i1 %35, label %41, label %36

36:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %104

37:                                               ; preds = %3
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %12, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %13, align 4
  br label %115

41:                                               ; preds = %31
  %42 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 8
  %43 = load float, ptr %9, align 4, !tbaa !23
  invoke void @_ZN3imp14NoiseOperation7setFreqEf(ptr noundef nonnull align 8 dereferenceable(44) %42, float noundef %43)
          to label %44 unwind label %55

44:                                               ; preds = %41
  %45 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 9
  %46 = load float, ptr %9, align 4, !tbaa !23
  invoke void @_ZN3imp16VoronoiOperation7setFreqEf(ptr noundef nonnull align 8 dereferenceable(44) %45, float noundef %46)
          to label %47 unwind label %55

47:                                               ; preds = %44
  %48 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 3
  %49 = load i32, ptr %48, align 4, !tbaa !27
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %68

51:                                               ; preds = %47
  %52 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  invoke void @_ZN3imp4Vec2C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(36) %7, float noundef 1.000000e+00)
          to label %53 unwind label %59

53:                                               ; preds = %51
  invoke void @_ZN3imp14NoiseOperation5applyERKNS_4Vec2ERNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(44) %52, ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(40) %11)
          to label %54 unwind label %63

54:                                               ; preds = %53
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  br label %68

55:                                               ; preds = %85, %44, %41
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %12, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %13, align 4
  br label %103

59:                                               ; preds = %51
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %12, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %13, align 4
  br label %67

63:                                               ; preds = %53
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %12, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %13, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  br label %67

67:                                               ; preds = %63, %59
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  br label %103

68:                                               ; preds = %54, %47
  %69 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 3
  %70 = load i32, ptr %69, align 4, !tbaa !27
  %71 = icmp eq i32 %70, 1
  br i1 %71, label %72, label %85

72:                                               ; preds = %68
  %73 = getelementptr inbounds %"struct.imp::FbmOperation", ptr %17, i32 0, i32 9
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #4
  invoke void @_ZN3imp4Vec2C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(36) %7, float noundef 1.000000e+00)
          to label %74 unwind label %76

74:                                               ; preds = %72
  invoke void @_ZN3imp16VoronoiOperation5applyERKNS_4Vec2ERNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(44) %73, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(40) %11)
          to label %75 unwind label %80

75:                                               ; preds = %74
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  br label %85

76:                                               ; preds = %72
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %12, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %13, align 4
  br label %84

80:                                               ; preds = %74
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %12, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %13, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  br label %84

84:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  br label %103

85:                                               ; preds = %75, %68
  %86 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi4EfEixEj(ptr noundef nonnull align 8 dereferenceable(40) %11, i32 noundef 0)
          to label %87 unwind label %55

87:                                               ; preds = %85
  %88 = load float, ptr %86, align 4, !tbaa !23
  %89 = load float, ptr %8, align 4, !tbaa !23
  %90 = load float, ptr %10, align 4, !tbaa !23
  %91 = call float @llvm.fmuladd.f32(float %88, float %89, float %90)
  store float %91, ptr %10, align 4, !tbaa !23
  %92 = load float, ptr %8, align 4, !tbaa !23
  %93 = fpext float %92 to double
  %94 = fmul double %93, 5.000000e-01
  %95 = fptrunc double %94 to float
  store float %95, ptr %8, align 4, !tbaa !23
  %96 = load float, ptr %9, align 4, !tbaa !23
  %97 = fpext float %96 to double
  %98 = fmul double %97, 2.000000e+00
  %99 = fptrunc double %98 to float
  store float %99, ptr %9, align 4, !tbaa !23
  br label %100

100:                                              ; preds = %87
  %101 = load i32, ptr %14, align 4, !tbaa !25
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %14, align 4, !tbaa !25
  br label %31, !llvm.loop !28

103:                                              ; preds = %84, %67, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %114

104:                                              ; preds = %36
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = load float, ptr %10, align 4, !tbaa !23
  %107 = load float, ptr %10, align 4, !tbaa !23
  %108 = load float, ptr %10, align 4, !tbaa !23
  invoke void @_ZN3imp4Vec43setEffff(ptr noundef nonnull align 8 dereferenceable(40) %105, float noundef %106, float noundef %107, float noundef %108, float noundef 1.000000e+00)
          to label %109 unwind label %110

109:                                              ; preds = %104
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %7) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #4
  ret void

110:                                              ; preds = %104
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %12, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %13, align 4
  br label %114

114:                                              ; preds = %110, %103
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #4
  br label %115

115:                                              ; preds = %114, %37
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %7) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #4
  br label %116

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp14NoiseOperation7setFreqEf(ptr noundef nonnull align 8 dereferenceable(44), float noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp16VoronoiOperation7setFreqEf(ptr noundef nonnull align 8 dereferenceable(44), float noundef) #2 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !18, i64 52}
!10 = !{!"_ZTSN3imp12FbmOperationE", !11, i64 0, !16, i64 24, !18, i64 40, !19, i64 44, !19, i64 48, !18, i64 52, !20, i64 56, !21, i64 64, !22, i64 112}
!11 = !{!"_ZTSN3imp14ImageOperationE", !12, i64 0}
!12 = !{!"_ZTSN3imp6ObjectE", !13, i64 8}
!13 = !{!"_ZTSSt10shared_ptrIN3imp6ObjectEE", !14, i64 0}
!14 = !{!"_ZTSSt12__shared_ptrIN3imp6ObjectELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !15, i64 8}
!15 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!16 = !{!"_ZTSSt10shared_ptrIN3imp5ImageEE", !17, i64 0}
!17 = !{!"_ZTSSt12__shared_ptrIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !15, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSN3imp14NoiseOperationE", !11, i64 0, !16, i64 24, !18, i64 40}
!22 = !{!"_ZTSN3imp16VoronoiOperationE", !11, i64 0, !16, i64 24, !18, i64 40}
!23 = !{!18, !18, i64 0}
!24 = !{!10, !18, i64 40}
!25 = !{!19, !19, i64 0}
!26 = !{!10, !19, i64 48}
!27 = !{!10, !19, i64 44}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec2C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(36), float noundef) 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 uwtable
declare dso_local void @_ZN3imp16VoronoiOperation5applyERKNS_4Vec2ERNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp12FbmOperation5applyERKNS_4Vec2ERNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(40) %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.imp::Vec3", align 8
  %5 = alloca %"class.imp::Vec4", align 8
  %6 = alloca %"class.imp::Vec2", align 8
  %7 = alloca %"class.imp::Vec2", align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @_ZN3imp14NoiseOperation10setHashmapERKSt10shared_ptrINS_5ImageEE(ptr noundef nonnull align 8 dereferenceable(44) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 112
  tail call void @_ZN3imp16VoronoiOperation10setHashmapERKSt10shared_ptrINS_5ImageEE(ptr noundef nonnull align 8 dereferenceable(44) %10, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #4
  %11 = tail call noundef float @_ZNK3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef 0)
  %12 = tail call noundef float @_ZNK3imp3VecILi2EfEixEj(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef 1)
  call void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %4, float noundef %11, float noundef %12, float noundef 0.000000e+00)
  %13 = getelementptr inbounds i8, ptr %0, i64 52
  %14 = load float, ptr %13, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  %16 = load float, ptr %15, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #4
  invoke void @_ZN3imp4Vec4C2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %.preheader unwind label %21

.preheader:                                       ; preds = %3
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  %18 = load i32, ptr %17, align 8, !tbaa !23
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %20 = getelementptr inbounds i8, ptr %0, i64 44
  br label %23

._crit_edge:                                      ; preds = %45, %.preheader
  %.022.lcssa = phi float [ 0.000000e+00, %.preheader ], [ %48, %45 ]
  invoke void @_ZN3imp4Vec43setEffff(ptr noundef nonnull align 8 dereferenceable(40) %2, float noundef %.022.lcssa, float noundef %.022.lcssa, float noundef %.022.lcssa, float noundef 1.000000e+00)
          to label %54 unwind label %55

21:                                               ; preds = %3
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %58

23:                                               ; preds = %.lr.ph, %45
  %.038 = phi i32 [ 0, %.lr.ph ], [ %51, %45 ]
  %.02237 = phi float [ 0.000000e+00, %.lr.ph ], [ %48, %45 ]
  %.02336 = phi float [ %16, %.lr.ph ], [ %50, %45 ]
  %.02435 = phi float [ %14, %.lr.ph ], [ %49, %45 ]
  call void @_ZN3imp14NoiseOperation7setFreqEf(ptr noundef nonnull align 8 dereferenceable(44) %8, float noundef %.02336)
  call void @_ZN3imp16VoronoiOperation7setFreqEf(ptr noundef nonnull align 8 dereferenceable(44) %10, float noundef %.02336)
  %24 = load i32, ptr %20, align 4, !tbaa !24
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %34

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  invoke void @_ZN3imp4Vec2C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(36) %4, float noundef 1.000000e+00)
          to label %27 unwind label %29

27:                                               ; preds = %26
  invoke void @_ZN3imp14NoiseOperation5applyERKNS_4Vec2ERNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(44) %8, ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %28 unwind label %31

28:                                               ; preds = %27
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  %.pr = load i32, ptr %20, align 4, !tbaa !24
  br label %34

29:                                               ; preds = %26
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %33

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

33:                                               ; preds = %31, %29
  %.pn = phi { ptr, i32 } [ %32, %31 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  br label %57

34:                                               ; preds = %28, %23
  %35 = phi i32 [ %.pr, %28 ], [ %24, %23 ]
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %45

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  invoke void @_ZN3imp4Vec2C2ILi3EEERKNS_3VecIXT_EfEEf(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(36) %4, float noundef 1.000000e+00)
          to label %38 unwind label %40

38:                                               ; preds = %37
  invoke void @_ZN3imp16VoronoiOperation5applyERKNS_4Vec2ERNS_4Vec4E(ptr noundef nonnull align 8 dereferenceable(44) %10, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %39 unwind label %42

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

40:                                               ; preds = %37
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

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

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

45:                                               ; preds = %39, %34
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp3VecILi4EfEixEj(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 0)
  %47 = load float, ptr %46, align 4, !tbaa !25
  %48 = call float @llvm.fmuladd.f32(float %47, float %.02435, float %.02237)
  %49 = fmul float %.02435, 5.000000e-01
  %50 = fmul float %.02336, 2.000000e+00
  %51 = add nuw nsw i32 %.038, 1
  %52 = load i32, ptr %17, align 8, !tbaa !23
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %23, label %._crit_edge, !llvm.loop !26

54:                                               ; preds = %._crit_edge
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #4
  ret void

55:                                               ; preds = %._crit_edge
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %57

57:                                               ; preds = %33, %44, %55
  %.pn26.pn.pn = phi { ptr, i32 } [ %56, %55 ], [ %.pn26, %44 ], [ %.pn, %33 ]
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #4
  br label %58

58:                                               ; preds = %57, %21
  %.pn26.pn.pn.pn = phi { ptr, i32 } [ %.pn26.pn.pn, %57 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %4) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn26.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp14NoiseOperation7setFreqEf(ptr noundef nonnull align 8 dereferenceable(44), float noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3imp16VoronoiOperation7setFreqEf(ptr noundef nonnull align 8 dereferenceable(44), float noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !17, i64 52}
!6 = !{!"_ZTSN3imp12FbmOperationE", !7, i64 0, !15, i64 24, !17, i64 40, !18, i64 44, !18, i64 48, !17, i64 52, !19, i64 56, !20, i64 64, !21, i64 112}
!7 = !{!"_ZTSN3imp14ImageOperationE", !8, i64 0}
!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 = !{!"_ZTSSt10shared_ptrIN3imp5ImageEE", !16, i64 0}
!16 = !{!"_ZTSSt12__shared_ptrIN3imp5ImageELN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0, !14, i64 8}
!17 = !{!"float", !12, i64 0}
!18 = !{!"int", !12, i64 0}
!19 = !{!"bool", !12, i64 0}
!20 = !{!"_ZTSN3imp14NoiseOperationE", !7, i64 0, !15, i64 24, !17, i64 40}
!21 = !{!"_ZTSN3imp16VoronoiOperationE", !7, i64 0, !15, i64 24, !17, i64 40}
!22 = !{!6, !17, i64 40}
!23 = !{!6, !18, i64 48}
!24 = !{!6, !18, i64 44}
!25 = !{!17, !17, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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