; LLVM IR from Ryuk17/SpeechAlgorithms :: WebRTC_AGC/src (agc)

; 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.LegacyAgc = type { i32, i16, i16, i16, i8, %struct.WebRtcAgcConfig, %struct.WebRtcAgcConfig, i16, i16, i32, i32, i32, i32, i32, i32, i32, i16, i16, [8 x i32], i32, i32, i32, i32, i32, i32, [10 x i32], [2 x [5 x i32]], [2 x [10 x i32]], i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i32, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, %struct.AgcVad, %struct.DigitalAgc, i16 }
%struct.WebRtcAgcConfig = type { i16, i16, i8 }
%struct.AgcVad = type { [8 x i32], i16, i16, i16, i16, i32, i16, i16, i32, i16 }
%struct.DigitalAgc = type { i32, i32, i32, [32 x i32], i16, i16, %struct.AgcVad, %struct.AgcVad }

; 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

; Function Attrs: inlinehint nounwind uwtable
declare hidden signext i16 @NormU32(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @WebRtcAgc_InitDigital(ptr noundef, i16 noundef signext) #2

; Function Attrs: nounwind uwtable
declare dso_local void @WebRtcAgc_InitVad(ptr 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: nounwind uwtable
declare dso_local i32 @WebRtcAgc_set_config(ptr noundef, i48) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @WebRtcAgc_Init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i16 noundef signext %3, i32 noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i16, align 2
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i48, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i16 %3, ptr %10, align 2, !tbaa !11
  store i32 %4, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %19, ptr %16, align 8, !tbaa !5
  %20 = load ptr, ptr %16, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.LegacyAgc, ptr %20, i32 0, i32 55
  %22 = load i16, ptr %10, align 2, !tbaa !11
  %23 = call i32 @WebRtcAgc_InitDigital(ptr noundef %21, i16 noundef signext %22)
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %28

25:                                               ; preds = %5
  %26 = load ptr, ptr %16, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.LegacyAgc, ptr %26, i32 0, i32 8
  store i16 18002, ptr %27, align 2, !tbaa !13
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %276

28:                                               ; preds = %5
  %29 = load ptr, ptr %16, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.LegacyAgc, ptr %29, i32 0, i32 29
  store i16 0, ptr %30, align 2, !tbaa !18
  %31 = load i16, ptr %10, align 2, !tbaa !11
  %32 = sext i16 %31 to i32
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %38, label %34

34:                                               ; preds = %28
  %35 = load i16, ptr %10, align 2, !tbaa !11
  %36 = sext i16 %35 to i32
  %37 = icmp sgt i32 %36, 3
  br i1 %37, label %38, label %39

38:                                               ; preds = %34, %28
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %276

39:                                               ; preds = %34
  %40 = load i16, ptr %10, align 2, !tbaa !11
  %41 = load ptr, ptr %16, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.LegacyAgc, ptr %41, i32 0, i32 3
  store i16 %40, ptr %42, align 4, !tbaa !19
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = load ptr, ptr %16, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.LegacyAgc, ptr %44, i32 0, i32 0
  store i32 %43, ptr %45, align 4, !tbaa !20
  %46 = load ptr, ptr %16, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.LegacyAgc, ptr %46, i32 0, i32 54
  call void @WebRtcAgc_InitVad(ptr noundef %47)
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = call signext i16 @NormU32(i32 noundef %48)
  %50 = sext i16 %49 to i32
  store i32 %50, ptr %15, align 4, !tbaa !9
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %52 = sub nsw i32 %51, 23
  %53 = trunc i32 %52 to i16
  %54 = load ptr, ptr %16, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.LegacyAgc, ptr %54, i32 0, i32 53
  store i16 %53, ptr %55, align 4, !tbaa !21
  %56 = load ptr, ptr %16, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.LegacyAgc, ptr %56, i32 0, i32 53
  %58 = load i16, ptr %57, align 4, !tbaa !21
  %59 = sext i16 %58 to i32
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %39
  %62 = load ptr, ptr %16, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.LegacyAgc, ptr %62, i32 0, i32 53
  store i16 0, ptr %63, align 4, !tbaa !21
  br label %64

64:                                               ; preds = %61, %39
  %65 = load ptr, ptr %16, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.LegacyAgc, ptr %65, i32 0, i32 53
  store i16 0, ptr %66, align 4, !tbaa !21
  %67 = load ptr, ptr %16, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.LegacyAgc, ptr %67, i32 0, i32 53
  %69 = load i16, ptr %68, align 4, !tbaa !21
  %70 = sext i16 %69 to i32
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = shl i32 %71, %70
  store i32 %72, ptr %9, align 4, !tbaa !9
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.LegacyAgc, ptr %73, i32 0, i32 53
  %75 = load i16, ptr %74, align 4, !tbaa !21
  %76 = sext i16 %75 to i32
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = shl i32 %77, %76
  store i32 %78, ptr %8, align 4, !tbaa !9
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.LegacyAgc, ptr %79, i32 0, i32 3
  %81 = load i16, ptr %80, align 4, !tbaa !19
  %82 = sext i16 %81 to i32
  %83 = icmp eq i32 %82, 2
  br i1 %83, label %84, label %87

84:                                               ; preds = %64
  store i32 0, ptr %8, align 4, !tbaa !9
  store i32 255, ptr %9, align 4, !tbaa !9
  %85 = load ptr, ptr %16, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.LegacyAgc, ptr %85, i32 0, i32 53
  store i16 0, ptr %86, align 4, !tbaa !21
  br label %87

87:                                               ; preds = %84, %64
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = load i32, ptr %8, align 4, !tbaa !9
  %90 = sub nsw i32 %88, %89
  %91 = sdiv i32 %90, 4
  store i32 %91, ptr %12, align 4, !tbaa !9
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.LegacyAgc, ptr %93, i32 0, i32 49
  store i32 %92, ptr %94, align 4, !tbaa !22
  %95 = load i32, ptr %9, align 4, !tbaa !9
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.LegacyAgc, ptr %96, i32 0, i32 47
  store i32 %95, ptr %97, align 4, !tbaa !23
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = load i32, ptr %12, align 4, !tbaa !9
  %100 = add nsw i32 %98, %99
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.LegacyAgc, ptr %101, i32 0, i32 46
  store i32 %100, ptr %102, align 4, !tbaa !24
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.LegacyAgc, ptr %103, i32 0, i32 46
  %105 = load i32, ptr %104, align 4, !tbaa !24
  %106 = load ptr, ptr %16, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.LegacyAgc, ptr %106, i32 0, i32 48
  store i32 %105, ptr %107, align 4, !tbaa !25
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.LegacyAgc, ptr %108, i32 0, i32 47
  %110 = load i32, ptr %109, align 4, !tbaa !23
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.LegacyAgc, ptr %111, i32 0, i32 51
  store i32 %110, ptr %112, align 4, !tbaa !26
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.LegacyAgc, ptr %113, i32 0, i32 52
  store i32 0, ptr %114, align 4, !tbaa !27
  %115 = load ptr, ptr %16, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.LegacyAgc, ptr %115, i32 0, i32 47
  %117 = load i32, ptr %116, align 4, !tbaa !23
  %118 = load ptr, ptr %16, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.LegacyAgc, ptr %118, i32 0, i32 45
  store i32 %117, ptr %119, align 4, !tbaa !28
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.LegacyAgc, ptr %120, i32 0, i32 3
  %122 = load i16, ptr %121, align 4, !tbaa !19
  %123 = sext i16 %122 to i32
  %124 = icmp eq i32 %123, 2
  br i1 %124, label %125, label %128

125:                                              ; preds = %87
  %126 = load ptr, ptr %16, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.LegacyAgc, ptr %126, i32 0, i32 45
  store i32 127, ptr %127, align 4, !tbaa !28
  br label %128

128:                                              ; preds = %125, %87
  %129 = load ptr, ptr %16, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.LegacyAgc, ptr %129, i32 0, i32 45
  %131 = load i32, ptr %130, align 4, !tbaa !28
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.LegacyAgc, ptr %132, i32 0, i32 42
  store i32 %131, ptr %133, align 4, !tbaa !29
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.LegacyAgc, ptr %134, i32 0, i32 44
  store i32 127, ptr %135, align 4, !tbaa !30
  %136 = load ptr, ptr %16, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.LegacyAgc, ptr %136, i32 0, i32 46
  %138 = load i32, ptr %137, align 4, !tbaa !24
  %139 = load ptr, ptr %16, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.LegacyAgc, ptr %139, i32 0, i32 49
  %141 = load i32, ptr %140, align 4, !tbaa !22
  %142 = sub nsw i32 %138, %141
  %143 = mul nsw i32 %142, 10
  %144 = ashr i32 %143, 8
  store i32 %144, ptr %13, align 4, !tbaa !9
  %145 = load ptr, ptr %16, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.LegacyAgc, ptr %145, i32 0, i32 49
  %147 = load i32, ptr %146, align 4, !tbaa !22
  %148 = load i32, ptr %13, align 4, !tbaa !9
  %149 = add nsw i32 %147, %148
  %150 = load ptr, ptr %16, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.LegacyAgc, ptr %150, i32 0, i32 50
  store i32 %149, ptr %151, align 4, !tbaa !31
  %152 = load ptr, ptr %16, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.LegacyAgc, ptr %152, i32 0, i32 32
  store i16 0, ptr %153, align 4, !tbaa !32
  %154 = load ptr, ptr %16, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.LegacyAgc, ptr %154, i32 0, i32 33
  store i16 0, ptr %155, align 2, !tbaa !33
  %156 = load ptr, ptr %16, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.LegacyAgc, ptr %156, i32 0, i32 34
  store i16 0, ptr %157, align 4, !tbaa !34
  %158 = load ptr, ptr %16, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.LegacyAgc, ptr %158, i32 0, i32 35
  store i16 0, ptr %159, align 2, !tbaa !35
  %160 = load ptr, ptr %16, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.LegacyAgc, ptr %160, i32 0, i32 36
  store i16 0, ptr %161, align 4, !tbaa !36
  %162 = load ptr, ptr %16, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.LegacyAgc, ptr %162, i32 0, i32 40
  store i16 0, ptr %163, align 4, !tbaa !37
  %164 = load ptr, ptr %16, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.LegacyAgc, ptr %164, i32 0, i32 43
  store i16 0, ptr %165, align 4, !tbaa !38
  %166 = load ptr, ptr %16, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.LegacyAgc, ptr %166, i32 0, i32 38
  store i16 520, ptr %167, align 4, !tbaa !39
  %168 = load ptr, ptr %16, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.LegacyAgc, ptr %168, i32 0, i32 37
  store i16 340, ptr %169, align 2, !tbaa !40
  %170 = load ptr, ptr %16, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.LegacyAgc, ptr %170, i32 0, i32 39
  store i16 0, ptr %171, align 2, !tbaa !41
  %172 = load ptr, ptr %16, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.LegacyAgc, ptr %172, i32 0, i32 24
  store i32 0, ptr %173, align 4, !tbaa !42
  %174 = load ptr, ptr %16, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.LegacyAgc, ptr %174, i32 0, i32 30
  store i16 400, ptr %175, align 4, !tbaa !43
  %176 = load ptr, ptr %16, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.LegacyAgc, ptr %176, i32 0, i32 31
  store i16 0, ptr %177, align 2, !tbaa !44
  store i16 0, ptr %14, align 2, !tbaa !11
  br label %178

178:                                              ; preds = %188, %128
  %179 = load i16, ptr %14, align 2, !tbaa !11
  %180 = sext i16 %179 to i32
  %181 = icmp slt i32 %180, 10
  br i1 %181, label %182, label %191

182:                                              ; preds = %178
  %183 = load ptr, ptr %16, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.LegacyAgc, ptr %183, i32 0, i32 25
  %185 = load i16, ptr %14, align 2, !tbaa !11
  %186 = sext i16 %185 to i64
  %187 = getelementptr inbounds [10 x i32], ptr %184, i64 0, i64 %186
  store i32 1000, ptr %187, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %182
  %189 = load i16, ptr %14, align 2, !tbaa !11
  %190 = add i16 %189, 1
  store i16 %190, ptr %14, align 2, !tbaa !11
  br label %178, !llvm.loop !45

191:                                              ; preds = %178
  %192 = load ptr, ptr %16, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.LegacyAgc, ptr %192, i32 0, i32 21
  store i32 1250, ptr %193, align 4, !tbaa !47
  %194 = load ptr, ptr %16, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.LegacyAgc, ptr %194, i32 0, i32 28
  store i16 0, ptr %195, align 4, !tbaa !48
  %196 = load ptr, ptr %16, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.LegacyAgc, ptr %196, i32 0, i32 22
  store i32 16284, ptr %197, align 4, !tbaa !49
  store i16 0, ptr %14, align 2, !tbaa !11
  br label %198

198:                                              ; preds = %209, %191
  %199 = load i16, ptr %14, align 2, !tbaa !11
  %200 = sext i16 %199 to i32
  %201 = icmp slt i32 %200, 5
  br i1 %201, label %202, label %212

202:                                              ; preds = %198
  %203 = load ptr, ptr %16, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.LegacyAgc, ptr %203, i32 0, i32 26
  %205 = getelementptr inbounds [2 x [5 x i32]], ptr %204, i64 0, i64 0
  %206 = load i16, ptr %14, align 2, !tbaa !11
  %207 = sext i16 %206 to i64
  %208 = getelementptr inbounds [5 x i32], ptr %205, i64 0, i64 %207
  store i32 0, ptr %208, align 4, !tbaa !9
  br label %209

209:                                              ; preds = %202
  %210 = load i16, ptr %14, align 2, !tbaa !11
  %211 = add i16 %210, 1
  store i16 %211, ptr %14, align 2, !tbaa !11
  br label %198, !llvm.loop !50

212:                                              ; preds = %198
  store i16 0, ptr %14, align 2, !tbaa !11
  br label %213

213:                                              ; preds = %230, %212
  %214 = load i16, ptr %14, align 2, !tbaa !11
  %215 = sext i16 %214 to i32
  %216 = icmp slt i32 %215, 10
  br i1 %216, label %217, label %233

217:                                              ; preds = %213
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.LegacyAgc, ptr %218, i32 0, i32 27
  %220 = getelementptr inbounds [2 x [10 x i32]], ptr %219, i64 0, i64 0
  %221 = load i16, ptr %14, align 2, !tbaa !11
  %222 = sext i16 %221 to i64
  %223 = getelementptr inbounds [10 x i32], ptr %220, i64 0, i64 %222
  store i32 0, ptr %223, align 4, !tbaa !9
  %224 = load ptr, ptr %16, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.LegacyAgc, ptr %224, i32 0, i32 27
  %226 = getelementptr inbounds [2 x [10 x i32]], ptr %225, i64 0, i64 1
  %227 = load i16, ptr %14, align 2, !tbaa !11
  %228 = sext i16 %227 to i64
  %229 = getelementptr inbounds [10 x i32], ptr %226, i64 0, i64 %228
  store i32 0, ptr %229, align 4, !tbaa !9
  br label %230

230:                                              ; preds = %217
  %231 = load i16, ptr %14, align 2, !tbaa !11
  %232 = add i16 %231, 1
  store i16 %232, ptr %14, align 2, !tbaa !11
  br label %213, !llvm.loop !51

233:                                              ; preds = %213
  %234 = load ptr, ptr %16, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.LegacyAgc, ptr %234, i32 0, i32 41
  store i16 0, ptr %235, align 2, !tbaa !52
  %236 = load ptr, ptr %16, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.LegacyAgc, ptr %236, i32 0, i32 18
  %238 = getelementptr inbounds [8 x i32], ptr %237, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 4 %238, i8 0, i64 32, i1 false)
  %239 = load ptr, ptr %16, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.LegacyAgc, ptr %239, i32 0, i32 7
  store i16 42, ptr %240, align 4, !tbaa !53
  %241 = load ptr, ptr %16, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.LegacyAgc, ptr %241, i32 0, i32 5
  %243 = getelementptr inbounds %struct.WebRtcAgcConfig, ptr %242, i32 0, i32 2
  store i8 1, ptr %243, align 4, !tbaa !54
  %244 = load ptr, ptr %16, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.LegacyAgc, ptr %244, i32 0, i32 5
  %246 = getelementptr inbounds %struct.WebRtcAgcConfig, ptr %245, i32 0, i32 0
  store i16 3, ptr %246, align 4, !tbaa !55
  %247 = load ptr, ptr %16, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.LegacyAgc, ptr %247, i32 0, i32 5
  %249 = getelementptr inbounds %struct.WebRtcAgcConfig, ptr %248, i32 0, i32 1
  store i16 9, ptr %249, align 2, !tbaa !56
  %250 = load ptr, ptr %16, align 8, !tbaa !5
  %251 = load ptr, ptr %16, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.LegacyAgc, ptr %251, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 4 %252, i64 6, i1 false)
  %253 = load i48, ptr %18, align 8
  %254 = call i32 @WebRtcAgc_set_config(ptr noundef %250, i48 %253)
  %255 = icmp eq i32 %254, -1
  br i1 %255, label %256, label %259

