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

; 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] }
%struct.silk_EncControlStruct = type { 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 }

; Function Attrs: nounwind uwtable
define dso_local i32 @silk_control_audio_bandwidth(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.silk_encoder_state, ptr %8, i32 0, i32 19
  %10 = load i32, ptr %9, align 8, !tbaa !9
  store i32 %10, ptr %6, align 4, !tbaa !18
  %11 = load i32, ptr %6, align 4, !tbaa !18
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %18

13:                                               ; preds = %2
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.silk_encoder_state, ptr %14, i32 0, i32 3
  %16 = getelementptr inbounds %struct.silk_LP_state, ptr %15, i32 0, i32 3
  %17 = load i32, ptr %16, align 8, !tbaa !19
  store i32 %17, ptr %6, align 4, !tbaa !18
  br label %18

18:                                               ; preds = %13, %2
  %19 = load i32, ptr %6, align 4, !tbaa !18
  store i32 %19, ptr %5, align 4, !tbaa !18
  %20 = load i32, ptr %5, align 4, !tbaa !18
  %21 = trunc i32 %20 to i16
  %22 = sext i16 %21 to i32
  %23 = mul nsw i32 %22, 1000
  store i32 %23, ptr %7, align 4, !tbaa !18
  %24 = load i32, ptr %7, align 4, !tbaa !18
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %46

26:                                               ; preds = %18
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.silk_encoder_state, ptr %27, i32 0, i32 18
  %29 = load i32, ptr %28, align 4, !tbaa !20
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.silk_encoder_state, ptr %30, i32 0, i32 14
  %32 = load i32, ptr %31, align 4, !tbaa !21
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %34, label %38

34:                                               ; preds = %26
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.silk_encoder_state, ptr %35, i32 0, i32 18
  %37 = load i32, ptr %36, align 4, !tbaa !20
  br label %42

38:                                               ; preds = %26
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.silk_encoder_state, ptr %39, i32 0, i32 14
  %41 = load i32, ptr %40, align 4, !tbaa !21
  br label %42

42:                                               ; preds = %38, %34
  %43 = phi i32 [ %37, %34 ], [ %41, %38 ]
  store i32 %43, ptr %7, align 4, !tbaa !18
  %44 = load i32, ptr %7, align 4, !tbaa !18
  %45 = sdiv i32 %44, 1000
  store i32 %45, ptr %5, align 4, !tbaa !18
  br label %252

46:                                               ; preds = %18
  %47 = load i32, ptr %7, align 4, !tbaa !18
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.silk_encoder_state, ptr %48, i32 0, i32 14
  %50 = load i32, ptr %49, align 4, !tbaa !21
  %51 = icmp sgt i32 %47, %50
  br i1 %51, label %64, label %52

52:                                               ; preds = %46
  %53 = load i32, ptr %7, align 4, !tbaa !18
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.silk_encoder_state, ptr %54, i32 0, i32 16
  %56 = load i32, ptr %55, align 4, !tbaa !22
  %57 = icmp sgt i32 %53, %56
  br i1 %57, label %64, label %58

58:                                               ; preds = %52
  %59 = load i32, ptr %7, align 4, !tbaa !18
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.silk_encoder_state, ptr %60, i32 0, i32 17
  %62 = load i32, ptr %61, align 8, !tbaa !23
  %63 = icmp slt i32 %59, %62
  br i1 %63, label %64, label %96

64:                                               ; preds = %58, %52, %46
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.silk_encoder_state, ptr %65, i32 0, i32 14
  %67 = load i32, ptr %66, align 4, !tbaa !21
  store i32 %67, ptr %7, align 4, !tbaa !18
  %68 = load i32, ptr %7, align 4, !tbaa !18
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.silk_encoder_state, ptr %69, i32 0, i32 16
  %71 = load i32, ptr %70, align 4, !tbaa !22
  %72 = icmp slt i32 %68, %71
  br i1 %72, label %73, label %75

73:                                               ; preds = %64
  %74 = load i32, ptr %7, align 4, !tbaa !18
  br label %79

75:                                               ; preds = %64
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.silk_encoder_state, ptr %76, i32 0, i32 16
  %78 = load i32, ptr %77, align 4, !tbaa !22
  br label %79

79:                                               ; preds = %75, %73
  %80 = phi i32 [ %74, %73 ], [ %78, %75 ]
  store i32 %80, ptr %7, align 4, !tbaa !18
  %81 = load i32, ptr %7, align 4, !tbaa !18
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.silk_encoder_state, ptr %82, i32 0, i32 17
  %84 = load i32, ptr %83, align 8, !tbaa !23
  %85 = icmp sgt i32 %81, %84
  br i1 %85, label %86, label %88

86:                                               ; preds = %79
  %87 = load i32, ptr %7, align 4, !tbaa !18
  br label %92

88:                                               ; preds = %79
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.silk_encoder_state, ptr %89, i32 0, i32 17
  %91 = load i32, ptr %90, align 8, !tbaa !23
  br label %92

92:                                               ; preds = %88, %86
  %93 = phi i32 [ %87, %86 ], [ %91, %88 ]
  store i32 %93, ptr %7, align 4, !tbaa !18
  %94 = load i32, ptr %7, align 4, !tbaa !18
  %95 = sdiv i32 %94, 1000
  store i32 %95, ptr %5, align 4, !tbaa !18
  br label %251

96:                                               ; preds = %58
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.silk_encoder_state, ptr %97, i32 0, i32 3
  %99 = getelementptr inbounds %struct.silk_LP_state, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 8, !tbaa !24
  %101 = icmp sge i32 %100, 256
  br i1 %101, label %102, label %106

102:                                              ; preds = %96
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.silk_encoder_state, ptr %103, i32 0, i32 3
  %105 = getelementptr inbounds %struct.silk_LP_state, ptr %104, i32 0, i32 2
  store i32 0, ptr %105, align 4, !tbaa !25
  br label %106

106:                                              ; preds = %102, %96
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.silk_encoder_state, ptr %107, i32 0, i32 8
  %109 = load i32, ptr %108, align 8, !tbaa !26
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %116, label %111

111:                                              ; preds = %106
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %112, i32 0, i32 16
  %114 = load i32, ptr %113, align 4, !tbaa !27
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %250

116:                                              ; preds = %111, %106
  %117 = load i32, ptr %6, align 4, !tbaa !18
  %118 = trunc i32 %117 to i16
  %119 = sext i16 %118 to i32
  %120 = mul nsw i32 %119, 1000
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.silk_encoder_state, ptr %121, i32 0, i32 18
  %123 = load i32, ptr %122, align 4, !tbaa !20
  %124 = icmp sgt i32 %120, %123
  br i1 %124, label %125, label %180

125:                                              ; preds = %116
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.silk_encoder_state, ptr %126, i32 0, i32 3
  %128 = getelementptr inbounds %struct.silk_LP_state, ptr %127, i32 0, i32 2
  %129 = load i32, ptr %128, align 4, !tbaa !25
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %131, label %139

131:                                              ; preds = %125
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.silk_encoder_state, ptr %132, i32 0, i32 3
  %134 = getelementptr inbounds %struct.silk_LP_state, ptr %133, i32 0, i32 1
  store i32 256, ptr %134, align 8, !tbaa !24
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.silk_encoder_state, ptr %135, i32 0, i32 3
  %137 = getelementptr inbounds %struct.silk_LP_state, ptr %136, i32 0, i32 0
  %138 = getelementptr inbounds [2 x i32], ptr %137, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %138, i8 0, i64 8, i1 false)
  br label %139

139:                                              ; preds = %131, %125
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %140, i32 0, i32 16
  %142 = load i32, ptr %141, align 4, !tbaa !27
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %152

144:                                              ; preds = %139
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.silk_encoder_state, ptr %145, i32 0, i32 3
  %147 = getelementptr inbounds %struct.silk_LP_state, ptr %146, i32 0, i32 2
  store i32 0, ptr %147, align 4, !tbaa !25
  %148 = load i32, ptr %6, align 4, !tbaa !18
  %149 = icmp eq i32 %148, 16
  %150 = zext i1 %149 to i64
  %151 = select i1 %149, i32 12, i32 8
  store i32 %151, ptr %5, align 4, !tbaa !18
  br label %179

152:                                              ; preds = %139
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.silk_encoder_state, ptr %153, i32 0, i32 3
  %155 = getelementptr inbounds %struct.silk_LP_state, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 8, !tbaa !24
  %157 = icmp sle i32 %156, 0
  br i1 %157, label %158, label %174

158:                                              ; preds = %152
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %159, i32 0, i32 22
  store i32 1, ptr %160, align 4, !tbaa !29
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %161, i32 0, i32 14
  %163 = load i32, ptr %162, align 4, !tbaa !30
  %164 = mul nsw i32 %163, 5
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %165, i32 0, i32 6
  %167 = load i32, ptr %166, align 4, !tbaa !31
  %168 = add nsw i32 %167, 5
  %169 = sdiv i32 %164, %168
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %170, i32 0, i32 14
  %172 = load i32, ptr %171, align 4, !tbaa !30
  %173 = sub nsw i32 %172, %169
  store i32 %173, ptr %171, align 4, !tbaa !30
  br label %178

174:                                              ; preds = %152
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.silk_encoder_state, ptr %175, i32 0, i32 3
  %177 = getelementptr inbounds %struct.silk_LP_state, ptr %176, i32 0, i32 2
  store i32 -2, ptr %177, align 4, !tbaa !25
  br label %178

178:                                              ; preds = %174, %158
  br label %179

179:                                              ; preds = %178, %144
  br label %249

180:                                              ; preds = %116
  %181 = load i32, ptr %6, align 4, !tbaa !18
  %182 = trunc i32 %181 to i16
  %183 = sext i16 %182 to i32
  %184 = mul nsw i32 %183, 1000
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.silk_encoder_state, ptr %185, i32 0, i32 18
  %187 = load i32, ptr %186, align 4, !tbaa !20
  %188 = icmp slt i32 %184, %187
  br i1 %188, label %189, label %237

189:                                              ; preds = %180
  %190 = load ptr, ptr %4, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %190, i32 0, i32 16
  %192 = load i32, ptr %191, align 4, !tbaa !27
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %194, label %209

194:                                              ; preds = %189
  %195 = load i32, ptr %6, align 4, !tbaa !18
  %196 = icmp eq i32 %195, 8
  %197 = zext i1 %196 to i64
  %198 = select i1 %196, i32 12, i32 16
  store i32 %198, ptr %5, align 4, !tbaa !18
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.silk_encoder_state, ptr %199, i32 0, i32 3
  %201 = getelementptr inbounds %struct.silk_LP_state, ptr %200, i32 0, i32 1
  store i32 0, ptr %201, align 8, !tbaa !24
  %202 = load ptr, ptr %3, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.silk_encoder_state, ptr %202, i32 0, i32 3
  %204 = getelementptr inbounds %struct.silk_LP_state, ptr %203, i32 0, i32 0
  %205 = getelementptr inbounds [2 x i32], ptr %204, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %205, i8 0, i64 8, i1 false)
  %206 = load ptr, ptr %3, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.silk_encoder_state, ptr %206, i32 0, i32 3
  %208 = getelementptr inbounds %struct.silk_LP_state, ptr %207, i32 0, i32 2
  store i32 1, ptr %208, align 4, !tbaa !25
  br label %236

209:                                              ; preds = %189
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.silk_encoder_state, ptr %210, i32 0, i32 3
  %212 = getelementptr inbounds %struct.silk_LP_state, ptr %211, i32 0, i32 2
  %213 = load i32, ptr %212, align 4, !tbaa !25
  %214 = icmp eq i32 %213, 0
  br i1 %214, label %215, label %231

215:                                              ; preds = %209
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %216, i32 0, i32 22
  store i32 1, ptr %217, align 4, !tbaa !29
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %218, i32 0, i32 14
  %220 = load i32, ptr %219, align 4, !tbaa !30
  %221 = mul nsw i32 %220, 5
  %222 = load ptr, ptr %4, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %222, i32 0, i32 6
  %224 = load i32, ptr %223, align 4, !tbaa !31
  %225 = add nsw i32 %224, 5
  %226 = sdiv i32 %221, %225
  %227 = load ptr, ptr %4, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.silk_EncControlStruct, ptr %227, i32 0, i32 14
  %229 = load i32, ptr %228, align 4, !tbaa !30
  %230 = sub nsw i32 %229, %226
  store i32 %230, ptr %228, align 4, !tbaa !30
  br label %235

231:                                              ; preds = %209
  %232 = load ptr, ptr %3, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.silk_encoder_state, ptr %232, i32 0, i32 3
  %234 = getelementptr inbounds %struct.silk_LP_state, ptr %233, i32 0, i32 2
  store i32 1, ptr %234, align 4, !tbaa !25
  br label %235

235:                                              ; preds = %231, %215
  br label %236

236:                                              ; preds = %235, %194
  br label %248

237:                                              ; preds = %180
  %238 = load ptr, ptr %3, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.silk_encoder_state, ptr %238, i32 0, i32 3
  %240 = getelementptr inbounds %struct.silk_LP_state, ptr %239, i32 0, i32 2
  %241 = load i32, ptr %240, align 4, !tbaa !25
  %242 = icmp slt i32 %241, 0
  br i1 %242, label %243, label %247

243:                                              ; preds = %237
  %244 = load ptr, ptr %3, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.silk_encoder_state, ptr %244, i32 0, i32 3
  %246 = getelementptr inbounds %struct.silk_LP_state, ptr %245, i32 0, i32 2
  store i32 1, ptr %246, align 4, !tbaa !25
  br label %247

247:                                              ; preds = %243, %237
  br label %248

248:                                              ; preds = %247, %236
  br label %249

249:                                              ; preds = %248, %179
  br label %250

250:                                              ; preds = %249, %111
  br label %251

251:                                              ; preds = %250, %92
  br label %252

252:                                              ; preds = %251, %42
  %253 = load i32, ptr %5, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret i32 %253
}

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

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

; 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 4576}
!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 32}
!20 = !{!10, !11, i64 4572}
!21 = !{!10, !11, i64 4556}
!22 = !{!10, !11, i64 4564}
!23 = !{!10, !11, i64 4568}
!24 = !{!10, !11, i64 24}
!25 = !{!10, !11, i64 28}
!26 = !{!10, !11, i64 4536}
!27 = !{!28, !11, i64 64}
!28 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96}
!29 = !{!28, !11, i64 88}
!30 = !{!28, !11, i64 56}
!31 = !{!28, !11, i64 24}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local i32 @silk_control_audio_bandwidth(ptr nocapture noundef %0, ptr nocapture noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 4576
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %6, label %9

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = load i32, ptr %7, align 8, !tbaa !17
  br label %9

9:                                                ; preds = %6, %2
  %.0 = phi i32 [ %8, %6 ], [ %4, %2 ]
  %sext = shl i32 %.0, 16
  %10 = ashr exact i32 %sext, 16
  %11 = mul nsw i32 %10, 1000
  %12 = icmp eq i32 %sext, 0
  br i1 %12, label %13, label %19

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 4572
  %15 = load i32, ptr %14, align 4, !tbaa !18
  %16 = getelementptr inbounds i8, ptr %0, i64 4556
  %17 = load i32, ptr %16, align 4, !tbaa !19
  %. = tail call i32 @llvm.smin.i32(i32 %15, i32 %17)
  %18 = sdiv i32 %., 1000
  br label %102

19:                                               ; preds = %9
  %20 = getelementptr inbounds i8, ptr %0, i64 4556
  %21 = load i32, ptr %20, align 4, !tbaa !19
  %22 = icmp sgt i32 %11, %21
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 4564
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !20
  %23 = icmp sgt i32 %11, %.pre
  %or.cond = select i1 %22, i1 true, i1 %23
  br i1 %or.cond, label %._crit_edge, label %24

24:                                               ; preds = %19
  %25 = getelementptr inbounds i8, ptr %0, i64 4568
  %26 = load i32, ptr %25, align 8, !tbaa !21
  %27 = icmp slt i32 %11, %26
  br i1 %27, label %._crit_edge, label %32

._crit_edge:                                      ; preds = %19, %24
  %.73 = tail call i32 @llvm.smin.i32(i32 %21, i32 %.pre)
  %28 = getelementptr inbounds i8, ptr %0, i64 4568
  %29 = load i32, ptr %28, align 8, !tbaa !21
  %30 = tail call i32 @llvm.smax.i32(i32 %.73, i32 %29)
  %31 = sdiv i32 %30, 1000
  br label %102

32:                                               ; preds = %24
  %33 = getelementptr inbounds i8, ptr %0, i64 16
  %34 = getelementptr inbounds i8, ptr %0, i64 24
  %35 = load i32, ptr %34, align 8, !tbaa !22
  %36 = icmp sgt i32 %35, 255
  br i1 %36, label %37, label %39

37:                                               ; preds = %32
  %38 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 0, ptr %38, align 4, !tbaa !23
  br label %39

39:                                               ; preds = %37, %32
  %40 = getelementptr inbounds i8, ptr %0, i64 4536
  %41 = load i32, ptr %40, align 8, !tbaa !24
  %.not = icmp eq i32 %41, 0
  br i1 %.not, label %42, label %45

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %1, i64 64
  %44 = load i32, ptr %43, align 4, !tbaa !25
  %.not70 = icmp eq i32 %44, 0
  br i1 %.not70, label %102, label %45

45:                                               ; preds = %42, %39
  %46 = getelementptr inbounds i8, ptr %0, i64 4572
  %47 = load i32, ptr %46, align 4, !tbaa !18
  %48 = icmp sgt i32 %11, %47
  br i1 %48, label %49, label %73

49:                                               ; preds = %45
  %50 = getelementptr inbounds i8, ptr %0, i64 28
  %51 = load i32, ptr %50, align 4, !tbaa !23
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %.thread, label %53

53:                                               ; preds = %49
  %54 = getelementptr inbounds i8, ptr %1, i64 64
  %55 = load i32, ptr %54, align 4, !tbaa !25
  %.not72 = icmp eq i32 %55, 0
  br i1 %.not72, label %61, label %58

.thread:                                          ; preds = %49
  store i32 256, ptr %34, align 8, !tbaa !22
  store i64 0, ptr %33, align 8
  %56 = getelementptr inbounds i8, ptr %1, i64 64
  %57 = load i32, ptr %56, align 4, !tbaa !25
  %.not7274 = icmp eq i32 %57, 0
  br i1 %.not7274, label %.thread75, label %58

58:                                               ; preds = %.thread, %53
  store i32 0, ptr %50, align 4, !tbaa !23
  %59 = icmp eq i32 %.0, 16
  %60 = select i1 %59, i32 12, i32 8
  br label %102

61:                                               ; preds = %53
  %62 = icmp slt i32 %35, 1
  br i1 %62, label %63, label %.thread75

63:                                               ; preds = %61
  %64 = getelementptr inbounds i8, ptr %1, i64 88
  store i32 1, ptr %64, align 4, !tbaa !27
  %65 = getelementptr inbounds i8, ptr %1, i64 56
  %66 = load i32, ptr %65, align 4, !tbaa !28
  %67 = mul nsw i32 %66, 5
  %68 = getelementptr inbounds i8, ptr %1, i64 24
  %69 = load i32, ptr %68, align 4, !tbaa !29
  %70 = add nsw i32 %69, 5
  %71 = sdiv i32 %67, %70
  %72 = sub nsw i32 %66, %71
  store i32 %72, ptr %65, align 4, !tbaa !28
  br label %102

.thread75:                                        ; preds = %.thread, %61
  store i32 -2, ptr %50, align 4, !tbaa !23
  br label %102

73:                                               ; preds = %45
  %74 = icmp slt i32 %11, %47
  br i1 %74, label %75, label %97

75:                                               ; preds = %73
  %76 = getelementptr inbounds i8, ptr %1, i64 64
  %77 = load i32, ptr %76, align 4, !tbaa !25
  %.not71 = icmp eq i32 %77, 0
  br i1 %.not71, label %82, label %78

78:                                               ; preds = %75
  %79 = icmp eq i32 %.0, 8
  %80 = select i1 %79, i32 12, i32 16
  store i32 0, ptr %34, align 8, !tbaa !22
  store i64 0, ptr %33, align 8
  %81 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 1, ptr %81, align 4, !tbaa !23
  br label %102

82:                                               ; preds = %75
  %83 = getelementptr inbounds i8, ptr %0, i64 28
  %84 = load i32, ptr %83, align 4, !tbaa !23
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %96

86:                                               ; preds = %82
  %87 = getelementptr inbounds i8, ptr %1, i64 88
  store i32 1, ptr %87, align 4, !tbaa !27
  %88 = getelementptr inbounds i8, ptr %1, i64 56
  %89 = load i32, ptr %88, align 4, !tbaa !28
  %90 = mul nsw i32 %89, 5
  %91 = getelementptr inbounds i8, ptr %1, i64 24
  %92 = load i32, ptr %91, align 4, !tbaa !29
  %93 = add nsw i32 %92, 5
  %94 = sdiv i32 %90, %93
  %95 = sub nsw i32 %89, %94
  store i32 %95, ptr %88, align 4, !tbaa !28
  br label %102

96:                                               ; preds = %82
  store i32 1, ptr %83, align 4, !tbaa !23
  br label %102

97:                                               ; preds = %73
  %98 = getelementptr inbounds i8, ptr %0, i64 28
  %99 = load i32, ptr %98, align 4, !tbaa !23
  %100 = icmp slt i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %97
  store i32 1, ptr %98, align 4, !tbaa !23
  br label %102

102:                                              ; preds = %._crit_edge, %63, %.thread75, %58, %97, %101, %78, %96, %86, %42, %13
  %.060 = phi i32 [ %18, %13 ], [ %31, %._crit_edge ], [ %60, %58 ], [ %.0, %63 ], [ %.0, %.thread75 ], [ %80, %78 ], [ %.0, %86 ], [ %.0, %96 ], [ %.0, %101 ], [ %.0, %97 ], [ %.0, %42 ]
  ret i32 %.060
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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 speculatable willreturn memory(none) }

!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 4576}
!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 32}
!18 = !{!6, !9, i64 4572}
!19 = !{!6, !9, i64 4556}
!20 = !{!6, !9, i64 4564}
!21 = !{!6, !9, i64 4568}
!22 = !{!6, !9, i64 24}
!23 = !{!6, !9, i64 28}
!24 = !{!6, !9, i64 4536}
!25 = !{!26, !9, i64 64}
!26 = !{!"", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !9, i64 32, !9, i64 36, !9, i64 40, !9, i64 44, !9, i64 48, !9, i64 52, !9, i64 56, !9, i64 60, !9, i64 64, !9, i64 68, !9, i64 72, !9, i64 76, !9, i64 80, !9, i64 84, !9, i64 88, !9, i64 92, !9, i64 96}
!27 = !{!26, !9, i64 88}
!28 = !{!26, !9, i64 56}
!29 = !{!26, !9, i64 24}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass