; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseResizerNearest.ll (ZN4Simd4Base14ResizerNearest13EstimateIndexEmmmmPi)

; 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.Simd::Resizer" = type { %"struct.Simd::Deletable", %"struct.Simd::ResParam" }
%"struct.Simd::Deletable" = type { ptr }
%"struct.Simd::ResParam" = type { i32, i32, i64, i64, i64, i64, i64, i64 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__._ZN4Simd4Base14ResizerNearest13EstimateIndexEmmmmPi = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base14ResizerNearest13EstimateIndexEmmmmPi(ptr noundef nonnull align 8 dereferenceable(104) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, ptr noundef %5) #0 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca float, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store i64 %2, ptr %9, align 8, !tbaa !9
  store i64 %3, ptr %10, align 8, !tbaa !9
  store i64 %4, ptr %11, align 8, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  %24 = load ptr, ptr %7, align 8
  %25 = getelementptr inbounds %"class.Simd::Resizer", ptr %24, i32 0, i32 1
  %26 = getelementptr inbounds %"struct.Simd::ResParam", ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !11
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %39, label %29

29:                                               ; preds = %6
  %30 = getelementptr inbounds %"class.Simd::Resizer", ptr %24, i32 0, i32 1
  %31 = getelementptr inbounds %"struct.Simd::ResParam", ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !11
  %33 = icmp eq i32 %32, 2
  br i1 %33, label %39, label %34

34:                                               ; preds = %29
  %35 = getelementptr inbounds %"class.Simd::Resizer", ptr %24, i32 0, i32 1
  %36 = getelementptr inbounds %"struct.Simd::ResParam", ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = icmp eq i32 %37, 5
  br i1 %38, label %39, label %94

39:                                               ; preds = %34, %29, %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = uitofp i64 %40 to float
  %42 = load i64, ptr %9, align 8, !tbaa !9
  %43 = uitofp i64 %42 to float
  %44 = fdiv float %41, %43
  store float %44, ptr %13, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %90, %39
  %46 = load i64, ptr %14, align 8, !tbaa !9
  %47 = load i64, ptr %9, align 8, !tbaa !9
  %48 = icmp ult i64 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %93

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %51 = load i64, ptr %14, align 8, !tbaa !9
  %52 = uitofp i64 %51 to float
  %53 = fadd float %52, 5.000000e-01
  %54 = load float, ptr %13, align 4, !tbaa !17
  %55 = fmul float %53, %54
  store float %55, ptr %16, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %56 = load float, ptr %16, align 4, !tbaa !17
  %57 = call noundef float @_ZSt5floorf(float noundef %56)
  %58 = fptosi float %57 to i32
  %59 = load i64, ptr %8, align 8, !tbaa !9
  %60 = trunc i64 %59 to i32
  %61 = sub nsw i32 %60, 1
  %62 = call noundef i32 @_ZN4Simd4Base13RestrictRangeEiii(i32 noundef %58, i32 noundef 0, i32 noundef %61)
  store i32 %62, ptr %17, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %86, %50
  %64 = load i64, ptr %18, align 8, !tbaa !9
  %65 = load i64, ptr %11, align 8, !tbaa !9
  %66 = icmp ult i64 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %89

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %69 = load i64, ptr %14, align 8, !tbaa !9
  %70 = load i64, ptr %11, align 8, !tbaa !9
  %71 = mul i64 %69, %70
  %72 = load i64, ptr %18, align 8, !tbaa !9
  %73 = add i64 %71, %72
  store i64 %73, ptr %19, align 8, !tbaa !9
  %74 = load i64, ptr %11, align 8, !tbaa !9
  %75 = load i32, ptr %17, align 4, !tbaa !19
  %76 = sext i32 %75 to i64
  %77 = mul i64 %74, %76
  %78 = load i64, ptr %18, align 8, !tbaa !9
  %79 = add i64 %77, %78
  %80 = load i64, ptr %10, align 8, !tbaa !9
  %81 = mul i64 %79, %80
  %82 = trunc i64 %81 to i32
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = load i64, ptr %19, align 8, !tbaa !9
  %85 = getelementptr inbounds i32, ptr %83, i64 %84
  store i32 %82, ptr %85, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %86

86:                                               ; preds = %68
  %87 = load i64, ptr %18, align 8, !tbaa !9
  %88 = add i64 %87, 1
  store i64 %88, ptr %18, align 8, !tbaa !9
  br label %63, !llvm.loop !21

89:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %14, align 8, !tbaa !9
  %92 = add i64 %91, 1
  store i64 %92, ptr %14, align 8, !tbaa !9
  br label %45, !llvm.loop !23

93:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %154

94:                                               ; preds = %34
  %95 = getelementptr inbounds %"class.Simd::Resizer", ptr %24, i32 0, i32 1
  %96 = getelementptr inbounds %"struct.Simd::ResParam", ptr %95, i32 0, i32 1
  %97 = load i32, ptr %96, align 4, !tbaa !11
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %104, label %99

99:                                               ; preds = %94
  %100 = getelementptr inbounds %"class.Simd::Resizer", ptr %24, i32 0, i32 1
  %101 = getelementptr inbounds %"struct.Simd::ResParam", ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 4, !tbaa !11
  %103 = icmp eq i32 %102, 4
  br i1 %103, label %104, label %152

104:                                              ; preds = %99, %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store i64 0, ptr %20, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %148, %104
  %106 = load i64, ptr %20, align 8, !tbaa !9
  %107 = load i64, ptr %9, align 8, !tbaa !9
  %108 = icmp ult i64 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %151

110:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %111 = load i64, ptr %20, align 8, !tbaa !9
  %112 = load i64, ptr %8, align 8, !tbaa !9
  %113 = mul i64 %111, %112
  %114 = load i64, ptr %9, align 8, !tbaa !9
  %115 = udiv i64 %113, %114
  %116 = trunc i64 %115 to i32
  %117 = load i64, ptr %8, align 8, !tbaa !9
  %118 = trunc i64 %117 to i32
  %119 = sub nsw i32 %118, 1
  %120 = call noundef i32 @_ZN4Simd4Base13RestrictRangeEiii(i32 noundef %116, i32 noundef 0, i32 noundef %119)
  store i32 %120, ptr %21, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %144, %110
  %122 = load i64, ptr %22, align 8, !tbaa !9
  %123 = load i64, ptr %11, align 8, !tbaa !9
  %124 = icmp ult i64 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %147

126:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %127 = load i64, ptr %20, align 8, !tbaa !9
  %128 = load i64, ptr %11, align 8, !tbaa !9
  %129 = mul i64 %127, %128
  %130 = load i64, ptr %22, align 8, !tbaa !9
  %131 = add i64 %129, %130
  store i64 %131, ptr %23, align 8, !tbaa !9
  %132 = load i64, ptr %11, align 8, !tbaa !9
  %133 = load i32, ptr %21, align 4, !tbaa !19
  %134 = sext i32 %133 to i64
  %135 = mul i64 %132, %134
  %136 = load i64, ptr %22, align 8, !tbaa !9
  %137 = add i64 %135, %136
  %138 = load i64, ptr %10, align 8, !tbaa !9
  %139 = mul i64 %137, %138
  %140 = trunc i64 %139 to i32
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  %142 = load i64, ptr %23, align 8, !tbaa !9
  %143 = getelementptr inbounds i32, ptr %141, i64 %142
  store i32 %140, ptr %143, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %144

144:                                              ; preds = %126
  %145 = load i64, ptr %22, align 8, !tbaa !9
  %146 = add i64 %145, 1
  store i64 %146, ptr %22, align 8, !tbaa !9
  br label %121, !llvm.loop !24

147:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %148

148:                                              ; preds = %147
  %149 = load i64, ptr %20, align 8, !tbaa !9
  %150 = add i64 %149, 1
  store i64 %150, ptr %20, align 8, !tbaa !9
  br label %105, !llvm.loop !25

151:                                              ; preds = %109
  br label %153

152:                                              ; preds = %99
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 67, ptr noundef @__PRETTY_FUNCTION__._ZN4Simd4Base14ResizerNearest13EstimateIndexEmmmmPi) #6
  unreachable

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153, %93
  ret void
}

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZN4Simd4Base13RestrictRangeEiii(i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) #3

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "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 }
attributes #6 = { noreturn 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 = !{!"long", !7, i64 0}
!11 = !{!12, !16, i64 12}
!12 = !{!"_ZTSN4Simd7ResizerE", !13, i64 0, !14, i64 8}
!13 = !{!"_ZTSN4Simd9DeletableE"}
!14 = !{!"_ZTSN4Simd8ResParamE", !15, i64 0, !16, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!15 = !{!"_ZTS21SimdResizeChannelType", !7, i64 0}
!16 = !{!"_ZTS20SimdResizeMethodType", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !22}


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

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__._ZN4Simd4Base14ResizerNearest13EstimateIndexEmmmmPi = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base14ResizerNearest13EstimateIndexEmmmmPi(ptr nocapture noundef nonnull readonly align 8 dereferenceable(104) %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #0 align 2 {
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  %8 = load i32, ptr %7, align 4, !tbaa !5
  switch i32 %8, label %70 [
    i32 0, label %9
    i32 2, label %9
    i32 5, label %9
    i32 1, label %43
    i32 4, label %43
  ]

9:                                                ; preds = %6, %6, %6
  %10 = uitofp i64 %1 to float
  %11 = uitofp i64 %2 to float
  %12 = fdiv float %10, %11
  %.not58 = icmp eq i64 %2, 0
  br i1 %.not58, label %.loopexit, label %.lr.ph54

.lr.ph54:                                         ; preds = %9
  %13 = trunc i64 %1 to i32
  %14 = add nsw i32 %13, -1
  %.not59 = icmp eq i64 %4, 0
  br i1 %.not59, label %.lr.ph54.split, label %.lr.ph.us55.preheader

.lr.ph.us55.preheader:                            ; preds = %.lr.ph54
  %min.iters.check78 = icmp ult i64 %4, 4
  %n.vec81 = and i64 %4, -4
  %broadcast.splatinsert89 = insertelement <4 x i64> poison, i64 %3, i64 0
  %broadcast.splat90 = shufflevector <4 x i64> %broadcast.splatinsert89, <4 x i64> poison, <4 x i32> zeroinitializer
  %cmp.n92 = icmp eq i64 %n.vec81, %4
  br label %.lr.ph.us55

.lr.ph.us55:                                      ; preds = %.lr.ph.us55.preheader, %._crit_edge.us56
  %.052.us = phi i64 [ %35, %._crit_edge.us56 ], [ 0, %.lr.ph.us55.preheader ]
  %15 = uitofp i64 %.052.us to float
  %16 = fadd float %15, 5.000000e-01
  %17 = fmul float %12, %16
  %18 = tail call noundef float @_ZSt5floorf(float noundef %17)
  %19 = fptosi float %18 to i32
  %20 = tail call noundef i32 @_ZN4Simd4Base13RestrictRangeEiii(i32 noundef %19, i32 noundef 0, i32 noundef %14)
  %21 = mul i64 %.052.us, %4
  %22 = zext i32 %20 to i64
  %23 = mul i64 %22, %4
  %24 = getelementptr i32, ptr %5, i64 %21
  br i1 %min.iters.check78, label %scalar.ph77.preheader, label %vector.ph79

vector.ph79:                                      ; preds = %.lr.ph.us55
  %broadcast.splatinsert87 = insertelement <4 x i64> poison, i64 %23, i64 0
  %broadcast.splat88 = shufflevector <4 x i64> %broadcast.splatinsert87, <4 x i64> poison, <4 x i32> zeroinitializer
  br label %vector.body83

vector.body83:                                    ; preds = %vector.body83, %vector.ph79
  %index84 = phi i64 [ 0, %vector.ph79 ], [ %index.next91, %vector.body83 ]
  %vec.ind85 = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph79 ], [ %vec.ind.next86, %vector.body83 ]
  %25 = add <4 x i64> %vec.ind85, %broadcast.splat88
  %26 = mul <4 x i64> %25, %broadcast.splat90
  %27 = trunc <4 x i64> %26 to <4 x i32>
  %28 = getelementptr i32, ptr %24, i64 %index84
  store <4 x i32> %27, ptr %28, align 4, !tbaa !14
  %index.next91 = add nuw i64 %index84, 4
  %vec.ind.next86 = add <4 x i64> %vec.ind85, <i64 4, i64 4, i64 4, i64 4>
  %29 = icmp eq i64 %index.next91, %n.vec81
  br i1 %29, label %middle.block76, label %vector.body83, !llvm.loop !16

middle.block76:                                   ; preds = %vector.body83
  br i1 %cmp.n92, label %._crit_edge.us56, label %scalar.ph77.preheader

scalar.ph77.preheader:                            ; preds = %middle.block76, %.lr.ph.us55
  %.04251.us.ph = phi i64 [ 0, %.lr.ph.us55 ], [ %n.vec81, %middle.block76 ]
  br label %scalar.ph77

scalar.ph77:                                      ; preds = %scalar.ph77.preheader, %scalar.ph77
  %.04251.us = phi i64 [ %34, %scalar.ph77 ], [ %.04251.us.ph, %scalar.ph77.preheader ]
  %30 = add i64 %.04251.us, %23
  %31 = mul i64 %30, %3
  %32 = trunc i64 %31 to i32
  %33 = getelementptr i32, ptr %24, i64 %.04251.us
  store i32 %32, ptr %33, align 4, !tbaa !14
  %34 = add nuw i64 %.04251.us, 1
  %exitcond65.not = icmp eq i64 %34, %4
  br i1 %exitcond65.not, label %._crit_edge.us56, label %scalar.ph77, !llvm.loop !20

._crit_edge.us56:                                 ; preds = %scalar.ph77, %middle.block76
  %35 = add nuw i64 %.052.us, 1
  %exitcond66.not = icmp eq i64 %35, %2
  br i1 %exitcond66.not, label %.loopexit, label %.lr.ph.us55, !llvm.loop !21

.lr.ph54.split:                                   ; preds = %.lr.ph54, %.lr.ph54.split
  %.052 = phi i64 [ %42, %.lr.ph54.split ], [ 0, %.lr.ph54 ]
  %36 = uitofp i64 %.052 to float
  %37 = fadd float %36, 5.000000e-01
  %38 = fmul float %12, %37
  %39 = tail call noundef float @_ZSt5floorf(float noundef %38)
  %40 = fptosi float %39 to i32
  %41 = tail call noundef i32 @_ZN4Simd4Base13RestrictRangeEiii(i32 noundef %40, i32 noundef 0, i32 noundef %14)
  %42 = add nuw i64 %.052, 1
  %exitcond67.not = icmp eq i64 %42, %2
  br i1 %exitcond67.not, label %.loopexit, label %.lr.ph54.split, !llvm.loop !21

43:                                               ; preds = %6, %6
  %.not = icmp eq i64 %2, 0
  br i1 %.not, label %.loopexit, label %.lr.ph50

.lr.ph50:                                         ; preds = %43
  %44 = trunc i64 %1 to i32
  %45 = add nsw i32 %44, -1
  %.not57 = icmp eq i64 %4, 0
  br i1 %.not57, label %.lr.ph50.split, label %.lr.ph.us.preheader

.lr.ph.us.preheader:                              ; preds = %.lr.ph50
  %min.iters.check = icmp ult i64 %4, 4
  %n.vec = and i64 %4, -4
  %broadcast.splatinsert74 = insertelement <4 x i64> poison, i64 %3, i64 0
  %broadcast.splat75 = shufflevector <4 x i64> %broadcast.splatinsert74, <4 x i64> poison, <4 x i32> zeroinitializer
  %cmp.n = icmp eq i64 %n.vec, %4
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %.04148.us = phi i64 [ %64, %._crit_edge.us ], [ 0, %.lr.ph.us.preheader ]
  %46 = mul i64 %.04148.us, %1
  %47 = udiv i64 %46, %2
  %48 = trunc i64 %47 to i32
  %49 = tail call noundef i32 @_ZN4Simd4Base13RestrictRangeEiii(i32 noundef %48, i32 noundef 0, i32 noundef %45)
  %50 = mul i64 %.04148.us, %4
  %51 = zext i32 %49 to i64
  %52 = mul i64 %51, %4
  %53 = getelementptr i32, ptr %5, i64 %50
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.us
  %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %52, i64 0
  %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %54 = add <4 x i64> %vec.ind, %broadcast.splat
  %55 = mul <4 x i64> %54, %broadcast.splat75
  %56 = trunc <4 x i64> %55 to <4 x i32>
  %57 = getelementptr i32, ptr %53, i64 %index
  store <4 x i32> %56, ptr %57, align 4, !tbaa !14
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
  %58 = icmp eq i64 %index.next, %n.vec
  br i1 %58, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph.us
  %.04047.us.ph = phi i64 [ 0, %.lr.ph.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.04047.us = phi i64 [ %63, %scalar.ph ], [ %.04047.us.ph, %scalar.ph.preheader ]
  %59 = add i64 %.04047.us, %52
  %60 = mul i64 %59, %3
  %61 = trunc i64 %60 to i32
  %62 = getelementptr i32, ptr %53, i64 %.04047.us
  store i32 %61, ptr %62, align 4, !tbaa !14
  %63 = add nuw i64 %.04047.us, 1
  %exitcond.not = icmp eq i64 %63, %4
  br i1 %exitcond.not, label %._crit_edge.us, label %scalar.ph, !llvm.loop !23

._crit_edge.us:                                   ; preds = %scalar.ph, %middle.block
  %64 = add nuw i64 %.04148.us, 1
  %exitcond63.not = icmp eq i64 %64, %2
  br i1 %exitcond63.not, label %.loopexit, label %.lr.ph.us, !llvm.loop !24

.lr.ph50.split:                                   ; preds = %.lr.ph50, %.lr.ph50.split
  %.04148 = phi i64 [ %69, %.lr.ph50.split ], [ 0, %.lr.ph50 ]
  %65 = mul i64 %.04148, %1
  %66 = udiv i64 %65, %2
  %67 = trunc i64 %66 to i32
  %68 = tail call noundef i32 @_ZN4Simd4Base13RestrictRangeEiii(i32 noundef %67, i32 noundef 0, i32 noundef %45)
  %69 = add nuw i64 %.04148, 1
  %exitcond64.not = icmp eq i64 %69, %2
  br i1 %exitcond64.not, label %.loopexit, label %.lr.ph50.split, !llvm.loop !24

70:                                               ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 67, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4Simd4Base14ResizerNearest13EstimateIndexEmmmmPi) #4
  unreachable

.loopexit:                                        ; preds = %._crit_edge.us, %.lr.ph50.split, %._crit_edge.us56, %.lr.ph54.split, %43, %9
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZN4Simd4Base13RestrictRangeEiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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 = { alwaysinline 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 = { 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 #3 = { noreturn nounwind "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 = { noreturn 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, !12, i64 12}
!6 = !{!"_ZTSN4Simd7ResizerE", !7, i64 0, !8, i64 8}
!7 = !{!"_ZTSN4Simd9DeletableE"}
!8 = !{!"_ZTSN4Simd8ResParamE", !9, i64 0, !12, i64 4, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48}
!9 = !{!"_ZTS21SimdResizeChannelType", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTS20SimdResizeMethodType", !10, i64 0}
!13 = !{!"long", !10, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !10, i64 0}
!16 = distinct !{!16, !17, !18, !19}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !17, !19, !18}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17, !18, !19}
!23 = distinct !{!23, !17, !19, !18}
!24 = distinct !{!24, !17}


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