; LLVM IR from jgaeddert/liquid-dsp :: src/filter/src (firdespm)

; 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.firdespm_s = type { i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, ptr, i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [80 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [64 x i8], align 1

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

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

declare i32 @liquid_error_fl(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @firdespm_compute_taps(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call i32 @firdespm_compute_interp(ptr noundef %18)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.firdespm_s, ptr %20, i32 0, i32 3
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.firdespm_s, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !13
  %26 = sub i32 %22, %25
  %27 = add i32 %26, 1
  store i32 %27, ptr %7, align 4, !tbaa !14
  %28 = load i32, ptr %7, align 4, !tbaa !14
  %29 = zext i32 %28 to i64
  %30 = call ptr @llvm.stacksave.p0()
  store ptr %30, ptr %8, align 8
  %31 = alloca double, i64 %29, align 16
  store i64 %29, ptr %9, align 8
  store i32 0, ptr %6, align 4, !tbaa !14
  br label %32

32:                                               ; preds = %124, %2
  %33 = load i32, ptr %6, align 4, !tbaa !14
  %34 = load i32, ptr %7, align 4, !tbaa !14
  %35 = icmp ult i32 %33, %34
  br i1 %35, label %36, label %127

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %37 = load i32, ptr %6, align 4, !tbaa !14
  %38 = uitofp i32 %37 to double
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.firdespm_s, ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !15
  %42 = uitofp i32 %41 to double
  %43 = fdiv double %38, %42
  store double %43, ptr %10, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %44 = load double, ptr %10, align 8, !tbaa !16
  %45 = fmul double 0x401921FB54442D18, %44
  %46 = call double @cos(double noundef %45) #6
  store double %46, ptr %11, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.firdespm_s, ptr %47, i32 0, i32 16
  %49 = load ptr, ptr %48, align 8, !tbaa !17
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.firdespm_s, ptr %50, i32 0, i32 18
  %52 = load ptr, ptr %51, align 8, !tbaa !18
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.firdespm_s, ptr %53, i32 0, i32 17
  %55 = load ptr, ptr %54, align 8, !tbaa !19
  %56 = load double, ptr %11, align 8, !tbaa !16
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.firdespm_s, ptr %57, i32 0, i32 3
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = add i32 %59, 1
  %61 = call double @poly_val_lagrange_barycentric(ptr noundef %49, ptr noundef %52, ptr noundef %55, double noundef %56, i32 noundef %60)
  store double %61, ptr %12, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store double 1.000000e+00, ptr %13, align 8, !tbaa !16
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.firdespm_s, ptr %62, i32 0, i32 7
  %64 = load i32, ptr %63, align 4, !tbaa !20
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %72

66:                                               ; preds = %36
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.firdespm_s, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !13
  %70 = icmp eq i32 %69, 1
  br i1 %70, label %71, label %72

71:                                               ; preds = %66
  store double 1.000000e+00, ptr %13, align 8, !tbaa !16
  br label %117

72:                                               ; preds = %66, %36
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.firdespm_s, ptr %73, i32 0, i32 7
  %75 = load i32, ptr %74, align 4, !tbaa !20
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %92

77:                                               ; preds = %72
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.firdespm_s, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 4, !tbaa !13
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %92

82:                                               ; preds = %77
  %83 = load i32, ptr %6, align 4, !tbaa !14
  %84 = uitofp i32 %83 to double
  %85 = fmul double 0x400921FB54442D18, %84
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.firdespm_s, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !15
  %89 = uitofp i32 %88 to double
  %90 = fdiv double %85, %89
  %91 = call double @cos(double noundef %90) #6
  store double %91, ptr %13, align 8, !tbaa !16
  br label %116

92:                                               ; preds = %77, %72
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.firdespm_s, ptr %93, i32 0, i32 7
  %95 = load i32, ptr %94, align 4, !tbaa !20
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %103

97:                                               ; preds = %92
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.firdespm_s, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !13
  %101 = icmp eq i32 %100, 1
  br i1 %101, label %102, label %103

102:                                              ; preds = %97
  br label %115

103:                                              ; preds = %97, %92
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.firdespm_s, ptr %104, i32 0, i32 7
  %106 = load i32, ptr %105, align 4, !tbaa !20
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %114

108:                                              ; preds = %103
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.firdespm_s, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !13
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %108
  br label %114

114:                                              ; preds = %113, %108, %103
  br label %115

115:                                              ; preds = %114, %102
  br label %116

116:                                              ; preds = %115, %82
  br label %117

117:                                              ; preds = %116, %71
  %118 = load double, ptr %12, align 8, !tbaa !16
  %119 = load double, ptr %13, align 8, !tbaa !16
  %120 = fmul double %118, %119
  %121 = load i32, ptr %6, align 4, !tbaa !14
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds double, ptr %31, i64 %122
  store double %120, ptr %123, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %124

124:                                              ; preds = %117
  %125 = load i32, ptr %6, align 4, !tbaa !14
  %126 = add i32 %125, 1
  store i32 %126, ptr %6, align 4, !tbaa !14
  br label %32, !llvm.loop !21

127:                                              ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.firdespm_s, ptr %128, i32 0, i32 7
  %130 = load i32, ptr %129, align 4, !tbaa !20
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %198

132:                                              ; preds = %127
  store i32 0, ptr %6, align 4, !tbaa !14
  br label %133

133:                                              ; preds = %194, %132
  %134 = load i32, ptr %6, align 4, !tbaa !14
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.firdespm_s, ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 8, !tbaa !15
  %138 = icmp ult i32 %134, %137
  br i1 %138, label %139, label %197

139:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %140 = getelementptr inbounds double, ptr %31, i64 0
  %141 = load double, ptr %140, align 16, !tbaa !16
  store double %141, ptr %15, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %142 = load i32, ptr %6, align 4, !tbaa !14
  %143 = uitofp i32 %142 to double
  %144 = load i32, ptr %7, align 4, !tbaa !14
  %145 = sub i32 %144, 1
  %146 = uitofp i32 %145 to double
  %147 = fsub double %143, %146
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.firdespm_s, ptr %148, i32 0, i32 1
  %150 = load i32, ptr %149, align 4, !tbaa !13
  %151 = sub i32 1, %150
  %152 = uitofp i32 %151 to double
  %153 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %152, double %147)
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.firdespm_s, ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 8, !tbaa !15
  %157 = uitofp i32 %156 to double
  %158 = fdiv double %153, %157
  store double %158, ptr %16, align 8, !tbaa !16
  store i32 1, ptr %14, align 4, !tbaa !14
  br label %159

159:                                              ; preds = %179, %139
  %160 = load i32, ptr %14, align 4, !tbaa !14
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.firdespm_s, ptr %161, i32 0, i32 3
  %163 = load i32, ptr %162, align 4, !tbaa !9
  %164 = icmp ult i32 %160, %163
  br i1 %164, label %165, label %182

165:                                              ; preds = %159
  %166 = load i32, ptr %14, align 4, !tbaa !14
  %167 = zext i32 %166 to i64
  %168 = getelementptr inbounds double, ptr %31, i64 %167
  %169 = load double, ptr %168, align 8, !tbaa !16
  %170 = fmul double 2.000000e+00, %169
  %171 = load double, ptr %16, align 8, !tbaa !16
  %172 = fmul double 0x401921FB54442D18, %171
  %173 = load i32, ptr %14, align 4, !tbaa !14
  %174 = uitofp i32 %173 to double
  %175 = fmul double %172, %174
  %176 = call double @cos(double noundef %175) #6
  %177 = load double, ptr %15, align 8, !tbaa !16
  %178 = call double @llvm.fmuladd.f64(double %170, double %176, double %177)
  store double %178, ptr %15, align 8, !tbaa !16
  br label %179

179:                                              ; preds = %165
  %180 = load i32, ptr %14, align 4, !tbaa !14
  %181 = add i32 %180, 1
  store i32 %181, ptr %14, align 4, !tbaa !14
  br label %159, !llvm.loop !23

182:                                              ; preds = %159
  %183 = load double, ptr %15, align 8, !tbaa !16
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.firdespm_s, ptr %184, i32 0, i32 0
  %186 = load i32, ptr %185, align 8, !tbaa !15
  %187 = uitofp i32 %186 to double
  %188 = fdiv double %183, %187
  %189 = fptrunc double %188 to float
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = load i32, ptr %6, align 4, !tbaa !14
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds float, ptr %190, i64 %192
  store float %189, ptr %193, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %194

194:                                              ; preds = %182
  %195 = load i32, ptr %6, align 4, !tbaa !14
  %196 = add i32 %195, 1
  store i32 %196, ptr %6, align 4, !tbaa !14
  br label %133, !llvm.loop !26

197:                                              ; preds = %133
  br label %224

198:                                              ; preds = %127
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.firdespm_s, ptr %199, i32 0, i32 7
  %201 = load i32, ptr %200, align 4, !tbaa !20
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %210

203:                                              ; preds = %198
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.firdespm_s, ptr %204, i32 0, i32 1
  %206 = load i32, ptr %205, align 4, !tbaa !13
  %207 = icmp eq i32 %206, 1
  br i1 %207, label %208, label %210

208:                                              ; preds = %203
  %209 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 1, ptr noundef @.str, i32 noundef 941, ptr noundef @.str.21)
  store i32 %209, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %225

210:                                              ; preds = %203, %198
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.firdespm_s, ptr %211, i32 0, i32 7
  %213 = load i32, ptr %212, align 4, !tbaa !20
  %214 = icmp ne i32 %213, 0
  br i1 %214, label %215, label %222

215:                                              ; preds = %210
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.firdespm_s, ptr %216, i32 0, i32 1
  %218 = load i32, ptr %217, align 4, !tbaa !13
  %219 = icmp eq i32 %218, 0
  br i1 %219, label %220, label %222

220:                                              ; preds = %215
  %221 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 1, ptr noundef @.str, i32 noundef 944, ptr noundef @.str.21)
  store i32 %221, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %225

222:                                              ; preds = %215, %210
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223, %197
  store i32 0, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %225

225:                                              ; preds = %224, %220, %208
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %226 = load ptr, ptr %8, align 8
  call void @llvm.stackrestore.p0(ptr %226)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %227 = load i32, ptr %3, align 4
  ret i32 %227
}

; Function Attrs: nounwind
declare double @cos(double noundef) #4

declare double @poly_val_lagrange_barycentric(ptr noundef, ptr noundef, ptr noundef, double noundef, i32 noundef) #1

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 speculatable willreturn memory(none) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 nosync nounwind willreturn }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 12}
!10 = !{!"firdespm_s", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !6, i64 128, !11, i64 136, !6, i64 144, !6, i64 152}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 0}
!16 = !{!12, !12, i64 0}
!17 = !{!10, !6, i64 96}
!18 = !{!10, !6, i64 112}
!19 = !{!10, !6, i64 104}
!20 = !{!10, !11, i64 28}
!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"

@.str = external hidden unnamed_addr constant [80 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [64 x i8], align 1

declare i32 @liquid_error_fl(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @firdespm_compute_taps(ptr noundef %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #2 {
  %3 = tail call i32 @firdespm_compute_interp(ptr noundef %0)
  %4 = getelementptr inbounds i8, ptr %0, i64 12
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 4, !tbaa !12
  %8 = sub i32 %5, %7
  %9 = add i32 %8, 1
  %10 = zext i32 %9 to i64
  %11 = alloca double, i64 %10, align 16
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 96
  %13 = getelementptr inbounds i8, ptr %0, i64 112
  %14 = getelementptr inbounds i8, ptr %0, i64 104
  %15 = getelementptr inbounds i8, ptr %0, i64 28
  br label %16

16:                                               ; preds = %.lr.ph, %40
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %40 ]
  %17 = trunc nuw i64 %indvars.iv to i32
  %18 = uitofp i32 %17 to double
  %19 = load i32, ptr %0, align 8, !tbaa !13
  %20 = uitofp i32 %19 to double
  %21 = fdiv double %18, %20
  %22 = fmul double %21, 0x401921FB54442D18
  %23 = tail call double @cos(double noundef %22) #4
  %24 = load ptr, ptr %12, align 8, !tbaa !14
  %25 = load ptr, ptr %13, align 8, !tbaa !15
  %26 = load ptr, ptr %14, align 8, !tbaa !16
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = add i32 %27, 1
  %29 = tail call double @poly_val_lagrange_barycentric(ptr noundef %24, ptr noundef %25, ptr noundef %26, double noundef %23, i32 noundef %28) #4
  %30 = load i32, ptr %15, align 4, !tbaa !17
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %40

32:                                               ; preds = %16
  %33 = load i32, ptr %6, align 4, !tbaa !12
  %cond = icmp eq i32 %33, 0
  br i1 %cond, label %34, label %40

34:                                               ; preds = %32
  %35 = fmul double %18, 0x400921FB54442D18
  %36 = load i32, ptr %0, align 8, !tbaa !13
  %37 = uitofp i32 %36 to double
  %38 = fdiv double %35, %37
  %39 = tail call double @cos(double noundef %38) #4
  br label %40

40:                                               ; preds = %32, %16, %34
  %.050 = phi double [ %39, %34 ], [ 1.000000e+00, %16 ], [ 1.000000e+00, %32 ]
  %41 = fmul double %29, %.050
  %42 = getelementptr inbounds double, ptr %11, i64 %indvars.iv
  store double %41, ptr %42, align 8, !tbaa !18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %10
  br i1 %exitcond.not, label %._crit_edge, label %16, !llvm.loop !19

._crit_edge:                                      ; preds = %40, %2
  %43 = getelementptr inbounds i8, ptr %0, i64 28
  %44 = load i32, ptr %43, align 4, !tbaa !17
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %.preheader, label %91

.preheader:                                       ; preds = %._crit_edge
  %46 = load i32, ptr %0, align 8, !tbaa !13
  %.not61 = icmp eq i32 %46, 0
  br i1 %.not61, label %.loopexit, label %.lr.ph60

.lr.ph60:                                         ; preds = %.preheader
  %47 = load double, ptr %11, align 16, !tbaa !18
  %48 = uitofp i32 %8 to double
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = icmp ugt i32 %49, 1
  br i1 %50, label %.lr.ph60.split, label %.lr.ph60.split.us

.lr.ph60.split.us:                                ; preds = %.lr.ph60
  %51 = uitofp i32 %46 to double
  %52 = fdiv double %47, %51
  %53 = fptrunc double %52 to float
  %wide.trip.count67 = zext i32 %46 to i64
  %min.iters.check = icmp ult i32 %46, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph60.split.us
  %n.vec = and i64 %wide.trip.count67, 4294967288
  %broadcast.splatinsert = insertelement <4 x float> poison, float %53, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %54 = getelementptr inbounds float, ptr %1, i64 %index
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  store <4 x float> %broadcast.splat, ptr %54, align 4, !tbaa !21
  store <4 x float> %broadcast.splat, ptr %55, align 4, !tbaa !21
  %index.next = add nuw i64 %index, 8
  %56 = icmp eq i64 %index.next, %n.vec
  br i1 %56, label %middle.block, label %vector.body, !llvm.loop !23

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count67
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph60.split.us
  %indvars.iv64.ph = phi i64 [ 0, %.lr.ph60.split.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %scalar.ph ], [ %indvars.iv64.ph, %scalar.ph.preheader ]
  %57 = getelementptr inbounds float, ptr %1, i64 %indvars.iv64
  store float %53, ptr %57, align 4, !tbaa !21
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count67
  br i1 %exitcond68.not, label %.loopexit, label %scalar.ph, !llvm.loop !26

.lr.ph60.split:                                   ; preds = %.lr.ph60, %._crit_edge58
  %58 = phi i32 [ %83, %._crit_edge58 ], [ %46, %.lr.ph60 ]
  %59 = phi i32 [ %84, %._crit_edge58 ], [ %49, %.lr.ph60 ]
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %._crit_edge58 ], [ 0, %.lr.ph60 ]
  %60 = icmp ugt i32 %59, 1
  br i1 %60, label %.lr.ph57, label %._crit_edge58

.lr.ph57:                                         ; preds = %.lr.ph60.split
  %61 = load i32, ptr %6, align 4, !tbaa !12
  %62 = sub i32 1, %61
  %63 = uitofp i32 %62 to double
  %64 = trunc nuw i64 %indvars.iv72 to i32
  %65 = uitofp i32 %64 to double
  %66 = fsub double %65, %48
  %67 = tail call double @llvm.fmuladd.f64(double %63, double 5.000000e-01, double %66)
  %68 = uitofp i32 %58 to double
  %69 = fdiv double %67, %68
  %70 = fmul double %69, 0x401921FB54442D18
  br label %71

71:                                               ; preds = %.lr.ph57, %71
  %indvars.iv69 = phi i64 [ 1, %.lr.ph57 ], [ %indvars.iv.next70, %71 ]
  %.04855 = phi double [ %47, %.lr.ph57 ], [ %79, %71 ]
  %72 = getelementptr inbounds double, ptr %11, i64 %indvars.iv69
  %73 = load double, ptr %72, align 8, !tbaa !18
  %74 = fmul double %73, 2.000000e+00
  %75 = trunc nuw i64 %indvars.iv69 to i32
  %76 = uitofp i32 %75 to double
  %77 = fmul double %70, %76
  %78 = tail call double @cos(double noundef %77) #4
  %79 = tail call double @llvm.fmuladd.f64(double %74, double %78, double %.04855)
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = zext i32 %80 to i64
  %82 = icmp ult i64 %indvars.iv.next70, %81
  br i1 %82, label %71, label %._crit_edge58.loopexit, !llvm.loop !27

._crit_edge58.loopexit:                           ; preds = %71
  %.pre = load i32, ptr %0, align 8, !tbaa !13
  br label %._crit_edge58

._crit_edge58:                                    ; preds = %._crit_edge58.loopexit, %.lr.ph60.split
  %83 = phi i32 [ %58, %.lr.ph60.split ], [ %.pre, %._crit_edge58.loopexit ]
  %84 = phi i32 [ %59, %.lr.ph60.split ], [ %80, %._crit_edge58.loopexit ]
  %.048.lcssa = phi double [ %47, %.lr.ph60.split ], [ %79, %._crit_edge58.loopexit ]
  %85 = uitofp i32 %83 to double
  %86 = fdiv double %.048.lcssa, %85
  %87 = fptrunc double %86 to float
  %88 = getelementptr inbounds float, ptr %1, i64 %indvars.iv72
  store float %87, ptr %88, align 4, !tbaa !21
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %89 = zext i32 %83 to i64
  %90 = icmp ult i64 %indvars.iv.next73, %89
  br i1 %90, label %.lr.ph60.split, label %.loopexit, !llvm.loop !28

91:                                               ; preds = %._crit_edge
  %92 = load i32, ptr %6, align 4, !tbaa !12
  switch i32 %92, label %.loopexit [
    i32 1, label %.loopexit.sink.split
    i32 0, label %93
  ]

93:                                               ; preds = %91
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %91, %93
  %.sink = phi i32 [ 944, %93 ], [ 941, %91 ]
  %94 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 1, ptr noundef nonnull @.str, i32 noundef %.sink, ptr noundef nonnull @.str.21) #4
  br label %.loopexit

.loopexit:                                        ; preds = %scalar.ph, %._crit_edge58, %middle.block, %.loopexit.sink.split, %.preheader, %91
  %.0 = phi i32 [ 0, %91 ], [ 0, %.preheader ], [ %94, %.loopexit.sink.split ], [ 0, %middle.block ], [ 0, %._crit_edge58 ], [ 0, %scalar.ph ]
  ret i32 %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3

declare double @poly_val_lagrange_barycentric(ptr noundef, ptr noundef, ptr noundef, double noundef, i32 noundef) local_unnamed_addr #0

attributes #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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 12}
!6 = !{!"firdespm_s", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !11, i64 120, !10, i64 128, !7, i64 136, !10, i64 144, !10, i64 152}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !10, i64 96}
!15 = !{!6, !10, i64 112}
!16 = !{!6, !10, i64 104}
!17 = !{!6, !7, i64 28}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !22, i64 0}
!22 = !{!"float", !8, i64 0}
!23 = distinct !{!23, !20, !24, !25}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !20, !25, !24}
!27 = distinct !{!27, !20}
!28 = distinct !{!28, !20, !29}
!29 = !{!"llvm.loop.unswitch.partial.disable"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass