; LLVM IR from OAID/AutoKernel :: autokernel_plugin/tests/common/tengine_operations.ll (Z12resize_image5imageii)

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

%struct.image = type { i32, i32, i32, ptr }

; 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10make_imageiii(ptr dead_on_unwind noalias writable sret(%struct.image) align 8, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12resize_image5imageii(ptr dead_on_unwind noalias writable sret(%struct.image) align 8 %0, ptr noundef byval(%struct.image) align 8 %1, i32 noundef %2, i32 noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca i32, align 4
  %24 = alloca float, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  store i32 %2, ptr %5, align 4, !tbaa !5
  store i32 %3, ptr %6, align 4, !tbaa !5
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 2
  %34 = load i32, ptr %33, align 8, !tbaa !9
  call void @_Z10make_imageiii(ptr dead_on_unwind writable sret(%struct.image) align 8 %0, i32 noundef %31, i32 noundef %32, i32 noundef %34)
  %35 = getelementptr inbounds %struct.image, ptr %0, i32 0, i32 3
  %36 = load ptr, ptr %35, align 8, !tbaa !12
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = mul i64 4, %38
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = mul i64 %39, %41
  %43 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 2
  %44 = load i32, ptr %43, align 8, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = mul i64 %42, %45
  call void @llvm.memset.p0.i64(ptr align 4 %36, i8 0, i64 %46, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %47 = getelementptr inbounds %struct.image, ptr %0, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !12
  store ptr %48, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %49 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !14
  %51 = sitofp i32 %50 to float
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sitofp i32 %52 to float
  %54 = fdiv float %51, %53
  store float %54, ptr %8, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %55 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !17
  %57 = sitofp i32 %56 to float
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = sitofp i32 %58 to float
  %60 = fdiv float %57, %59
  store float %60, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %61 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !14
  store i32 %62, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %63 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !17
  store i32 %64, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %65 = load i32, ptr %11, align 4, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = mul nsw i32 %65, %66
  store i32 %67, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %211, %4
  %69 = load i32, ptr %13, align 4, !tbaa !5
  %70 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 2
  %71 = load i32, ptr %70, align 8, !tbaa !9
  %72 = icmp slt i32 %69, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %68
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %214

74:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %207, %74
  %76 = load i32, ptr %15, align 4, !tbaa !5
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %210

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %81 = load i32, ptr %15, align 4, !tbaa !5
  %82 = sitofp i32 %81 to double
  %83 = fadd double %82, 5.000000e-01
  %84 = load float, ptr %9, align 4, !tbaa !15
  %85 = fpext float %84 to double
  %86 = call double @llvm.fmuladd.f64(double %83, double %85, double -5.000000e-01)
  %87 = fptrunc double %86 to float
  store float %87, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %88 = load float, ptr %16, align 4, !tbaa !15
  %89 = call noundef float @_ZSt5floorf(float noundef %88)
  %90 = fptosi float %89 to i32
  store i32 %90, ptr %17, align 4, !tbaa !5
  %91 = load i32, ptr %17, align 4, !tbaa !5
  %92 = sitofp i32 %91 to float
  %93 = load float, ptr %16, align 4, !tbaa !15
  %94 = fsub float %93, %92
  store float %94, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = sub nsw i32 %95, 2
  store i32 %96, ptr %18, align 4, !tbaa !5
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %98 = load i32, ptr %97, align 4, !tbaa !5
  store i32 %98, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %100 = load i32, ptr %99, align 4, !tbaa !5
  store i32 %100, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %101 = load float, ptr %16, align 4, !tbaa !15
  %102 = fsub float 1.000000e+00, %101
  store float %102, ptr %20, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %203, %80
  %104 = load i32, ptr %21, align 4, !tbaa !5
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %206

108:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %109 = load i32, ptr %21, align 4, !tbaa !5
  %110 = sitofp i32 %109 to double
  %111 = fadd double %110, 5.000000e-01
  %112 = load float, ptr %8, align 4, !tbaa !15
  %113 = fpext float %112 to double
  %114 = call double @llvm.fmuladd.f64(double %111, double %113, double -5.000000e-01)
  %115 = fptrunc double %114 to float
  store float %115, ptr %22, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %116 = load float, ptr %22, align 4, !tbaa !15
  %117 = call noundef float @_ZSt5floorf(float noundef %116)
  %118 = fptosi float %117 to i32
  store i32 %118, ptr %23, align 4, !tbaa !5
  %119 = load i32, ptr %23, align 4, !tbaa !5
  %120 = sitofp i32 %119 to float
  %121 = load float, ptr %22, align 4, !tbaa !15
  %122 = fsub float %121, %120
  store float %122, ptr %22, align 4, !tbaa !15
  %123 = load i32, ptr %23, align 4, !tbaa !5
  %124 = icmp slt i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %108
  store i32 0, ptr %23, align 4, !tbaa !5
  store float 0.000000e+00, ptr %22, align 4, !tbaa !15
  br label %126

126:                                              ; preds = %125, %108
  %127 = load i32, ptr %23, align 4, !tbaa !5
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = sub nsw i32 %128, 1
  %130 = icmp sge i32 %127, %129
  br i1 %130, label %131, label %134

131:                                              ; preds = %126
  store float 0.000000e+00, ptr %22, align 4, !tbaa !15
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 2
  store i32 %133, ptr %23, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %131, %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %135 = load float, ptr %22, align 4, !tbaa !15
  %136 = fsub float 1.000000e+00, %135
  store float %136, ptr %24, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %137 = load i32, ptr %17, align 4, !tbaa !5
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = mul nsw i32 %137, %138
  %140 = load i32, ptr %23, align 4, !tbaa !5
  %141 = add nsw i32 %139, %140
  store i32 %141, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %142 = load i32, ptr %25, align 4, !tbaa !5
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = load i32, ptr %12, align 4, !tbaa !5
  %145 = mul nsw i32 %143, %144
  %146 = add nsw i32 %142, %145
  store i32 %146, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %147 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 3
  %148 = load ptr, ptr %147, align 8, !tbaa !12
  %149 = load i32, ptr %26, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds float, ptr %148, i64 %150
  %152 = load float, ptr %151, align 4, !tbaa !15
  %153 = load float, ptr %24, align 4, !tbaa !15
  %154 = fmul float %152, %153
  %155 = load float, ptr %20, align 4, !tbaa !15
  %156 = fmul float %154, %155
  store float %156, ptr %27, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %157 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 3
  %158 = load ptr, ptr %157, align 8, !tbaa !12
  %159 = load i32, ptr %26, align 4, !tbaa !5
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = add nsw i32 %159, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds float, ptr %158, i64 %162
  %164 = load float, ptr %163, align 4, !tbaa !15
  %165 = load float, ptr %24, align 4, !tbaa !15
  %166 = fmul float %164, %165
  %167 = load float, ptr %16, align 4, !tbaa !15
  %168 = fmul float %166, %167
  store float %168, ptr %28, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %169 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 3
  %170 = load ptr, ptr %169, align 8, !tbaa !12
  %171 = load i32, ptr %26, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds float, ptr %170, i64 %173
  %175 = load float, ptr %174, align 4, !tbaa !15
  %176 = load float, ptr %22, align 4, !tbaa !15
  %177 = fmul float %175, %176
  %178 = load float, ptr %20, align 4, !tbaa !15
  %179 = fmul float %177, %178
  store float %179, ptr %29, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %180 = getelementptr inbounds %struct.image, ptr %1, i32 0, i32 3
  %181 = load ptr, ptr %180, align 8, !tbaa !12
  %182 = load i32, ptr %26, align 4, !tbaa !5
  %183 = load i32, ptr %10, align 4, !tbaa !5
  %184 = add nsw i32 %182, %183
  %185 = add nsw i32 %184, 1
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds float, ptr %181, i64 %186
  %188 = load float, ptr %187, align 4, !tbaa !15
  %189 = load float, ptr %22, align 4, !tbaa !15
  %190 = fmul float %188, %189
  %191 = load float, ptr %16, align 4, !tbaa !15
  %192 = fmul float %190, %191
  store float %192, ptr %30, align 4, !tbaa !15
  %193 = load float, ptr %27, align 4, !tbaa !15
  %194 = load float, ptr %28, align 4, !tbaa !15
  %195 = fadd float %193, %194
  %196 = load float, ptr %29, align 4, !tbaa !15
  %197 = fadd float %195, %196
  %198 = load float, ptr %30, align 4, !tbaa !15
  %199 = fadd float %197, %198
  %200 = load ptr, ptr %7, align 8, !tbaa !13
  store float %199, ptr %200, align 4, !tbaa !15
  %201 = load ptr, ptr %7, align 8, !tbaa !13
  %202 = getelementptr inbounds float, ptr %201, i32 1
  store ptr %202, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %203

203:                                              ; preds = %134
  %204 = load i32, ptr %21, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %21, align 4, !tbaa !5
  br label %103, !llvm.loop !18

206:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %15, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %15, align 4, !tbaa !5
  br label %75, !llvm.loop !20

210:                                              ; preds = %79
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %13, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %13, align 4, !tbaa !5
  br label %68, !llvm.loop !21

214:                                              ; preds = %73
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTS5image", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!10, !6, i64 4}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}


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

%struct.image = type { i32, i32, i32, ptr }

; 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10make_imageiii(ptr dead_on_unwind noalias writable sret(%struct.image) align 8, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12resize_image5imageii(ptr dead_on_unwind noalias writable sret(%struct.image) align 8 %0, ptr nocapture noundef readonly byval(%struct.image) align 8 %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !5
  tail call void @_Z10make_imageiii(ptr dead_on_unwind writable sret(%struct.image) align 8 %0, i32 noundef %2, i32 noundef %3, i32 noundef %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = sext i32 %2 to i64
  %13 = shl nsw i64 %12, 2
  %14 = sext i32 %3 to i64
  %15 = mul i64 %13, %14
  %16 = sext i32 %9 to i64
  %17 = mul i64 %15, %16
  tail call void @llvm.memset.p0.i64(ptr align 4 %11, i8 0, i64 %17, i1 false)
  %18 = load ptr, ptr %10, align 8, !tbaa !11
  %19 = load i32, ptr %1, align 8, !tbaa !12
  %20 = getelementptr inbounds i8, ptr %1, i64 4
  %21 = load i32, ptr %20, align 4, !tbaa !13
  %22 = icmp sgt i32 %9, 0
  br i1 %22, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %4
  %23 = sitofp i32 %21 to float
  %24 = sitofp i32 %3 to float
  %25 = fdiv float %23, %24
  %26 = sitofp i32 %19 to float
  %27 = sitofp i32 %2 to float
  %28 = fdiv float %26, %27
  %29 = icmp sgt i32 %3, 0
  %30 = fpext float %25 to double
  %31 = add nsw i32 %21, -2
  %32 = fpext float %28 to double
  %33 = add nsw i32 %19, -1
  %34 = add nsw i32 %19, -2
  %35 = getelementptr inbounds i8, ptr %1, i64 16
  br i1 %29, label %.preheader.lr.ph.split.us, label %._crit_edge

.preheader.lr.ph.split.us:                        ; preds = %.preheader.lr.ph
  %36 = icmp sgt i32 %2, 0
  br i1 %36, label %.preheader.us.us, label %.preheader.us

.preheader.us.us:                                 ; preds = %.preheader.lr.ph.split.us, %._crit_edge69.split.us.us.us
  %.072.us.us = phi ptr [ %87, %._crit_edge69.split.us.us.us ], [ %18, %.preheader.lr.ph.split.us ]
  %.05671.us.us = phi i32 [ %90, %._crit_edge69.split.us.us.us ], [ 0, %.preheader.lr.ph.split.us ]
  %37 = mul i32 %.05671.us.us, %21
  br label %.lr.ph.us.us.us

.lr.ph.us.us.us:                                  ; preds = %._crit_edge.us.us.us, %.preheader.us.us
  %.167.us.us.us = phi ptr [ %.072.us.us, %.preheader.us.us ], [ %87, %._crit_edge.us.us.us ]
  %.05766.us.us.us = phi i32 [ 0, %.preheader.us.us ], [ %89, %._crit_edge.us.us.us ]
  %38 = uitofp nneg i32 %.05766.us.us.us to double
  %39 = fadd double %38, 5.000000e-01
  %40 = call double @llvm.fmuladd.f64(double %39, double %30, double -5.000000e-01)
  %41 = fptrunc double %40 to float
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %42 = call noundef float @_ZSt5floorf(float noundef %41)
  %43 = fptosi float %42 to i32
  store i32 %43, ptr %5, align 4, !tbaa !14
  %44 = sitofp i32 %43 to float
  %45 = fsub float %41, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 %31, ptr %6, align 4, !tbaa !14
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %47 = load i32, ptr %46, align 4, !tbaa !14
  store i32 %47, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !14
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %49 = load i32, ptr %48, align 4, !tbaa !14
  store i32 %49, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %50 = fsub float 1.000000e+00, %45
  %51 = load ptr, ptr %35, align 8
  br label %52

52:                                               ; preds = %52, %.lr.ph.us.us.us
  %.265.us.us.us = phi ptr [ %.167.us.us.us, %.lr.ph.us.us.us ], [ %87, %52 ]
  %.05864.us.us.us = phi i32 [ 0, %.lr.ph.us.us.us ], [ %88, %52 ]
  %53 = uitofp nneg i32 %.05864.us.us.us to double
  %54 = fadd double %53, 5.000000e-01
  %55 = call double @llvm.fmuladd.f64(double %54, double %32, double -5.000000e-01)
  %56 = fptrunc double %55 to float
  %57 = call noundef float @_ZSt5floorf(float noundef %56)
  %58 = fptosi float %57 to i32
  %59 = sitofp i32 %58 to float
  %60 = fsub float %56, %59
  %61 = icmp slt i32 %58, 0
  %.061.us.us.us = call i32 @llvm.smax.i32(i32 %58, i32 0)
  %.059.us.us.us = select i1 %61, float 0.000000e+00, float %60
  %.not.us.us.us = icmp slt i32 %.061.us.us.us, %33
  %.162.us.us.us = select i1 %.not.us.us.us, i32 %.061.us.us.us, i32 %34
  %.160.us.us.us = select i1 %.not.us.us.us, float %.059.us.us.us, float 0.000000e+00
  %62 = fsub float 1.000000e+00, %.160.us.us.us
  %63 = load i32, ptr %5, align 4, !tbaa !14
  %reass.add.us.us.us = add i32 %63, %37
  %reass.mul.us.us.us = mul i32 %reass.add.us.us.us, %19
  %64 = add i32 %.162.us.us.us, %reass.mul.us.us.us
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds float, ptr %51, i64 %65
  %67 = load float, ptr %66, align 4, !tbaa !15
  %68 = fmul float %67, %62
  %69 = fmul float %50, %68
  %70 = add nsw i32 %64, %19
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds float, ptr %51, i64 %71
  %73 = load float, ptr %72, align 4, !tbaa !15
  %74 = fmul float %73, %62
  %75 = fmul float %45, %74
  %76 = getelementptr i8, ptr %66, i64 4
  %77 = load float, ptr %76, align 4, !tbaa !15
  %78 = fmul float %77, %.160.us.us.us
  %79 = fmul float %50, %78
  %80 = getelementptr i8, ptr %72, i64 4
  %81 = load float, ptr %80, align 4, !tbaa !15
  %82 = fmul float %.160.us.us.us, %81
  %83 = fmul float %45, %82
  %84 = fadd float %69, %75
  %85 = fadd float %79, %84
  %86 = fadd float %83, %85
  store float %86, ptr %.265.us.us.us, align 4, !tbaa !15
  %87 = getelementptr inbounds i8, ptr %.265.us.us.us, i64 4
  %88 = add nuw nsw i32 %.05864.us.us.us, 1
  %exitcond79.not = icmp eq i32 %88, %2
  br i1 %exitcond79.not, label %._crit_edge.us.us.us, label %52, !llvm.loop !17

._crit_edge.us.us.us:                             ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %89 = add nuw nsw i32 %.05766.us.us.us, 1
  %exitcond80.not = icmp eq i32 %89, %3
  br i1 %exitcond80.not, label %._crit_edge69.split.us.us.us, label %.lr.ph.us.us.us, !llvm.loop !19

._crit_edge69.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %90 = add nuw nsw i32 %.05671.us.us, 1
  %exitcond81.not = icmp eq i32 %90, %9
  br i1 %exitcond81.not, label %._crit_edge, label %.preheader.us.us, !llvm.loop !20

.preheader.us:                                    ; preds = %.preheader.lr.ph.split.us, %._crit_edge69.split.us74
  %.05671.us = phi i32 [ %102, %._crit_edge69.split.us74 ], [ 0, %.preheader.lr.ph.split.us ]
  br label %91

91:                                               ; preds = %.preheader.us, %91
  %.05766.us73 = phi i32 [ 0, %.preheader.us ], [ %101, %91 ]
  %92 = uitofp nneg i32 %.05766.us73 to double
  %93 = fadd double %92, 5.000000e-01
  %94 = call double @llvm.fmuladd.f64(double %93, double %30, double -5.000000e-01)
  %95 = fptrunc double %94 to float
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %96 = call noundef float @_ZSt5floorf(float noundef %95)
  %97 = fptosi float %96 to i32
  store i32 %97, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 %31, ptr %6, align 4, !tbaa !14
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %99 = load i32, ptr %98, align 4, !tbaa !14
  store i32 %99, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !14
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %101 = add nuw nsw i32 %.05766.us73, 1
  %exitcond.not = icmp eq i32 %101, %3
  br i1 %exitcond.not, label %._crit_edge69.split.us74, label %91, !llvm.loop !19

._crit_edge69.split.us74:                         ; preds = %91
  %102 = add nuw nsw i32 %.05671.us, 1
  %exitcond78.not = icmp eq i32 %102, %9
  br i1 %exitcond78.not, label %._crit_edge, label %.preheader.us, !llvm.loop !20

._crit_edge:                                      ; preds = %._crit_edge69.split.us74, %._crit_edge69.split.us.us.us, %.preheader.lr.ph, %4
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTS5image", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 4}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass