; LLVM IR from jgaeddert/liquid-dsp :: src/nco/src (nco_crcf)

; 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.nco_crcf_s = type { i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, i32, float, float }
%struct.vco_tab_e_s = type { float, float }

@.str = external hidden unnamed_addr constant [78 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @nco_crcf_create(i32 noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %16 = call noalias ptr @malloc(i64 noundef 72) #6
  store ptr %16, ptr %4, align 8, !tbaa !9
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !9
  %19 = getelementptr inbounds %struct.nco_crcf_s, ptr %18, i32 0, i32 0
  store i32 %17, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %20 = load ptr, ptr %4, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.nco_crcf_s, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !11
  switch i32 %22, label %238 [
    i32 0, label %23
    i32 1, label %53
    i32 2, label %229
  ]

23:                                               ; preds = %1
  %24 = load ptr, ptr %4, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.nco_crcf_s, ptr %24, i32 0, i32 4
  store ptr null, ptr %25, align 8, !tbaa !14
  %26 = load ptr, ptr %4, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.nco_crcf_s, ptr %26, i32 0, i32 7
  store ptr null, ptr %27, align 8, !tbaa !15
  %28 = load ptr, ptr %4, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.nco_crcf_s, ptr %28, i32 0, i32 8
  store ptr null, ptr %29, align 8, !tbaa !16
  %30 = call noalias ptr @malloc(i64 noundef 4096) #6
  %31 = load ptr, ptr %4, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.nco_crcf_s, ptr %31, i32 0, i32 3
  store ptr %30, ptr %32, align 8, !tbaa !17
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %49, %23
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = zext i32 %34 to i64
  %36 = icmp ult i64 %35, 1024
  br i1 %36, label %37, label %52

37:                                               ; preds = %33
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = uitofp i32 %38 to float
  %40 = fmul float 0x401921FB60000000, %39
  %41 = fdiv float %40, 1.024000e+03
  %42 = call float @sinf(float noundef %41) #5
  %43 = load ptr, ptr %4, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.nco_crcf_s, ptr %43, i32 0, i32 3
  %45 = load ptr, ptr %44, align 8, !tbaa !17
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds float, ptr %45, i64 %47
  store float %42, ptr %48, align 4, !tbaa !18
  br label %49

49:                                               ; preds = %37
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = add i32 %50, 1
  store i32 %51, ptr %5, align 4, !tbaa !5
  br label %33, !llvm.loop !19

52:                                               ; preds = %33
  br label %243

53:                                               ; preds = %1
  %54 = load ptr, ptr %4, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.nco_crcf_s, ptr %54, i32 0, i32 3
  store ptr null, ptr %55, align 8, !tbaa !17
  %56 = load ptr, ptr %4, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.nco_crcf_s, ptr %56, i32 0, i32 7
  store ptr null, ptr %57, align 8, !tbaa !15
  %58 = load ptr, ptr %4, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.nco_crcf_s, ptr %58, i32 0, i32 8
  store ptr null, ptr %59, align 8, !tbaa !16
  %60 = call noalias ptr @malloc(i64 noundef 8192) #6
  %61 = load ptr, ptr %4, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.nco_crcf_s, ptr %61, i32 0, i32 4
  store ptr %60, ptr %62, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 4194303, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %117, %53
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = zext i32 %64 to i64
  %66 = icmp ult i64 %65, 256
  br i1 %66, label %67, label %120

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = uitofp i32 %68 to float
  %70 = call float @nco_crcf_fp_sin(float noundef %69)
  store float %70, ptr %9, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = add i32 %71, 4194303
  %73 = uitofp i32 %72 to float
  %74 = call float @nco_crcf_fp_sin(float noundef %73)
  store float %74, ptr %10, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %75 = load float, ptr %10, align 4, !tbaa !18
  %76 = load float, ptr %9, align 4, !tbaa !18
  %77 = fsub float %75, %76
  %78 = fdiv float %77, 0x414FFFFF80000000
  store float %78, ptr %11, align 4, !tbaa !18
  %79 = load float, ptr %9, align 4, !tbaa !18
  %80 = load ptr, ptr %4, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct.nco_crcf_s, ptr %80, i32 0, i32 4
  %82 = load ptr, ptr %81, align 8, !tbaa !14
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds %struct.vco_tab_e_s, ptr %82, i64 %84
  %86 = getelementptr inbounds %struct.vco_tab_e_s, ptr %85, i32 0, i32 0
  store float %79, ptr %86, align 4, !tbaa !21
  %87 = load float, ptr %11, align 4, !tbaa !18
  %88 = load ptr, ptr %4, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct.nco_crcf_s, ptr %88, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !14
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds %struct.vco_tab_e_s, ptr %90, i64 %92
  %94 = getelementptr inbounds %struct.vco_tab_e_s, ptr %93, i32 0, i32 1
  store float %87, ptr %94, align 4, !tbaa !23
  %95 = load float, ptr %9, align 4, !tbaa !18
  %96 = fneg float %95
  %97 = load ptr, ptr %4, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.nco_crcf_s, ptr %97, i32 0, i32 4
  %99 = load ptr, ptr %98, align 8, !tbaa !14
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = zext i32 %100 to i64
  %102 = add i64 %101, 512
  %103 = getelementptr inbounds %struct.vco_tab_e_s, ptr %99, i64 %102
  %104 = getelementptr inbounds %struct.vco_tab_e_s, ptr %103, i32 0, i32 0
  store float %96, ptr %104, align 4, !tbaa !21
  %105 = load float, ptr %11, align 4, !tbaa !18
  %106 = fneg float %105
  %107 = load ptr, ptr %4, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.nco_crcf_s, ptr %107, i32 0, i32 4
  %109 = load ptr, ptr %108, align 8, !tbaa !14
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = zext i32 %110 to i64
  %112 = add i64 %111, 512
  %113 = getelementptr inbounds %struct.vco_tab_e_s, ptr %109, i64 %112
  %114 = getelementptr inbounds %struct.vco_tab_e_s, ptr %113, i32 0, i32 1
  store float %106, ptr %114, align 4, !tbaa !23
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = add i32 %115, 4194303
  store i32 %116, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %117

117:                                              ; preds = %67
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = add i32 %118, 1
  store i32 %119, ptr %8, align 4, !tbaa !5
  br label %63, !llvm.loop !24

120:                                              ; preds = %63
  %121 = load ptr, ptr %4, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.nco_crcf_s, ptr %121, i32 0, i32 4
  %123 = load ptr, ptr %122, align 8, !tbaa !14
  %124 = getelementptr inbounds %struct.vco_tab_e_s, ptr %123, i64 256
  %125 = getelementptr inbounds %struct.vco_tab_e_s, ptr %124, i32 0, i32 0
  store float 1.000000e+00, ptr %125, align 4, !tbaa !21
  %126 = load ptr, ptr %4, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.nco_crcf_s, ptr %126, i32 0, i32 4
  %128 = load ptr, ptr %127, align 8, !tbaa !14
  %129 = getelementptr inbounds %struct.vco_tab_e_s, ptr %128, i64 255
  %130 = getelementptr inbounds %struct.vco_tab_e_s, ptr %129, i32 0, i32 1
  %131 = load float, ptr %130, align 4, !tbaa !23
  %132 = fneg float %131
  %133 = load ptr, ptr %4, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.nco_crcf_s, ptr %133, i32 0, i32 4
  %135 = load ptr, ptr %134, align 8, !tbaa !14
  %136 = getelementptr inbounds %struct.vco_tab_e_s, ptr %135, i64 256
  %137 = getelementptr inbounds %struct.vco_tab_e_s, ptr %136, i32 0, i32 1
  store float %132, ptr %137, align 4, !tbaa !23
  %138 = load ptr, ptr %4, align 8, !tbaa !9
  %139 = getelementptr inbounds %struct.nco_crcf_s, ptr %138, i32 0, i32 4
  %140 = load ptr, ptr %139, align 8, !tbaa !14
  %141 = getelementptr inbounds %struct.vco_tab_e_s, ptr %140, i64 256
  %142 = getelementptr inbounds %struct.vco_tab_e_s, ptr %141, i32 0, i32 0
  %143 = load float, ptr %142, align 4, !tbaa !21
  %144 = fneg float %143
  %145 = load ptr, ptr %4, align 8, !tbaa !9
  %146 = getelementptr inbounds %struct.nco_crcf_s, ptr %145, i32 0, i32 4
  %147 = load ptr, ptr %146, align 8, !tbaa !14
  %148 = getelementptr inbounds %struct.vco_tab_e_s, ptr %147, i64 768
  %149 = getelementptr inbounds %struct.vco_tab_e_s, ptr %148, i32 0, i32 0
  store float %144, ptr %149, align 4, !tbaa !21
  %150 = load ptr, ptr %4, align 8, !tbaa !9
  %151 = getelementptr inbounds %struct.nco_crcf_s, ptr %150, i32 0, i32 4
  %152 = load ptr, ptr %151, align 8, !tbaa !14
  %153 = getelementptr inbounds %struct.vco_tab_e_s, ptr %152, i64 255
  %154 = getelementptr inbounds %struct.vco_tab_e_s, ptr %153, i32 0, i32 1
  %155 = load float, ptr %154, align 4, !tbaa !23
  %156 = load ptr, ptr %4, align 8, !tbaa !9
  %157 = getelementptr inbounds %struct.nco_crcf_s, ptr %156, i32 0, i32 4
  %158 = load ptr, ptr %157, align 8, !tbaa !14
  %159 = getelementptr inbounds %struct.vco_tab_e_s, ptr %158, i64 768
  %160 = getelementptr inbounds %struct.vco_tab_e_s, ptr %159, i32 0, i32 1
  store float %155, ptr %160, align 4, !tbaa !23
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %225, %120
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = zext i32 %162 to i64
  %164 = icmp ult i64 %163, 256
  br i1 %164, label %165, label %228

165:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = zext i32 %166 to i64
  %168 = add i64 %167, 256
  %169 = trunc i64 %168 to i32
  store i32 %169, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %170 = load ptr, ptr %4, align 8, !tbaa !9
  %171 = getelementptr inbounds %struct.nco_crcf_s, ptr %170, i32 0, i32 4
  %172 = load ptr, ptr %171, align 8, !tbaa !14
  %173 = load i32, ptr %8, align 4, !tbaa !5
  %174 = zext i32 %173 to i64
  %175 = sub i64 256, %174
  %176 = getelementptr inbounds %struct.vco_tab_e_s, ptr %172, i64 %175
  %177 = getelementptr inbounds %struct.vco_tab_e_s, ptr %176, i32 0, i32 0
  %178 = load float, ptr %177, align 4, !tbaa !21
  store float %178, ptr %13, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %179 = load ptr, ptr %4, align 8, !tbaa !9
  %180 = getelementptr inbounds %struct.nco_crcf_s, ptr %179, i32 0, i32 4
  %181 = load ptr, ptr %180, align 8, !tbaa !14
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = zext i32 %182 to i64
  %184 = sub i64 256, %183
  %185 = sub i64 %184, 1
  %186 = getelementptr inbounds %struct.vco_tab_e_s, ptr %181, i64 %185
  %187 = getelementptr inbounds %struct.vco_tab_e_s, ptr %186, i32 0, i32 1
  %188 = load float, ptr %187, align 4, !tbaa !23
  store float %188, ptr %14, align 4, !tbaa !18
  %189 = load float, ptr %13, align 4, !tbaa !18
  %190 = load ptr, ptr %4, align 8, !tbaa !9
  %191 = getelementptr inbounds %struct.nco_crcf_s, ptr %190, i32 0, i32 4
  %192 = load ptr, ptr %191, align 8, !tbaa !14
  %193 = load i32, ptr %12, align 4, !tbaa !5
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds %struct.vco_tab_e_s, ptr %192, i64 %194
  %196 = getelementptr inbounds %struct.vco_tab_e_s, ptr %195, i32 0, i32 0
  store float %189, ptr %196, align 4, !tbaa !21
  %197 = load float, ptr %14, align 4, !tbaa !18
  %198 = fneg float %197
  %199 = load ptr, ptr %4, align 8, !tbaa !9
  %200 = getelementptr inbounds %struct.nco_crcf_s, ptr %199, i32 0, i32 4
  %201 = load ptr, ptr %200, align 8, !tbaa !14
  %202 = load i32, ptr %12, align 4, !tbaa !5
  %203 = zext i32 %202 to i64
  %204 = getelementptr inbounds %struct.vco_tab_e_s, ptr %201, i64 %203
  %205 = getelementptr inbounds %struct.vco_tab_e_s, ptr %204, i32 0, i32 1
  store float %198, ptr %205, align 4, !tbaa !23
  %206 = load float, ptr %13, align 4, !tbaa !18
  %207 = fneg float %206
  %208 = load ptr, ptr %4, align 8, !tbaa !9
  %209 = getelementptr inbounds %struct.nco_crcf_s, ptr %208, i32 0, i32 4
  %210 = load ptr, ptr %209, align 8, !tbaa !14
  %211 = load i32, ptr %12, align 4, !tbaa !5
  %212 = zext i32 %211 to i64
  %213 = add i64 %212, 512
  %214 = getelementptr inbounds %struct.vco_tab_e_s, ptr %210, i64 %213
  %215 = getelementptr inbounds %struct.vco_tab_e_s, ptr %214, i32 0, i32 0
  store float %207, ptr %215, align 4, !tbaa !21
  %216 = load float, ptr %14, align 4, !tbaa !18
  %217 = load ptr, ptr %4, align 8, !tbaa !9
  %218 = getelementptr inbounds %struct.nco_crcf_s, ptr %217, i32 0, i32 4
  %219 = load ptr, ptr %218, align 8, !tbaa !14
  %220 = load i32, ptr %12, align 4, !tbaa !5
  %221 = zext i32 %220 to i64
  %222 = add i64 %221, 512
  %223 = getelementptr inbounds %struct.vco_tab_e_s, ptr %219, i64 %222
  %224 = getelementptr inbounds %struct.vco_tab_e_s, ptr %223, i32 0, i32 1
  store float %216, ptr %224, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %225

225:                                              ; preds = %165
  %226 = load i32, ptr %8, align 4, !tbaa !5
  %227 = add i32 %226, 1
  store i32 %227, ptr %8, align 4, !tbaa !5
  br label %161, !llvm.loop !25

228:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %243

229:                                              ; preds = %1
  %230 = load ptr, ptr %4, align 8, !tbaa !9
  %231 = getelementptr inbounds %struct.nco_crcf_s, ptr %230, i32 0, i32 3
  store ptr null, ptr %231, align 8, !tbaa !17
  %232 = load ptr, ptr %4, align 8, !tbaa !9
  %233 = getelementptr inbounds %struct.nco_crcf_s, ptr %232, i32 0, i32 4
  store ptr null, ptr %233, align 8, !tbaa !14
  %234 = load ptr, ptr %4, align 8, !tbaa !9
  %235 = getelementptr inbounds %struct.nco_crcf_s, ptr %234, i32 0, i32 7
  store ptr null, ptr %235, align 8, !tbaa !15
  %236 = load ptr, ptr %4, align 8, !tbaa !9
  %237 = getelementptr inbounds %struct.nco_crcf_s, ptr %236, i32 0, i32 8
  store ptr null, ptr %237, align 8, !tbaa !16
  br label %243

238:                                              ; preds = %1
  %239 = load ptr, ptr %4, align 8, !tbaa !9
  %240 = getelementptr inbounds %struct.nco_crcf_s, ptr %239, i32 0, i32 0
  %241 = load i32, ptr %240, align 8, !tbaa !11
  %242 = call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef @.str, i32 noundef 166, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef %241)
  store ptr %242, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %249

243:                                              ; preds = %229, %228, %52
  %244 = load ptr, ptr %4, align 8, !tbaa !9
  %245 = call i32 @nco_crcf_pll_set_bandwidth(ptr noundef %244, float noundef 0x3FB99999A0000000)
  %246 = load ptr, ptr %4, align 8, !tbaa !9
  %247 = call i32 @nco_crcf_reset(ptr noundef %246)
  %248 = load ptr, ptr %4, align 8, !tbaa !9
  store ptr %248, ptr %2, align 8
  store i32 1, ptr %15, align 4
  br label %249

249:                                              ; preds = %243, %238
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %250 = load ptr, ptr %2, align 8
  ret ptr %250
}

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

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

; Function Attrs: nounwind
declare float @sinf(float noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local float @nco_crcf_fp_sin(float noundef) #0

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

declare ptr @liquid_error_config_fl(ptr noundef, i32 noundef, ptr noundef, ...) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @nco_crcf_pll_set_bandwidth(ptr noundef, float noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @nco_crcf_reset(ptr noundef) #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nounwind }
attributes #6 = { 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 = !{!"nco_crcf_s", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !6, i64 36, !10, i64 40, !10, i64 48, !6, i64 56, !13, i64 60, !13, i64 64}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !10, i64 24}
!15 = !{!12, !10, i64 40}
!16 = !{!12, !10, i64 48}
!17 = !{!12, !10, i64 16}
!18 = !{!13, !13, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !13, i64 0}
!22 = !{!"vco_tab_e_s", !13, i64 0, !13, i64 4}
!23 = !{!22, !13, i64 4}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !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.vco_tab_e_s = type { float, float }

@.str = external hidden unnamed_addr constant [78 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @nco_crcf_create(i32 noundef %0) local_unnamed_addr #0 {
  %2 = tail call noalias dereferenceable_or_null(72) ptr @malloc(i64 noundef 72) #5
  store i32 %0, ptr %2, align 8, !tbaa !5
  switch i32 %0, label %66 [
    i32 0, label %3
    i32 1, label %21
    i32 2, label %63
  ]

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %2, i64 24
  store ptr null, ptr %4, align 8, !tbaa !12
  %5 = getelementptr inbounds i8, ptr %2, i64 40
  %6 = tail call noalias dereferenceable_or_null(4096) ptr @malloc(i64 noundef 4096) #5
  %7 = getelementptr inbounds i8, ptr %2, i64 16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  store ptr %6, ptr %7, align 8, !tbaa !13
  br label %8

8:                                                ; preds = %8, %3
  %indvars.iv87 = phi i64 [ 0, %3 ], [ %indvars.iv.next88.1, %8 ]
  %9 = trunc nuw nsw i64 %indvars.iv87 to i32
  %10 = uitofp nneg i32 %9 to float
  %11 = fmul float %10, 0x401921FB60000000
  %12 = fmul float %11, 0x3F50000000000000
  %13 = tail call float @sinf(float noundef %12) #6
  %14 = getelementptr inbounds float, ptr %6, i64 %indvars.iv87
  store float %13, ptr %14, align 4, !tbaa !14
  %indvars.iv.next88 = or disjoint i64 %indvars.iv87, 1
  %15 = trunc nuw nsw i64 %indvars.iv.next88 to i32
  %16 = uitofp nneg i32 %15 to float
  %17 = fmul float %16, 0x401921FB60000000
  %18 = fmul float %17, 0x3F50000000000000
  %19 = tail call float @sinf(float noundef %18) #6
  %20 = getelementptr inbounds float, ptr %6, i64 %indvars.iv.next88
  store float %19, ptr %20, align 4, !tbaa !14
  %indvars.iv.next88.1 = add nuw nsw i64 %indvars.iv87, 2
  %exitcond90.not.1 = icmp eq i64 %indvars.iv.next88.1, 1024
  br i1 %exitcond90.not.1, label %.loopexit, label %8, !llvm.loop !15

21:                                               ; preds = %1
  %22 = getelementptr inbounds i8, ptr %2, i64 16
  store ptr null, ptr %22, align 8, !tbaa !13
  %23 = getelementptr inbounds i8, ptr %2, i64 40
  %24 = tail call noalias dereferenceable_or_null(8192) ptr @malloc(i64 noundef 8192) #5
  %25 = getelementptr inbounds i8, ptr %2, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %23, i8 0, i64 16, i1 false)
  store ptr %24, ptr %25, align 8, !tbaa !12
  br label %26

26:                                               ; preds = %21, %26
  %indvars.iv = phi i64 [ 0, %21 ], [ %indvars.iv.next, %26 ]
  %.07077 = phi i32 [ 0, %21 ], [ %29, %26 ]
  %27 = uitofp nneg i32 %.07077 to float
  %28 = tail call float @nco_crcf_fp_sin(float noundef %27)
  %29 = add nuw nsw i32 %.07077, 4194303
  %30 = uitofp nneg i32 %29 to float
  %31 = tail call float @nco_crcf_fp_sin(float noundef %30)
  %32 = fsub float %31, %28
  %33 = fdiv float %32, 0x414FFFFF80000000
  %34 = getelementptr inbounds %struct.vco_tab_e_s, ptr %24, i64 %indvars.iv
  store float %28, ptr %34, align 4, !tbaa !17
  %35 = getelementptr inbounds %struct.vco_tab_e_s, ptr %24, i64 %indvars.iv, i32 1
  store float %33, ptr %35, align 4, !tbaa !19
  %36 = or disjoint i64 %indvars.iv, 512
  %37 = getelementptr inbounds %struct.vco_tab_e_s, ptr %24, i64 %36
  %38 = insertelement <2 x float> poison, float %28, i64 0
  %39 = insertelement <2 x float> %38, float %33, i64 1
  %40 = fneg <2 x float> %39
  store <2 x float> %40, ptr %37, align 4, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond.not, label %41, label %26, !llvm.loop !20

41:                                               ; preds = %26
  %42 = getelementptr inbounds i8, ptr %24, i64 2048
  store float 1.000000e+00, ptr %42, align 4, !tbaa !17
  %43 = getelementptr inbounds i8, ptr %24, i64 2044
  %44 = load float, ptr %43, align 4, !tbaa !19
  %45 = fneg float %44
  %46 = getelementptr inbounds i8, ptr %24, i64 2052
  store float %45, ptr %46, align 4, !tbaa !19
  %47 = getelementptr inbounds i8, ptr %24, i64 6144
  store float -1.000000e+00, ptr %47, align 4, !tbaa !17
  %48 = getelementptr inbounds i8, ptr %24, i64 6148
  store float %44, ptr %48, align 4, !tbaa !19
  br label %49

49:                                               ; preds = %41, %49
  %indvars.iv82 = phi i64 [ 1, %41 ], [ %indvars.iv.next83, %49 ]
  %50 = or disjoint i64 %indvars.iv82, 256
  %51 = sub nuw nsw i64 256, %indvars.iv82
  %52 = getelementptr inbounds %struct.vco_tab_e_s, ptr %24, i64 %51
  %53 = load float, ptr %52, align 4, !tbaa !17
  %54 = getelementptr i8, ptr %52, i64 -4
  %55 = load float, ptr %54, align 4, !tbaa !19
  %56 = getelementptr inbounds %struct.vco_tab_e_s, ptr %24, i64 %50
  store float %53, ptr %56, align 4, !tbaa !17
  %57 = fneg float %55
  %58 = getelementptr inbounds %struct.vco_tab_e_s, ptr %24, i64 %50, i32 1
  store float %57, ptr %58, align 4, !tbaa !19
  %59 = fneg float %53
  %60 = or i64 %indvars.iv82, 768
  %61 = getelementptr inbounds %struct.vco_tab_e_s, ptr %24, i64 %60
  store float %59, ptr %61, align 4, !tbaa !17
  %62 = getelementptr inbounds %struct.vco_tab_e_s, ptr %24, i64 %60, i32 1
  store float %55, ptr %62, align 4, !tbaa !19
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next83, 256
  br i1 %exitcond86.not, label %.loopexit, label %49, !llvm.loop !21

63:                                               ; preds = %1
  %64 = getelementptr inbounds i8, ptr %2, i64 16
  %65 = getelementptr inbounds i8, ptr %2, i64 40
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %64, i8 0, i64 16, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %65, i8 0, i64 16, i1 false)
  br label %.loopexit

66:                                               ; preds = %1
  %67 = tail call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef nonnull @.str, i32 noundef 166, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef %0) #6
  br label %70

.loopexit:                                        ; preds = %49, %8, %63
  %68 = tail call i32 @nco_crcf_pll_set_bandwidth(ptr noundef nonnull %2, float noundef 0x3FB99999A0000000)
  %69 = tail call i32 @nco_crcf_reset(ptr noundef nonnull %2)
  br label %70

70:                                               ; preds = %.loopexit, %66
  %.0 = phi ptr [ %67, %66 ], [ %2, %.loopexit ]
  ret ptr %.0
}

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @nco_crcf_fp_sin(float noundef) local_unnamed_addr #0

declare ptr @liquid_error_config_fl(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @nco_crcf_pll_set_bandwidth(ptr noundef, float noundef) local_unnamed_addr #0

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind allocsize(0) }
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, !7, i64 0}
!6 = !{!"nco_crcf_s", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !10, i64 40, !10, i64 48, !7, i64 56, !11, i64 60, !11, 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 = !{!"float", !8, i64 0}
!12 = !{!6, !10, i64 24}
!13 = !{!6, !10, i64 16}
!14 = !{!11, !11, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !11, i64 0}
!18 = !{!"vco_tab_e_s", !11, i64 0, !11, i64 4}
!19 = !{!18, !11, i64 4}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}


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