; LLVM IR from rdguez-mariano/fast_imas_IPOL :: libLocalDesc/surf/image.ll (ZN5image14printImageParaEPcPS_)

; 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.image = type { i32, i32, ptr }

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #1

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5image14printImageParaEPcPS_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1, ptr noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %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 float, align 4
  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
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %14 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = mul nsw i32 3, %15
  %17 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 1
  %18 = load i32, ptr %17, align 4, !tbaa !12
  %19 = mul nsw i32 %16, %18
  %20 = sext i32 %19 to i64
  %21 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %20, i64 4)
  %22 = extractvalue { i64, i1 } %21, 1
  %23 = extractvalue { i64, i1 } %21, 0
  %24 = select i1 %22, i64 -1, i64 %23
  %25 = call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #7
  store ptr %25, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %26 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds double, ptr %27, i64 0
  %29 = load double, ptr %28, align 8, !tbaa !14
  %30 = fptrunc double %29 to float
  store float %30, ptr %8, align 4, !tbaa !16
  %31 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = getelementptr inbounds double, ptr %32, i64 0
  %34 = load double, ptr %33, align 8, !tbaa !14
  %35 = fptrunc double %34 to float
  store float %35, ptr %9, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !18
  br label %36

36:                                               ; preds = %82, %3
  %37 = load i32, ptr %10, align 4, !tbaa !18
  %38 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !12
  %42 = mul nsw i32 %39, %41
  %43 = icmp slt i32 %37, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %85

45:                                               ; preds = %36
  %46 = load float, ptr %9, align 4, !tbaa !16
  %47 = fpext float %46 to double
  %48 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  %50 = load i32, ptr %10, align 4, !tbaa !18
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %49, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !14
  %54 = fcmp ogt double %47, %53
  br i1 %54, label %55, label %63

55:                                               ; preds = %45
  %56 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !13
  %58 = load i32, ptr %10, align 4, !tbaa !18
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds double, ptr %57, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !14
  %62 = fptrunc double %61 to float
  store float %62, ptr %9, align 4, !tbaa !16
  br label %63

63:                                               ; preds = %55, %45
  %64 = load float, ptr %8, align 4, !tbaa !16
  %65 = fpext float %64 to double
  %66 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !13
  %68 = load i32, ptr %10, align 4, !tbaa !18
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %67, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !14
  %72 = fcmp olt double %65, %71
  br i1 %72, label %73, label %81

73:                                               ; preds = %63
  %74 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 2
  %75 = load ptr, ptr %74, align 8, !tbaa !13
  %76 = load i32, ptr %10, align 4, !tbaa !18
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %75, i64 %77
  %79 = load double, ptr %78, align 8, !tbaa !14
  %80 = fptrunc double %79 to float
  store float %80, ptr %8, align 4, !tbaa !16
  br label %81

81:                                               ; preds = %73, %63
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %10, align 4, !tbaa !18
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %10, align 4, !tbaa !18
  br label %36, !llvm.loop !19

85:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !18
  br label %86

86:                                               ; preds = %224, %85
  %87 = load i32, ptr %11, align 4, !tbaa !18
  %88 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !12
  %92 = mul nsw i32 %89, %91
  %93 = icmp slt i32 %87, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %227

95:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %96 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !13
  %98 = load i32, ptr %11, align 4, !tbaa !18
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds double, ptr %97, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !14
  %102 = load float, ptr %8, align 4, !tbaa !16
  %103 = fpext float %102 to double
  %104 = fsub double %101, %103
  %105 = load float, ptr %9, align 4, !tbaa !16
  %106 = load float, ptr %8, align 4, !tbaa !16
  %107 = fsub float %105, %106
  %108 = fpext float %107 to double
  %109 = fdiv double %104, %108
  %110 = fptrunc double %109 to float
  store float %110, ptr %12, align 4, !tbaa !16
  %111 = load float, ptr %12, align 4, !tbaa !16
  %112 = load float, ptr %12, align 4, !tbaa !16
  %113 = fsub float 1.000000e+00, %112
  %114 = fmul float %113, 2.550000e+02
  %115 = call float @llvm.fmuladd.f32(float 0.000000e+00, float %111, float %114)
  %116 = call noundef i32 @_Z6froundf(float noundef %115)
  %117 = sitofp i32 %116 to float
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !18
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds float, ptr %118, i64 %120
  store float %117, ptr %121, align 4, !tbaa !16
  %122 = load float, ptr %12, align 4, !tbaa !16
  %123 = load float, ptr %12, align 4, !tbaa !16
  %124 = fsub float 1.000000e+00, %123
  %125 = fmul float %124, 2.550000e+02
  %126 = call float @llvm.fmuladd.f32(float 0.000000e+00, float %122, float %125)
  %127 = call noundef i32 @_Z6froundf(float noundef %126)
  %128 = sitofp i32 %127 to float
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 0
  %131 = load i32, ptr %130, align 8, !tbaa !9
  %132 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !12
  %134 = mul nsw i32 %131, %133
  %135 = load i32, ptr %11, align 4, !tbaa !18
  %136 = add nsw i32 %134, %135
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds float, ptr %129, i64 %137
  store float %128, ptr %138, align 4, !tbaa !16
  %139 = load float, ptr %12, align 4, !tbaa !16
  %140 = load float, ptr %12, align 4, !tbaa !16
  %141 = fsub float 1.000000e+00, %140
  %142 = fmul float %141, 2.550000e+02
  %143 = call float @llvm.fmuladd.f32(float 0.000000e+00, float %139, float %142)
  %144 = call noundef i32 @_Z6froundf(float noundef %143)
  %145 = sitofp i32 %144 to float
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 0
  %148 = load i32, ptr %147, align 8, !tbaa !9
  %149 = mul nsw i32 2, %148
  %150 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 1
  %151 = load i32, ptr %150, align 4, !tbaa !12
  %152 = mul nsw i32 %149, %151
  %153 = load i32, ptr %11, align 4, !tbaa !18
  %154 = add nsw i32 %152, %153
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds float, ptr %146, i64 %155
  store float %145, ptr %156, align 4, !tbaa !16
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load i32, ptr %11, align 4, !tbaa !18
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = call noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16) %159)
  %161 = srem i32 %158, %160
  %162 = load i32, ptr %11, align 4, !tbaa !18
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = call noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16) %163)
  %165 = sdiv i32 %162, %164
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5imageclEii(ptr noundef nonnull align 8 dereferenceable(16) %157, i32 noundef %161, i32 noundef %165)
  %167 = load double, ptr %166, align 8, !tbaa !14
  %168 = fcmp une double %167, 0.000000e+00
  br i1 %168, label %169, label %223

169:                                              ; preds = %95
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  %171 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 0
  %172 = load i32, ptr %171, align 8, !tbaa !9
  %173 = mul nsw i32 2, %172
  %174 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !12
  %176 = mul nsw i32 %173, %175
  %177 = load i32, ptr %11, align 4, !tbaa !18
  %178 = add nsw i32 %176, %177
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds float, ptr %170, i64 %179
  store float 0.000000e+00, ptr %180, align 4, !tbaa !16
  %181 = load float, ptr %12, align 4, !tbaa !16
  %182 = load float, ptr %12, align 4, !tbaa !16
  %183 = fsub float 1.000000e+00, %182
  %184 = fmul float %183, 1.300000e+02
  %185 = call float @llvm.fmuladd.f32(float 0.000000e+00, float %181, float %184)
  %186 = call noundef i32 @_Z6froundf(float noundef %185)
  %187 = sitofp i32 %186 to double
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = load i32, ptr %11, align 4, !tbaa !18
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = call noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16) %190)
  %192 = srem i32 %189, %191
  %193 = load i32, ptr %11, align 4, !tbaa !18
  %194 = load ptr, ptr %6, align 8, !tbaa !5
  %195 = call noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16) %194)
  %196 = sdiv i32 %193, %195
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5imageclEii(ptr noundef nonnull align 8 dereferenceable(16) %188, i32 noundef %192, i32 noundef %196)
  %198 = load double, ptr %197, align 8, !tbaa !14
  %199 = fadd double %187, %198
  %200 = fptrunc double %199 to float
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 0
  %203 = load i32, ptr %202, align 8, !tbaa !9
  %204 = mul nsw i32 0, %203
  %205 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 1
  %206 = load i32, ptr %205, align 4, !tbaa !12
  %207 = mul nsw i32 %204, %206
  %208 = load i32, ptr %11, align 4, !tbaa !18
  %209 = add nsw i32 %207, %208
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds float, ptr %201, i64 %210
  store float %200, ptr %211, align 4, !tbaa !16
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 0
  %214 = load i32, ptr %213, align 8, !tbaa !9
  %215 = mul nsw i32 1, %214
  %216 = getelementptr inbounds %class.image, ptr %13, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !12
  %218 = mul nsw i32 %215, %217
  %219 = load i32, ptr %11, align 4, !tbaa !18
  %220 = add nsw i32 %218, %219
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds float, ptr %212, i64 %221
  store float 0.000000e+00, ptr %222, align 4, !tbaa !16
  br label %223

223:                                              ; preds = %169, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %11, align 4, !tbaa !18
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %11, align 4, !tbaa !18
  br label %86, !llvm.loop !21

227:                                              ; preds = %94
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = icmp eq ptr %228, null
  br i1 %229, label %231, label %230

230:                                              ; preds = %227
  call void @_ZdaPv(ptr noundef %228) #8
  br label %231

231:                                              ; preds = %230, %227
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6froundf(float noundef) #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN5imageclEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nobuiltin 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !11, i64 0}
!10 = !{!"_ZTS5image", !11, i64 0, !11, i64 4, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5image14printImageParaEPcPS_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(16) %0, ptr nocapture noundef readnone %1, ptr noundef %2) local_unnamed_addr #0 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = load i32, ptr %0, align 8, !tbaa !11
  %8 = load i32, ptr %4, align 4, !tbaa !12
  %9 = mul nsw i32 %8, %7
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %11 = load double, ptr %6, align 8, !tbaa !13
  %12 = fptrunc double %11 to float
  %wide.trip.count = zext nneg i32 %9 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %13 = icmp eq i32 %9, 1
  br i1 %13, label %.preheader.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.preheader.unr-lcssa:                             ; preds = %.lr.ph, %.lr.ph.preheader
  %.148.lcssa.ph = phi float [ poison, %.lr.ph.preheader ], [ %.148.1, %.lr.ph ]
  %.1.lcssa.ph = phi float [ poison, %.lr.ph.preheader ], [ %.1.1, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %.053.unr = phi float [ %12, %.lr.ph.preheader ], [ %.1.1, %.lr.ph ]
  %.04751.unr = phi float [ %12, %.lr.ph.preheader ], [ %.148.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader.unr-lcssa
  %14 = fpext float %.04751.unr to double
  %15 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.unr
  %16 = load double, ptr %15, align 8, !tbaa !13
  %17 = fcmp olt double %16, %14
  %18 = fptrunc double %16 to float
  %.148.epil = select i1 %17, float %18, float %.04751.unr
  %19 = fpext float %.053.unr to double
  %20 = fcmp ogt double %16, %19
  %.1.epil = select i1 %20, float %18, float %.053.unr
  br label %.preheader

.preheader:                                       ; preds = %.preheader.unr-lcssa, %.lr.ph.epil
  %.148.lcssa = phi float [ %.148.lcssa.ph, %.preheader.unr-lcssa ], [ %.148.epil, %.lr.ph.epil ]
  %.1.lcssa = phi float [ %.1.lcssa.ph, %.preheader.unr-lcssa ], [ %.1.epil, %.lr.ph.epil ]
  br i1 %10, label %.lr.ph56, label %._crit_edge

.lr.ph56:                                         ; preds = %.preheader
  %21 = fpext float %.1.lcssa to double
  %22 = fsub float %.148.lcssa, %.1.lcssa
  %23 = fpext float %22 to double
  br label %38

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %.053 = phi float [ %12, %.lr.ph.preheader.new ], [ %.1.1, %.lr.ph ]
  %.04751 = phi float [ %12, %.lr.ph.preheader.new ], [ %.148.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %24 = fpext float %.04751 to double
  %25 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  %26 = load double, ptr %25, align 8, !tbaa !13
  %27 = fcmp olt double %26, %24
  %28 = fptrunc double %26 to float
  %.148 = select i1 %27, float %28, float %.04751
  %29 = fpext float %.053 to double
  %30 = fcmp ogt double %26, %29
  %.1 = select i1 %30, float %28, float %.053
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %31 = fpext float %.148 to double
  %32 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next
  %33 = load double, ptr %32, align 8, !tbaa !13
  %34 = fcmp olt double %33, %31
  %35 = fptrunc double %33 to float
  %.148.1 = select i1 %34, float %35, float %.148
  %36 = fpext float %.1 to double
  %37 = fcmp ogt double %33, %36
  %.1.1 = select i1 %37, float %35, float %.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.unr-lcssa, label %.lr.ph, !llvm.loop !15

38:                                               ; preds = %.lr.ph56, %68
  %indvars.iv58 = phi i64 [ 0, %.lr.ph56 ], [ %indvars.iv.next59, %68 ]
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds double, ptr %39, i64 %indvars.iv58
  %41 = load double, ptr %40, align 8, !tbaa !13
  %42 = fsub double %41, %21
  %43 = fdiv double %42, %23
  %44 = fptrunc double %43 to float
  %45 = fsub float 1.000000e+00, %44
  %46 = fmul float %45, 2.550000e+02
  %47 = tail call float @llvm.fmuladd.f32(float %44, float 0.000000e+00, float %46)
  %48 = tail call noundef i32 @_Z6froundf(float noundef %47)
  %49 = tail call noundef i32 @_Z6froundf(float noundef %47)
  %50 = tail call noundef i32 @_Z6froundf(float noundef %47)
  %51 = tail call noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %52 = trunc nuw nsw i64 %indvars.iv58 to i32
  %53 = srem i32 %52, %51
  %54 = tail call noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %55 = sdiv i32 %52, %54
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5imageclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %53, i32 noundef %55)
  %57 = load double, ptr %56, align 8, !tbaa !13
  %58 = fcmp une double %57, 0.000000e+00
  br i1 %58, label %59, label %68

59:                                               ; preds = %38
  %60 = fmul float %45, 1.300000e+02
  %61 = tail call float @llvm.fmuladd.f32(float %44, float 0.000000e+00, float %60)
  %62 = tail call noundef i32 @_Z6froundf(float noundef %61)
  %63 = tail call noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %64 = srem i32 %52, %63
  %65 = tail call noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %66 = sdiv i32 %52, %65
  %67 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5imageclEii(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %64, i32 noundef %66)
  br label %68

68:                                               ; preds = %59, %38
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %69 = load i32, ptr %0, align 8, !tbaa !11
  %70 = load i32, ptr %4, align 4, !tbaa !12
  %71 = mul nsw i32 %70, %69
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next59, %72
  br i1 %73, label %38, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %68, %3, %.preheader
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6froundf(float noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN5imageclEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !10, i64 8}
!6 = !{!"_ZTS5image", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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