; LLVM IR from Wilson-ZheLin/Introduction-to-Digital-Image-Processing :: 6. Low Pass Filter and High Pass Filter/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.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = 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 void @_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
  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
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef %19, ptr noundef @.str.2)
  store ptr %20, ptr %11, 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 %11, 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.3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !12
  br label %28

28:                                               ; preds = %174, %3
  %29 = load i32, ptr %12, 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 %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %177

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

36:                                               ; preds = %170, %35
  %37 = load i32, ptr %14, 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 %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %173

43:                                               ; preds = %36
  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 %44

44:                                               ; preds = %144, %43
  %45 = load i32, ptr %15, 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 %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %147

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

52:                                               ; preds = %140, %51
  %53 = load i32, ptr %16, 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 %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %143

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

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

143:                                              ; preds = %58
  br label %144

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

147:                                              ; preds = %50
  %148 = load float, ptr %9, align 4, !tbaa !15
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.Image, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 8, !tbaa !14
  %153 = load i32, ptr %12, align 4, !tbaa !12
  %154 = mul nsw i32 %152, %153
  %155 = load i32, ptr %14, align 4, !tbaa !12
  %156 = add nsw i32 %154, %155
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds float, ptr %149, i64 %157
  store float %148, ptr %158, align 4, !tbaa !15
  %159 = load float, ptr %10, align 4, !tbaa !15
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.Image, ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 8, !tbaa !14
  %164 = load i32, ptr %12, align 4, !tbaa !12
  %165 = mul nsw i32 %163, %164
  %166 = load i32, ptr %14, align 4, !tbaa !12
  %167 = add nsw i32 %165, %166
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds float, ptr %160, i64 %168
  store float %159, ptr %169, align 4, !tbaa !15
  br label %170

170:                                              ; preds = %147
  %171 = load i32, ptr %14, align 4, !tbaa !12
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %14, align 4, !tbaa !12
  br label %36, !llvm.loop !21

173:                                              ; preds = %42
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %12, align 4, !tbaa !12
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %12, align 4, !tbaa !12
  br label %28, !llvm.loop !22

177:                                              ; preds = %34
  %178 = call i32 (ptr, ...) @printf(ptr noundef @.str.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 void
}

; 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 = !{!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.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3DFTP5ImagePfS1_(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #0 {
  %4 = ptrtoint ptr %1 to i64
  %5 = ptrtoint ptr %2 to i64
  %6 = tail call noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef %0, ptr noundef nonnull @.str.2)
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %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 %.preheader54.lr.ph, label %._crit_edge70

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

.preheader54.preheader:                           ; preds = %.preheader54.lr.ph
  %15 = sub i64 %5, %4
  %diff.check = icmp ult i64 %15, 32
  br label %.preheader54

.preheader54:                                     ; preds = %.preheader54.preheader, %._crit_edge67
  %16 = phi i32 [ %57, %._crit_edge67 ], [ %11, %.preheader54.preheader ]
  %17 = phi i32 [ %58, %._crit_edge67 ], [ %13, %.preheader54.preheader ]
  %18 = phi i32 [ %59, %._crit_edge67 ], [ %13, %.preheader54.preheader ]
  %19 = phi i32 [ %60, %._crit_edge67 ], [ %13, %.preheader54.preheader ]
  %.05168 = phi i32 [ %61, %._crit_edge67 ], [ 0, %.preheader54.preheader ]
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.preheader53.lr.ph, label %._crit_edge67

.preheader53.lr.ph:                               ; preds = %.preheader54
  %21 = uitofp nneg i32 %.05168 to float
  %22 = icmp sgt i32 %16, 0
  br i1 %22, label %.preheader53, label %.preheader53.lr.ph.split.us

.preheader53.lr.ph.split.us:                      ; preds = %.preheader53.lr.ph
  %23 = mul nsw i32 %18, %.05168
  %24 = sext i32 %23 to i64
  %smax = tail call i32 @llvm.smax.i32(i32 %18, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  %min.iters.check = icmp slt i32 %18, 8
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.preheader53.us.preheader, label %vector.ph

vector.ph:                                        ; preds = %.preheader53.lr.ph.split.us
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %25 = add nsw i64 %index, %24
  %26 = getelementptr inbounds float, ptr %1, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store <4 x float> zeroinitializer, ptr %26, align 4, !tbaa !13
  store <4 x float> zeroinitializer, ptr %27, align 4, !tbaa !13
  %28 = getelementptr inbounds float, ptr %2, i64 %25
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  store <4 x float> zeroinitializer, ptr %28, align 4, !tbaa !13
  store <4 x float> zeroinitializer, ptr %29, align 4, !tbaa !13
  %index.next = add nuw i64 %index, 8
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge67, label %.preheader53.us.preheader

.preheader53.us.preheader:                        ; preds = %middle.block, %.preheader53.lr.ph.split.us
  %indvars.iv.ph = phi i64 [ 0, %.preheader53.lr.ph.split.us ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader53.us.prol.loopexit, label %.preheader53.us.prol

.preheader53.us.prol:                             ; preds = %.preheader53.us.preheader, %.preheader53.us.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.preheader53.us.prol ], [ %indvars.iv.ph, %.preheader53.us.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.preheader53.us.prol ], [ 0, %.preheader53.us.preheader ]
  %31 = add nsw i64 %indvars.iv.prol, %24
  %32 = getelementptr inbounds float, ptr %1, i64 %31
  store float 0.000000e+00, ptr %32, align 4, !tbaa !13
  %33 = getelementptr inbounds float, ptr %2, i64 %31
  store float 0.000000e+00, ptr %33, align 4, !tbaa !13
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.preheader53.us.prol.loopexit, label %.preheader53.us.prol, !llvm.loop !19

.preheader53.us.prol.loopexit:                    ; preds = %.preheader53.us.prol, %.preheader53.us.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.preheader53.us.preheader ], [ %indvars.iv.next.prol, %.preheader53.us.prol ]
  %34 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %35 = icmp ugt i64 %34, -4
  br i1 %35, label %._crit_edge67, label %.preheader53.us

.preheader53.us:                                  ; preds = %.preheader53.us.prol.loopexit, %.preheader53.us
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader53.us ], [ %indvars.iv.unr, %.preheader53.us.prol.loopexit ]
  %36 = add nsw i64 %indvars.iv, %24
  %37 = getelementptr inbounds float, ptr %1, i64 %36
  store float 0.000000e+00, ptr %37, align 4, !tbaa !13
  %38 = getelementptr inbounds float, ptr %2, i64 %36
  store float 0.000000e+00, ptr %38, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = add nsw i64 %indvars.iv.next, %24
  %40 = getelementptr inbounds float, ptr %1, i64 %39
  store float 0.000000e+00, ptr %40, align 4, !tbaa !13
  %41 = getelementptr inbounds float, ptr %2, i64 %39
  store float 0.000000e+00, ptr %41, align 4, !tbaa !13
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %42 = add nsw i64 %indvars.iv.next.1, %24
  %43 = getelementptr inbounds float, ptr %1, i64 %42
  store float 0.000000e+00, ptr %43, align 4, !tbaa !13
  %44 = getelementptr inbounds float, ptr %2, i64 %42
  store float 0.000000e+00, ptr %44, align 4, !tbaa !13
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %45 = add nsw i64 %indvars.iv.next.2, %24
  %46 = getelementptr inbounds float, ptr %1, i64 %45
  store float 0.000000e+00, ptr %46, align 4, !tbaa !13
  %47 = getelementptr inbounds float, ptr %2, i64 %45
  store float 0.000000e+00, ptr %47, align 4, !tbaa !13
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge67, label %.preheader53.us, !llvm.loop !21

._crit_edge70:                                    ; preds = %._crit_edge67, %.preheader54.lr.ph, %3
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  ret void

.preheader53:                                     ; preds = %.preheader53.lr.ph, %._crit_edge62
  %49 = phi i32 [ %71, %._crit_edge62 ], [ %16, %.preheader53.lr.ph ]
  %50 = phi i32 [ %72, %._crit_edge62 ], [ %17, %.preheader53.lr.ph ]
  %51 = phi i32 [ %74, %._crit_edge62 ], [ %16, %.preheader53.lr.ph ]
  %52 = phi i32 [ %72, %._crit_edge62 ], [ %18, %.preheader53.lr.ph ]
  %53 = phi i32 [ %75, %._crit_edge62 ], [ %16, %.preheader53.lr.ph ]
  %.05066 = phi i32 [ %84, %._crit_edge62 ], [ 0, %.preheader53.lr.ph ]
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %.preheader.lr.ph, label %._crit_edge62

.preheader.lr.ph:                                 ; preds = %.preheader53
  %55 = uitofp nneg i32 %.05066 to float
  %56 = icmp sgt i32 %52, 0
  br i1 %56, label %.preheader, label %._crit_edge62

._crit_edge67:                                    ; preds = %.preheader53.us.prol.loopexit, %.preheader53.us, %._crit_edge62, %middle.block, %.preheader54
  %57 = phi i32 [ %16, %.preheader54 ], [ %16, %middle.block ], [ %71, %._crit_edge62 ], [ %16, %.preheader53.us ], [ %16, %.preheader53.us.prol.loopexit ]
  %58 = phi i32 [ %17, %.preheader54 ], [ %17, %middle.block ], [ %72, %._crit_edge62 ], [ %17, %.preheader53.us ], [ %17, %.preheader53.us.prol.loopexit ]
  %59 = phi i32 [ %18, %.preheader54 ], [ %18, %middle.block ], [ %72, %._crit_edge62 ], [ %18, %.preheader53.us ], [ %18, %.preheader53.us.prol.loopexit ]
  %60 = phi i32 [ %19, %.preheader54 ], [ %18, %middle.block ], [ %72, %._crit_edge62 ], [ %18, %.preheader53.us ], [ %18, %.preheader53.us.prol.loopexit ]
  %61 = add nuw nsw i32 %.05168, 1
  %62 = icmp slt i32 %61, %57
  br i1 %62, label %.preheader54, label %._crit_edge70, !llvm.loop !22

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %63 = phi i32 [ %86, %._crit_edge ], [ %49, %.preheader.lr.ph ]
  %64 = phi i32 [ %87, %._crit_edge ], [ %50, %.preheader.lr.ph ]
  %65 = phi i32 [ %88, %._crit_edge ], [ %51, %.preheader.lr.ph ]
  %66 = phi i32 [ %89, %._crit_edge ], [ %52, %.preheader.lr.ph ]
  %.04959 = phi i32 [ %91, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %67 = phi <2 x float> [ %90, %._crit_edge ], [ zeroinitializer, %.preheader.lr.ph ]
  %68 = icmp sgt i32 %66, 0
  br i1 %68, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %69 = uitofp nneg i32 %.04959 to float
  %70 = fmul float %21, %69
  br label %93

._crit_edge62:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %.preheader53
  %71 = phi i32 [ %49, %.preheader53 ], [ %49, %.preheader.lr.ph ], [ %86, %._crit_edge ]
  %72 = phi i32 [ %50, %.preheader53 ], [ %50, %.preheader.lr.ph ], [ %87, %._crit_edge ]
  %73 = phi i32 [ %52, %.preheader53 ], [ %52, %.preheader.lr.ph ], [ %89, %._crit_edge ]
  %74 = phi i32 [ %51, %.preheader53 ], [ %51, %.preheader.lr.ph ], [ %88, %._crit_edge ]
  %75 = phi i32 [ %53, %.preheader53 ], [ %53, %.preheader.lr.ph ], [ %88, %._crit_edge ]
  %76 = phi <2 x float> [ zeroinitializer, %.preheader53 ], [ zeroinitializer, %.preheader.lr.ph ], [ %90, %._crit_edge ]
  %77 = mul nsw i32 %73, %.05168
  %78 = add nsw i32 %77, %.05066
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds float, ptr %1, i64 %79
  %81 = extractelement <2 x float> %76, i64 1
  store float %81, ptr %80, align 4, !tbaa !13
  %82 = getelementptr inbounds float, ptr %2, i64 %79
  %83 = extractelement <2 x float> %76, i64 0
  store float %83, ptr %82, align 4, !tbaa !13
  %84 = add nuw nsw i32 %.05066, 1
  %85 = icmp slt i32 %84, %72
  br i1 %85, label %.preheader53, label %._crit_edge67, !llvm.loop !24

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %86 = phi i32 [ %63, %.preheader ], [ %.pre, %._crit_edge.loopexit ]
  %87 = phi i32 [ %64, %.preheader ], [ %144, %._crit_edge.loopexit ]
  %88 = phi i32 [ %65, %.preheader ], [ %.pre, %._crit_edge.loopexit ]
  %89 = phi i32 [ %66, %.preheader ], [ %144, %._crit_edge.loopexit ]
  %90 = phi <2 x float> [ %67, %.preheader ], [ %142, %._crit_edge.loopexit ]
  %91 = add nuw nsw i32 %.04959, 1
  %92 = icmp slt i32 %91, %88
  br i1 %92, label %.preheader, label %._crit_edge62, !llvm.loop !25

93:                                               ; preds = %.lr.ph, %93
  %94 = phi i32 [ %66, %.lr.ph ], [ %144, %93 ]
  %.04855 = phi i32 [ 0, %.lr.ph ], [ %143, %93 ]
  %95 = phi <2 x float> [ %67, %.lr.ph ], [ %142, %93 ]
  %96 = load i32, ptr %10, align 4, !tbaa !11
  %97 = uitofp nneg i32 %.04855 to float
  %98 = fmul float %55, %97
  %99 = insertelement <2 x i32> poison, i32 %94, i64 0
  %100 = insertelement <2 x i32> %99, i32 %96, i64 1
  %101 = sitofp <2 x i32> %100 to <2 x float>
  %102 = insertelement <2 x float> poison, float %98, i64 0
  %103 = insertelement <2 x float> %102, float %70, i64 1
  %104 = fdiv <2 x float> %103, %101
  %shift = shufflevector <2 x float> %104, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %105 = fadd <2 x float> %104, %shift
  %106 = extractelement <2 x float> %105, i64 0
  %107 = add nuw nsw i32 %.04855, %.04959
  %108 = and i32 %107, 1
  %109 = icmp eq i32 %108, 0
  %110 = select i1 %109, i32 1, i32 -1
  %111 = mul nsw i32 %94, %.04959
  %112 = add nsw i32 %111, %.04855
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i8, ptr %8, i64 %113
  %115 = load i8, ptr %114, align 1, !tbaa !26
  %116 = tail call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %117 = fmul double %116, -2.000000e+00
  %118 = fpext float %106 to double
  %119 = fmul double %117, %118
  %120 = tail call double @cos(double noundef %119) #5
  %121 = sitofp i32 %110 to double
  %122 = fpext <2 x float> %95 to <2 x double>
  %123 = load i32, ptr %0, align 8, !tbaa !12
  %124 = mul nsw i32 %123, %.04959
  %125 = add nsw i32 %124, %.04855
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i8, ptr %8, i64 %126
  %128 = load i8, ptr %127, align 1, !tbaa !26
  %129 = tail call noundef double @_ZSt4acosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef -1)
  %130 = fmul double %129, -2.000000e+00
  %131 = fmul double %130, %118
  %132 = tail call double @sin(double noundef %131) #5
  %133 = insertelement <2 x i8> poison, i8 %128, i64 0
  %134 = insertelement <2 x i8> %133, i8 %115, i64 1
  %135 = uitofp <2 x i8> %134 to <2 x double>
  %136 = insertelement <2 x double> poison, double %132, i64 0
  %137 = insertelement <2 x double> %136, double %120, i64 1
  %138 = fmul <2 x double> %137, %135
  %139 = insertelement <2 x double> poison, double %121, i64 0
  %140 = shufflevector <2 x double> %139, <2 x double> poison, <2 x i32> zeroinitializer
  %141 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %138, <2 x double> %140, <2 x double> %122)
  %142 = fptrunc <2 x double> %141 to <2 x float>
  %143 = add nuw nsw i32 %.04855, 1
  %144 = load i32, ptr %0, align 8, !tbaa !12
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %93, label %._crit_edge.loopexit, !llvm.loop !27
}

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

; 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>) #4

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 = { 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, !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 = !{!14, !14, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = distinct !{!15, !16, !17, !18}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !16, !17}
!22 = distinct !{!22, !16, !23}
!23 = !{!"llvm.loop.unswitch.partial.disable"}
!24 = distinct !{!24, !16, !23}
!25 = distinct !{!25, !16, !23}
!26 = !{!8, !8, i64 0}
!27 = distinct !{!27, !16}


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