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

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

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

35:                                               ; preds = %29
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %217

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

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

43:                                               ; preds = %37
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %213

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

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

51:                                               ; preds = %45
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %148

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

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

59:                                               ; preds = %53
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %144

60:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %61 = load i32, ptr %12, align 4, !tbaa !12
  %62 = sitofp i32 %61 to float
  %63 = load i32, ptr %15, align 4, !tbaa !12
  %64 = sitofp i32 %63 to float
  %65 = fmul float %62, %64
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.Image, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !13
  %69 = sitofp i32 %68 to float
  %70 = fdiv float %65, %69
  %71 = load i32, ptr %14, align 4, !tbaa !12
  %72 = sitofp i32 %71 to float
  %73 = load i32, ptr %16, align 4, !tbaa !12
  %74 = sitofp i32 %73 to float
  %75 = fmul float %72, %74
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.Image, ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 8, !tbaa !14
  %79 = sitofp i32 %78 to float
  %80 = fdiv float %75, %79
  %81 = fadd float %70, %80
  store float %81, ptr %17, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %82 = load i32, ptr %15, align 4, !tbaa !12
  %83 = load i32, ptr %16, align 4, !tbaa !12
  %84 = add nsw i32 %82, %83
  %85 = srem i32 %84, 2
  %86 = icmp eq i32 %85, 0
  %87 = zext i1 %86 to i64
  %88 = select i1 %86, i32 1, i32 -1
  store i32 %88, ptr %18, align 4, !tbaa !12
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.Image, ptr %90, i32 0, i32 0
  %92 = load i32, ptr %91, align 8, !tbaa !14
  %93 = load i32, ptr %15, align 4, !tbaa !12
  %94 = mul nsw i32 %92, %93
  %95 = load i32, ptr %16, align 4, !tbaa !12
  %96 = add nsw i32 %94, %95
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %89, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !17
  %100 = zext i8 %99 to i32
  %101 = sitofp i32 %100 to double
  %102 = call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %103 = fmul double -2.000000e+00, %102
  %104 = load float, ptr %17, align 4, !tbaa !15
  %105 = fpext float %104 to double
  %106 = fmul double %103, %105
  %107 = call double @cos(double noundef %106) #6
  %108 = fmul double %101, %107
  %109 = load i32, ptr %18, align 4, !tbaa !12
  %110 = sitofp i32 %109 to double
  %111 = load float, ptr %9, align 4, !tbaa !15
  %112 = fpext float %111 to double
  %113 = call double @llvm.fmuladd.f64(double %108, double %110, double %112)
  %114 = fptrunc double %113 to float
  store float %114, ptr %9, align 4, !tbaa !15
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.Image, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !14
  %119 = load i32, ptr %15, align 4, !tbaa !12
  %120 = mul nsw i32 %118, %119
  %121 = load i32, ptr %16, align 4, !tbaa !12
  %122 = add nsw i32 %120, %121
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %115, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !17
  %126 = zext i8 %125 to i32
  %127 = sitofp i32 %126 to double
  %128 = call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %129 = fmul double -2.000000e+00, %128
  %130 = load float, ptr %17, align 4, !tbaa !15
  %131 = fpext float %130 to double
  %132 = fmul double %129, %131
  %133 = call double @sin(double noundef %132) #6
  %134 = fmul double %127, %133
  %135 = load i32, ptr %18, align 4, !tbaa !12
  %136 = sitofp i32 %135 to double
  %137 = load float, ptr %10, align 4, !tbaa !15
  %138 = fpext float %137 to double
  %139 = call double @llvm.fmuladd.f64(double %134, double %136, double %138)
  %140 = fptrunc double %139 to float
  store float %140, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %141

141:                                              ; preds = %60
  %142 = load i32, ptr %16, align 4, !tbaa !12
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %16, align 4, !tbaa !12
  br label %53, !llvm.loop !18

144:                                              ; preds = %59
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %15, align 4, !tbaa !12
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %15, align 4, !tbaa !12
  br label %45, !llvm.loop !20

148:                                              ; preds = %51
  %149 = load float, ptr %9, align 4, !tbaa !15
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.Image, ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 8, !tbaa !14
  %154 = load i32, ptr %12, align 4, !tbaa !12
  %155 = mul nsw i32 %153, %154
  %156 = load i32, ptr %14, align 4, !tbaa !12
  %157 = add nsw i32 %155, %156
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds float, ptr %150, i64 %158
  store float %149, ptr %159, align 4, !tbaa !15
  %160 = load float, ptr %10, align 4, !tbaa !15
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.Image, ptr %162, i32 0, i32 0
  %164 = load i32, ptr %163, align 8, !tbaa !14
  %165 = load i32, ptr %12, align 4, !tbaa !12
  %166 = mul nsw i32 %164, %165
  %167 = load i32, ptr %14, align 4, !tbaa !12
  %168 = add nsw i32 %166, %167
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds float, ptr %161, i64 %169
  store float %160, ptr %170, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %171 = load float, ptr %9, align 4, !tbaa !15
  %172 = load float, ptr %9, align 4, !tbaa !15
  %173 = load float, ptr %10, align 4, !tbaa !15
  %174 = load float, ptr %10, align 4, !tbaa !15
  %175 = fmul float %173, %174
  %176 = call float @llvm.fmuladd.f32(float %171, float %172, float %175)
  %177 = call noundef float @_ZSt4sqrtf(float noundef %176)
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.Image, ptr %178, i32 0, i32 1
  %180 = load i32, ptr %179, align 4, !tbaa !13
  %181 = sitofp i32 %180 to float
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.Image, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 8, !tbaa !14
  %185 = sitofp i32 %184 to float
  %186 = fmul float %181, %185
  %187 = call noundef float @_ZSt4sqrtf(float noundef %186)
  %188 = fdiv float %177, %187
  %189 = fptosi float %188 to i32
  store i32 %189, ptr %19, align 4, !tbaa !12
  %190 = load i32, ptr %19, align 4, !tbaa !12
  %191 = icmp slt i32 %190, 0
  br i1 %191, label %192, label %193

192:                                              ; preds = %148
  store i32 0, ptr %19, align 4, !tbaa !12
  br label %193

193:                                              ; preds = %192, %148
  %194 = load i32, ptr %19, align 4, !tbaa !12
  %195 = icmp sgt i32 %194, 255
  br i1 %195, label %196, label %197

196:                                              ; preds = %193
  store i32 255, ptr %19, align 4, !tbaa !12
  br label %197

197:                                              ; preds = %196, %193
  %198 = load i32, ptr %19, align 4, !tbaa !12
  %199 = trunc i32 %198 to i8
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.Image, ptr %201, i32 0, i32 0
  %203 = load i32, ptr %202, align 8, !tbaa !14
  %204 = load i32, ptr %12, align 4, !tbaa !12
  %205 = mul nsw i32 %203, %204
  %206 = load i32, ptr %14, align 4, !tbaa !12
  %207 = add nsw i32 %205, %206
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds i8, ptr %200, i64 %208
  store i8 %199, ptr %209, align 1, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %210

210:                                              ; preds = %197
  %211 = load i32, ptr %14, align 4, !tbaa !12
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %14, align 4, !tbaa !12
  br label %37, !llvm.loop !21

213:                                              ; preds = %43
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %12, align 4, !tbaa !12
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %12, align 4, !tbaa !12
  br label %29, !llvm.loop !22

217:                                              ; preds = %35
  %218 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %219 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, 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 %219
}

; 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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #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 = { 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 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !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"

@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1

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

.preheader69.lr.ph:                               ; preds = %3
  %13 = load i32, ptr %0, align 8, !tbaa !12
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.preheader69, label %._crit_edge84

.preheader69:                                     ; preds = %.preheader69.lr.ph, %._crit_edge82
  %15 = phi i32 [ %25, %._crit_edge82 ], [ %11, %.preheader69.lr.ph ]
  %16 = phi i32 [ %26, %._crit_edge82 ], [ %13, %.preheader69.lr.ph ]
  %.06383 = phi i32 [ %27, %._crit_edge82 ], [ 0, %.preheader69.lr.ph ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader68.lr.ph, label %._crit_edge82

.preheader68.lr.ph:                               ; preds = %.preheader69
  %18 = uitofp nneg i32 %.06383 to float
  br label %.preheader68

._crit_edge84:                                    ; preds = %._crit_edge82, %.preheader69.lr.ph, %3
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  ret ptr %4

.preheader68:                                     ; preds = %.preheader68.lr.ph, %._crit_edge77
  %20 = phi i32 [ %16, %.preheader68.lr.ph ], [ %62, %._crit_edge77 ]
  %.06681 = phi i32 [ 0, %.preheader68.lr.ph ], [ %61, %._crit_edge77 ]
  %21 = load i32, ptr %10, align 4, !tbaa !11
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.preheader.lr.ph, label %._crit_edge77

.preheader.lr.ph:                                 ; preds = %.preheader68
  %23 = uitofp nneg i32 %.06681 to float
  %24 = icmp sgt i32 %20, 0
  br i1 %24, label %.preheader, label %._crit_edge77

._crit_edge82.loopexit:                           ; preds = %._crit_edge77
  %.pre88 = load i32, ptr %10, align 4, !tbaa !11
  br label %._crit_edge82

._crit_edge82:                                    ; preds = %._crit_edge82.loopexit, %.preheader69
  %25 = phi i32 [ %.pre88, %._crit_edge82.loopexit ], [ %15, %.preheader69 ]
  %26 = phi i32 [ %62, %._crit_edge82.loopexit ], [ %16, %.preheader69 ]
  %27 = add nuw nsw i32 %.06383, 1
  %28 = icmp slt i32 %27, %25
  br i1 %28, label %.preheader69, label %._crit_edge84, !llvm.loop !13

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %29 = phi i32 [ %64, %._crit_edge ], [ %21, %.preheader.lr.ph ]
  %30 = phi i32 [ %65, %._crit_edge ], [ %20, %.preheader.lr.ph ]
  %.06574 = phi i32 [ %67, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %31 = phi <2 x float> [ %66, %._crit_edge ], [ zeroinitializer, %.preheader.lr.ph ]
  %32 = icmp sgt i32 %30, 0
  br i1 %32, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %33 = uitofp nneg i32 %.06574 to float
  %34 = fmul float %18, %33
  br label %69

._crit_edge77:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %.preheader68
  %35 = phi i32 [ %20, %.preheader68 ], [ %20, %.preheader.lr.ph ], [ %65, %._crit_edge ]
  %36 = phi <2 x float> [ zeroinitializer, %.preheader68 ], [ zeroinitializer, %.preheader.lr.ph ], [ %66, %._crit_edge ]
  %37 = mul nsw i32 %35, %.06383
  %38 = add nsw i32 %37, %.06681
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds float, ptr %1, i64 %39
  %41 = extractelement <2 x float> %36, i64 1
  store float %41, ptr %40, align 4, !tbaa !16
  %42 = getelementptr inbounds float, ptr %2, i64 %39
  %43 = extractelement <2 x float> %36, i64 0
  store float %43, ptr %42, align 4, !tbaa !16
  %44 = fmul <2 x float> %36, %36
  %45 = extractelement <2 x float> %44, i64 0
  %46 = tail call float @llvm.fmuladd.f32(float %41, float %41, float %45)
  %47 = tail call noundef float @_ZSt4sqrtf(float noundef %46)
  %48 = load <2 x i32>, ptr %0, align 8, !tbaa !18
  %49 = sitofp <2 x i32> %48 to <2 x float>
  %shift = shufflevector <2 x float> %49, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %50 = fmul <2 x float> %shift, %49
  %51 = extractelement <2 x float> %50, i64 0
  %52 = tail call noundef float @_ZSt4sqrtf(float noundef %51)
  %53 = fdiv float %47, %52
  %54 = fptosi float %53 to i32
  %spec.store.select1 = tail call i32 @llvm.smax.i32(i32 %54, i32 0)
  %spec.store.select = tail call i32 @llvm.umin.i32(i32 %spec.store.select1, i32 255)
  %55 = trunc nuw i32 %spec.store.select to i8
  %56 = load i32, ptr %0, align 8, !tbaa !12
  %57 = mul nsw i32 %56, %.06383
  %58 = add nsw i32 %57, %.06681
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %8, i64 %59
  store i8 %55, ptr %60, align 1, !tbaa !19
  %61 = add nuw nsw i32 %.06681, 1
  %62 = load i32, ptr %0, align 8, !tbaa !12
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %.preheader68, label %._crit_edge82.loopexit, !llvm.loop !20

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %64 = phi i32 [ %29, %.preheader ], [ %.pre, %._crit_edge.loopexit ]
  %65 = phi i32 [ %30, %.preheader ], [ %120, %._crit_edge.loopexit ]
  %66 = phi <2 x float> [ %31, %.preheader ], [ %118, %._crit_edge.loopexit ]
  %67 = add nuw nsw i32 %.06574, 1
  %68 = icmp slt i32 %67, %64
  br i1 %68, label %.preheader, label %._crit_edge77, !llvm.loop !21

69:                                               ; preds = %.lr.ph, %69
  %70 = phi i32 [ %30, %.lr.ph ], [ %120, %69 ]
  %.06470 = phi i32 [ 0, %.lr.ph ], [ %119, %69 ]
  %71 = phi <2 x float> [ %31, %.lr.ph ], [ %118, %69 ]
  %72 = load i32, ptr %10, align 4, !tbaa !11
  %73 = uitofp nneg i32 %.06470 to float
  %74 = fmul float %23, %73
  %75 = insertelement <2 x i32> poison, i32 %70, i64 0
  %76 = insertelement <2 x i32> %75, i32 %72, i64 1
  %77 = sitofp <2 x i32> %76 to <2 x float>
  %78 = insertelement <2 x float> poison, float %74, i64 0
  %79 = insertelement <2 x float> %78, float %34, i64 1
  %80 = fdiv <2 x float> %79, %77
  %shift97 = shufflevector <2 x float> %80, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %81 = fadd <2 x float> %80, %shift97
  %82 = extractelement <2 x float> %81, i64 0
  %83 = add nuw nsw i32 %.06470, %.06574
  %84 = and i32 %83, 1
  %85 = icmp eq i32 %84, 0
  %86 = select i1 %85, i32 1, i32 -1
  %87 = mul nsw i32 %70, %.06574
  %88 = add nsw i32 %87, %.06470
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %6, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !19
  %92 = tail call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %93 = fmul double %92, -2.000000e+00
  %94 = fpext float %82 to double
  %95 = fmul double %93, %94
  %96 = tail call double @cos(double noundef %95) #6
  %97 = sitofp i32 %86 to double
  %98 = fpext <2 x float> %71 to <2 x double>
  %99 = load i32, ptr %0, align 8, !tbaa !12
  %100 = mul nsw i32 %99, %.06574
  %101 = add nsw i32 %100, %.06470
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i8, ptr %6, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !19
  %105 = tail call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %106 = fmul double %105, -2.000000e+00
  %107 = fmul double %106, %94
  %108 = tail call double @sin(double noundef %107) #6
  %109 = insertelement <2 x i8> poison, i8 %104, i64 0
  %110 = insertelement <2 x i8> %109, i8 %91, i64 1
  %111 = uitofp <2 x i8> %110 to <2 x double>
  %112 = insertelement <2 x double> poison, double %108, i64 0
  %113 = insertelement <2 x double> %112, double %96, i64 1
  %114 = fmul <2 x double> %113, %111
  %115 = insertelement <2 x double> poison, double %97, i64 0
  %116 = shufflevector <2 x double> %115, <2 x double> poison, <2 x i32> zeroinitializer
  %117 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %114, <2 x double> %116, <2 x double> %98)
  %118 = fptrunc <2 x double> %117 to <2 x float>
  %119 = add nuw nsw i32 %.06470, 1
  %120 = load i32, ptr %0, align 8, !tbaa !12
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %69, label %._crit_edge.loopexit, !llvm.loop !22
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float 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: 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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #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 = !{!17, !17, i64 0}
!17 = !{!"float", !8, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!8, !8, i64 0}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14, !15}
!22 = distinct !{!22, !14}


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