256:                                              ; preds = %233
  %257 = load ptr, ptr %16, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.LegacyAgc, ptr %257, i32 0, i32 8
  store i16 18000, ptr %258, align 2, !tbaa !13
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %276

259:                                              ; preds = %233
  %260 = load ptr, ptr %16, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.LegacyAgc, ptr %260, i32 0, i32 9
  %262 = load i32, ptr %261, align 4, !tbaa !57
  %263 = load ptr, ptr %16, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.LegacyAgc, ptr %263, i32 0, i32 23
  store i32 %262, ptr %264, align 4, !tbaa !58
  %265 = load ptr, ptr %16, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.LegacyAgc, ptr %265, i32 0, i32 56
  store i16 0, ptr %266, align 4, !tbaa !59
  %267 = load i32, ptr %8, align 4, !tbaa !9
  %268 = load i32, ptr %9, align 4, !tbaa !9
  %269 = icmp sge i32 %267, %268
  br i1 %269, label %274, label %270

270:                                              ; preds = %259
  %271 = load i32, ptr %9, align 4, !tbaa !9
  %272 = and i32 %271, -67108864
  %273 = icmp ne i32 %272, 0
  br i1 %273, label %274, label %275

274:                                              ; preds = %270, %259
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %276

275:                                              ; preds = %270
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %276

276:                                              ; preds = %275, %274, %256, %38, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %277 = load i32, ptr %6, align 4
  ret i32 %277
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !12, i64 26}
!14 = !{!"", !10, i64 0, !12, i64 4, !12, i64 6, !12, i64 8, !7, i64 10, !15, i64 12, !15, i64 18, !12, i64 24, !12, i64 26, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !12, i64 56, !12, i64 58, !7, i64 60, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !7, i64 116, !7, i64 156, !7, i64 196, !12, i64 276, !12, i64 278, !12, i64 280, !12, i64 282, !12, i64 284, !12, i64 286, !12, i64 288, !12, i64 290, !12, i64 292, !12, i64 294, !12, i64 296, !12, i64 298, !12, i64 300, !12, i64 302, !10, i64 304, !12, i64 308, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !12, i64 348, !16, i64 352, !17, i64 408, !12, i64 664}
!15 = !{!"", !12, i64 0, !12, i64 2, !7, i64 4}
!16 = !{!"", !7, i64 0, !12, i64 32, !12, i64 34, !12, i64 36, !12, i64 38, !10, i64 40, !12, i64 44, !12, i64 46, !10, i64 48, !12, i64 52}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 12, !12, i64 140, !12, i64 142, !16, i64 144, !16, i64 200}
!18 = !{!14, !12, i64 278}
!19 = !{!14, !12, i64 8}
!20 = !{!14, !10, i64 0}
!21 = !{!14, !12, i64 348}
!22 = !{!14, !10, i64 332}
!23 = !{!14, !10, i64 324}
!24 = !{!14, !10, i64 320}
!25 = !{!14, !10, i64 328}
!26 = !{!14, !10, i64 340}
!27 = !{!14, !10, i64 344}
!28 = !{!14, !10, i64 316}
!29 = !{!14, !10, i64 304}
!30 = !{!14, !10, i64 312}
!31 = !{!14, !10, i64 336}
!32 = !{!14, !12, i64 284}
!33 = !{!14, !12, i64 286}
!34 = !{!14, !12, i64 288}
!35 = !{!14, !12, i64 290}
!36 = !{!14, !12, i64 292}
!37 = !{!14, !12, i64 300}
!38 = !{!14, !12, i64 308}
!39 = !{!14, !12, i64 296}
!40 = !{!14, !12, i64 294}
!41 = !{!14, !12, i64 298}
!42 = !{!14, !10, i64 112}
!43 = !{!14, !12, i64 280}
!44 = !{!14, !12, i64 282}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = !{!14, !10, i64 100}
!48 = !{!14, !12, i64 276}
!49 = !{!14, !10, i64 104}
!50 = distinct !{!50, !46}
!51 = distinct !{!51, !46}
!52 = !{!14, !12, i64 302}
!53 = !{!14, !12, i64 24}
!54 = !{!14, !7, i64 16}
!55 = !{!14, !12, i64 12}
!56 = !{!14, !12, i64 14}
!57 = !{!14, !10, i64 28}
!58 = !{!14, !10, i64 108}
!59 = !{!14, !12, i64 664}


; 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: inlinehint nounwind uwtable
declare hidden signext i16 @NormU32(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @WebRtcAgc_InitDigital(ptr noundef, i16 noundef signext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @WebRtcAgc_InitVad(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @WebRtcAgc_set_config(ptr noundef, i48) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @WebRtcAgc_Init(ptr noundef %0, i32 noundef %1, i32 noundef %2, i16 noundef signext %3, i32 noundef %4) local_unnamed_addr #1 {
  %6 = getelementptr inbounds i8, ptr %0, i64 408
  %7 = tail call i32 @WebRtcAgc_InitDigital(ptr noundef nonnull %6, i16 noundef signext %3)
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %10, label %8

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 26
  store i16 18002, ptr %9, align 2, !tbaa !5
  br label %65

10:                                               ; preds = %5
  %11 = getelementptr inbounds i8, ptr %0, i64 278
  store i16 0, ptr %11, align 2, !tbaa !14
  %or.cond = icmp ugt i16 %3, 3
  br i1 %or.cond, label %65, label %.preheader

.preheader:                                       ; preds = %10
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  store i16 %3, ptr %12, align 4, !tbaa !15
  store i32 %4, ptr %0, align 4, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 352
  tail call void @WebRtcAgc_InitVad(ptr noundef nonnull %13)
  %14 = tail call signext i16 @NormU32(i32 noundef %2)
  %15 = getelementptr inbounds i8, ptr %0, i64 348
  %16 = load i16, ptr %12, align 4, !tbaa !15
  %17 = icmp eq i16 %16, 2
  store i16 0, ptr %15, align 4
  %spec.select = select i1 %17, i32 255, i32 %2
  %spec.select105 = select i1 %17, i32 0, i32 %1
  %18 = sub nsw i32 %spec.select, %spec.select105
  %19 = sdiv i32 %18, 4
  %20 = getelementptr inbounds i8, ptr %0, i64 332
  store i32 %spec.select105, ptr %20, align 4, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %0, i64 324
  store i32 %spec.select, ptr %21, align 4, !tbaa !18
  %22 = add nsw i32 %19, %spec.select
  %23 = getelementptr inbounds i8, ptr %0, i64 320
  store i32 %22, ptr %23, align 4, !tbaa !19
  %24 = getelementptr inbounds i8, ptr %0, i64 328
  store i32 %22, ptr %24, align 4, !tbaa !20
  %25 = getelementptr inbounds i8, ptr %0, i64 340
  store i32 %spec.select, ptr %25, align 4, !tbaa !21
  %26 = getelementptr inbounds i8, ptr %0, i64 344
  store i32 0, ptr %26, align 4, !tbaa !22
  %27 = getelementptr inbounds i8, ptr %0, i64 316
  %spec.store.select = select i1 %17, i32 127, i32 %2
  store i32 %spec.store.select, ptr %27, align 4
  %28 = getelementptr inbounds i8, ptr %0, i64 304
  store i32 %spec.store.select, ptr %28, align 4, !tbaa !23
  %29 = getelementptr inbounds i8, ptr %0, i64 312
  store i32 127, ptr %29, align 4, !tbaa !24
  %30 = sub nsw i32 %22, %spec.select105
  %31 = mul nsw i32 %30, 10
  %32 = ashr i32 %31, 8
  %33 = add nsw i32 %32, %spec.select105
  %34 = getelementptr inbounds i8, ptr %0, i64 336
  store i32 %33, ptr %34, align 4, !tbaa !25
  %35 = getelementptr inbounds i8, ptr %0, i64 284
  %36 = getelementptr inbounds i8, ptr %0, i64 308
  store i16 0, ptr %36, align 4, !tbaa !26
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(10) %35, i8 0, i64 10, i1 false)
  %37 = getelementptr inbounds i8, ptr %0, i64 294
  store <4 x i16> <i16 340, i16 520, i16 0, i16 0>, ptr %37, align 2, !tbaa !27
  %38 = getelementptr inbounds i8, ptr %0, i64 112
  store i32 0, ptr %38, align 4, !tbaa !28
  %39 = getelementptr inbounds i8, ptr %0, i64 280
  store i16 400, ptr %39, align 4, !tbaa !29
  %40 = getelementptr inbounds i8, ptr %0, i64 282
  store i16 0, ptr %40, align 2, !tbaa !30
  %41 = getelementptr inbounds i8, ptr %0, i64 116
  store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %41, align 4, !tbaa !31
  %42 = getelementptr inbounds i8, ptr %0, i64 132
  store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, ptr %42, align 4, !tbaa !31
  %43 = getelementptr inbounds i8, ptr %0, i64 148
  store i32 1000, ptr %43, align 4, !tbaa !31
  %44 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 1000, ptr %44, align 4, !tbaa !31
  %45 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 1250, ptr %45, align 4, !tbaa !32
  %46 = getelementptr inbounds i8, ptr %0, i64 276
  store i16 0, ptr %46, align 4, !tbaa !33
  %47 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 16284, ptr %47, align 4, !tbaa !34
  %48 = getelementptr inbounds i8, ptr %0, i64 156
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %48, i8 0, i64 20, i1 false), !tbaa !31
  %49 = getelementptr inbounds i8, ptr %0, i64 196
  %50 = getelementptr inbounds i8, ptr %0, i64 302
  store i16 0, ptr %50, align 2, !tbaa !35
  %51 = getelementptr inbounds i8, ptr %0, i64 60
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %51, i8 0, i64 32, i1 false)
  %52 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(80) %49, i8 0, i64 80, i1 false)
  store i16 42, ptr %52, align 4, !tbaa !36
  %53 = getelementptr inbounds i8, ptr %0, i64 12
  %54 = getelementptr inbounds i8, ptr %0, i64 16
  store i8 1, ptr %54, align 4, !tbaa !37
  store i16 3, ptr %53, align 4, !tbaa !38
  %55 = getelementptr inbounds i8, ptr %0, i64 14
  store i16 9, ptr %55, align 2, !tbaa !39
  %.0.copyload = load i48, ptr %53, align 4
  %56 = tail call i32 @WebRtcAgc_set_config(ptr noundef nonnull %0, i48 %.0.copyload)
  %57 = icmp eq i32 %56, -1
  br i1 %57, label %58, label %60

58:                                               ; preds = %.preheader
  %59 = getelementptr inbounds i8, ptr %0, i64 26
  store i16 18000, ptr %59, align 2, !tbaa !5
  br label %65

60:                                               ; preds = %.preheader
  %61 = getelementptr inbounds i8, ptr %0, i64 28
  %62 = load i32, ptr %61, align 4, !tbaa !40
  %63 = getelementptr inbounds i8, ptr %0, i64 108
  store i32 %62, ptr %63, align 4, !tbaa !41
  %64 = getelementptr inbounds i8, ptr %0, i64 664
  store i16 0, ptr %64, align 4, !tbaa !42
  %.not101 = icmp sge i32 %spec.select105, %spec.select
  %.not102 = icmp ugt i32 %spec.select, 67108863
  %or.cond103.not = or i1 %.not101, %.not102
  %spec.select106 = sext i1 %or.cond103.not to i32
  br label %65

65:                                               ; preds = %60, %10, %58, %8
  %.0 = phi i32 [ -1, %8 ], [ -1, %58 ], [ -1, %10 ], [ %spec.select106, %60 ]
  ret i32 %.0
}

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

attributes #0 = { inlinehint 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 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !10, i64 26}
!6 = !{!"", !7, i64 0, !10, i64 4, !10, i64 6, !10, i64 8, !8, i64 10, !11, i64 12, !11, i64 18, !10, i64 24, !10, i64 26, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !10, i64 56, !10, i64 58, !8, i64 60, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !8, i64 116, !8, i64 156, !8, i64 196, !10, i64 276, !10, i64 278, !10, i64 280, !10, i64 282, !10, i64 284, !10, i64 286, !10, i64 288, !10, i64 290, !10, i64 292, !10, i64 294, !10, i64 296, !10, i64 298, !10, i64 300, !10, i64 302, !7, i64 304, !10, i64 308, !7, i64 312, !7, i64 316, !7, i64 320, !7, i64 324, !7, i64 328, !7, i64 332, !7, i64 336, !7, i64 340, !7, i64 344, !10, i64 348, !12, i64 352, !13, i64 408, !10, i64 664}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"", !10, i64 0, !10, i64 2, !8, i64 4}
!12 = !{!"", !8, i64 0, !10, i64 32, !10, i64 34, !10, i64 36, !10, i64 38, !7, i64 40, !10, i64 44, !10, i64 46, !7, i64 48, !10, i64 52}
!13 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12, !10, i64 140, !10, i64 142, !12, i64 144, !12, i64 200}
!14 = !{!6, !10, i64 278}
!15 = !{!6, !10, i64 8}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !7, i64 332}
!18 = !{!6, !7, i64 324}
!19 = !{!6, !7, i64 320}
!20 = !{!6, !7, i64 328}
!21 = !{!6, !7, i64 340}
!22 = !{!6, !7, i64 344}
!23 = !{!6, !7, i64 304}
!24 = !{!6, !7, i64 312}
!25 = !{!6, !7, i64 336}
!26 = !{!6, !10, i64 308}
!27 = !{!10, !10, i64 0}
!28 = !{!6, !7, i64 112}
!29 = !{!6, !10, i64 280}
!30 = !{!6, !10, i64 282}
!31 = !{!7, !7, i64 0}
!32 = !{!6, !7, i64 100}
!33 = !{!6, !10, i64 276}
!34 = !{!6, !7, i64 104}
!35 = !{!6, !10, i64 302}
!36 = !{!6, !10, i64 24}
!37 = !{!6, !8, i64 16}
!38 = !{!6, !10, i64 12}
!39 = !{!6, !10, i64 14}
!40 = !{!6, !7, i64 28}
!41 = !{!6, !7, i64 108}
!42 = !{!6, !10, i64 664}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,MemCpyOptPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass