; LLVM IR from jingweizhanghuai/Morn :: src/wave (morn_wave_pitch)

; 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.MWave = type { i32, i32, [32 x ptr] }

@.str = external hidden unnamed_addr constant [82 x i8], align 1
@__FUNCTION__.mWaveSelfCorrelation = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @mWaveSelfCorrelation(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %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
  %20 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  br label %21

21:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %28, label %24

24:                                               ; preds = %21
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = ptrtoint ptr %25 to i64
  %27 = icmp eq i64 %26, -1
  br i1 %27, label %28, label %29

28:                                               ; preds = %24, %21
  br label %53

29:                                               ; preds = %24
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.MWave, ptr %30, i32 0, i32 2
  %32 = getelementptr inbounds [32 x ptr], ptr %31, i64 0, i64 0
  %33 = icmp eq ptr %32, null
  br i1 %33, label %50, label %34

34:                                               ; preds = %29
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.MWave, ptr %35, i32 0, i32 2
  %37 = getelementptr inbounds [32 x ptr], ptr %36, i64 0, i64 0
  %38 = ptrtoint ptr %37 to i64
  %39 = icmp eq i64 %38, -1
  br i1 %39, label %50, label %40

40:                                               ; preds = %34
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.MWave, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !11
  %44 = icmp sle i32 %43, 0
  br i1 %44, label %50, label %45

45:                                               ; preds = %40
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.MWave, ptr %46, i32 0, i32 1
  %48 = load i32, ptr %47, align 4, !tbaa !13
  %49 = icmp sle i32 %48, 0
  br label %50

50:                                               ; preds = %45, %40, %34, %29
  %51 = phi i1 [ true, %40 ], [ true, %34 ], [ true, %29 ], [ %49, %45 ]
  %52 = zext i1 %51 to i32
  br label %53

53:                                               ; preds = %50, %28
  %54 = phi i32 [ 1, %28 ], [ %52, %50 ]
  store i32 %54, ptr %15, align 4, !tbaa !9
  %55 = load i32, ptr %15, align 4, !tbaa !9
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %53
  %58 = load i32, ptr %15, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %58, i32 noundef -1, ptr noundef @.str, i32 noundef 21, ptr noundef @__FUNCTION__.mWaveSelfCorrelation, ptr noundef @.str.1)
  br label %59

59:                                               ; preds = %57, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = icmp eq ptr %63, null
  br i1 %64, label %69, label %65

65:                                               ; preds = %62
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = ptrtoint ptr %66 to i64
  %68 = icmp eq i64 %67, -1
  br label %69

69:                                               ; preds = %65, %62
  %70 = phi i1 [ true, %62 ], [ %68, %65 ]
  %71 = zext i1 %70 to i32
  store i32 %71, ptr %16, align 4, !tbaa !9
  %72 = load i32, ptr %16, align 4, !tbaa !9
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %76

74:                                               ; preds = %69
  %75 = load i32, ptr %16, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %75, i32 noundef -1, ptr noundef @.str, i32 noundef 22, ptr noundef @__FUNCTION__.mWaveSelfCorrelation, ptr noundef @.str.2)
  br label %76

76:                                               ; preds = %74, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = icmp sle i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %81, %78
  %83 = load i32, ptr %6, align 4, !tbaa !9
  %84 = icmp sle i32 %83, 0
  br i1 %84, label %85, label %114

85:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store float -1.000000e+00, ptr %17, align 4, !tbaa !14
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = call ptr @m_PropertyRead(ptr noundef %86, ptr noundef @.str.3, ptr noundef %17, ptr noundef null)
  br label %88

88:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %89 = load float, ptr %17, align 4, !tbaa !14
  %90 = fcmp olt float %89, 0.000000e+00
  %91 = zext i1 %90 to i32
  store i32 %91, ptr %18, align 4, !tbaa !9
  %92 = load i32, ptr %18, align 4, !tbaa !9
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %96

94:                                               ; preds = %88
  %95 = load i32, ptr %18, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %95, i32 noundef -1, ptr noundef @.str, i32 noundef 30, ptr noundef @__FUNCTION__.mWaveSelfCorrelation, ptr noundef @.str.4)
  br label %96

96:                                               ; preds = %94, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = load float, ptr %17, align 4, !tbaa !14
  %100 = fdiv float %99, 5.000000e+01
  %101 = fptosi float %100 to i32
  store i32 %101, ptr %6, align 4, !tbaa !9
  %102 = load i32, ptr %6, align 4, !tbaa !9
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.MWave, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !13
  %106 = ashr i32 %105, 1
  %107 = icmp sgt i32 %102, %106
  br i1 %107, label %108, label %113

108:                                              ; preds = %98
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.MWave, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !13
  %112 = ashr i32 %111, 1
  store i32 %112, ptr %6, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %108, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %114

114:                                              ; preds = %113, %82
  %115 = load i32, ptr %6, align 4, !tbaa !9
  %116 = load i32, ptr %7, align 4, !tbaa !9
  %117 = sdiv i32 %115, %116
  store i32 %117, ptr %6, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %119 = load i32, ptr %6, align 4, !tbaa !9
  %120 = icmp sle i32 %119, 0
  %121 = zext i1 %120 to i32
  store i32 %121, ptr %19, align 4, !tbaa !9
  %122 = load i32, ptr %19, align 4, !tbaa !9
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %126

124:                                              ; preds = %118
  %125 = load i32, ptr %19, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %125, i32 noundef -1, ptr noundef @.str, i32 noundef 36, ptr noundef @__FUNCTION__.mWaveSelfCorrelation, ptr noundef @.str.1)
  br label %126

126:                                              ; preds = %124, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.MWave, ptr %129, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !13
  %132 = load i32, ptr %6, align 4, !tbaa !9
  %133 = load i32, ptr %7, align 4, !tbaa !9
  %134 = mul nsw i32 %132, %133
  %135 = sub nsw i32 %131, %134
  store i32 %135, ptr %9, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %137 = load i32, ptr %9, align 4, !tbaa !9
  %138 = icmp sle i32 %137, 0
  %139 = zext i1 %138 to i32
  store i32 %139, ptr %20, align 4, !tbaa !9
  %140 = load i32, ptr %20, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %144

142:                                              ; preds = %136
  %143 = load i32, ptr %20, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %143, i32 noundef -1, ptr noundef @.str, i32 noundef 39, ptr noundef @__FUNCTION__.mWaveSelfCorrelation, ptr noundef @.str.1)
  br label %144

144:                                              ; preds = %142, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %9, align 4, !tbaa !9
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %147)
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %149

149:                                              ; preds = %227, %146
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.MWave, ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 8, !tbaa !11
  %154 = icmp slt i32 %150, %153
  br i1 %154, label %155, label %230

155:                                              ; preds = %149
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %223, %155
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = load i32, ptr %6, align 4, !tbaa !9
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %160, label %226

160:                                              ; preds = %156
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.MWave, ptr %161, i32 0, i32 2
  %163 = load i32, ptr %12, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [32 x ptr], ptr %162, i64 0, i64 %164
  %166 = load ptr, ptr %165, align 8, !tbaa !5
  %167 = load i32, ptr %13, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds float, ptr %166, i64 %168
  store ptr %169, ptr %14, align 8, !tbaa !5
  %170 = load ptr, ptr %8, align 8, !tbaa !5
  %171 = load i32, ptr %12, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds ptr, ptr %170, i64 %172
  %174 = load ptr, ptr %173, align 8, !tbaa !5
  %175 = load i32, ptr %11, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds float, ptr %174, i64 %176
  store float 0.000000e+00, ptr %177, align 4, !tbaa !14
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %178

178:                                              ; preds = %216, %160
  %179 = load i32, ptr %10, align 4, !tbaa !9
  %180 = load i32, ptr %9, align 4, !tbaa !9
  %181 = icmp slt i32 %179, %180
  br i1 %181, label %182, label %219

182:                                              ; preds = %178
  %183 = load ptr, ptr %8, align 8, !tbaa !5
  %184 = load i32, ptr %12, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds ptr, ptr %183, i64 %185
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = load i32, ptr %11, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds float, ptr %187, i64 %189
  %191 = load float, ptr %190, align 4, !tbaa !14
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.MWave, ptr %192, i32 0, i32 2
  %194 = load i32, ptr %12, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [32 x ptr], ptr %193, i64 0, i64 %195
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = load i32, ptr %10, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds float, ptr %197, i64 %199
  %201 = load float, ptr %200, align 4, !tbaa !14
  %202 = load ptr, ptr %14, align 8, !tbaa !5
  %203 = load i32, ptr %10, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds float, ptr %202, i64 %204
  %206 = load float, ptr %205, align 4, !tbaa !14
  %207 = call float @llvm.fmuladd.f32(float %201, float %206, float %191)
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  %209 = load i32, ptr %12, align 4, !tbaa !9
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds ptr, ptr %208, i64 %210
  %212 = load ptr, ptr %211, align 8, !tbaa !5
  %213 = load i32, ptr %11, align 4, !tbaa !9
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds float, ptr %212, i64 %214
  store float %207, ptr %215, align 4, !tbaa !14
  br label %216

216:                                              ; preds = %182
  %217 = load i32, ptr %10, align 4, !tbaa !9
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %10, align 4, !tbaa !9
  br label %178, !llvm.loop !16

219:                                              ; preds = %178
  %220 = load i32, ptr %13, align 4, !tbaa !9
  %221 = load i32, ptr %7, align 4, !tbaa !9
  %222 = add nsw i32 %220, %221
  store i32 %222, ptr %13, align 4, !tbaa !9
  br label %223

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

226:                                              ; preds = %156
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %12, align 4, !tbaa !9
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %12, align 4, !tbaa !9
  br label %149, !llvm.loop !19

230:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #2

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

declare ptr @m_PropertyRead(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 speculatable willreturn memory(none) }
attributes #4 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"MWave", !10, i64 0, !10, i64 4, !7, i64 8}
!13 = !{!12, !10, i64 4}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}


; 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 = external hidden unnamed_addr constant [82 x i8], align 1
@__FUNCTION__.mWaveSelfCorrelation = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @mWaveSelfCorrelation(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca float, align 4
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %6 [
    i64 -1, label %.critedge
    i64 0, label %.critedge
  ]

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = icmp eq ptr %7, inttoptr (i64 -1 to ptr)
  br i1 %8, label %.critedge, label %9

9:                                                ; preds = %6
  %10 = load i32, ptr %0, align 8, !tbaa !5
  %11 = icmp slt i32 %10, 1
  br i1 %11, label %.critedge, label %12

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !10
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %16, label %.critedge

.critedge:                                        ; preds = %4, %4, %9, %6, %12
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 21, ptr noundef nonnull @__FUNCTION__.mWaveSelfCorrelation, ptr noundef nonnull @.str.1) #7
  br label %16

16:                                               ; preds = %.critedge, %12
  %magicptr75 = ptrtoint ptr %3 to i64
  switch i64 %magicptr75, label %22 [
    i64 -1, label %17
    i64 0, label %17
  ]

17:                                               ; preds = %16, %16
  %18 = icmp eq ptr %3, null
  %19 = icmp eq ptr %3, inttoptr (i64 -1 to ptr)
  %20 = or i1 %18, %19
  %21 = zext i1 %20 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %21, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 22, ptr noundef nonnull @__FUNCTION__.mWaveSelfCorrelation, ptr noundef nonnull @.str.2) #7
  br label %22

22:                                               ; preds = %16, %17
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %2, i32 1)
  %23 = icmp slt i32 %1, 1
  br i1 %23, label %24, label %36

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store float -1.000000e+00, ptr %5, align 4, !tbaa !11
  %25 = call ptr @m_PropertyRead(ptr noundef %0, ptr noundef nonnull @.str.3, ptr noundef nonnull %5, ptr noundef null) #7
  %26 = load float, ptr %5, align 4, !tbaa !11
  %27 = fcmp olt float %26, 0.000000e+00
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 30, ptr noundef nonnull @__FUNCTION__.mWaveSelfCorrelation, ptr noundef nonnull @.str.4) #7
  %.pre = load float, ptr %5, align 4, !tbaa !11
  br label %29

29:                                               ; preds = %28, %24
  %30 = phi float [ %.pre, %28 ], [ %26, %24 ]
  %31 = fdiv float %30, 5.000000e+01
  %32 = fptosi float %31 to i32
  %33 = getelementptr inbounds i8, ptr %0, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !10
  %35 = ashr i32 %34, 1
  %spec.select = call i32 @llvm.smin.i32(i32 %35, i32 %32)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %36

36:                                               ; preds = %29, %22
  %.1 = phi i32 [ %spec.select, %29 ], [ %1, %22 ]
  %37 = sdiv i32 %.1, %spec.store.select
  %38 = icmp slt i32 %37, 1
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 36, ptr noundef nonnull @__FUNCTION__.mWaveSelfCorrelation, ptr noundef nonnull @.str.1) #7
  br label %40

40:                                               ; preds = %39, %36
  %41 = getelementptr inbounds i8, ptr %0, i64 4
  %42 = load i32, ptr %41, align 4, !tbaa !10
  %43 = mul nsw i32 %37, %spec.store.select
  %44 = sub nsw i32 %42, %43
  %45 = icmp slt i32 %44, 1
  br i1 %45, label %46, label %47

46:                                               ; preds = %40
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 39, ptr noundef nonnull @__FUNCTION__.mWaveSelfCorrelation, ptr noundef nonnull @.str.1) #7
  br label %47

47:                                               ; preds = %46, %40
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %44)
  %49 = load i32, ptr %0, align 8, !tbaa !5
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %47
  %51 = icmp sgt i32 %37, 0
  %52 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %51, label %.preheader.lr.ph.split.us, label %._crit_edge

.preheader.lr.ph.split.us:                        ; preds = %.preheader.lr.ph
  %53 = icmp sgt i32 %44, 0
  br i1 %53, label %.preheader.us.us.preheader, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph.split.us
  %54 = zext nneg i32 %37 to i64
  %55 = shl nuw nsw i64 %54, 2
  %wide.trip.count = zext nneg i32 %49 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %56 = icmp ult i32 %49, 8
  br i1 %56, label %._crit_edge.loopexit111.unr-lcssa, label %.preheader.us.preheader.new

.preheader.us.preheader.new:                      ; preds = %.preheader.us.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483640
  br label %.preheader.us

.preheader.us.us.preheader:                       ; preds = %.preheader.lr.ph.split.us
  %57 = zext nneg i32 %spec.store.select to i64
  %wide.trip.count107 = zext nneg i32 %49 to i64
  %wide.trip.count102 = zext nneg i32 %37 to i64
  %wide.trip.count93 = zext nneg i32 %44 to i64
  %xtraiter112 = and i64 %wide.trip.count93, 1
  %58 = icmp eq i32 %44, 1
  %unroll_iter115 = and i64 %wide.trip.count93, 2147483646
  %lcmp.mod114.not = icmp eq i64 %xtraiter112, 0
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %.preheader.us.us.preheader, %._crit_edge80.split.us.us.us
  %indvars.iv104 = phi i64 [ 0, %.preheader.us.us.preheader ], [ %indvars.iv.next105, %._crit_edge80.split.us.us.us ]
  %59 = getelementptr inbounds [32 x ptr], ptr %52, i64 0, i64 %indvars.iv104
  %60 = load ptr, ptr %59, align 8, !tbaa !13
  %61 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv104
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  br label %.lr.ph.us.us.us

.lr.ph.us.us.us:                                  ; preds = %._crit_edge.us.us.us, %.preheader.us.us
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %._crit_edge.us.us.us ], [ 0, %.preheader.us.us ]
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %._crit_edge.us.us.us ], [ 0, %.preheader.us.us ]
  %63 = getelementptr inbounds float, ptr %60, i64 %indvars.iv97
  %64 = getelementptr inbounds float, ptr %62, i64 %indvars.iv95
  store float 0.000000e+00, ptr %64, align 4, !tbaa !11
  br i1 %58, label %._crit_edge.us.us.us.unr-lcssa, label %.lr.ph.us.us.us.new

.lr.ph.us.us.us.new:                              ; preds = %.lr.ph.us.us.us, %.lr.ph.us.us.us.new
  %indvars.iv90 = phi i64 [ %indvars.iv.next91.1, %.lr.ph.us.us.us.new ], [ 0, %.lr.ph.us.us.us ]
  %65 = phi float [ %75, %.lr.ph.us.us.us.new ], [ 0.000000e+00, %.lr.ph.us.us.us ]
  %niter116 = phi i64 [ %niter116.next.1, %.lr.ph.us.us.us.new ], [ 0, %.lr.ph.us.us.us ]
  %66 = getelementptr inbounds float, ptr %60, i64 %indvars.iv90
  %67 = load float, ptr %66, align 4, !tbaa !11
  %68 = getelementptr inbounds float, ptr %63, i64 %indvars.iv90
  %69 = load float, ptr %68, align 4, !tbaa !11
  %70 = call float @llvm.fmuladd.f32(float %67, float %69, float %65)
  store float %70, ptr %64, align 4, !tbaa !11
  %indvars.iv.next91 = or disjoint i64 %indvars.iv90, 1
  %71 = getelementptr inbounds float, ptr %60, i64 %indvars.iv.next91
  %72 = load float, ptr %71, align 4, !tbaa !11
  %73 = getelementptr inbounds float, ptr %63, i64 %indvars.iv.next91
  %74 = load float, ptr %73, align 4, !tbaa !11
  %75 = call float @llvm.fmuladd.f32(float %72, float %74, float %70)
  store float %75, ptr %64, align 4, !tbaa !11
  %indvars.iv.next91.1 = add nuw nsw i64 %indvars.iv90, 2
  %niter116.next.1 = add i64 %niter116, 2
  %niter116.ncmp.1 = icmp eq i64 %niter116.next.1, %unroll_iter115
  br i1 %niter116.ncmp.1, label %._crit_edge.us.us.us.unr-lcssa, label %.lr.ph.us.us.us.new, !llvm.loop !15

._crit_edge.us.us.us.unr-lcssa:                   ; preds = %.lr.ph.us.us.us.new, %.lr.ph.us.us.us
  %indvars.iv90.unr = phi i64 [ 0, %.lr.ph.us.us.us ], [ %indvars.iv.next91.1, %.lr.ph.us.us.us.new ]
  %.unr = phi float [ 0.000000e+00, %.lr.ph.us.us.us ], [ %75, %.lr.ph.us.us.us.new ]
  br i1 %lcmp.mod114.not, label %._crit_edge.us.us.us, label %._crit_edge.us.us.us.epilog-lcssa

._crit_edge.us.us.us.epilog-lcssa:                ; preds = %._crit_edge.us.us.us.unr-lcssa
  %76 = getelementptr inbounds float, ptr %60, i64 %indvars.iv90.unr
  %77 = load float, ptr %76, align 4, !tbaa !11
  %78 = getelementptr inbounds float, ptr %63, i64 %indvars.iv90.unr
  %79 = load float, ptr %78, align 4, !tbaa !11
  %80 = call float @llvm.fmuladd.f32(float %77, float %79, float %.unr)
  store float %80, ptr %64, align 4, !tbaa !11
  br label %._crit_edge.us.us.us

._crit_edge.us.us.us:                             ; preds = %._crit_edge.us.us.us.unr-lcssa, %._crit_edge.us.us.us.epilog-lcssa
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, %57
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond103.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count102
  br i1 %exitcond103.not, label %._crit_edge80.split.us.us.us, label %.lr.ph.us.us.us, !llvm.loop !17

._crit_edge80.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count107
  br i1 %exitcond108.not, label %._crit_edge, label %.preheader.us.us, !llvm.loop !18

.preheader.us:                                    ; preds = %.preheader.us, %.preheader.us.preheader.new
  %indvars.iv = phi i64 [ 0, %.preheader.us.preheader.new ], [ %indvars.iv.next.7, %.preheader.us ]
  %niter = phi i64 [ 0, %.preheader.us.preheader.new ], [ %niter.next.7, %.preheader.us ]
  %81 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv
  %82 = load ptr, ptr %81, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %82, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %83 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.next
  %84 = load ptr, ptr %83, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %84, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %85 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.next.1
  %86 = load ptr, ptr %85, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %86, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %87 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.next.2
  %88 = load ptr, ptr %87, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %88, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next.3 = or disjoint i64 %indvars.iv, 4
  %89 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.next.3
  %90 = load ptr, ptr %89, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %90, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next.4 = or disjoint i64 %indvars.iv, 5
  %91 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.next.4
  %92 = load ptr, ptr %91, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %92, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next.5 = or disjoint i64 %indvars.iv, 6
  %93 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.next.5
  %94 = load ptr, ptr %93, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %94, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next.6 = or disjoint i64 %indvars.iv, 7
  %95 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.next.6
  %96 = load ptr, ptr %95, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %96, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge.loopexit111.unr-lcssa, label %.preheader.us, !llvm.loop !18

._crit_edge.loopexit111.unr-lcssa:                ; preds = %.preheader.us, %.preheader.us.preheader
  %indvars.iv.unr = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next.7, %.preheader.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.preheader.us.epil

.preheader.us.epil:                               ; preds = %._crit_edge.loopexit111.unr-lcssa, %.preheader.us.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.preheader.us.epil ], [ %indvars.iv.unr, %._crit_edge.loopexit111.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader.us.epil ], [ 0, %._crit_edge.loopexit111.unr-lcssa ]
  %97 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.epil
  %98 = load ptr, ptr %97, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 4 %98, i8 0, i64 %55, i1 false), !tbaa !11
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.preheader.us.epil, !llvm.loop !19

._crit_edge:                                      ; preds = %._crit_edge.loopexit111.unr-lcssa, %.preheader.us.epil, %._crit_edge80.split.us.us.us, %.preheader.lr.ph, %47
  ret void
}

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

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

declare ptr @m_PropertyRead(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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.smin.i32(i32, i32) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !7, i64 0}
!6 = !{!"MWave", !7, i64 0, !7, i64 4, !8, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass