; LLVM IR from glaretechnologies/substrata :: opus/opus-1.3.1/silk (process_NLSFs)

; 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.silk_encoder_state = type { [2 x i32], i32, i32, %struct.silk_LP_state, %struct.silk_VAD_state, %struct.silk_nsq_state, [16 x i16], i32, i32, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, [4 x i32], i32, i32, [3 x i8], i8, [3 x i32], %struct.SideInfoIndices, [320 x i8], i32, [322 x i16], i32, i32, i32, i32, i32, i32, i32, i32, i16, %struct._silk_resampler_state_struct, i32, i32, i32, i32, i32, i32, [3 x %struct.SideInfoIndices], [3 x [320 x i8]] }
%struct.silk_LP_state = type { [2 x i32], i32, i32, i32 }
%struct.silk_VAD_state = type { [2 x i32], [2 x i32], [2 x i32], [4 x i32], [4 x i32], i16, [4 x i32], [4 x i32], [4 x i32], i32 }
%struct.silk_nsq_state = type { [640 x i16], [640 x i32], [96 x i32], [24 x i32], i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SideInfoIndices = type { [4 x i8], [4 x i8], [17 x i8], i16, i8, i8, i8, i8, i8, i8, i8 }
%struct._silk_resampler_state_struct = type { [6 x i32], %union.anon, [48 x i16], i32, i32, i32, i32, i32, i32, i32, i32, ptr }
%union.anon = type { [36 x i32] }

; Function Attrs: nounwind uwtable
define dso_local void @silk_process_NLSFs(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i16, align 2
  %13 = alloca [16 x i16], align 16
  %14 = alloca [16 x i16], align 16
  %15 = alloca [16 x i16], align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.silk_encoder_state, ptr %16, i32 0, i32 7
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = trunc i32 %18 to i16
  %20 = sext i16 %19 to i64
  %21 = mul nsw i64 -268434, %20
  %22 = ashr i64 %21, 16
  %23 = add nsw i64 3146, %22
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %11, align 4, !tbaa !18
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.silk_encoder_state, ptr %25, i32 0, i32 20
  %27 = load i32, ptr %26, align 4, !tbaa !19
  %28 = icmp eq i32 %27, 2
  br i1 %28, label %29, label %34

29:                                               ; preds = %4
  %30 = load i32, ptr %11, align 4, !tbaa !18
  %31 = load i32, ptr %11, align 4, !tbaa !18
  %32 = ashr i32 %31, 1
  %33 = add nsw i32 %30, %32
  store i32 %33, ptr %11, align 4, !tbaa !18
  br label %34

34:                                               ; preds = %29, %4
  %35 = getelementptr inbounds [16 x i16], ptr %14, i64 0, i64 0
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.silk_encoder_state, ptr %37, i32 0, i32 35
  %39 = load i32, ptr %38, align 8, !tbaa !20
  call void @silk_NLSF_VQ_weights_laroia(ptr noundef %35, ptr noundef %36, i32 noundef %39)
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.silk_encoder_state, ptr %40, i32 0, i32 33
  %42 = load i32, ptr %41, align 8, !tbaa !21
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %51

44:                                               ; preds = %34
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.silk_encoder_state, ptr %45, i32 0, i32 55
  %47 = getelementptr inbounds %struct.SideInfoIndices, ptr %46, i32 0, i32 7
  %48 = load i8, ptr %47, align 1, !tbaa !22
  %49 = sext i8 %48 to i32
  %50 = icmp slt i32 %49, 4
  br label %51

51:                                               ; preds = %44, %34
  %52 = phi i1 [ false, %34 ], [ %50, %44 ]
  %53 = zext i1 %52 to i32
  store i32 %53, ptr %10, align 4, !tbaa !18
  %54 = load i32, ptr %10, align 4, !tbaa !18
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %119

56:                                               ; preds = %51
  %57 = getelementptr inbounds [16 x i16], ptr %13, i64 0, i64 0
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.silk_encoder_state, ptr %60, i32 0, i32 55
  %62 = getelementptr inbounds %struct.SideInfoIndices, ptr %61, i32 0, i32 7
  %63 = load i8, ptr %62, align 1, !tbaa !22
  %64 = sext i8 %63 to i32
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.silk_encoder_state, ptr %65, i32 0, i32 35
  %67 = load i32, ptr %66, align 8, !tbaa !20
  call void @silk_interpolate(ptr noundef %57, ptr noundef %58, ptr noundef %59, i32 noundef %64, i32 noundef %67)
  %68 = getelementptr inbounds [16 x i16], ptr %15, i64 0, i64 0
  %69 = getelementptr inbounds [16 x i16], ptr %13, i64 0, i64 0
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.silk_encoder_state, ptr %70, i32 0, i32 35
  %72 = load i32, ptr %71, align 8, !tbaa !20
  call void @silk_NLSF_VQ_weights_laroia(ptr noundef %68, ptr noundef %69, i32 noundef %72)
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.silk_encoder_state, ptr %73, i32 0, i32 55
  %75 = getelementptr inbounds %struct.SideInfoIndices, ptr %74, i32 0, i32 7
  %76 = load i8, ptr %75, align 1, !tbaa !22
  %77 = sext i8 %76 to i16
  %78 = sext i16 %77 to i32
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.silk_encoder_state, ptr %79, i32 0, i32 55
  %81 = getelementptr inbounds %struct.SideInfoIndices, ptr %80, i32 0, i32 7
  %82 = load i8, ptr %81, align 1, !tbaa !22
  %83 = sext i8 %82 to i16
  %84 = sext i16 %83 to i32
  %85 = mul nsw i32 %78, %84
  %86 = shl i32 %85, 11
  %87 = trunc i32 %86 to i16
  store i16 %87, ptr %12, align 2, !tbaa !23
  store i32 0, ptr %9, align 4, !tbaa !18
  br label %88

88:                                               ; preds = %115, %56
  %89 = load i32, ptr %9, align 4, !tbaa !18
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.silk_encoder_state, ptr %90, i32 0, i32 35
  %92 = load i32, ptr %91, align 8, !tbaa !20
  %93 = icmp slt i32 %89, %92
  br i1 %93, label %94, label %118

94:                                               ; preds = %88
  %95 = load i32, ptr %9, align 4, !tbaa !18
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [16 x i16], ptr %14, i64 0, i64 %96
  %98 = load i16, ptr %97, align 2, !tbaa !23
  %99 = sext i16 %98 to i32
  %100 = ashr i32 %99, 1
  %101 = load i32, ptr %9, align 4, !tbaa !18
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [16 x i16], ptr %15, i64 0, i64 %102
  %104 = load i16, ptr %103, align 2, !tbaa !23
  %105 = sext i16 %104 to i32
  %106 = load i16, ptr %12, align 2, !tbaa !23
  %107 = sext i16 %106 to i32
  %108 = mul nsw i32 %105, %107
  %109 = ashr i32 %108, 16
  %110 = add nsw i32 %100, %109
  %111 = trunc i32 %110 to i16
  %112 = load i32, ptr %9, align 4, !tbaa !18
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [16 x i16], ptr %14, i64 0, i64 %113
  store i16 %111, ptr %114, align 2, !tbaa !23
  br label %115

115:                                              ; preds = %94
  %116 = load i32, ptr %9, align 4, !tbaa !18
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %9, align 4, !tbaa !18
  br label %88, !llvm.loop !24

118:                                              ; preds = %88
  br label %119

119:                                              ; preds = %118, %51
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.silk_encoder_state, ptr %120, i32 0, i32 55
  %122 = getelementptr inbounds %struct.SideInfoIndices, ptr %121, i32 0, i32 2
  %123 = getelementptr inbounds [17 x i8], ptr %122, i64 0, i64 0
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.silk_encoder_state, ptr %125, i32 0, i32 48
  %127 = load ptr, ptr %126, align 8, !tbaa !26
  %128 = getelementptr inbounds [16 x i16], ptr %14, i64 0, i64 0
  %129 = load i32, ptr %11, align 4, !tbaa !18
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.silk_encoder_state, ptr %130, i32 0, i32 40
  %132 = load i32, ptr %131, align 4, !tbaa !27
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.silk_encoder_state, ptr %133, i32 0, i32 55
  %135 = getelementptr inbounds %struct.SideInfoIndices, ptr %134, i32 0, i32 5
  %136 = load i8, ptr %135, align 1, !tbaa !28
  %137 = sext i8 %136 to i32
  %138 = call i32 @silk_NLSF_encode(ptr noundef %123, ptr noundef %124, ptr noundef %127, ptr noundef %128, i32 noundef %129, i32 noundef %132, i32 noundef %137)
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = getelementptr inbounds [16 x i16], ptr %139, i64 1
  %141 = getelementptr inbounds [16 x i16], ptr %140, i64 0, i64 0
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.silk_encoder_state, ptr %143, i32 0, i32 35
  %145 = load i32, ptr %144, align 8, !tbaa !20
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.silk_encoder_state, ptr %146, i32 0, i32 57
  %148 = load i32, ptr %147, align 4, !tbaa !29
  call void @silk_NLSF2A(ptr noundef %141, ptr noundef %142, i32 noundef %145, i32 noundef %148)
  %149 = load i32, ptr %10, align 4, !tbaa !18
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %173

151:                                              ; preds = %119
  %152 = getelementptr inbounds [16 x i16], ptr %13, i64 0, i64 0
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.silk_encoder_state, ptr %155, i32 0, i32 55
  %157 = getelementptr inbounds %struct.SideInfoIndices, ptr %156, i32 0, i32 7
  %158 = load i8, ptr %157, align 1, !tbaa !22
  %159 = sext i8 %158 to i32
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.silk_encoder_state, ptr %160, i32 0, i32 35
  %162 = load i32, ptr %161, align 8, !tbaa !20
  call void @silk_interpolate(ptr noundef %152, ptr noundef %153, ptr noundef %154, i32 noundef %159, i32 noundef %162)
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds [16 x i16], ptr %163, i64 0
  %165 = getelementptr inbounds [16 x i16], ptr %164, i64 0, i64 0
  %166 = getelementptr inbounds [16 x i16], ptr %13, i64 0, i64 0
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.silk_encoder_state, ptr %167, i32 0, i32 35
  %169 = load i32, ptr %168, align 8, !tbaa !20
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.silk_encoder_state, ptr %170, i32 0, i32 57
  %172 = load i32, ptr %171, align 4, !tbaa !29
  call void @silk_NLSF2A(ptr noundef %165, ptr noundef %166, i32 noundef %169, i32 noundef %172)
  br label %185

173:                                              ; preds = %119
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = getelementptr inbounds [16 x i16], ptr %174, i64 0
  %176 = getelementptr inbounds [16 x i16], ptr %175, i64 0, i64 0
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = getelementptr inbounds [16 x i16], ptr %177, i64 1
  %179 = getelementptr inbounds [16 x i16], ptr %178, i64 0, i64 0
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.silk_encoder_state, ptr %180, i32 0, i32 35
  %182 = load i32, ptr %181, align 8, !tbaa !20
  %183 = sext i32 %182 to i64
  %184 = mul i64 %183, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %176, ptr align 2 %179, i64 %184, i1 false)
  br label %185

185:                                              ; preds = %173, %151
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

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

declare void @silk_NLSF_VQ_weights_laroia(ptr noundef, ptr noundef, i32 noundef) #2

declare void @silk_interpolate(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

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

declare void @silk_NLSF2A(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

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

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

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 = { "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 nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 4532}
!10 = !{!"", !7, i64 0, !11, i64 8, !11, i64 12, !12, i64 16, !13, i64 36, !15, i64 148, !7, i64 4500, !11, i64 4532, !11, i64 4536, !7, i64 4540, !7, i64 4541, !11, i64 4544, !11, i64 4548, !11, i64 4552, !11, i64 4556, !11, i64 4560, !11, i64 4564, !11, i64 4568, !11, i64 4572, !11, i64 4576, !11, i64 4580, !11, i64 4584, !11, i64 4588, !11, i64 4592, !11, i64 4596, !11, i64 4600, !11, i64 4604, !11, i64 4608, !11, i64 4612, !11, i64 4616, !11, i64 4620, !11, i64 4624, !11, i64 4628, !11, i64 4632, !11, i64 4636, !11, i64 4640, !11, i64 4644, !11, i64 4648, !11, i64 4652, !11, i64 4656, !11, i64 4660, !11, i64 4664, !11, i64 4668, !11, i64 4672, !11, i64 4676, !11, i64 4680, !6, i64 4688, !6, i64 4696, !6, i64 4704, !7, i64 4712, !11, i64 4728, !11, i64 4732, !7, i64 4736, !7, i64 4739, !7, i64 4740, !16, i64 4752, !7, i64 4788, !11, i64 5108, !7, i64 5112, !11, i64 5756, !11, i64 5760, !11, i64 5764, !11, i64 5768, !11, i64 5772, !11, i64 5776, !11, i64 5780, !11, i64 5784, !14, i64 5788, !17, i64 5792, !11, i64 6096, !11, i64 6100, !11, i64 6104, !11, i64 6108, !11, i64 6112, !11, i64 6116, !7, i64 6120, !7, i64 6228}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!13 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 40, !14, i64 56, !7, i64 60, !7, i64 76, !7, i64 92, !11, i64 108}
!14 = !{!"short", !7, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 1280, !7, i64 3840, !7, i64 4224, !11, i64 4320, !11, i64 4324, !11, i64 4328, !11, i64 4332, !11, i64 4336, !11, i64 4340, !11, i64 4344, !11, i64 4348}
!16 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !14, i64 26, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34}
!17 = !{!"_silk_resampler_state_struct", !7, i64 0, !7, i64 24, !7, i64 168, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !11, i64 288, !11, i64 292, !6, i64 296}
!18 = !{!11, !11, i64 0}
!19 = !{!10, !11, i64 4580}
!20 = !{!10, !11, i64 4640}
!21 = !{!10, !11, i64 4632}
!22 = !{!10, !7, i64 4783}
!23 = !{!14, !14, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!10, !6, i64 4704}
!27 = !{!10, !11, i64 4660}
!28 = !{!10, !7, i64 4781}
!29 = !{!10, !11, i64 5108}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
define dso_local void @silk_process_NLSFs(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca [16 x i16], align 16
  %6 = alloca [16 x i16], align 16
  %7 = alloca [16 x i16], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 4532
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = zext i32 %9 to i64
  %sext = shl i64 %10, 48
  %11 = ashr exact i64 %sext, 48
  %12 = mul nsw i64 %11, 281474976442222
  %13 = lshr i64 %12, 16
  %14 = trunc i64 %13 to i32
  %15 = add i32 %14, 3146
  %16 = getelementptr inbounds i8, ptr %0, i64 4580
  %17 = load i32, ptr %16, align 4, !tbaa !17
  %18 = icmp eq i32 %17, 2
  %19 = ashr i32 %15, 1
  %20 = select i1 %18, i32 %19, i32 0
  %.043 = add nsw i32 %20, %15
  %21 = getelementptr inbounds i8, ptr %0, i64 4640
  %22 = load i32, ptr %21, align 8, !tbaa !18
  call void @silk_NLSF_VQ_weights_laroia(ptr noundef nonnull %6, ptr noundef %2, i32 noundef %22) #4
  %23 = getelementptr inbounds i8, ptr %0, i64 4632
  %24 = load i32, ptr %23, align 8, !tbaa !19
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %.thread

26:                                               ; preds = %4
  %27 = getelementptr inbounds i8, ptr %0, i64 4783
  %28 = load i8, ptr %27, align 1, !tbaa !20
  %29 = icmp slt i8 %28, 4
  br i1 %29, label %30, label %.thread

30:                                               ; preds = %26
  %31 = sext i8 %28 to i32
  %32 = load i32, ptr %21, align 8, !tbaa !18
  call void @silk_interpolate(ptr noundef nonnull %5, ptr noundef %3, ptr noundef %2, i32 noundef %31, i32 noundef %32) #4
  %33 = load i32, ptr %21, align 8, !tbaa !18
  call void @silk_NLSF_VQ_weights_laroia(ptr noundef nonnull %7, ptr noundef nonnull %5, i32 noundef %33) #4
  %34 = load i32, ptr %21, align 8, !tbaa !18
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %30
  %36 = load i8, ptr %27, align 1, !tbaa !20
  %37 = sext i8 %36 to i16
  %38 = shl i16 %37, 11
  %39 = mul i16 %38, %37
  %40 = sext i16 %39 to i32
  %wide.trip.count = zext nneg i32 %34 to i64
  %min.iters.check = icmp ult i32 %34, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert = insertelement <8 x i32> poison, i32 %40, i64 0
  %broadcast.splat = shufflevector <8 x i32> %broadcast.splatinsert, <8 x i32> poison, <8 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %41 = getelementptr inbounds [16 x i16], ptr %6, i64 0, i64 %index
  %wide.load = load <8 x i16>, ptr %41, align 16, !tbaa !21
  %42 = ashr <8 x i16> %wide.load, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
  %43 = getelementptr inbounds [16 x i16], ptr %7, i64 0, i64 %index
  %wide.load46 = load <8 x i16>, ptr %43, align 16, !tbaa !21
  %44 = sext <8 x i16> %wide.load46 to <8 x i32>
  %45 = mul nsw <8 x i32> %broadcast.splat, %44
  %46 = lshr <8 x i32> %45, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
  %47 = trunc nuw <8 x i32> %46 to <8 x i16>
  %48 = add <8 x i16> %42, %47
  store <8 x i16> %48, ptr %41, align 16, !tbaa !21
  %index.next = add nuw i64 %index, 8
  %49 = icmp eq i64 %index.next, %n.vec
  br i1 %49, label %middle.block, label %vector.body, !llvm.loop !22

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

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

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %50 = getelementptr inbounds [16 x i16], ptr %6, i64 0, i64 %indvars.iv
  %51 = load i16, ptr %50, align 2, !tbaa !21
  %52 = ashr i16 %51, 1
  %53 = getelementptr inbounds [16 x i16], ptr %7, i64 0, i64 %indvars.iv
  %54 = load i16, ptr %53, align 2, !tbaa !21
  %55 = sext i16 %54 to i32
  %56 = mul nsw i32 %55, %40
  %57 = lshr i32 %56, 16
  %58 = trunc nuw i32 %57 to i16
  %59 = add i16 %52, %58
  store i16 %59, ptr %50, align 2, !tbaa !21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.thread, label %scalar.ph, !llvm.loop !26

.thread:                                          ; preds = %scalar.ph, %middle.block, %30, %4, %26
  %60 = phi i1 [ false, %26 ], [ false, %4 ], [ true, %30 ], [ true, %middle.block ], [ true, %scalar.ph ]
  %61 = getelementptr inbounds i8, ptr %0, i64 4760
  %62 = getelementptr inbounds i8, ptr %0, i64 4704
  %63 = load ptr, ptr %62, align 8, !tbaa !27
  %64 = getelementptr inbounds i8, ptr %0, i64 4660
  %65 = load i32, ptr %64, align 4, !tbaa !28
  %66 = getelementptr inbounds i8, ptr %0, i64 4781
  %67 = load i8, ptr %66, align 1, !tbaa !29
  %68 = sext i8 %67 to i32
  %69 = call i32 @silk_NLSF_encode(ptr noundef nonnull %61, ptr noundef %2, ptr noundef %63, ptr noundef nonnull %6, i32 noundef %.043, i32 noundef %65, i32 noundef %68) #4
  %70 = getelementptr inbounds i8, ptr %1, i64 32
  %71 = load i32, ptr %21, align 8, !tbaa !18
  %72 = getelementptr inbounds i8, ptr %0, i64 5108
  %73 = load i32, ptr %72, align 4, !tbaa !30
  call void @silk_NLSF2A(ptr noundef nonnull %70, ptr noundef %2, i32 noundef %71, i32 noundef %73) #4
  br i1 %60, label %74, label %81

74:                                               ; preds = %.thread
  %75 = getelementptr inbounds i8, ptr %0, i64 4783
  %76 = load i8, ptr %75, align 1, !tbaa !20
  %77 = sext i8 %76 to i32
  %78 = load i32, ptr %21, align 8, !tbaa !18
  call void @silk_interpolate(ptr noundef nonnull %5, ptr noundef %3, ptr noundef %2, i32 noundef %77, i32 noundef %78) #4
  %79 = load i32, ptr %21, align 8, !tbaa !18
  %80 = load i32, ptr %72, align 4, !tbaa !30
  call void @silk_NLSF2A(ptr noundef %1, ptr noundef nonnull %5, i32 noundef %79, i32 noundef %80) #4
  br label %85

81:                                               ; preds = %.thread
  %82 = load i32, ptr %21, align 8, !tbaa !18
  %83 = sext i32 %82 to i64
  %84 = shl nsw i64 %83, 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %1, ptr nonnull align 2 %70, i64 %84, i1 false)
  br label %85

85:                                               ; preds = %81, %74
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  ret void
}

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

declare void @silk_NLSF_VQ_weights_laroia(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @silk_interpolate(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @silk_NLSF_encode(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @silk_NLSF2A(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !9, i64 4532}
!6 = !{!"", !7, i64 0, !9, i64 8, !9, i64 12, !10, i64 16, !11, i64 36, !13, i64 148, !7, i64 4500, !9, i64 4532, !9, i64 4536, !7, i64 4540, !7, i64 4541, !9, i64 4544, !9, i64 4548, !9, i64 4552, !9, i64 4556, !9, i64 4560, !9, i64 4564, !9, i64 4568, !9, i64 4572, !9, i64 4576, !9, i64 4580, !9, i64 4584, !9, i64 4588, !9, i64 4592, !9, i64 4596, !9, i64 4600, !9, i64 4604, !9, i64 4608, !9, i64 4612, !9, i64 4616, !9, i64 4620, !9, i64 4624, !9, i64 4628, !9, i64 4632, !9, i64 4636, !9, i64 4640, !9, i64 4644, !9, i64 4648, !9, i64 4652, !9, i64 4656, !9, i64 4660, !9, i64 4664, !9, i64 4668, !9, i64 4672, !9, i64 4676, !9, i64 4680, !14, i64 4688, !14, i64 4696, !14, i64 4704, !7, i64 4712, !9, i64 4728, !9, i64 4732, !7, i64 4736, !7, i64 4739, !7, i64 4740, !15, i64 4752, !7, i64 4788, !9, i64 5108, !7, i64 5112, !9, i64 5756, !9, i64 5760, !9, i64 5764, !9, i64 5768, !9, i64 5772, !9, i64 5776, !9, i64 5780, !9, i64 5784, !12, i64 5788, !16, i64 5792, !9, i64 6096, !9, i64 6100, !9, i64 6104, !9, i64 6108, !9, i64 6112, !9, i64 6116, !7, i64 6120, !7, i64 6228}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"", !7, i64 0, !9, i64 8, !9, i64 12, !9, i64 16}
!11 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 40, !12, i64 56, !7, i64 60, !7, i64 76, !7, i64 92, !9, i64 108}
!12 = !{!"short", !7, i64 0}
!13 = !{!"", !7, i64 0, !7, i64 1280, !7, i64 3840, !7, i64 4224, !9, i64 4320, !9, i64 4324, !9, i64 4328, !9, i64 4332, !9, i64 4336, !9, i64 4340, !9, i64 4344, !9, i64 4348}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !12, i64 26, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34}
!16 = !{!"_silk_resampler_state_struct", !7, i64 0, !7, i64 24, !7, i64 168, !9, i64 264, !9, i64 268, !9, i64 272, !9, i64 276, !9, i64 280, !9, i64 284, !9, i64 288, !9, i64 292, !14, i64 296}
!17 = !{!6, !9, i64 4580}
!18 = !{!6, !9, i64 4640}
!19 = !{!6, !9, i64 4632}
!20 = !{!6, !7, i64 4783}
!21 = !{!12, !12, i64 0}
!22 = distinct !{!22, !23, !24, !25}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !23, !25, !24}
!27 = !{!6, !14, i64 4704}
!28 = !{!6, !9, i64 4660}
!29 = !{!6, !7, i64 4781}
!30 = !{!6, !9, i64 5108}


; Effective O3 passes: AggressiveInstCombinePass,ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass