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

; 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.autotest_psd_s = type { float, float, float, float, i32, i32 }

@liquid_autotest_verbose = external global i32, align 4
@liquid_window_str = external global [10 x [2 x ptr]], align 16
@.str.9 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [55 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: nounwind
declare float @powf(float noundef, float noundef) #1

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

declare ptr @spgramcf_create(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare float @randnf(...) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

declare i32 @spgramcf_get_psd(ptr noundef, ptr noundef) #2

declare i32 @spgramcf_destroy(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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

; Function Attrs: nounwind uwtable
define dso_local void @testbench_spgramcf_signal(i32 noundef %0, i32 noundef %1, float noundef %2, float noundef %3) #4 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca float, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca float, align 4
  %25 = alloca [3 x %struct.autotest_psd_s], align 16
  %26 = alloca [256 x i8], align 16
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store float 2.500000e-01, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 25, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store float 0x3FC99999A0000000, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store float -8.000000e+01, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store float 5.000000e-01, ptr %13, align 4, !tbaa !9
  %27 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %41

29:                                               ; preds = %4
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [10 x [2 x ptr]], ptr @liquid_window_str, i64 0, i64 %32
  %34 = getelementptr inbounds [2 x ptr], ptr %33, i64 0, i64 1
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = load float, ptr %7, align 4, !tbaa !9
  %37 = fpext float %36 to double
  %38 = load float, ptr %8, align 4, !tbaa !9
  %39 = fpext float %38 to double
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %30, ptr noundef %35, double noundef %37, double noundef %39)
  br label %41

41:                                               ; preds = %29, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = udiv i32 %44, 2
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = udiv i32 %46, 4
  %48 = call ptr @spgramcf_create(i32 noundef %42, i32 noundef %43, i32 noundef %45, i32 noundef %47)
  store ptr %48, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %49 = load float, ptr %9, align 4, !tbaa !9
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = load float, ptr %11, align 4, !tbaa !9
  %52 = call ptr @symstreamrcf_create_linear(i32 noundef 1, float noundef %49, i32 noundef %50, float noundef %51, i32 noundef 40)
  store ptr %52, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %53 = call ptr @nco_crcf_create(i32 noundef 1)
  store ptr %53, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %54 = load float, ptr %12, align 4, !tbaa !9
  %55 = fdiv float %54, 2.000000e+01
  %56 = call float @powf(float noundef 1.000000e+01, float noundef %55) #6
  store float %56, ptr %17, align 4, !tbaa !9
  %57 = load ptr, ptr %15, align 8, !tbaa !11
  %58 = load float, ptr %12, align 4, !tbaa !9
  %59 = load float, ptr %8, align 4, !tbaa !9
  %60 = fadd float %58, %59
  %61 = load float, ptr %9, align 4, !tbaa !9
  %62 = call float @log10f(float noundef %61) #6
  %63 = call float @llvm.fmuladd.f32(float 1.000000e+01, float %62, float %60)
  %64 = fdiv float %63, 2.000000e+01
  %65 = call float @powf(float noundef 1.000000e+01, float noundef %64) #6
  %66 = call i32 @symstreamrcf_set_gain(ptr noundef %57, float noundef %65)
  %67 = load ptr, ptr %16, align 8, !tbaa !11
  %68 = load float, ptr %7, align 4, !tbaa !9
  %69 = fpext float %68 to double
  %70 = fmul double 0x401921FB54442D18, %69
  %71 = fptrunc double %70 to float
  %72 = call i32 @nco_crcf_set_frequency(ptr noundef %67, float noundef %71)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 256, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  %73 = load i32, ptr %19, align 4, !tbaa !5
  %74 = zext i32 %73 to i64
  %75 = call ptr @llvm.stacksave.p0()
  store ptr %75, ptr %21, align 8
  %76 = alloca { float, float }, i64 %74, align 16
  store i64 %74, ptr %22, align 8
  br label %77

77:                                               ; preds = %124, %41
  %78 = load i32, ptr %20, align 4, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = mul i32 2000, %79
  %81 = icmp ult i32 %78, %80
  br i1 %81, label %82, label %131

82:                                               ; preds = %77
  %83 = load ptr, ptr %15, align 8, !tbaa !11
  %84 = load i32, ptr %19, align 4, !tbaa !5
  %85 = call i32 @symstreamrcf_write_samples(ptr noundef %83, ptr noundef %76, i32 noundef %84)
  %86 = load ptr, ptr %16, align 8, !tbaa !11
  %87 = load i32, ptr %19, align 4, !tbaa !5
  %88 = call i32 @nco_crcf_mix_block_up(ptr noundef %86, ptr noundef %76, ptr noundef %76, i32 noundef %87)
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %121, %82
  %90 = load i32, ptr %18, align 4, !tbaa !5
  %91 = load i32, ptr %19, align 4, !tbaa !5
  %92 = icmp ult i32 %90, %91
  br i1 %92, label %93, label %124

93:                                               ; preds = %89
  %94 = load float, ptr %17, align 4, !tbaa !9
  %95 = call float (...) @randnf()
  %96 = call float (...) @randnf()
  %97 = fmul float 0.000000e+00, %96
  %98 = fmul float 1.000000e+00, %96
  %99 = fadd float %95, %97
  %100 = fmul float %94, %99
  %101 = fmul float %94, %98
  %102 = fpext float %100 to double
  %103 = fpext float %101 to double
  %104 = fmul double %102, 0x3FE6A09E667F3BCD
  %105 = fmul double %103, 0x3FE6A09E667F3BCD
  %106 = load i32, ptr %18, align 4, !tbaa !5
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds { float, float }, ptr %76, i64 %107
  %109 = getelementptr inbounds { float, float }, ptr %108, i32 0, i32 0
  %110 = load float, ptr %109, align 8
  %111 = getelementptr inbounds { float, float }, ptr %108, i32 0, i32 1
  %112 = load float, ptr %111, align 4
  %113 = fpext float %110 to double
  %114 = fpext float %112 to double
  %115 = fadd double %113, %104
  %116 = fadd double %114, %105
  %117 = fptrunc double %115 to float
  %118 = fptrunc double %116 to float
  %119 = getelementptr inbounds { float, float }, ptr %108, i32 0, i32 0
  %120 = getelementptr inbounds { float, float }, ptr %108, i32 0, i32 1
  store float %117, ptr %119, align 8
  store float %118, ptr %120, align 4
  br label %121

121:                                              ; preds = %93
  %122 = load i32, ptr %18, align 4, !tbaa !5
  %123 = add i32 %122, 1
  store i32 %123, ptr %18, align 4, !tbaa !5
  br label %89, !llvm.loop !13

124:                                              ; preds = %89
  %125 = load ptr, ptr %14, align 8, !tbaa !11
  %126 = load i32, ptr %19, align 4, !tbaa !5
  %127 = call i32 @spgramcf_write(ptr noundef %125, ptr noundef %76, i32 noundef %126)
  %128 = load i32, ptr %19, align 4, !tbaa !5
  %129 = load i32, ptr %20, align 4, !tbaa !5
  %130 = add i32 %129, %128
  store i32 %130, ptr %20, align 4, !tbaa !5
  br label %77, !llvm.loop !15

131:                                              ; preds = %77
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = zext i32 %132 to i64
  %134 = alloca float, i64 %133, align 16
  store i64 %133, ptr %23, align 8
  %135 = load ptr, ptr %14, align 8, !tbaa !11
  %136 = call i32 @spgramcf_get_psd(ptr noundef %135, ptr noundef %134)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %137 = load float, ptr %8, align 4, !tbaa !9
  %138 = load float, ptr %12, align 4, !tbaa !9
  %139 = fadd float %137, %138
  %140 = fdiv float %139, 1.000000e+01
  %141 = call float @powf(float noundef 1.000000e+01, float noundef %140) #6
  %142 = load float, ptr %12, align 4, !tbaa !9
  %143 = fdiv float %142, 1.000000e+01
  %144 = call float @powf(float noundef 1.000000e+01, float noundef %143) #6
  %145 = fadd float %141, %144
  %146 = call float @log10f(float noundef %145) #6
  %147 = fmul float 1.000000e+01, %146
  store float %147, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %25) #6
  %148 = getelementptr inbounds %struct.autotest_psd_s, ptr %25, i32 0, i32 0
  store float -5.000000e-01, ptr %148, align 8, !tbaa !16
  %149 = getelementptr inbounds %struct.autotest_psd_s, ptr %25, i32 0, i32 1
  %150 = load float, ptr %7, align 4, !tbaa !9
  %151 = load float, ptr %9, align 4, !tbaa !9
  %152 = call float @llvm.fmuladd.f32(float 0xBFE3333340000000, float %151, float %150)
  store float %152, ptr %149, align 4, !tbaa !18
  %153 = getelementptr inbounds %struct.autotest_psd_s, ptr %25, i32 0, i32 2
  %154 = load float, ptr %12, align 4, !tbaa !9
  %155 = load float, ptr %13, align 4, !tbaa !9
  %156 = fsub float %154, %155
  store float %156, ptr %153, align 8, !tbaa !19
  %157 = getelementptr inbounds %struct.autotest_psd_s, ptr %25, i32 0, i32 3
  %158 = load float, ptr %12, align 4, !tbaa !9
  %159 = load float, ptr %13, align 4, !tbaa !9
  %160 = fadd float %158, %159
  store float %160, ptr %157, align 4, !tbaa !20
  %161 = getelementptr inbounds %struct.autotest_psd_s, ptr %25, i32 0, i32 4
  store i32 1, ptr %161, align 8, !tbaa !21
  %162 = getelementptr inbounds %struct.autotest_psd_s, ptr %25, i32 0, i32 5
  store i32 1, ptr %162, align 4, !tbaa !22
  %163 = getelementptr inbounds %struct.autotest_psd_s, ptr %25, i64 1
  %164 = getelementptr inbounds %struct.autotest_psd_s, ptr %163, i32 0, i32 0
  %165 = load float, ptr %7, align 4, !tbaa !9
  %166 = load float, ptr %9, align 4, !tbaa !9
  %167 = call float @llvm.fmuladd.f32(float 0xBFD99999A0000000, float %166, float %165)
  store float %167, ptr %164, align 8, !tbaa !16
  %168 = getelementptr inbounds %struct.autotest_psd_s, ptr %163, i32 0, i32 1
  %169 = load float, ptr %7, align 4, !tbaa !9
  %170 = load float, ptr %9, align 4, !tbaa !9
  %171 = call float @llvm.fmuladd.f32(float 0x3FD99999A0000000, float %170, float %169)
  store float %171, ptr %168, align 4, !tbaa !18
  %172 = getelementptr inbounds %struct.autotest_psd_s, ptr %163, i32 0, i32 2
  %173 = load float, ptr %24, align 4, !tbaa !9
  %174 = load float, ptr %13, align 4, !tbaa !9
  %175 = fsub float %173, %174
  store float %175, ptr %172, align 8, !tbaa !19
  %176 = getelementptr inbounds %struct.autotest_psd_s, ptr %163, i32 0, i32 3
  %177 = load float, ptr %24, align 4, !tbaa !9
  %178 = load float, ptr %13, align 4, !tbaa !9
  %179 = fadd float %177, %178
  store float %179, ptr %176, align 4, !tbaa !20
  %180 = getelementptr inbounds %struct.autotest_psd_s, ptr %163, i32 0, i32 4
  store i32 1, ptr %180, align 8, !tbaa !21
  %181 = getelementptr inbounds %struct.autotest_psd_s, ptr %163, i32 0, i32 5
  store i32 1, ptr %181, align 4, !tbaa !22
  %182 = getelementptr inbounds %struct.autotest_psd_s, ptr %25, i64 2
  %183 = getelementptr inbounds %struct.autotest_psd_s, ptr %182, i32 0, i32 0
  %184 = load float, ptr %7, align 4, !tbaa !9
  %185 = load float, ptr %9, align 4, !tbaa !9
  %186 = call float @llvm.fmuladd.f32(float 0x3FE3333340000000, float %185, float %184)
  store float %186, ptr %183, align 8, !tbaa !16
  %187 = getelementptr inbounds %struct.autotest_psd_s, ptr %182, i32 0, i32 1
  store float 5.000000e-01, ptr %187, align 4, !tbaa !18
  %188 = getelementptr inbounds %struct.autotest_psd_s, ptr %182, i32 0, i32 2
  %189 = load float, ptr %12, align 4, !tbaa !9
  %190 = load float, ptr %13, align 4, !tbaa !9
  %191 = fsub float %189, %190
  store float %191, ptr %188, align 8, !tbaa !19
  %192 = getelementptr inbounds %struct.autotest_psd_s, ptr %182, i32 0, i32 3
  %193 = load float, ptr %12, align 4, !tbaa !9
  %194 = load float, ptr %13, align 4, !tbaa !9
  %195 = fadd float %193, %194
  store float %195, ptr %192, align 4, !tbaa !20
  %196 = getelementptr inbounds %struct.autotest_psd_s, ptr %182, i32 0, i32 4
  store i32 1, ptr %196, align 8, !tbaa !21
  %197 = getelementptr inbounds %struct.autotest_psd_s, ptr %182, i32 0, i32 5
  store i32 1, ptr %197, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 256, ptr %26) #6
  %198 = getelementptr inbounds [256 x i8], ptr %26, i64 0, i64 0
  %199 = load i32, ptr %6, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [10 x [2 x ptr]], ptr @liquid_window_str, i64 0, i64 %200
  %202 = getelementptr inbounds [2 x ptr], ptr %201, i64 0, i64 0
  %203 = load ptr, ptr %202, align 16, !tbaa !11
  %204 = load i32, ptr %5, align 4, !tbaa !5
  %205 = load float, ptr %7, align 4, !tbaa !9
  %206 = fcmp olt float %205, 0.000000e+00
  %207 = zext i1 %206 to i64
  %208 = select i1 %206, i32 109, i32 112
  %209 = load float, ptr %7, align 4, !tbaa !9
  %210 = fmul float %209, 1.000000e+03
  %211 = call float @llvm.fabs.f32(float %210)
  %212 = fpext float %211 to double
  %213 = load float, ptr %8, align 4, !tbaa !9
  %214 = fcmp olt float %213, 0.000000e+00
  %215 = zext i1 %214 to i64
  %216 = select i1 %214, i32 109, i32 112
  %217 = load float, ptr %8, align 4, !tbaa !9
  %218 = fmul float %217, 1.000000e+03
  %219 = call float @llvm.fabs.f32(float %218)
  %220 = fpext float %219 to double
  %221 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %198, ptr noundef @.str.10, ptr noundef %203, i32 noundef %204, i32 noundef %208, double noundef %212, i32 noundef %216, double noundef %220) #6
  %222 = load i32, ptr %5, align 4, !tbaa !5
  %223 = getelementptr inbounds [3 x %struct.autotest_psd_s], ptr %25, i64 0, i64 0
  %224 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %225 = icmp ne i32 %224, 0
  br i1 %225, label %226, label %228

226:                                              ; preds = %131
  %227 = getelementptr inbounds [256 x i8], ptr %26, i64 0, i64 0
  br label %229

228:                                              ; preds = %131
  br label %229

229:                                              ; preds = %228, %226
  %230 = phi ptr [ %227, %226 ], [ null, %228 ]
  %231 = call i32 @liquid_autotest_validate_spectrum(ptr noundef %134, i32 noundef %222, ptr noundef %223, i32 noundef 3, ptr noundef %230)
  %232 = load ptr, ptr %14, align 8, !tbaa !11
  %233 = call i32 @spgramcf_destroy(ptr noundef %232)
  %234 = load ptr, ptr %15, align 8, !tbaa !11
  %235 = call i32 @symstreamrcf_destroy(ptr noundef %234)
  %236 = load ptr, ptr %16, align 8, !tbaa !11
  %237 = call i32 @nco_crcf_destroy(ptr noundef %236)
  call void @llvm.lifetime.end.p0(i64 256, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  %238 = load ptr, ptr %21, align 8
  call void @llvm.stackrestore.p0(ptr %238)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void
}

declare ptr @symstreamrcf_create_linear(i32 noundef, float noundef, i32 noundef, float noundef, i32 noundef) #2

declare ptr @nco_crcf_create(i32 noundef) #2

declare i32 @symstreamrcf_set_gain(ptr noundef, float noundef) #2

; Function Attrs: nounwind
declare float @log10f(float noundef) #1

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

declare i32 @nco_crcf_set_frequency(ptr noundef, float noundef) #2

declare i32 @symstreamrcf_write_samples(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @nco_crcf_mix_block_up(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @spgramcf_write(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #1

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

declare i32 @liquid_autotest_validate_spectrum(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) #2

declare i32 @symstreamrcf_destroy(ptr noundef) #2

declare i32 @nco_crcf_destroy(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 willreturn }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !10, i64 0}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 20}
!18 = !{!17, !10, i64 4}
!19 = !{!17, !10, i64 8}
!20 = !{!17, !10, i64 12}
!21 = !{!17, !6, i64 16}
!22 = !{!17, !6, i64 20}


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

%struct.autotest_psd_s = type { float, float, float, float, i32, i32 }

@liquid_autotest_verbose = external local_unnamed_addr global i32, align 4
@liquid_window_str = external local_unnamed_addr global [10 x [2 x ptr]], align 16
@.str.9 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [55 x i8], align 1

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @powf(float noundef, float noundef) local_unnamed_addr #1

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

declare ptr @spgramcf_create(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare float @randnf(...) local_unnamed_addr #3

declare i32 @spgramcf_get_psd(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @spgramcf_destroy(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local void @testbench_spgramcf_signal(i32 noundef %0, i32 noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #4 {
  %5 = alloca [3 x %struct.autotest_psd_s], align 16
  %6 = alloca [256 x i8], align 16
  %7 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %._crit_edge75, label %8

._crit_edge75:                                    ; preds = %4
  %.pre = fpext float %2 to double
  br label %15

8:                                                ; preds = %4
  %9 = sext i32 %1 to i64
  %10 = getelementptr inbounds [10 x [2 x ptr]], ptr @liquid_window_str, i64 0, i64 %9, i64 1
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = fpext float %2 to double
  %13 = fpext float %3 to double
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %0, ptr noundef %11, double noundef %12, double noundef %13)
  br label %15

15:                                               ; preds = %._crit_edge75, %8
  %.pre-phi = phi double [ %.pre, %._crit_edge75 ], [ %12, %8 ]
  %16 = lshr i32 %0, 1
  %17 = lshr i32 %0, 2
  %18 = tail call ptr @spgramcf_create(i32 noundef %0, i32 noundef %1, i32 noundef %16, i32 noundef %17) #6
  %19 = tail call ptr @symstreamrcf_create_linear(i32 noundef 1, float noundef 2.500000e-01, i32 noundef 25, float noundef 0x3FC99999A0000000, i32 noundef 40) #6
  %20 = tail call ptr @nco_crcf_create(i32 noundef 1) #6
  %21 = fadd float %3, -8.000000e+01
  %22 = fadd float %21, 0xC018151840000000
  %23 = fdiv float %22, 2.000000e+01
  %24 = tail call float @powf(float noundef 1.000000e+01, float noundef %23) #6
  %25 = tail call i32 @symstreamrcf_set_gain(ptr noundef %19, float noundef %24) #6
  %26 = fmul double %.pre-phi, 0x401921FB54442D18
  %27 = fptrunc double %26 to float
  %28 = tail call i32 @nco_crcf_set_frequency(ptr noundef %20, float noundef %27) #6
  %29 = alloca [256 x { float, float }], align 16
  %30 = mul i32 %0, 2000
  %.not73 = icmp eq i32 %30, 0
  br i1 %.not73, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %15, %48
  %.06972 = phi i32 [ %50, %48 ], [ 0, %15 ]
  %31 = call i32 @symstreamrcf_write_samples(ptr noundef %19, ptr noundef nonnull %29, i32 noundef 256) #6
  %32 = call i32 @nco_crcf_mix_block_up(ptr noundef %20, ptr noundef nonnull %29, ptr noundef nonnull %29, i32 noundef 256) #6
  br label %33

33:                                               ; preds = %.lr.ph, %33
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %33 ]
  %34 = call float (...) @randnf() #6
  %35 = call float (...) @randnf() #6
  %36 = fmul float %35, 0.000000e+00
  %37 = fadd float %34, %36
  %38 = getelementptr inbounds { float, float }, ptr %29, i64 %indvars.iv
  %39 = insertelement <2 x float> poison, float %37, i64 0
  %40 = insertelement <2 x float> %39, float %35, i64 1
  %41 = fmul <2 x float> %40, <float 0x3F1A36E2E0000000, float 0x3F1A36E2E0000000>
  %42 = fpext <2 x float> %41 to <2 x double>
  %43 = fmul <2 x double> %42, <double 0x3FE6A09E667F3BCD, double 0x3FE6A09E667F3BCD>
  %44 = load <2 x float>, ptr %38, align 8
  %45 = fpext <2 x float> %44 to <2 x double>
  %46 = fadd <2 x double> %43, %45
  %47 = fptrunc <2 x double> %46 to <2 x float>
  store <2 x float> %47, ptr %38, align 8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond.not, label %48, label %33, !llvm.loop !11

48:                                               ; preds = %33
  %49 = call i32 @spgramcf_write(ptr noundef %18, ptr noundef nonnull %29, i32 noundef 256) #6
  %50 = add i32 %.06972, 256
  %51 = icmp ult i32 %50, %30
  br i1 %51, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %48, %15
  %52 = zext i32 %0 to i64
  %53 = alloca float, i64 %52, align 16
  %54 = call i32 @spgramcf_get_psd(ptr noundef %18, ptr noundef nonnull %53) #6
  %55 = fdiv float %21, 1.000000e+01
  %56 = call float @powf(float noundef 1.000000e+01, float noundef %55) #6
  %57 = fadd float %56, 0x3E45798EE0000000
  %58 = call float @log10f(float noundef %57) #6
  %59 = fmul float %58, 1.000000e+01
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #6
  store float -5.000000e-01, ptr %5, align 16, !tbaa !14
  %60 = getelementptr inbounds i8, ptr %5, i64 4
  %61 = fadd float %2, 0xBFC3333340000000
  store float %61, ptr %60, align 4, !tbaa !17
  %62 = getelementptr inbounds i8, ptr %5, i64 8
  store <2 x float> <float -8.050000e+01, float -7.950000e+01>, ptr %62, align 8, !tbaa !18
  %63 = getelementptr inbounds i8, ptr %5, i64 16
  store i32 1, ptr %63, align 16, !tbaa !19
  %64 = getelementptr inbounds i8, ptr %5, i64 20
  store i32 1, ptr %64, align 4, !tbaa !20
  %65 = getelementptr inbounds i8, ptr %5, i64 24
  %66 = insertelement <4 x float> poison, float %2, i64 0
  %67 = insertelement <4 x float> %66, float %59, i64 1
  %68 = shufflevector <4 x float> %67, <4 x float> poison, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
  %69 = fadd <4 x float> %68, <float 0xBFB99999A0000000, float 0x3FB99999A0000000, float -5.000000e-01, float 5.000000e-01>
  store <4 x float> %69, ptr %65, align 8, !tbaa !18
  %70 = getelementptr inbounds i8, ptr %5, i64 40
  store i32 1, ptr %70, align 8, !tbaa !19
  %71 = getelementptr inbounds i8, ptr %5, i64 44
  store i32 1, ptr %71, align 4, !tbaa !20
  %72 = getelementptr inbounds i8, ptr %5, i64 48
  %73 = fadd float %2, 0x3FC3333340000000
  store float %73, ptr %72, align 16, !tbaa !14
  %74 = getelementptr inbounds i8, ptr %5, i64 52
  store <2 x float> <float 5.000000e-01, float -8.050000e+01>, ptr %74, align 4, !tbaa !18
  %75 = getelementptr inbounds i8, ptr %5, i64 60
  store float -7.950000e+01, ptr %75, align 4, !tbaa !21
  %76 = getelementptr inbounds i8, ptr %5, i64 64
  store i32 1, ptr %76, align 16, !tbaa !19
  %77 = getelementptr inbounds i8, ptr %5, i64 68
  store i32 1, ptr %77, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %6) #6
  %78 = sext i32 %1 to i64
  %79 = getelementptr inbounds [10 x [2 x ptr]], ptr @liquid_window_str, i64 0, i64 %78
  %80 = load ptr, ptr %79, align 16, !tbaa !9
  %81 = fcmp olt float %2, 0.000000e+00
  %82 = select i1 %81, i32 109, i32 112
  %83 = fmul float %2, 1.000000e+03
  %84 = call float @llvm.fabs.f32(float %83)
  %85 = fpext float %84 to double
  %86 = fcmp olt float %3, 0.000000e+00
  %87 = select i1 %86, i32 109, i32 112
  %88 = fmul float %3, 1.000000e+03
  %89 = call float @llvm.fabs.f32(float %88)
  %90 = fpext float %89 to double
  %91 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef %80, i32 noundef %0, i32 noundef %82, double noundef %85, i32 noundef %87, double noundef %90) #6
  %92 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %.not70 = icmp eq i32 %92, 0
  %93 = select i1 %.not70, ptr null, ptr %6
  %94 = call i32 @liquid_autotest_validate_spectrum(ptr noundef nonnull %53, i32 noundef %0, ptr noundef nonnull %5, i32 noundef 3, ptr noundef %93) #6
  %95 = call i32 @spgramcf_destroy(ptr noundef %18) #6
  %96 = call i32 @symstreamrcf_destroy(ptr noundef %19) #6
  %97 = call i32 @nco_crcf_destroy(ptr noundef %20) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #6
  ret void
}

declare ptr @symstreamrcf_create_linear(i32 noundef, float noundef, i32 noundef, float noundef, i32 noundef) local_unnamed_addr #3

declare ptr @nco_crcf_create(i32 noundef) local_unnamed_addr #3

declare i32 @symstreamrcf_set_gain(ptr noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @log10f(float noundef) local_unnamed_addr #1

declare i32 @nco_crcf_set_frequency(ptr noundef, float noundef) local_unnamed_addr #3

declare i32 @symstreamrcf_write_samples(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @nco_crcf_mix_block_up(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @spgramcf_write(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

declare i32 @liquid_autotest_validate_spectrum(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @symstreamrcf_destroy(ptr noundef) local_unnamed_addr #3

declare i32 @nco_crcf_destroy(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "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 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !16, i64 0}
!15 = !{!"", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !6, i64 16, !6, i64 20}
!16 = !{!"float", !7, i64 0}
!17 = !{!15, !16, i64 4}
!18 = !{!16, !16, i64 0}
!19 = !{!15, !6, i64 16}
!20 = !{!15, !6, i64 20}
!21 = !{!15, !16, i64 12}


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