; LLVM IR from shamadee/web-dsp-demo :: cpp/dft.ll (ZN3FFT7forwardEPdi)

; 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.FFT = type { ptr, ptr, i32, i32 }
%struct.FourierTransform = type { i32, i32, i32, double, ptr, ptr, ptr, i32, double, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [43 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16FourierTransform17calculateSpectrumEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3FFT7forwardEPdi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, i32 noundef %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, 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 i32 %2, ptr %6, align 4, !tbaa !9
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %21 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.FourierTransform, ptr %22, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !13
  %25 = call noundef double @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %24)
  %26 = call noundef double @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 2)
  %27 = fdiv double %25, %26
  %28 = call double @llvm.floor.f64(double %27)
  %29 = fptosi double %28 to i32
  store i32 %29, ptr %7, align 4, !tbaa !9
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 2, i32 noundef %30)
  %32 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds %struct.FourierTransform, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !13
  %36 = sitofp i32 %35 to double
  %37 = fcmp une double %31, %36
  br i1 %37, label %38, label %40

38:                                               ; preds = %3
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %40

40:                                               ; preds = %38, %3
  %41 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct.FourierTransform, ptr %42, i32 0, i32 0
  %44 = load i32, ptr %43, align 8, !tbaa !13
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = icmp ne i32 %44, %45
  br i1 %46, label %47, label %49

47:                                               ; preds = %40
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %49

49:                                               ; preds = %47, %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %83, %49
  %51 = load i32, ptr %17, align 4, !tbaa !9
  %52 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds %struct.FourierTransform, ptr %53, i32 0, i32 0
  %55 = load i32, ptr %54, align 8, !tbaa !13
  %56 = icmp slt i32 %51, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %86

58:                                               ; preds = %50
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !16
  %62 = load i32, ptr %17, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i32, ptr %61, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds double, ptr %59, i64 %66
  %68 = load double, ptr %67, align 8, !tbaa !17
  %69 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct.FourierTransform, ptr %70, i32 0, i32 5
  %72 = load ptr, ptr %71, align 8, !tbaa !18
  %73 = load i32, ptr %17, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds double, ptr %72, i64 %74
  store double %68, ptr %75, align 8, !tbaa !17
  %76 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = getelementptr inbounds %struct.FourierTransform, ptr %77, i32 0, i32 6
  %79 = load ptr, ptr %78, align 8, !tbaa !19
  %80 = load i32, ptr %17, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %79, i64 %81
  store double 0.000000e+00, ptr %82, align 8, !tbaa !17
  br label %83

83:                                               ; preds = %58
  %84 = load i32, ptr %17, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %17, align 4, !tbaa !9
  br label %50, !llvm.loop !20

86:                                               ; preds = %57
  br label %87

87:                                               ; preds = %248, %86
  %88 = load i32, ptr %8, align 4, !tbaa !9
  %89 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !11
  %91 = getelementptr inbounds %struct.FourierTransform, ptr %90, i32 0, i32 0
  %92 = load i32, ptr %91, align 8, !tbaa !13
  %93 = icmp slt i32 %88, %92
  br i1 %93, label %94, label %251

94:                                               ; preds = %87
  %95 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = getelementptr inbounds %struct.FourierTransform, ptr %96, i32 0, i32 10
  %98 = load ptr, ptr %97, align 8, !tbaa !22
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds double, ptr %98, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !17
  store double %102, ptr %10, align 8, !tbaa !17
  %103 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = getelementptr inbounds %struct.FourierTransform, ptr %104, i32 0, i32 9
  %106 = load ptr, ptr %105, align 8, !tbaa !23
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds double, ptr %106, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !17
  store double %110, ptr %11, align 8, !tbaa !17
  store double 1.000000e+00, ptr %12, align 8, !tbaa !17
  store double 0.000000e+00, ptr %13, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %245, %94
  %112 = load i32, ptr %18, align 4, !tbaa !9
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %248

116:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %117 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %117, ptr %19, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %125, %116
  %119 = load i32, ptr %19, align 4, !tbaa !9
  %120 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !11
  %122 = getelementptr inbounds %struct.FourierTransform, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !13
  %124 = icmp slt i32 %119, %123
  br i1 %124, label %125, label %229

125:                                              ; preds = %118
  %126 = load i32, ptr %19, align 4, !tbaa !9
  %127 = load i32, ptr %8, align 4, !tbaa !9
  %128 = add nsw i32 %126, %127
  store i32 %128, ptr %9, align 4, !tbaa !9
  %129 = load double, ptr %12, align 8, !tbaa !17
  %130 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !11
  %132 = getelementptr inbounds %struct.FourierTransform, ptr %131, i32 0, i32 5
  %133 = load ptr, ptr %132, align 8, !tbaa !18
  %134 = load i32, ptr %9, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds double, ptr %133, i64 %135
  %137 = load double, ptr %136, align 8, !tbaa !17
  %138 = load double, ptr %13, align 8, !tbaa !17
  %139 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  %141 = getelementptr inbounds %struct.FourierTransform, ptr %140, i32 0, i32 6
  %142 = load ptr, ptr %141, align 8, !tbaa !19
  %143 = load i32, ptr %9, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds double, ptr %142, i64 %144
  %146 = load double, ptr %145, align 8, !tbaa !17
  %147 = fmul double %138, %146
  %148 = fneg double %147
  %149 = call double @llvm.fmuladd.f64(double %129, double %137, double %148)
  store double %149, ptr %14, align 8, !tbaa !17
  %150 = load double, ptr %12, align 8, !tbaa !17
  %151 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !11
  %153 = getelementptr inbounds %struct.FourierTransform, ptr %152, i32 0, i32 5
  %154 = load ptr, ptr %153, align 8, !tbaa !18
  %155 = load i32, ptr %9, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds double, ptr %154, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !17
  %159 = load double, ptr %13, align 8, !tbaa !17
  %160 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %161 = load ptr, ptr %160, align 8, !tbaa !11
  %162 = getelementptr inbounds %struct.FourierTransform, ptr %161, i32 0, i32 6
  %163 = load ptr, ptr %162, align 8, !tbaa !19
  %164 = load i32, ptr %9, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds double, ptr %163, i64 %165
  %167 = load double, ptr %166, align 8, !tbaa !17
  %168 = fmul double %159, %167
  %169 = fneg double %168
  %170 = call double @llvm.fmuladd.f64(double %150, double %158, double %169)
  store double %170, ptr %15, align 8, !tbaa !17
  %171 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !11
  %173 = getelementptr inbounds %struct.FourierTransform, ptr %172, i32 0, i32 5
  %174 = load ptr, ptr %173, align 8, !tbaa !18
  %175 = load i32, ptr %19, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds double, ptr %174, i64 %176
  %178 = load double, ptr %177, align 8, !tbaa !17
  %179 = load double, ptr %14, align 8, !tbaa !17
  %180 = fsub double %178, %179
  %181 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !11
  %183 = getelementptr inbounds %struct.FourierTransform, ptr %182, i32 0, i32 5
  %184 = load ptr, ptr %183, align 8, !tbaa !18
  %185 = load i32, ptr %9, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds double, ptr %184, i64 %186
  store double %180, ptr %187, align 8, !tbaa !17
  %188 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %189 = load ptr, ptr %188, align 8, !tbaa !11
  %190 = getelementptr inbounds %struct.FourierTransform, ptr %189, i32 0, i32 6
  %191 = load ptr, ptr %190, align 8, !tbaa !19
  %192 = load i32, ptr %19, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds double, ptr %191, i64 %193
  %195 = load double, ptr %194, align 8, !tbaa !17
  %196 = load double, ptr %15, align 8, !tbaa !17
  %197 = fsub double %195, %196
  %198 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !11
  %200 = getelementptr inbounds %struct.FourierTransform, ptr %199, i32 0, i32 6
  %201 = load ptr, ptr %200, align 8, !tbaa !19
  %202 = load i32, ptr %9, align 4, !tbaa !9
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds double, ptr %201, i64 %203
  store double %197, ptr %204, align 8, !tbaa !17
  %205 = load double, ptr %14, align 8, !tbaa !17
  %206 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %207 = load ptr, ptr %206, align 8, !tbaa !11
  %208 = getelementptr inbounds %struct.FourierTransform, ptr %207, i32 0, i32 5
  %209 = load ptr, ptr %208, align 8, !tbaa !18
  %210 = load i32, ptr %19, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds double, ptr %209, i64 %211
  %213 = load double, ptr %212, align 8, !tbaa !17
  %214 = fadd double %213, %205
  store double %214, ptr %212, align 8, !tbaa !17
  %215 = load double, ptr %15, align 8, !tbaa !17
  %216 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %217 = load ptr, ptr %216, align 8, !tbaa !11
  %218 = getelementptr inbounds %struct.FourierTransform, ptr %217, i32 0, i32 6
  %219 = load ptr, ptr %218, align 8, !tbaa !19
  %220 = load i32, ptr %19, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds double, ptr %219, i64 %221
  %223 = load double, ptr %222, align 8, !tbaa !17
  %224 = fadd double %223, %215
  store double %224, ptr %222, align 8, !tbaa !17
  %225 = load i32, ptr %8, align 4, !tbaa !9
  %226 = shl i32 %225, 1
  %227 = load i32, ptr %19, align 4, !tbaa !9
  %228 = add nsw i32 %227, %226
  store i32 %228, ptr %19, align 4, !tbaa !9
  br label %118, !llvm.loop !24

229:                                              ; preds = %118
  %230 = load double, ptr %12, align 8, !tbaa !17
  store double %230, ptr %16, align 8, !tbaa !17
  %231 = load double, ptr %16, align 8, !tbaa !17
  %232 = load double, ptr %10, align 8, !tbaa !17
  %233 = load double, ptr %13, align 8, !tbaa !17
  %234 = load double, ptr %11, align 8, !tbaa !17
  %235 = fmul double %233, %234
  %236 = fneg double %235
  %237 = call double @llvm.fmuladd.f64(double %231, double %232, double %236)
  store double %237, ptr %12, align 8, !tbaa !17
  %238 = load double, ptr %16, align 8, !tbaa !17
  %239 = load double, ptr %11, align 8, !tbaa !17
  %240 = load double, ptr %13, align 8, !tbaa !17
  %241 = load double, ptr %10, align 8, !tbaa !17
  %242 = fmul double %240, %241
  %243 = fneg double %242
  %244 = call double @llvm.fmuladd.f64(double %238, double %239, double %243)
  store double %244, ptr %13, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %245

245:                                              ; preds = %229
  %246 = load i32, ptr %18, align 4, !tbaa !9
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %18, align 4, !tbaa !9
  br label %111, !llvm.loop !25

248:                                              ; preds = %115
  %249 = load i32, ptr %8, align 4, !tbaa !9
  %250 = shl i32 %249, 1
  store i32 %250, ptr %8, align 4, !tbaa !9
  br label %87, !llvm.loop !26

251:                                              ; preds = %87
  %252 = getelementptr inbounds %struct.FFT, ptr %20, i32 0, i32 0
  %253 = load ptr, ptr %252, align 8, !tbaa !11
  call void @_ZN16FourierTransform17calculateSpectrumEv(ptr noundef nonnull align 8 dereferenceable(80) %253)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3logIiEN9__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.floor.f64(double) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { "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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS3FFT", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTS16FourierTransform", !10, i64 0, !10, i64 4, !10, i64 8, !15, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !15, i64 56, !6, i64 64, !6, i64 72}
!15 = !{!"double", !7, i64 0}
!16 = !{!12, !6, i64 8}
!17 = !{!15, !15, i64 0}
!18 = !{!14, !6, i64 32}
!19 = !{!14, !6, i64 40}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!14, !6, i64 72}
!23 = !{!14, !6, i64 64}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !21}


; 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.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [43 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16FourierTransform17calculateSpectrumEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3FFT7forwardEPdi(ptr nocapture noundef nonnull readonly align 8 dereferenceable(24) %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #1 align 2 {
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = load i32, ptr %4, align 8, !tbaa !11
  %6 = tail call noundef double @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %5)
  %7 = tail call noundef double @_ZSt3logIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 2)
  %8 = fdiv double %6, %7
  %9 = tail call double @llvm.floor.f64(double %8)
  %10 = fptosi double %9 to i32
  %11 = tail call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 2, i32 noundef %10)
  %12 = load ptr, ptr %0, align 8, !tbaa !5
  %13 = load i32, ptr %12, align 8, !tbaa !11
  %14 = sitofp i32 %13 to double
  %15 = fcmp une double %11, %14
  br i1 %15, label %16, label %18

16:                                               ; preds = %3
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %.pre = load ptr, ptr %0, align 8, !tbaa !5
  %.pre75 = load i32, ptr %.pre, align 8, !tbaa !11
  br label %18

18:                                               ; preds = %16, %3
  %19 = phi i32 [ %.pre75, %16 ], [ %13, %3 ]
  %20 = phi ptr [ %.pre, %16 ], [ %12, %3 ]
  %.not = icmp eq i32 %19, %2
  br i1 %.not, label %23, label %21

21:                                               ; preds = %18
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %.pre76 = load ptr, ptr %0, align 8, !tbaa !5
  %.pre77 = load i32, ptr %.pre76, align 8, !tbaa !11
  br label %23

23:                                               ; preds = %21, %18
  %24 = phi i32 [ %.pre77, %21 ], [ %2, %18 ]
  %25 = phi ptr [ %.pre76, %21 ], [ %20, %18 ]
  %26 = icmp sgt i32 %24, 0
  br i1 %26, label %.lr.ph, label %._crit_edge65

.lr.ph:                                           ; preds = %23
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !14
  %29 = getelementptr inbounds i8, ptr %25, i64 32
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = getelementptr inbounds i8, ptr %25, i64 40
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %wide.trip.count = zext nneg i32 %24 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %33 = icmp eq i32 %24, 1
  br i1 %33, label %.preheader53.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %48

.preheader53.unr-lcssa:                           ; preds = %48, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %48 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader53, label %.preheader53.epilog-lcssa

.preheader53.epilog-lcssa:                        ; preds = %.preheader53.unr-lcssa
  %34 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv.unr
  %35 = load i32, ptr %34, align 4, !tbaa !17
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds double, ptr %1, i64 %36
  %38 = load double, ptr %37, align 8, !tbaa !18
  %39 = getelementptr inbounds double, ptr %30, i64 %indvars.iv.unr
  store double %38, ptr %39, align 8, !tbaa !18
  %40 = getelementptr inbounds double, ptr %32, i64 %indvars.iv.unr
  store double 0.000000e+00, ptr %40, align 8, !tbaa !18
  br label %.preheader53

.preheader53:                                     ; preds = %.preheader53.unr-lcssa, %.preheader53.epilog-lcssa
  %.not81 = icmp eq i32 %24, 1
  br i1 %.not81, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %.preheader53
  %41 = getelementptr inbounds i8, ptr %25, i64 72
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = getelementptr inbounds i8, ptr %25, i64 64
  %44 = load ptr, ptr %43, align 8, !tbaa !20
  %45 = getelementptr inbounds i8, ptr %25, i64 32
  %46 = getelementptr inbounds i8, ptr %25, i64 40
  %47 = zext nneg i32 %24 to i64
  br label %63

48:                                               ; preds = %48, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %48 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %48 ]
  %49 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv
  %50 = load i32, ptr %49, align 4, !tbaa !17
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %1, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !18
  %54 = getelementptr inbounds double, ptr %30, i64 %indvars.iv
  store double %53, ptr %54, align 8, !tbaa !18
  %55 = getelementptr inbounds double, ptr %32, i64 %indvars.iv
  store double 0.000000e+00, ptr %55, align 8, !tbaa !18
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %56 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv.next
  %57 = load i32, ptr %56, align 4, !tbaa !17
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds double, ptr %1, i64 %58
  %60 = load double, ptr %59, align 8, !tbaa !18
  %61 = getelementptr inbounds double, ptr %30, i64 %indvars.iv.next
  store double %60, ptr %61, align 8, !tbaa !18
  %62 = getelementptr inbounds double, ptr %32, i64 %indvars.iv.next
  store double 0.000000e+00, ptr %62, align 8, !tbaa !18
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader53.unr-lcssa, label %48, !llvm.loop !21

63:                                               ; preds = %.lr.ph64, %._crit_edge62
  %.05063 = phi i32 [ 1, %.lr.ph64 ], [ %66, %._crit_edge62 ]
  %64 = sext i32 %.05063 to i64
  %65 = icmp sgt i32 %.05063, 0
  %66 = shl i32 %.05063, 1
  br i1 %65, label %.preheader.lr.ph, label %._crit_edge62

.preheader.lr.ph:                                 ; preds = %63
  %67 = getelementptr inbounds double, ptr %44, i64 %64
  %68 = load double, ptr %67, align 8, !tbaa !18
  %69 = getelementptr inbounds double, ptr %42, i64 %64
  %70 = load double, ptr %69, align 8, !tbaa !18
  %71 = sext i32 %66 to i64
  %wide.trip.count73 = zext nneg i32 %.05063 to i64
  %72 = insertelement <2 x double> poison, double %68, i64 0
  %73 = insertelement <2 x double> %72, double %70, i64 1
  %74 = insertelement <2 x double> poison, double %70, i64 0
  %75 = insertelement <2 x double> %74, double %68, i64 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %indvars.iv67 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next68, %._crit_edge ]
  %76 = phi <2 x double> [ <double 0.000000e+00, double 1.000000e+00>, %.preheader.lr.ph ], [ %108, %._crit_edge ]
  %indvars72 = trunc i64 %indvars.iv67 to i32
  %77 = icmp sgt i32 %24, %indvars72
  br i1 %77, label %.lr.ph58, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %78 = extractelement <2 x double> %76, i64 0
  %.pre78 = fneg double %78
  br label %._crit_edge

.lr.ph58:                                         ; preds = %.preheader
  %79 = load ptr, ptr %45, align 8, !tbaa !15
  %80 = load ptr, ptr %46, align 8, !tbaa !16
  %81 = extractelement <2 x double> %76, i64 0
  %82 = fneg double %81
  %83 = extractelement <2 x double> %76, i64 1
  br label %85

._crit_edge62:                                    ; preds = %._crit_edge, %63
  %84 = icmp slt i32 %66, %24
  br i1 %84, label %63, label %._crit_edge65, !llvm.loop !23

85:                                               ; preds = %.lr.ph58, %85
  %indvars.iv69 = phi i64 [ %indvars.iv67, %.lr.ph58 ], [ %indvars.iv.next70, %85 ]
  %86 = add nsw i64 %indvars.iv69, %64
  %87 = getelementptr inbounds double, ptr %79, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !18
  %89 = getelementptr inbounds double, ptr %80, i64 %86
  %90 = load double, ptr %89, align 8, !tbaa !18
  %91 = fmul double %90, %82
  %92 = tail call double @llvm.fmuladd.f64(double %83, double %88, double %91)
  %93 = getelementptr inbounds double, ptr %79, i64 %indvars.iv69
  %94 = load double, ptr %93, align 8, !tbaa !18
  %95 = fsub double %94, %92
  store double %95, ptr %87, align 8, !tbaa !18
  %96 = getelementptr inbounds double, ptr %80, i64 %indvars.iv69
  %97 = load double, ptr %96, align 8, !tbaa !18
  %98 = fsub double %97, %92
  store double %98, ptr %89, align 8, !tbaa !18
  %99 = load double, ptr %93, align 8, !tbaa !18
  %100 = fadd double %92, %99
  store double %100, ptr %93, align 8, !tbaa !18
  %101 = load double, ptr %96, align 8, !tbaa !18
  %102 = fadd double %92, %101
  store double %102, ptr %96, align 8, !tbaa !18
  %indvars.iv.next70 = add nsw i64 %indvars.iv69, %71
  %103 = icmp slt i64 %indvars.iv.next70, %47
  br i1 %103, label %85, label %._crit_edge, !llvm.loop !24

._crit_edge:                                      ; preds = %85, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi double [ %.pre78, %.preheader.._crit_edge_crit_edge ], [ %82, %85 ]
  %104 = insertelement <2 x double> poison, double %.pre-phi, i64 0
  %105 = shufflevector <2 x double> %104, <2 x double> poison, <2 x i32> zeroinitializer
  %106 = fmul <2 x double> %75, %105
  %107 = shufflevector <2 x double> %76, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %108 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %107, <2 x double> %73, <2 x double> %106)
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge62, label %.preheader, !llvm.loop !25

._crit_edge65:                                    ; preds = %._crit_edge62, %23, %.preheader53
  tail call void @_ZN16FourierTransform17calculateSpectrumEv(ptr noundef nonnull align 8 dereferenceable(80) %25)
  ret void
}

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

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

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

; 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #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) }

!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 = !{!"_ZTS3FFT", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS16FourierTransform", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !13, i64 56, !7, i64 64, !7, i64 72}
!13 = !{!"double", !8, i64 0}
!14 = !{!6, !7, i64 8}
!15 = !{!12, !7, i64 32}
!16 = !{!12, !7, i64 40}
!17 = !{!10, !10, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !7, i64 72}
!20 = !{!12, !7, i64 64}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !22}


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