; LLVM IR from Wilson-ZheLin/Introduction-to-Digital-Image-Processing :: 6. Low Pass Filter and High Pass Filter/src/main.ll (Z4GLPFP5ImagePfS1_)

; 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, [15 x [100 x i8]], i32 }

@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1

; 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
define dso_local void @_Z4GLPFP5ImagePfS1_(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca float, align 4
  %19 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Image, ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = sitofp i32 %22 to float
  store float %23, ptr %9, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.Image, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !14
  %27 = sitofp i32 %26 to float
  store float %27, ptr %10, align 4, !tbaa !12
  %28 = load float, ptr %9, align 4, !tbaa !12
  %29 = load float, ptr %10, align 4, !tbaa !12
  %30 = fmul float %28, %29
  %31 = fptosi float %30 to i32
  %32 = zext i32 %31 to i64
  %33 = call ptr @llvm.stacksave.p0()
  store ptr %33, ptr %11, align 8
  %34 = alloca float, i64 %32, align 16
  store i64 %32, ptr %12, align 8
  %35 = load float, ptr %9, align 4, !tbaa !12
  %36 = load float, ptr %10, align 4, !tbaa !12
  %37 = fmul float %35, %36
  %38 = fptosi float %37 to i32
  %39 = zext i32 %38 to i64
  %40 = alloca float, i64 %39, align 16
  store i64 %39, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = call noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef %41, ptr noundef @.str.2)
  store ptr %42, ptr %14, align 8, !tbaa !5
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.Image, ptr %43, i32 0, i32 3
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  store ptr %45, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Image, ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  store ptr %48, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !16
  br label %49

49:                                               ; preds = %134, %3
  %50 = load i32, ptr %15, align 4, !tbaa !16
  %51 = sitofp i32 %50 to float
  %52 = load float, ptr %9, align 4, !tbaa !12
  %53 = fcmp olt float %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %49
  store i32 2, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %137

55:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !16
  br label %56

56:                                               ; preds = %130, %55
  %57 = load i32, ptr %17, align 4, !tbaa !16
  %58 = sitofp i32 %57 to float
  %59 = load float, ptr %10, align 4, !tbaa !12
  %60 = fcmp olt float %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %133

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %63 = load i32, ptr %15, align 4, !tbaa !16
  %64 = sitofp i32 %63 to float
  %65 = load float, ptr %9, align 4, !tbaa !12
  %66 = fdiv float %65, 2.000000e+00
  %67 = fsub float %64, %66
  %68 = call noundef double @_ZSt3powIfiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef %67, i32 noundef 2)
  %69 = load i32, ptr %17, align 4, !tbaa !16
  %70 = sitofp i32 %69 to float
  %71 = load float, ptr %10, align 4, !tbaa !12
  %72 = fdiv float %71, 2.000000e+00
  %73 = fsub float %70, %72
  %74 = call noundef double @_ZSt3powIfiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef %73, i32 noundef 2)
  %75 = fadd double %68, %74
  %76 = call double @sqrt(double noundef %75) #7
  %77 = fptrunc double %76 to float
  store float %77, ptr %18, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %78 = load float, ptr %18, align 4, !tbaa !12
  %79 = call noundef double @_ZSt3powIfiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef %78, i32 noundef 2)
  %80 = fmul double %79, -1.000000e+00
  %81 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 60, i32 noundef 2)
  %82 = fmul double %81, 2.000000e+00
  %83 = fdiv double %80, %82
  %84 = call double @pow(double noundef 0x4005BF0A8B145769, double noundef %83) #7
  %85 = fptrunc double %84 to float
  store float %85, ptr %19, align 4, !tbaa !12
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load i32, ptr %15, align 4, !tbaa !16
  %88 = sitofp i32 %87 to float
  %89 = load float, ptr %9, align 4, !tbaa !12
  %90 = load i32, ptr %17, align 4, !tbaa !16
  %91 = sitofp i32 %90 to float
  %92 = call float @llvm.fmuladd.f32(float %88, float %89, float %91)
  %93 = fptosi float %92 to i32
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds float, ptr %86, i64 %94
  %96 = load float, ptr %95, align 4, !tbaa !12
  %97 = load float, ptr %19, align 4, !tbaa !12
  %98 = fmul float %96, %97
  %99 = load i32, ptr %15, align 4, !tbaa !16
  %100 = sitofp i32 %99 to float
  %101 = load float, ptr %9, align 4, !tbaa !12
  %102 = load i32, ptr %17, align 4, !tbaa !16
  %103 = sitofp i32 %102 to float
  %104 = call float @llvm.fmuladd.f32(float %100, float %101, float %103)
  %105 = fptosi float %104 to i32
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds float, ptr %34, i64 %106
  store float %98, ptr %107, align 4, !tbaa !12
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = load i32, ptr %15, align 4, !tbaa !16
  %110 = sitofp i32 %109 to float
  %111 = load float, ptr %9, align 4, !tbaa !12
  %112 = load i32, ptr %17, align 4, !tbaa !16
  %113 = sitofp i32 %112 to float
  %114 = call float @llvm.fmuladd.f32(float %110, float %111, float %113)
  %115 = fptosi float %114 to i32
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds float, ptr %108, i64 %116
  %118 = load float, ptr %117, align 4, !tbaa !12
  %119 = load float, ptr %19, align 4, !tbaa !12
  %120 = fmul float %118, %119
  %121 = load i32, ptr %15, align 4, !tbaa !16
  %122 = sitofp i32 %121 to float
  %123 = load float, ptr %9, align 4, !tbaa !12
  %124 = load i32, ptr %17, align 4, !tbaa !16
  %125 = sitofp i32 %124 to float
  %126 = call float @llvm.fmuladd.f32(float %122, float %123, float %125)
  %127 = fptosi float %126 to i32
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds float, ptr %40, i64 %128
  store float %120, ptr %129, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %130

130:                                              ; preds = %62
  %131 = load i32, ptr %17, align 4, !tbaa !16
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %17, align 4, !tbaa !16
  br label %56, !llvm.loop !17

133:                                              ; preds = %61
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %15, align 4, !tbaa !16
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %15, align 4, !tbaa !16
  br label %49, !llvm.loop !19

137:                                              ; preds = %54
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = call noundef ptr @_Z4iDFTP5ImagePfS1_(ptr noundef %139, ptr noundef %34, ptr noundef %40)
  store ptr %140, ptr %14, align 8, !tbaa !5
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_Z12SavePNMImageP5ImagePc(ptr noundef %141, ptr noundef @.str.12)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %142 = load ptr, ptr %11, align 8
  call void @llvm.stackrestore.p0(ptr %142)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef, ptr noundef) #1

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z4iDFTP5ImagePfS1_(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: nounwind
declare double @sqrt(double noundef) #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12SavePNMImageP5ImagePc(ptr noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, i32 noundef) #5

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 = { "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 willreturn }
attributes #4 = { 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 4}
!10 = !{!"_ZTS5Image", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !7, i64 24, !11, i64 1524}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!10, !11, i64 0}
!15 = !{!10, !6, i64 16}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4GLPFP5ImagePfS1_(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = sitofp i32 %5 to float
  %7 = load i32, ptr %0, align 8, !tbaa !11
  %8 = sitofp i32 %7 to float
  %9 = fmul float %6, %8
  %10 = fptosi float %9 to i32
  %11 = zext i32 %10 to i64
  %12 = alloca float, i64 %11, align 16
  %13 = alloca float, i64 %11, align 16
  %14 = tail call noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef nonnull %0, ptr noundef nonnull @.str.2)
  %15 = icmp sgt i32 %5, 0
  br i1 %15, label %.preheader.lr.ph, label %._crit_edge45

.preheader.lr.ph:                                 ; preds = %3
  %16 = icmp sgt i32 %7, 0
  %17 = fmul float %6, 5.000000e-01
  %18 = fmul float %8, 5.000000e-01
  br i1 %16, label %.preheader.us, label %._crit_edge45

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge.us
  %19 = phi float [ %51, %._crit_edge.us ], [ 0.000000e+00, %.preheader.lr.ph ]
  %.044.us = phi i32 [ %50, %._crit_edge.us ], [ 0, %.preheader.lr.ph ]
  %20 = fsub float %19, %17
  br label %21

21:                                               ; preds = %.preheader.us, %21
  %22 = phi float [ 0.000000e+00, %.preheader.us ], [ %48, %21 ]
  %.03843.us = phi i32 [ 0, %.preheader.us ], [ %47, %21 ]
  %23 = tail call noundef double @_ZSt3powIfiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef %20, i32 noundef 2)
  %24 = fsub float %22, %18
  %25 = tail call noundef double @_ZSt3powIfiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef %24, i32 noundef 2)
  %26 = fadd double %23, %25
  %27 = tail call double @sqrt(double noundef %26) #5
  %28 = fptrunc double %27 to float
  %29 = tail call noundef double @_ZSt3powIfiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef %28, i32 noundef 2)
  %30 = fneg double %29
  %31 = tail call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 60, i32 noundef 2)
  %32 = fmul double %31, 2.000000e+00
  %33 = fdiv double %30, %32
  %34 = tail call double @pow(double noundef 0x4005BF0A8B145769, double noundef %33) #5
  %35 = fptrunc double %34 to float
  %36 = tail call float @llvm.fmuladd.f32(float %19, float %6, float %22)
  %37 = fptosi float %36 to i32
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds float, ptr %1, i64 %38
  %40 = load float, ptr %39, align 4, !tbaa !12
  %41 = fmul float %40, %35
  %42 = getelementptr inbounds float, ptr %12, i64 %38
  store float %41, ptr %42, align 4, !tbaa !12
  %43 = getelementptr inbounds float, ptr %2, i64 %38
  %44 = load float, ptr %43, align 4, !tbaa !12
  %45 = fmul float %44, %35
  %46 = getelementptr inbounds float, ptr %13, i64 %38
  store float %45, ptr %46, align 4, !tbaa !12
  %47 = add nuw nsw i32 %.03843.us, 1
  %48 = uitofp nneg i32 %47 to float
  %49 = fcmp olt float %48, %8
  br i1 %49, label %21, label %._crit_edge.us, !llvm.loop !14

._crit_edge.us:                                   ; preds = %21
  %50 = add nuw nsw i32 %.044.us, 1
  %51 = uitofp nneg i32 %50 to float
  %52 = fcmp olt float %51, %6
  br i1 %52, label %.preheader.us, label %._crit_edge45, !llvm.loop !16

._crit_edge45:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph, %3
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %54 = call noundef ptr @_Z4iDFTP5ImagePfS1_(ptr noundef nonnull %0, ptr noundef nonnull %12, ptr noundef nonnull %13)
  call void @_Z12SavePNMImageP5ImagePc(ptr noundef %54, ptr noundef nonnull @.str.12)
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z4iDFTP5ImagePfS1_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIfiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12SavePNMImageP5ImagePc(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, i32 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 = { nofree 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 #2 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 4}
!6 = !{!"_ZTS5Image", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !8, i64 24, !7, i64 1524}
!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 = !{!13, !13, i64 0}
!13 = !{!"float", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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