; 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.3 = type { i32, 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_rader2(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 i32, align 4
  %15 = alloca float, align 4
  %16 = alloca { float, float }, align 4
  %17 = 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
  %18 = call noalias ptr @malloc(i64 noundef 120) #8
  store ptr %18, ptr %11, align 8, !tbaa !9
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = load ptr, ptr %11, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.fftplan_s, ptr %20, i32 0, i32 0
  store i32 %19, ptr %21, align 8, !tbaa !11
  %22 = load ptr, ptr %7, align 8, !tbaa !9
  %23 = load ptr, ptr %11, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.fftplan_s, ptr %23, i32 0, i32 1
  store ptr %22, ptr %24, align 8, !tbaa !13
  %25 = load ptr, ptr %8, align 8, !tbaa !9
  %26 = load ptr, ptr %11, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.fftplan_s, ptr %26, i32 0, i32 2
  store ptr %25, ptr %27, align 8, !tbaa !14
  %28 = load i32, ptr %10, align 4, !tbaa !5
  %29 = load ptr, ptr %11, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.fftplan_s, ptr %29, i32 0, i32 4
  store i32 %28, ptr %30, align 4, !tbaa !15
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = icmp eq i32 %31, 1
  %33 = zext i1 %32 to i64
  %34 = select i1 %32, i32 1, i32 -1
  %35 = load ptr, ptr %11, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.fftplan_s, ptr %35, i32 0, i32 5
  store i32 %34, ptr %36, align 8, !tbaa !16
  %37 = load i32, ptr %9, align 4, !tbaa !5
  %38 = icmp eq i32 %37, 1
  %39 = zext i1 %38 to i64
  %40 = select i1 %38, i32 1, i32 -1
  %41 = load ptr, ptr %11, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.fftplan_s, ptr %41, i32 0, i32 3
  store i32 %40, ptr %42, align 8, !tbaa !17
  %43 = load ptr, ptr %11, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.fftplan_s, ptr %43, i32 0, i32 6
  store i32 4, ptr %44, align 4, !tbaa !18
  %45 = load ptr, ptr %11, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.fftplan_s, ptr %45, i32 0, i32 7
  store ptr @fft_execute_rader2, ptr %46, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %47 = load ptr, ptr %11, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.fftplan_s, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !11
  %50 = call i32 @liquid_primitive_root_prime(i32 noundef %49)
  store i32 %50, ptr %13, align 4, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.fftplan_s, ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 8, !tbaa !11
  %54 = sub i32 %53, 1
  %55 = zext i32 %54 to i64
  %56 = mul i64 %55, 4
  %57 = call noalias ptr @malloc(i64 noundef %56) #8
  %58 = load ptr, ptr %11, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.fftplan_s, ptr %58, i32 0, i32 10
  %60 = getelementptr inbounds %struct.anon.3, ptr %59, i32 0, i32 1
  store ptr %57, ptr %60, align 8, !tbaa !20
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %83, %5
  %62 = load i32, ptr %12, align 4, !tbaa !5
  %63 = load ptr, ptr %11, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.fftplan_s, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !11
  %66 = sub i32 %65, 1
  %67 = icmp ult i32 %62, %66
  br i1 %67, label %68, label %86

68:                                               ; preds = %61
  %69 = load i32, ptr %13, align 4, !tbaa !5
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = add i32 %70, 1
  %72 = load ptr, ptr %11, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.fftplan_s, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !11
  %75 = call i32 @liquid_modpow(i32 noundef %69, i32 noundef %71, i32 noundef %74)
  %76 = load ptr, ptr %11, align 8, !tbaa !9
  %77 = getelementptr inbounds %struct.fftplan_s, ptr %76, i32 0, i32 10
  %78 = getelementptr inbounds %struct.anon.3, ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !20
  %80 = load i32, ptr %12, align 4, !tbaa !5
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %79, i64 %81
  store i32 %75, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %68
  %84 = load i32, ptr %12, align 4, !tbaa !5
  %85 = add i32 %84, 1
  store i32 %85, ptr %12, align 4, !tbaa !5
  br label %61, !llvm.loop !21

86:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  %87 = load ptr, ptr %11, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.fftplan_s, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !11
  %90 = mul i32 2, %89
  %91 = sub i32 %90, 4
  %92 = sub i32 %91, 1
  %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.3, ptr %94, i32 0, i32 0
  store i32 %92, ptr %95, align 8, !tbaa !20
  br label %96

96:                                               ; preds = %102, %86
  %97 = load ptr, ptr %11, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.fftplan_s, ptr %97, i32 0, i32 10
  %99 = getelementptr inbounds %struct.anon.3, ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 8, !tbaa !20
  %101 = icmp ugt i32 %100, 0
  br i1 %101, label %102, label %110

102:                                              ; preds = %96
  %103 = load ptr, ptr %11, align 8, !tbaa !9
  %104 = getelementptr inbounds %struct.fftplan_s, ptr %103, i32 0, i32 10
  %105 = getelementptr inbounds %struct.anon.3, ptr %104, i32 0, i32 0
  %106 = load i32, ptr %105, align 8, !tbaa !20
  %107 = lshr i32 %106, 1
  store i32 %107, ptr %105, align 8, !tbaa !20
  %108 = load i32, ptr %14, align 4, !tbaa !5
  %109 = add i32 %108, 1
  store i32 %109, ptr %14, align 4, !tbaa !5
  br label %96, !llvm.loop !23

110:                                              ; preds = %96
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = shl i32 1, %111
  %113 = load ptr, ptr %11, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.fftplan_s, ptr %113, i32 0, i32 10
  %115 = getelementptr inbounds %struct.anon.3, ptr %114, i32 0, i32 0
  store i32 %112, ptr %115, align 8, !tbaa !20
  %116 = load ptr, ptr %11, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.fftplan_s, ptr %116, i32 0, i32 10
  %118 = getelementptr inbounds %struct.anon.3, ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !20
  %120 = zext i32 %119 to i64
  %121 = mul i64 %120, 8
  %122 = call noalias ptr @malloc(i64 noundef %121) #8
  %123 = load ptr, ptr %11, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.fftplan_s, ptr %123, i32 0, i32 10
  %125 = getelementptr inbounds %struct.anon.3, ptr %124, i32 0, i32 3
  store ptr %122, ptr %125, align 8, !tbaa !20
  %126 = load ptr, ptr %11, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.fftplan_s, ptr %126, i32 0, i32 10
  %128 = getelementptr inbounds %struct.anon.3, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !20
  %130 = zext i32 %129 to i64
  %131 = mul i64 %130, 8
  %132 = call noalias ptr @malloc(i64 noundef %131) #8
  %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.3, ptr %134, i32 0, i32 4
  store ptr %132, ptr %135, align 8, !tbaa !20
  %136 = load ptr, ptr %11, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.fftplan_s, ptr %136, i32 0, i32 10
  %138 = getelementptr inbounds %struct.anon.3, ptr %137, i32 0, i32 0
  %139 = load i32, ptr %138, align 8, !tbaa !20
  %140 = load ptr, ptr %11, align 8, !tbaa !9
  %141 = getelementptr inbounds %struct.fftplan_s, ptr %140, i32 0, i32 10
  %142 = getelementptr inbounds %struct.anon.3, ptr %141, i32 0, i32 3
  %143 = load ptr, ptr %142, align 8, !tbaa !20
  %144 = load ptr, ptr %11, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.fftplan_s, ptr %144, i32 0, i32 10
  %146 = getelementptr inbounds %struct.anon.3, ptr %145, i32 0, i32 4
  %147 = load ptr, ptr %146, align 8, !tbaa !20
  %148 = load ptr, ptr %11, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.fftplan_s, ptr %148, i32 0, i32 4
  %150 = load i32, ptr %149, align 4, !tbaa !15
  %151 = call ptr @fft_create_plan(i32 noundef %139, ptr noundef %143, ptr noundef %147, i32 noundef 1, i32 noundef %150)
  %152 = load ptr, ptr %11, align 8, !tbaa !9
  %153 = getelementptr inbounds %struct.fftplan_s, ptr %152, i32 0, i32 10
  %154 = getelementptr inbounds %struct.anon.3, ptr %153, i32 0, i32 5
  store ptr %151, ptr %154, align 8, !tbaa !20
  %155 = load ptr, ptr %11, align 8, !tbaa !9
  %156 = getelementptr inbounds %struct.fftplan_s, ptr %155, i32 0, i32 10
  %157 = getelementptr inbounds %struct.anon.3, ptr %156, i32 0, i32 0
  %158 = load i32, ptr %157, align 8, !tbaa !20
  %159 = load ptr, ptr %11, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.fftplan_s, ptr %159, i32 0, i32 10
  %161 = getelementptr inbounds %struct.anon.3, ptr %160, i32 0, i32 4
  %162 = load ptr, ptr %161, align 8, !tbaa !20
  %163 = load ptr, ptr %11, align 8, !tbaa !9
  %164 = getelementptr inbounds %struct.fftplan_s, ptr %163, i32 0, i32 10
  %165 = getelementptr inbounds %struct.anon.3, ptr %164, i32 0, i32 3
  %166 = load ptr, ptr %165, align 8, !tbaa !20
  %167 = load ptr, ptr %11, align 8, !tbaa !9
  %168 = getelementptr inbounds %struct.fftplan_s, ptr %167, i32 0, i32 4
  %169 = load i32, ptr %168, align 4, !tbaa !15
  %170 = call ptr @fft_create_plan(i32 noundef %158, ptr noundef %162, ptr noundef %166, i32 noundef -1, i32 noundef %169)
  %171 = load ptr, ptr %11, align 8, !tbaa !9
  %172 = getelementptr inbounds %struct.fftplan_s, ptr %171, i32 0, i32 10
  %173 = getelementptr inbounds %struct.anon.3, ptr %172, i32 0, i32 6
  store ptr %170, ptr %173, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %174 = load ptr, ptr %11, align 8, !tbaa !9
  %175 = getelementptr inbounds %struct.fftplan_s, ptr %174, i32 0, i32 3
  %176 = load i32, ptr %175, align 8, !tbaa !17
  %177 = icmp eq i32 %176, 1
  %178 = zext i1 %177 to i64
  %179 = select i1 %177, double -1.000000e+00, double 1.000000e+00
  %180 = fptrunc double %179 to float
  store float %180, ptr %15, align 4, !tbaa !24
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %240, %110
  %182 = load i32, ptr %12, align 4, !tbaa !5
  %183 = load ptr, ptr %11, align 8, !tbaa !9
  %184 = getelementptr inbounds %struct.fftplan_s, ptr %183, i32 0, i32 10
  %185 = getelementptr inbounds %struct.anon.3, ptr %184, i32 0, i32 0
  %186 = load i32, ptr %185, align 8, !tbaa !20
  %187 = icmp ult i32 %182, %186
  br i1 %187, label %188, label %243

188:                                              ; preds = %181
  %189 = load float, ptr %15, align 4, !tbaa !24
  %190 = fmul float 0.000000e+00, %189
  %191 = fmul float 1.000000e+00, %189
  %192 = fmul float %190, 2.000000e+00
  %193 = fmul float %191, 2.000000e+00
  %194 = fpext float %192 to double
  %195 = fpext float %193 to double
  %196 = fmul double %194, 0x400921FB54442D18
  %197 = fmul double %195, 0x400921FB54442D18
  %198 = load ptr, ptr %11, align 8, !tbaa !9
  %199 = getelementptr inbounds %struct.fftplan_s, ptr %198, i32 0, i32 10
  %200 = getelementptr inbounds %struct.anon.3, ptr %199, i32 0, i32 1
  %201 = load ptr, ptr %200, align 8, !tbaa !20
  %202 = load i32, ptr %12, align 4, !tbaa !5
  %203 = load ptr, ptr %11, align 8, !tbaa !9
  %204 = getelementptr inbounds %struct.fftplan_s, ptr %203, i32 0, i32 0
  %205 = load i32, ptr %204, align 8, !tbaa !11
  %206 = sub i32 %205, 1
  %207 = urem i32 %202, %206
  %208 = zext i32 %207 to i64
  %209 = getelementptr inbounds i32, ptr %201, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = uitofp i32 %210 to double
  %212 = fmul double %196, %211
  %213 = fmul double %197, %211
  %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 = uitofp i32 %216 to float
  %218 = fpext float %217 to double
  %219 = fdiv double %212, %218
  %220 = fdiv double %213, %218
  %221 = fptrunc double %219 to float
  %222 = fptrunc double %220 to float
  %223 = getelementptr inbounds { float, float }, ptr %16, i32 0, i32 0
  %224 = getelementptr inbounds { float, float }, ptr %16, i32 0, i32 1
  store float %221, ptr %223, align 4
  store float %222, ptr %224, align 4
  %225 = load <2 x float>, ptr %16, align 4
  %226 = call <2 x float> @cexpf(<2 x float> noundef %225) #7
  store <2 x float> %226, ptr %17, align 4
  %227 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 0
  %228 = load float, ptr %227, align 4
  %229 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 1
  %230 = load float, ptr %229, align 4
  %231 = load ptr, ptr %11, align 8, !tbaa !9
  %232 = getelementptr inbounds %struct.fftplan_s, ptr %231, i32 0, i32 10
  %233 = getelementptr inbounds %struct.anon.3, ptr %232, i32 0, i32 3
  %234 = load ptr, ptr %233, align 8, !tbaa !20
  %235 = load i32, ptr %12, align 4, !tbaa !5
  %236 = zext i32 %235 to i64
  %237 = getelementptr inbounds { float, float }, ptr %234, i64 %236
  %238 = getelementptr inbounds { float, float }, ptr %237, i32 0, i32 0
  %239 = getelementptr inbounds { float, float }, ptr %237, i32 0, i32 1
  store float %228, ptr %238, align 4
  store float %230, ptr %239, align 4
  br label %240

240:                                              ; preds = %188
  %241 = load i32, ptr %12, align 4, !tbaa !5
  %242 = add i32 %241, 1
  store i32 %242, ptr %12, align 4, !tbaa !5
  br label %181, !llvm.loop !26

243:                                              ; preds = %181
  %244 = load ptr, ptr %11, align 8, !tbaa !9
  %245 = getelementptr inbounds %struct.fftplan_s, ptr %244, i32 0, i32 10
  %246 = getelementptr inbounds %struct.anon.3, ptr %245, i32 0, i32 5
  %247 = load ptr, ptr %246, align 8, !tbaa !20
  %248 = call i32 @fft_execute(ptr noundef %247)
  %249 = load ptr, ptr %11, align 8, !tbaa !9
  %250 = getelementptr inbounds %struct.fftplan_s, ptr %249, i32 0, i32 10
  %251 = getelementptr inbounds %struct.anon.3, ptr %250, i32 0, i32 0
  %252 = load i32, ptr %251, align 8, !tbaa !20
  %253 = zext i32 %252 to i64
  %254 = mul i64 %253, 8
  %255 = call noalias ptr @malloc(i64 noundef %254) #8
  %256 = load ptr, ptr %11, align 8, !tbaa !9
  %257 = getelementptr inbounds %struct.fftplan_s, ptr %256, i32 0, i32 10
  %258 = getelementptr inbounds %struct.anon.3, ptr %257, i32 0, i32 2
  store ptr %255, ptr %258, align 8, !tbaa !20
  %259 = load ptr, ptr %11, align 8, !tbaa !9
  %260 = getelementptr inbounds %struct.fftplan_s, ptr %259, i32 0, i32 10
  %261 = getelementptr inbounds %struct.anon.3, ptr %260, i32 0, i32 2
  %262 = load ptr, ptr %261, align 8, !tbaa !20
  %263 = load ptr, ptr %11, align 8, !tbaa !9
  %264 = getelementptr inbounds %struct.fftplan_s, ptr %263, i32 0, i32 10
  %265 = getelementptr inbounds %struct.anon.3, ptr %264, i32 0, i32 4
  %266 = load ptr, ptr %265, align 8, !tbaa !20
  %267 = load ptr, ptr %11, align 8, !tbaa !9
  %268 = getelementptr inbounds %struct.fftplan_s, ptr %267, i32 0, i32 10
  %269 = getelementptr inbounds %struct.anon.3, ptr %268, i32 0, i32 0
  %270 = load i32, ptr %269, align 8, !tbaa !20
  %271 = zext i32 %270 to i64
  %272 = mul i64 %271, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 4 %262, ptr align 4 %266, i64 %272, i1 false)
  %273 = load ptr, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  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 %273
}

; 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

declare i32 @liquid_primitive_root_prime(i32 noundef) #6

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

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

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 = distinct !{!23, !22}
!24 = !{!25, !25, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = distinct !{!26, !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_rader2(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 4, ptr %14, align 4, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %6, i64 40
  store ptr @fft_execute_rader2, ptr %15, align 8, !tbaa !17
  %16 = tail call i32 @liquid_primitive_root_prime(i32 noundef %0) #8
  %17 = add i32 %0, -1
  %18 = zext i32 %17 to i64
  %19 = shl nuw nsw i64 %18, 2
  %20 = tail call noalias ptr @malloc(i64 noundef %19) #7
  %21 = getelementptr inbounds i8, ptr %6, i64 64
  %22 = getelementptr inbounds i8, ptr %6, i64 72
  store ptr %20, ptr %22, align 8, !tbaa !18
  %.not70 = icmp eq i32 %17, 0
  br i1 %.not70, label %._crit_edge, 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
  %23 = trunc nuw i64 %indvars.iv.next to i32
  %24 = tail call i32 @liquid_modpow(i32 noundef %16, i32 noundef %23, i32 noundef %0) #8
  %25 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv
  store i32 %24, ptr %25, align 4, !tbaa !19
  %exitcond.not = icmp eq i64 %indvars.iv.next, %18
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph, %5
  %26 = shl i32 %0, 1
  %27 = add i32 %26, -5
  br label %28

28:                                               ; preds = %._crit_edge, %28
  %.06568 = phi i32 [ 0, %._crit_edge ], [ %31, %28 ]
  %29 = phi i32 [ %27, %._crit_edge ], [ %30, %28 ]
  %30 = lshr i32 %29, 1
  %31 = add nuw nsw i32 %.06568, 1
  %.not = icmp ult i32 %29, 2
  br i1 %.not, label %32, label %28, !llvm.loop !22

32:                                               ; preds = %28
  %33 = shl nuw i32 2, %.06568
  store i32 %33, ptr %21, align 8, !tbaa !18
  %34 = zext i32 %33 to i64
  %35 = shl nuw nsw i64 %34, 3
  %36 = tail call noalias ptr @malloc(i64 noundef %35) #7
  %37 = getelementptr inbounds i8, ptr %6, i64 88
  store ptr %36, ptr %37, align 8, !tbaa !18
  %38 = tail call noalias ptr @malloc(i64 noundef %35) #7
  %39 = getelementptr inbounds i8, ptr %6, i64 96
  store ptr %38, ptr %39, align 8, !tbaa !18
  %40 = tail call ptr @fft_create_plan(i32 noundef %33, ptr noundef %36, ptr noundef %38, i32 noundef 1, i32 noundef %4)
  %41 = getelementptr inbounds i8, ptr %6, i64 104
  store ptr %40, ptr %41, align 8, !tbaa !18
  %42 = tail call ptr @fft_create_plan(i32 noundef %33, ptr noundef %38, ptr noundef %36, i32 noundef -1, i32 noundef %4)
  %43 = getelementptr inbounds i8, ptr %6, i64 112
  store ptr %42, ptr %43, align 8, !tbaa !18
  %44 = select i1 %10, float -1.000000e+00, float 1.000000e+00
  %45 = tail call float @llvm.copysign.f32(float 0.000000e+00, float %44)
  %46 = insertelement <2 x float> poison, float %45, i64 0
  %47 = insertelement <2 x float> %46, float %44, i64 1
  %48 = fmul <2 x float> %47, <float 2.000000e+00, float 2.000000e+00>
  %49 = fpext <2 x float> %48 to <2 x double>
  %50 = fmul <2 x double> %49, <double 0x400921FB54442D18, double 0x400921FB54442D18>
  %51 = uitofp i32 %0 to float
  %52 = fpext float %51 to double
  %53 = insertelement <2 x double> poison, double %52, i64 0
  %54 = shufflevector <2 x double> %53, <2 x double> poison, <2 x i32> zeroinitializer
  br label %55

55:                                               ; preds = %32, %55
  %indvars.iv72 = phi i64 [ 0, %32 ], [ %indvars.iv.next73, %55 ]
  %56 = trunc nuw i64 %indvars.iv72 to i32
  %57 = urem i32 %56, %17
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr %20, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !19
  %61 = uitofp i32 %60 to double
  %62 = insertelement <2 x double> poison, double %61, i64 0
  %63 = shufflevector <2 x double> %62, <2 x double> poison, <2 x i32> zeroinitializer
  %64 = fmul <2 x double> %50, %63
  %65 = fdiv <2 x double> %64, %54
  %66 = fptrunc <2 x double> %65 to <2 x float>
  %67 = tail call <2 x float> @cexpf(<2 x float> noundef %66) #8
  %68 = getelementptr inbounds { float, float }, ptr %36, i64 %indvars.iv72
  store <2 x float> %67, ptr %68, align 4
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next73, %34
  br i1 %exitcond76.not, label %69, label %55, !llvm.loop !23

69:                                               ; preds = %55
  %70 = tail call i32 @fft_execute(ptr noundef %40)
  %71 = tail call noalias ptr @malloc(i64 noundef %35) #7
  %72 = getelementptr inbounds i8, ptr %6, i64 80
  store ptr %71, ptr %72, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %71, ptr noundef nonnull align 4 dereferenceable(1) %38, i64 %35, 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

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: nounwind uwtable
declare dso_local i32 @fft_execute_rader2(ptr noundef) #2

; 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}
!23 = distinct !{!23, !21}


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