; LLVM IR from jgaeddert/liquid-dsp :: src/fft/src (fftf)

; 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.fftplan_s = type { i32, ptr, ptr, i32, i32, i32, i32, ptr, ptr, ptr, %union.anon }
%union.anon = type { %struct.anon.1 }
%struct.anon.1 = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.2 = type { ptr, ptr, ptr, ptr, ptr, ptr }

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @fft_create_plan(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local ptr @fft_create_plan_rader(i32 noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) #3 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca { float, float }, align 4
  %16 = alloca { float, float }, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %17 = call noalias ptr @malloc(i64 noundef 120) #8
  store ptr %17, ptr %11, align 8, !tbaa !9
  %18 = load i32, ptr %6, align 4, !tbaa !5
  %19 = load ptr, ptr %11, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.fftplan_s, ptr %19, i32 0, i32 0
  store i32 %18, ptr %20, align 8, !tbaa !11
  %21 = load ptr, ptr %7, align 8, !tbaa !9
  %22 = load ptr, ptr %11, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.fftplan_s, ptr %22, i32 0, i32 1
  store ptr %21, ptr %23, align 8, !tbaa !13
  %24 = load ptr, ptr %8, align 8, !tbaa !9
  %25 = load ptr, ptr %11, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.fftplan_s, ptr %25, i32 0, i32 2
  store ptr %24, ptr %26, align 8, !tbaa !14
  %27 = load i32, ptr %10, align 4, !tbaa !5
  %28 = load ptr, ptr %11, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.fftplan_s, ptr %28, i32 0, i32 4
  store i32 %27, ptr %29, align 4, !tbaa !15
  %30 = load i32, ptr %9, align 4, !tbaa !5
  %31 = icmp eq i32 %30, 1
  %32 = zext i1 %31 to i64
  %33 = select i1 %31, i32 1, i32 -1
  %34 = load ptr, ptr %11, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.fftplan_s, ptr %34, i32 0, i32 5
  store i32 %33, ptr %35, align 8, !tbaa !16
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 1
  %38 = zext i1 %37 to i64
  %39 = select i1 %37, i32 1, i32 -1
  %40 = load ptr, ptr %11, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.fftplan_s, ptr %40, i32 0, i32 3
  store i32 %39, ptr %41, align 8, !tbaa !17
  %42 = load ptr, ptr %11, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct.fftplan_s, ptr %42, i32 0, i32 6
  store i32 3, ptr %43, align 4, !tbaa !18
  %44 = load ptr, ptr %11, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.fftplan_s, ptr %44, i32 0, i32 7
  store ptr @fft_execute_rader, ptr %45, align 8, !tbaa !19
  %46 = load ptr, ptr %11, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.fftplan_s, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !11
  %49 = sub i32 %48, 1
  %50 = zext i32 %49 to i64
  %51 = mul i64 %50, 8
  %52 = call noalias ptr @malloc(i64 noundef %51) #8
  %53 = load ptr, ptr %11, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.fftplan_s, ptr %53, i32 0, i32 10
  %55 = getelementptr inbounds %struct.anon.2, ptr %54, i32 0, i32 2
  store ptr %52, ptr %55, align 8, !tbaa !20
  %56 = load ptr, ptr %11, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.fftplan_s, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !11
  %59 = sub i32 %58, 1
  %60 = zext i32 %59 to i64
  %61 = mul i64 %60, 8
  %62 = call noalias ptr @malloc(i64 noundef %61) #8
  %63 = load ptr, ptr %11, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.fftplan_s, ptr %63, i32 0, i32 10
  %65 = getelementptr inbounds %struct.anon.2, ptr %64, i32 0, i32 3
  store ptr %62, ptr %65, align 8, !tbaa !20
  %66 = load ptr, ptr %11, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct.fftplan_s, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !11
  %69 = sub i32 %68, 1
  %70 = load ptr, ptr %11, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.fftplan_s, ptr %70, i32 0, i32 10
  %72 = getelementptr inbounds %struct.anon.2, ptr %71, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !20
  %74 = load ptr, ptr %11, align 8, !tbaa !9
  %75 = getelementptr inbounds %struct.fftplan_s, ptr %74, i32 0, i32 10
  %76 = getelementptr inbounds %struct.anon.2, ptr %75, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  %78 = load ptr, ptr %11, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.fftplan_s, ptr %78, i32 0, i32 4
  %80 = load i32, ptr %79, align 4, !tbaa !15
  %81 = call ptr @fft_create_plan(i32 noundef %69, ptr noundef %73, ptr noundef %77, i32 noundef 1, i32 noundef %80)
  %82 = load ptr, ptr %11, align 8, !tbaa !9
  %83 = getelementptr inbounds %struct.fftplan_s, ptr %82, i32 0, i32 10
  %84 = getelementptr inbounds %struct.anon.2, ptr %83, i32 0, i32 4
  store ptr %81, ptr %84, align 8, !tbaa !20
  %85 = load ptr, ptr %11, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.fftplan_s, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !11
  %88 = sub i32 %87, 1
  %89 = load ptr, ptr %11, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.fftplan_s, ptr %89, i32 0, i32 10
  %91 = getelementptr inbounds %struct.anon.2, ptr %90, i32 0, i32 3
  %92 = load ptr, ptr %91, align 8, !tbaa !20
  %93 = load ptr, ptr %11, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.fftplan_s, ptr %93, i32 0, i32 10
  %95 = getelementptr inbounds %struct.anon.2, ptr %94, i32 0, i32 2
  %96 = load ptr, ptr %95, align 8, !tbaa !20
  %97 = load ptr, ptr %11, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.fftplan_s, ptr %97, i32 0, i32 4
  %99 = load i32, ptr %98, align 4, !tbaa !15
  %100 = call ptr @fft_create_plan(i32 noundef %88, ptr noundef %92, ptr noundef %96, i32 noundef -1, i32 noundef %99)
  %101 = load ptr, ptr %11, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.fftplan_s, ptr %101, i32 0, i32 10
  %103 = getelementptr inbounds %struct.anon.2, ptr %102, i32 0, i32 5
  store ptr %100, ptr %103, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %104 = load ptr, ptr %11, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.fftplan_s, ptr %104, i32 0, i32 0
  %106 = load i32, ptr %105, align 8, !tbaa !11
  %107 = call i32 @liquid_primitive_root_prime(i32 noundef %106)
  store i32 %107, ptr %12, align 4, !tbaa !5
  %108 = load ptr, ptr %11, align 8, !tbaa !9
  %109 = getelementptr inbounds %struct.fftplan_s, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !11
  %111 = sub i32 %110, 1
  %112 = zext i32 %111 to i64
  %113 = mul i64 %112, 4
  %114 = call noalias ptr @malloc(i64 noundef %113) #8
  %115 = load ptr, ptr %11, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.fftplan_s, ptr %115, i32 0, i32 10
  %117 = getelementptr inbounds %struct.anon.2, ptr %116, i32 0, i32 0
  store ptr %114, ptr %117, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %140, %5
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = load ptr, ptr %11, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.fftplan_s, ptr %120, i32 0, i32 0
  %122 = load i32, ptr %121, align 8, !tbaa !11
  %123 = sub i32 %122, 1
  %124 = icmp ult i32 %119, %123
  br i1 %124, label %125, label %143

125:                                              ; preds = %118
  %126 = load i32, ptr %12, align 4, !tbaa !5
  %127 = load i32, ptr %13, align 4, !tbaa !5
  %128 = add i32 %127, 1
  %129 = load ptr, ptr %11, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.fftplan_s, ptr %129, i32 0, i32 0
  %131 = load i32, ptr %130, align 8, !tbaa !11
  %132 = call i32 @liquid_modpow(i32 noundef %126, i32 noundef %128, i32 noundef %131)
  %133 = load ptr, ptr %11, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.fftplan_s, ptr %133, i32 0, i32 10
  %135 = getelementptr inbounds %struct.anon.2, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !20
  %137 = load i32, ptr %13, align 4, !tbaa !5
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds i32, ptr %136, i64 %138
  store i32 %132, ptr %139, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %125
  %141 = load i32, ptr %13, align 4, !tbaa !5
  %142 = add i32 %141, 1
  store i32 %142, ptr %13, align 4, !tbaa !5
  br label %118, !llvm.loop !21

143:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %144 = load ptr, ptr %11, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.fftplan_s, ptr %144, i32 0, i32 3
  %146 = load i32, ptr %145, align 8, !tbaa !17
  %147 = icmp eq i32 %146, 1
  %148 = zext i1 %147 to i64
  %149 = select i1 %147, double -1.000000e+00, double 1.000000e+00
  %150 = fptrunc double %149 to float
  store float %150, ptr %14, align 4, !tbaa !23
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %205, %143
  %152 = load i32, ptr %13, align 4, !tbaa !5
  %153 = load ptr, ptr %11, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.fftplan_s, ptr %153, i32 0, i32 0
  %155 = load i32, ptr %154, align 8, !tbaa !11
  %156 = sub i32 %155, 1
  %157 = icmp ult i32 %152, %156
  br i1 %157, label %158, label %208

158:                                              ; preds = %151
  %159 = load float, ptr %14, align 4, !tbaa !23
  %160 = fmul float 0.000000e+00, %159
  %161 = fmul float 1.000000e+00, %159
  %162 = fmul float %160, 2.000000e+00
  %163 = fmul float %161, 2.000000e+00
  %164 = fpext float %162 to double
  %165 = fpext float %163 to double
  %166 = fmul double %164, 0x400921FB54442D18
  %167 = fmul double %165, 0x400921FB54442D18
  %168 = load ptr, ptr %11, align 8, !tbaa !9
  %169 = getelementptr inbounds %struct.fftplan_s, ptr %168, i32 0, i32 10
  %170 = getelementptr inbounds %struct.anon.2, ptr %169, i32 0, i32 0
  %171 = load ptr, ptr %170, align 8, !tbaa !20
  %172 = load i32, ptr %13, align 4, !tbaa !5
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds i32, ptr %171, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = uitofp i32 %175 to double
  %177 = fmul double %166, %176
  %178 = fmul double %167, %176
  %179 = load ptr, ptr %11, align 8, !tbaa !9
  %180 = getelementptr inbounds %struct.fftplan_s, ptr %179, i32 0, i32 0
  %181 = load i32, ptr %180, align 8, !tbaa !11
  %182 = uitofp i32 %181 to float
  %183 = fpext float %182 to double
  %184 = fdiv double %177, %183
  %185 = fdiv double %178, %183
  %186 = fptrunc double %184 to float
  %187 = fptrunc double %185 to float
  %188 = getelementptr inbounds { float, float }, ptr %15, i32 0, i32 0
  %189 = getelementptr inbounds { float, float }, ptr %15, i32 0, i32 1
  store float %186, ptr %188, align 4
  store float %187, ptr %189, align 4
  %190 = load <2 x float>, ptr %15, align 4
  %191 = call <2 x float> @cexpf(<2 x float> noundef %190) #7
  store <2 x float> %191, ptr %16, align 4
  %192 = getelementptr inbounds { float, float }, ptr %16, i32 0, i32 0
  %193 = load float, ptr %192, align 4
  %194 = getelementptr inbounds { float, float }, ptr %16, i32 0, i32 1
  %195 = load float, ptr %194, align 4
  %196 = load ptr, ptr %11, align 8, !tbaa !9
  %197 = getelementptr inbounds %struct.fftplan_s, ptr %196, i32 0, i32 10
  %198 = getelementptr inbounds %struct.anon.2, ptr %197, i32 0, i32 2
  %199 = load ptr, ptr %198, align 8, !tbaa !20
  %200 = load i32, ptr %13, align 4, !tbaa !5
  %201 = zext i32 %200 to i64
  %202 = getelementptr inbounds { float, float }, ptr %199, i64 %201
  %203 = getelementptr inbounds { float, float }, ptr %202, i32 0, i32 0
  %204 = getelementptr inbounds { float, float }, ptr %202, i32 0, i32 1
  store float %193, ptr %203, align 4
  store float %195, ptr %204, align 4
  br label %205

205:                                              ; preds = %158
  %206 = load i32, ptr %13, align 4, !tbaa !5
  %207 = add i32 %206, 1
  store i32 %207, ptr %13, align 4, !tbaa !5
  br label %151, !llvm.loop !25

208:                                              ; preds = %151
  %209 = load ptr, ptr %11, align 8, !tbaa !9
  %210 = getelementptr inbounds %struct.fftplan_s, ptr %209, i32 0, i32 10
  %211 = getelementptr inbounds %struct.anon.2, ptr %210, i32 0, i32 4
  %212 = load ptr, ptr %211, align 8, !tbaa !20
  %213 = call i32 @fft_execute(ptr noundef %212)
  %214 = load ptr, ptr %11, align 8, !tbaa !9
  %215 = getelementptr inbounds %struct.fftplan_s, ptr %214, i32 0, i32 0
  %216 = load i32, ptr %215, align 8, !tbaa !11
  %217 = sub i32 %216, 1
  %218 = zext i32 %217 to i64
  %219 = mul i64 %218, 8
  %220 = call noalias ptr @malloc(i64 noundef %219) #8
  %221 = load ptr, ptr %11, align 8, !tbaa !9
  %222 = getelementptr inbounds %struct.fftplan_s, ptr %221, i32 0, i32 10
  %223 = getelementptr inbounds %struct.anon.2, ptr %222, i32 0, i32 1
  store ptr %220, ptr %223, align 8, !tbaa !20
  %224 = load ptr, ptr %11, align 8, !tbaa !9
  %225 = getelementptr inbounds %struct.fftplan_s, ptr %224, i32 0, i32 10
  %226 = getelementptr inbounds %struct.anon.2, ptr %225, i32 0, i32 1
  %227 = load ptr, ptr %226, align 8, !tbaa !20
  %228 = load ptr, ptr %11, align 8, !tbaa !9
  %229 = getelementptr inbounds %struct.fftplan_s, ptr %228, i32 0, i32 10
  %230 = getelementptr inbounds %struct.anon.2, ptr %229, i32 0, i32 3
  %231 = load ptr, ptr %230, align 8, !tbaa !20
  %232 = load ptr, ptr %11, align 8, !tbaa !9
  %233 = getelementptr inbounds %struct.fftplan_s, ptr %232, i32 0, i32 0
  %234 = load i32, ptr %233, align 8, !tbaa !11
  %235 = sub i32 %234, 1
  %236 = zext i32 %235 to i64
  %237 = mul i64 %236, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 4 %227, ptr align 4 %231, i64 %237, i1 false)
  %238 = load ptr, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  ret ptr %238
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @fft_execute(ptr noundef) #1

; Function Attrs: nounwind
declare <2 x float> @cexpf(<2 x float> noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @fft_execute_rader(ptr noundef) #3

declare i32 @liquid_primitive_root_prime(i32 noundef) #6

declare i32 @liquid_modpow(i32 noundef, i32 noundef, i32 noundef) #6

attributes #0 = { nounwind allocsize(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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

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


; 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"

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @fft_create_plan(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @fft_create_plan_rader(i32 noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 {
  %6 = tail call noalias dereferenceable_or_null(120) ptr @malloc(i64 noundef 120) #7
  store i32 %0, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %1, ptr %7, align 8, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %2, ptr %8, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %6, i64 28
  store i32 %4, ptr %9, align 4, !tbaa !13
  %10 = icmp eq i32 %3, 1
  %11 = select i1 %10, i32 1, i32 -1
  %12 = getelementptr inbounds i8, ptr %6, i64 32
  store i32 %11, ptr %12, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %6, i64 24
  store i32 %11, ptr %13, align 8, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %6, i64 36
  store i32 3, ptr %14, align 4, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %6, i64 40
  store ptr @fft_execute_rader, ptr %15, align 8, !tbaa !17
  %16 = add i32 %0, -1
  %17 = zext i32 %16 to i64
  %18 = shl nuw nsw i64 %17, 3
  %19 = tail call noalias ptr @malloc(i64 noundef %18) #7
  %20 = getelementptr inbounds i8, ptr %6, i64 64
  %21 = getelementptr inbounds i8, ptr %6, i64 80
  store ptr %19, ptr %21, align 8, !tbaa !18
  %22 = tail call noalias ptr @malloc(i64 noundef %18) #7
  %23 = getelementptr inbounds i8, ptr %6, i64 88
  store ptr %22, ptr %23, align 8, !tbaa !18
  %24 = tail call ptr @fft_create_plan(i32 noundef %16, ptr noundef %19, ptr noundef %22, i32 noundef 1, i32 noundef %4)
  %25 = getelementptr inbounds i8, ptr %6, i64 96
  store ptr %24, ptr %25, align 8, !tbaa !18
  %26 = tail call ptr @fft_create_plan(i32 noundef %16, ptr noundef %22, ptr noundef %19, i32 noundef -1, i32 noundef %4)
  %27 = getelementptr inbounds i8, ptr %6, i64 104
  store ptr %26, ptr %27, align 8, !tbaa !18
  %28 = tail call i32 @liquid_primitive_root_prime(i32 noundef %0) #8
  %29 = shl nuw nsw i64 %17, 2
  %30 = tail call noalias ptr @malloc(i64 noundef %29) #7
  store ptr %30, ptr %20, align 8, !tbaa !18
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %._crit_edge61, label %.lr.ph

.lr.ph:                                           ; preds = %5, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %5 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = trunc nuw i64 %indvars.iv.next to i32
  %32 = tail call i32 @liquid_modpow(i32 noundef %28, i32 noundef %31, i32 noundef %0) #8
  %33 = getelementptr inbounds i32, ptr %30, i64 %indvars.iv
  store i32 %32, ptr %33, align 4, !tbaa !19
  %exitcond.not = icmp eq i64 %indvars.iv.next, %17
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph
  br i1 %.not, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %._crit_edge
  %34 = select i1 %10, float -1.000000e+00, float 1.000000e+00
  %35 = tail call float @llvm.copysign.f32(float 0.000000e+00, float %34)
  %36 = insertelement <2 x float> poison, float %35, i64 0
  %37 = insertelement <2 x float> %36, float %34, i64 1
  %38 = fmul <2 x float> %37, <float 2.000000e+00, float 2.000000e+00>
  %39 = fpext <2 x float> %38 to <2 x double>
  %40 = fmul <2 x double> %39, <double 0x400921FB54442D18, double 0x400921FB54442D18>
  %41 = uitofp i32 %0 to float
  %42 = fpext float %41 to double
  %43 = insertelement <2 x double> poison, double %42, i64 0
  %44 = shufflevector <2 x double> %43, <2 x double> poison, <2 x i32> zeroinitializer
  br label %45

45:                                               ; preds = %.lr.ph60, %45
  %indvars.iv64 = phi i64 [ 0, %.lr.ph60 ], [ %indvars.iv.next65, %45 ]
  %46 = getelementptr inbounds i32, ptr %30, i64 %indvars.iv64
  %47 = load i32, ptr %46, align 4, !tbaa !19
  %48 = uitofp i32 %47 to double
  %49 = insertelement <2 x double> poison, double %48, i64 0
  %50 = shufflevector <2 x double> %49, <2 x double> poison, <2 x i32> zeroinitializer
  %51 = fmul <2 x double> %40, %50
  %52 = fdiv <2 x double> %51, %44
  %53 = fptrunc <2 x double> %52 to <2 x float>
  %54 = tail call <2 x float> @cexpf(<2 x float> noundef %53) #8
  %55 = getelementptr inbounds { float, float }, ptr %19, i64 %indvars.iv64
  store <2 x float> %54, ptr %55, align 4
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next65, %17
  br i1 %exitcond68.not, label %._crit_edge61, label %45, !llvm.loop !22

._crit_edge61:                                    ; preds = %45, %5, %._crit_edge
  %56 = tail call i32 @fft_execute(ptr noundef %24)
  %57 = tail call noalias ptr @malloc(i64 noundef %18) #7
  %58 = getelementptr inbounds i8, ptr %6, i64 72
  store ptr %57, ptr %58, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %57, ptr align 4 %22, i64 %18, i1 false)
  ret ptr %6
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @fft_execute(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare <2 x float> @cexpf(<2 x float> noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @fft_execute_rader(ptr noundef) #2

declare i32 @liquid_primitive_root_prime(i32 noundef) local_unnamed_addr #4

declare i32 @liquid_modpow(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #2 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { 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 = !{!"fftplan_s", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !10, i64 40, !10, i64 48, !10, i64 56, !8, i64 64}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !10, i64 16}
!13 = !{!6, !7, i64 28}
!14 = !{!6, !7, i64 32}
!15 = !{!6, !7, i64 24}
!16 = !{!6, !7, i64 36}
!17 = !{!6, !10, i64 40}
!18 = !{!8, !8, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass