; LLVM IR from Wilson-ZheLin/Introduction-to-Digital-Image-Processing :: 5. Fourier Transform and Reconstruction/src/main.ll (Z4iDFTP5ImagePfS1_)

; 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.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 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 noundef ptr @_Z4iDFTP5ImagePfS1_(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 ptr, align 8
  %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
  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) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef %19, ptr noundef @.str.6)
  store ptr %20, ptr %10, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.Image, ptr %21, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  store ptr %23, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.Image, ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  store ptr %26, ptr %8, align 8, !tbaa !5
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !12
  br label %28

28:                                               ; preds = %178, %3
  %29 = load i32, ptr %11, align 4, !tbaa !12
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.Image, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !13
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %28
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %181

35:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !12
  br label %36

36:                                               ; preds = %174, %35
  %37 = load i32, ptr %13, align 4, !tbaa !12
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Image, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !14
  %41 = icmp slt i32 %37, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %36
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %177

43:                                               ; preds = %36
  store float 0.000000e+00, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !12
  br label %44

44:                                               ; preds = %128, %43
  %45 = load i32, ptr %14, align 4, !tbaa !12
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Image, ptr %46, i32 0, i32 1
  %48 = load i32, ptr %47, align 4, !tbaa !13
  %49 = icmp slt i32 %45, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %44
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %131

51:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !12
  br label %52

52:                                               ; preds = %124, %51
  %53 = load i32, ptr %15, align 4, !tbaa !12
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.Image, ptr %54, i32 0, i32 0
  %56 = load i32, ptr %55, align 8, !tbaa !14
  %57 = icmp slt i32 %53, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %52
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %127

59:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %60 = load i32, ptr %11, align 4, !tbaa !12
  %61 = sitofp i32 %60 to float
  %62 = load i32, ptr %14, align 4, !tbaa !12
  %63 = sitofp i32 %62 to float
  %64 = fmul float %61, %63
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Image, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !13
  %68 = sitofp i32 %67 to float
  %69 = fdiv float %64, %68
  %70 = load i32, ptr %13, align 4, !tbaa !12
  %71 = sitofp i32 %70 to float
  %72 = load i32, ptr %15, align 4, !tbaa !12
  %73 = sitofp i32 %72 to float
  %74 = fmul float %71, %73
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Image, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 8, !tbaa !14
  %78 = sitofp i32 %77 to float
  %79 = fdiv float %74, %78
  %80 = fadd float %69, %79
  store float %80, ptr %16, align 4, !tbaa !15
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Image, ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !14
  %85 = load i32, ptr %14, align 4, !tbaa !12
  %86 = mul nsw i32 %84, %85
  %87 = load i32, ptr %15, align 4, !tbaa !12
  %88 = add nsw i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds float, ptr %81, i64 %89
  %91 = load float, ptr %90, align 4, !tbaa !15
  %92 = fpext float %91 to double
  %93 = call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %94 = fmul double 2.000000e+00, %93
  %95 = load float, ptr %16, align 4, !tbaa !15
  %96 = fpext float %95 to double
  %97 = fmul double %94, %96
  %98 = call double @cos(double noundef %97) #6
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.Image, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 8, !tbaa !14
  %103 = load i32, ptr %14, align 4, !tbaa !12
  %104 = mul nsw i32 %102, %103
  %105 = load i32, ptr %15, align 4, !tbaa !12
  %106 = add nsw i32 %104, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds float, ptr %99, i64 %107
  %109 = load float, ptr %108, align 4, !tbaa !15
  %110 = fpext float %109 to double
  %111 = call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %112 = fmul double 2.000000e+00, %111
  %113 = load float, ptr %16, align 4, !tbaa !15
  %114 = fpext float %113 to double
  %115 = fmul double %112, %114
  %116 = call double @sin(double noundef %115) #6
  %117 = fmul double %110, %116
  %118 = fneg double %117
  %119 = call double @llvm.fmuladd.f64(double %92, double %98, double %118)
  %120 = load float, ptr %9, align 4, !tbaa !15
  %121 = fpext float %120 to double
  %122 = fadd double %121, %119
  %123 = fptrunc double %122 to float
  store float %123, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %124

124:                                              ; preds = %59
  %125 = load i32, ptr %15, align 4, !tbaa !12
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %15, align 4, !tbaa !12
  br label %52, !llvm.loop !17

127:                                              ; preds = %58
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %14, align 4, !tbaa !12
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %14, align 4, !tbaa !12
  br label %44, !llvm.loop !19

131:                                              ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %132 = load i32, ptr %11, align 4, !tbaa !12
  %133 = load i32, ptr %13, align 4, !tbaa !12
  %134 = add nsw i32 %132, %133
  %135 = srem i32 %134, 2
  %136 = icmp eq i32 %135, 0
  %137 = zext i1 %136 to i64
  %138 = select i1 %136, i32 1, i32 -1
  store i32 %138, ptr %17, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %139 = load float, ptr %9, align 4, !tbaa !15
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.Image, ptr %140, i32 0, i32 1
  %142 = load i32, ptr %141, align 4, !tbaa !13
  %143 = sitofp i32 %142 to float
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.Image, ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 8, !tbaa !14
  %147 = sitofp i32 %146 to float
  %148 = fmul float %143, %147
  %149 = fdiv float %139, %148
  %150 = load i32, ptr %17, align 4, !tbaa !12
  %151 = sitofp i32 %150 to float
  %152 = fmul float %149, %151
  %153 = fptosi float %152 to i32
  store i32 %153, ptr %18, align 4, !tbaa !12
  %154 = load i32, ptr %18, align 4, !tbaa !12
  %155 = icmp slt i32 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %131
  store i32 0, ptr %18, align 4, !tbaa !12
  br label %157

157:                                              ; preds = %156, %131
  %158 = load i32, ptr %18, align 4, !tbaa !12
  %159 = icmp sgt i32 %158, 255
  br i1 %159, label %160, label %161

160:                                              ; preds = %157
  store i32 255, ptr %18, align 4, !tbaa !12
  br label %161

161:                                              ; preds = %160, %157
  %162 = load i32, ptr %18, align 4, !tbaa !12
  %163 = trunc i32 %162 to i8
  %164 = load ptr, ptr %8, align 8, !tbaa !5
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.Image, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 8, !tbaa !14
  %168 = load i32, ptr %11, align 4, !tbaa !12
  %169 = mul nsw i32 %167, %168
  %170 = load i32, ptr %13, align 4, !tbaa !12
  %171 = add nsw i32 %169, %170
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds i8, ptr %164, i64 %172
  store i8 %163, ptr %173, align 1, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %174

174:                                              ; preds = %161
  %175 = load i32, ptr %13, align 4, !tbaa !12
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %13, align 4, !tbaa !12
  br label %36, !llvm.loop !21

177:                                              ; preds = %42
  br label %178

178:                                              ; preds = %177
  %179 = load i32, ptr %11, align 4, !tbaa !12
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %11, align 4, !tbaa !12
  br label %28, !llvm.loop !22

181:                                              ; preds = %34
  %182 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %183 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret ptr %183
}

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

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

; Function Attrs: nounwind
declare double @cos(double noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #4

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

; Function Attrs: nounwind
declare double @sin(double noundef) #3

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 = { 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 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!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 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!10, !11, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !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.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z4iDFTP5ImagePfS1_(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %4 = tail call noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef %0, ptr noundef nonnull @.str.6)
  %5 = getelementptr inbounds i8, ptr %4, i64 16
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !11
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader53.lr.ph, label %._crit_edge65

.preheader53.lr.ph:                               ; preds = %3
  %11 = load i32, ptr %0, align 8, !tbaa !12
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.preheader53, label %._crit_edge65

.preheader53:                                     ; preds = %.preheader53.lr.ph, %._crit_edge63
  %13 = phi i32 [ %23, %._crit_edge63 ], [ %9, %.preheader53.lr.ph ]
  %14 = phi i32 [ %24, %._crit_edge63 ], [ %11, %.preheader53.lr.ph ]
  %.04664 = phi i32 [ %25, %._crit_edge63 ], [ 0, %.preheader53.lr.ph ]
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader52.lr.ph, label %._crit_edge63

.preheader52.lr.ph:                               ; preds = %.preheader53
  %16 = uitofp nneg i32 %.04664 to float
  br label %.preheader52

._crit_edge65:                                    ; preds = %._crit_edge63, %.preheader53.lr.ph, %3
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  ret ptr %4

.preheader52:                                     ; preds = %.preheader52.lr.ph, %._crit_edge58
  %18 = phi i32 [ %14, %.preheader52.lr.ph ], [ %50, %._crit_edge58 ]
  %.04962 = phi i32 [ 0, %.preheader52.lr.ph ], [ %49, %._crit_edge58 ]
  %19 = load i32, ptr %8, align 4, !tbaa !11
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.preheader.lr.ph, label %._crit_edge58

.preheader.lr.ph:                                 ; preds = %.preheader52
  %21 = uitofp nneg i32 %.04962 to float
  %22 = icmp sgt i32 %18, 0
  br i1 %22, label %.preheader, label %._crit_edge58

._crit_edge63.loopexit:                           ; preds = %._crit_edge58
  %.pre70 = load i32, ptr %8, align 4, !tbaa !11
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge63.loopexit, %.preheader53
  %23 = phi i32 [ %.pre70, %._crit_edge63.loopexit ], [ %13, %.preheader53 ]
  %24 = phi i32 [ %50, %._crit_edge63.loopexit ], [ %14, %.preheader53 ]
  %25 = add nuw nsw i32 %.04664, 1
  %26 = icmp slt i32 %25, %23
  br i1 %26, label %.preheader53, label %._crit_edge65, !llvm.loop !13

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %27 = phi i32 [ %52, %._crit_edge ], [ %19, %.preheader.lr.ph ]
  %28 = phi i32 [ %53, %._crit_edge ], [ %18, %.preheader.lr.ph ]
  %.057 = phi float [ %.1.lcssa, %._crit_edge ], [ 0.000000e+00, %.preheader.lr.ph ]
  %.04856 = phi i32 [ %54, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %30 = uitofp nneg i32 %.04856 to float
  %31 = fmul float %16, %30
  br label %56

._crit_edge58:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %.preheader52
  %32 = phi i32 [ %18, %.preheader52 ], [ %18, %.preheader.lr.ph ], [ %53, %._crit_edge ]
  %.0.lcssa = phi float [ 0.000000e+00, %.preheader52 ], [ 0.000000e+00, %.preheader.lr.ph ], [ %.1.lcssa, %._crit_edge ]
  %.lcssa = phi i32 [ %19, %.preheader52 ], [ %19, %.preheader.lr.ph ], [ %52, %._crit_edge ]
  %33 = add nuw nsw i32 %.04962, %.04664
  %34 = and i32 %33, 1
  %35 = icmp eq i32 %34, 0
  %36 = select i1 %35, i32 1, i32 -1
  %37 = sitofp i32 %.lcssa to float
  %38 = sitofp i32 %32 to float
  %39 = fmul float %37, %38
  %40 = fdiv float %.0.lcssa, %39
  %41 = sitofp i32 %36 to float
  %42 = fmul float %40, %41
  %43 = fptosi float %42 to i32
  %spec.store.select1 = tail call i32 @llvm.smax.i32(i32 %43, i32 0)
  %spec.store.select = tail call i32 @llvm.umin.i32(i32 %spec.store.select1, i32 255)
  %44 = trunc nuw i32 %spec.store.select to i8
  %45 = mul nsw i32 %32, %.04664
  %46 = add nsw i32 %45, %.04962
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %6, i64 %47
  store i8 %44, ptr %48, align 1, !tbaa !16
  %49 = add nuw nsw i32 %.04962, 1
  %50 = load i32, ptr %0, align 8, !tbaa !12
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %.preheader52, label %._crit_edge63.loopexit, !llvm.loop !17

._crit_edge.loopexit:                             ; preds = %56
  %.pre = load i32, ptr %8, align 4, !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %52 = phi i32 [ %27, %.preheader ], [ %.pre, %._crit_edge.loopexit ]
  %53 = phi i32 [ %28, %.preheader ], [ %98, %._crit_edge.loopexit ]
  %.1.lcssa = phi float [ %.057, %.preheader ], [ %96, %._crit_edge.loopexit ]
  %54 = add nuw nsw i32 %.04856, 1
  %55 = icmp slt i32 %54, %52
  br i1 %55, label %.preheader, label %._crit_edge58, !llvm.loop !18

56:                                               ; preds = %.lr.ph, %56
  %57 = phi i32 [ %28, %.lr.ph ], [ %98, %56 ]
  %.155 = phi float [ %.057, %.lr.ph ], [ %96, %56 ]
  %.04754 = phi i32 [ 0, %.lr.ph ], [ %97, %56 ]
  %58 = load i32, ptr %8, align 4, !tbaa !11
  %59 = uitofp nneg i32 %.04754 to float
  %60 = fmul float %21, %59
  %61 = insertelement <2 x i32> poison, i32 %57, i64 0
  %62 = insertelement <2 x i32> %61, i32 %58, i64 1
  %63 = sitofp <2 x i32> %62 to <2 x float>
  %64 = insertelement <2 x float> poison, float %60, i64 0
  %65 = insertelement <2 x float> %64, float %31, i64 1
  %66 = fdiv <2 x float> %65, %63
  %shift = shufflevector <2 x float> %66, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %67 = fadd <2 x float> %66, %shift
  %68 = extractelement <2 x float> %67, i64 0
  %69 = mul nsw i32 %57, %.04856
  %70 = add nsw i32 %69, %.04754
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds float, ptr %1, i64 %71
  %73 = load float, ptr %72, align 4, !tbaa !19
  %74 = fpext float %73 to double
  %75 = tail call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %76 = fmul double %75, 2.000000e+00
  %77 = fpext float %68 to double
  %78 = fmul double %76, %77
  %79 = tail call double @cos(double noundef %78) #6
  %80 = load i32, ptr %0, align 8, !tbaa !12
  %81 = mul nsw i32 %80, %.04856
  %82 = add nsw i32 %81, %.04754
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds float, ptr %2, i64 %83
  %85 = load float, ptr %84, align 4, !tbaa !19
  %86 = fpext float %85 to double
  %87 = tail call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %88 = fmul double %87, 2.000000e+00
  %89 = fmul double %88, %77
  %90 = tail call double @sin(double noundef %89) #6
  %91 = fneg double %90
  %92 = fmul double %86, %91
  %93 = tail call double @llvm.fmuladd.f64(double %74, double %79, double %92)
  %94 = fpext float %.155 to double
  %95 = fadd double %93, %94
  %96 = fptrunc double %95 to float
  %97 = add nuw nsw i32 %.04754, 1
  %98 = load i32, ptr %0, align 8, !tbaa !12
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %56, label %._crit_edge.loopexit, !llvm.loop !21
}

; 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 nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #2

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

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

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

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

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

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 = { 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, !10, i64 16}
!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 4}
!12 = !{!6, !7, i64 0}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = !{!8, !8, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14, !15}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !8, i64 0}
!21 = distinct !{!21, !14}


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