; LLVM IR from VoidRune/Audio-engine :: src (minivorbis)

; 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.vorbis_info = type { i32, i32, i64, i64, i64, i64, i64, ptr }
%struct.vorbis_info_residue0 = type { i64, i64, i32, i32, i32, i32, [64 x i32], [512 x i32], [64 x i32], [64 x i32] }
%struct.codec_setup_info = type { [2 x i64], i32, i32, i32, i32, i32, i32, [64 x ptr], [64 x i32], [64 x ptr], [64 x i32], [64 x ptr], [64 x i32], [64 x ptr], [256 x ptr], ptr, [4 x ptr], %struct.vorbis_info_psy_global, %struct.bitrate_manager_info, %struct.highlevel_encode_setup, i32 }
%struct.vorbis_info_psy_global = type { i32, [7 x float], [7 x float], float, float, float, [15 x i32], [2 x [15 x i32]], [15 x i32], [15 x i32], [2 x [15 x i32]] }
%struct.bitrate_manager_info = type { i64, i64, i64, i64, double, double }
%struct.highlevel_encode_setup = type { i32, ptr, double, double, float, i32, i64, i64, double, i64, i64, double, i32, i32, i32, double, double, i32, double, double, double, double, [4 x %struct.highlevel_byblocktype] }
%struct.highlevel_byblocktype = type { double, double, double, double }
%struct.static_codebook = type { i64, i64, ptr, i32, i64, i64, i32, i32, ptr, i32 }

; 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: nounwind uwtable
declare dso_local i64 @oggpack_read(ptr noundef, i32 noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @icount(i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @res0_unpack(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %18 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 2848) #4
  store ptr %18, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.vorbis_info, ptr %19, i32 0, i32 7
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  store ptr %21, ptr %9, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call i64 @oggpack_read(ptr noundef %22, i32 noundef 24)
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %24, i32 0, i32 0
  store i64 %23, ptr %25, align 8, !tbaa !14
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call i64 @oggpack_read(ptr noundef %26, i32 noundef 24)
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %28, i32 0, i32 1
  store i64 %27, ptr %29, align 8, !tbaa !16
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call i64 @oggpack_read(ptr noundef %30, i32 noundef 24)
  %32 = add nsw i64 %31, 1
  %33 = trunc i64 %32 to i32
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %34, i32 0, i32 2
  store i32 %33, ptr %35, align 8, !tbaa !17
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call i64 @oggpack_read(ptr noundef %36, i32 noundef 6)
  %38 = add nsw i64 %37, 1
  %39 = trunc i64 %38 to i32
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %40, i32 0, i32 3
  store i32 %39, ptr %41, align 4, !tbaa !18
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = call i64 @oggpack_read(ptr noundef %42, i32 noundef 8)
  %44 = trunc i64 %43 to i32
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %45, i32 0, i32 5
  store i32 %44, ptr %46, align 4, !tbaa !19
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %47, i32 0, i32 5
  %49 = load i32, ptr %48, align 4, !tbaa !19
  %50 = icmp slt i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %2
  br label %226

52:                                               ; preds = %2
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %101, %52
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %55, i32 0, i32 3
  %57 = load i32, ptr %56, align 4, !tbaa !18
  %58 = icmp slt i32 %54, %57
  br i1 %58, label %59, label %104

59:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call i64 @oggpack_read(ptr noundef %60, i32 noundef 3)
  %62 = trunc i64 %61 to i32
  store i32 %62, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = call i64 @oggpack_read(ptr noundef %63, i32 noundef 1)
  %65 = trunc i64 %64 to i32
  store i32 %65, ptr %11, align 4, !tbaa !9
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = icmp slt i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %59
  store i32 2, ptr %13, align 4
  br label %98

69:                                               ; preds = %59
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %87

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = call i64 @oggpack_read(ptr noundef %73, i32 noundef 5)
  %75 = trunc i64 %74 to i32
  store i32 %75, ptr %12, align 4, !tbaa !9
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = icmp slt i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %72
  store i32 2, ptr %13, align 4
  br label %84

79:                                               ; preds = %72
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = shl i32 %80, 3
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = or i32 %82, %81
  store i32 %83, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %13, align 4
  br label %84

84:                                               ; preds = %79, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %85 = load i32, ptr %13, align 4
  switch i32 %85, label %98 [
    i32 0, label %86
  ]

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86, %69
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %89, i32 0, i32 6
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [64 x i32], ptr %90, i64 0, i64 %92
  store i32 %88, ptr %93, align 4, !tbaa !9
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = call i32 @icount(i32 noundef %94)
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = add nsw i32 %96, %95
  store i32 %97, ptr %7, align 4, !tbaa !9
  store i32 0, ptr %13, align 4
  br label %98

98:                                               ; preds = %87, %84, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %99 = load i32, ptr %13, align 4
  switch i32 %99, label %228 [
    i32 0, label %100
    i32 2, label %226
  ]

100:                                              ; preds = %98
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %6, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %6, align 4, !tbaa !9
  br label %53, !llvm.loop !20

104:                                              ; preds = %53
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %126, %104
  %106 = load i32, ptr %6, align 4, !tbaa !9
  %107 = load i32, ptr %7, align 4, !tbaa !9
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %129

109:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = call i64 @oggpack_read(ptr noundef %110, i32 noundef 8)
  %112 = trunc i64 %111 to i32
  store i32 %112, ptr %14, align 4, !tbaa !9
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = icmp slt i32 %113, 0
  br i1 %114, label %115, label %116

115:                                              ; preds = %109
  store i32 2, ptr %13, align 4
  br label %123

116:                                              ; preds = %109
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %118, i32 0, i32 7
  %120 = load i32, ptr %6, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [512 x i32], ptr %119, i64 0, i64 %121
  store i32 %117, ptr %122, align 4, !tbaa !9
  store i32 0, ptr %13, align 4
  br label %123

123:                                              ; preds = %116, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %124 = load i32, ptr %13, align 4
  switch i32 %124, label %228 [
    i32 0, label %125
    i32 2, label %226
  ]

125:                                              ; preds = %123
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %6, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %6, align 4, !tbaa !9
  br label %105, !llvm.loop !22

129:                                              ; preds = %105
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %130, i32 0, i32 5
  %132 = load i32, ptr %131, align 4, !tbaa !19
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.codec_setup_info, ptr %133, i32 0, i32 5
  %135 = load i32, ptr %134, align 8, !tbaa !23
  %136 = icmp sge i32 %132, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %129
  br label %226

138:                                              ; preds = %129
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %172, %138
  %140 = load i32, ptr %6, align 4, !tbaa !9
  %141 = load i32, ptr %7, align 4, !tbaa !9
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %143, label %175

143:                                              ; preds = %139
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %144, i32 0, i32 7
  %146 = load i32, ptr %6, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [512 x i32], ptr %145, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !9
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.codec_setup_info, ptr %150, i32 0, i32 5
  %152 = load i32, ptr %151, align 8, !tbaa !23
  %153 = icmp sge i32 %149, %152
  br i1 %153, label %154, label %155

154:                                              ; preds = %143
  br label %226

155:                                              ; preds = %143
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.codec_setup_info, ptr %156, i32 0, i32 14
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %158, i32 0, i32 7
  %160 = load i32, ptr %6, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [512 x i32], ptr %159, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [256 x ptr], ptr %157, i64 0, i64 %164
  %166 = load ptr, ptr %165, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.static_codebook, ptr %166, i32 0, i32 3
  %168 = load i32, ptr %167, align 8, !tbaa !30
  %169 = icmp eq i32 %168, 0
  br i1 %169, label %170, label %171

170:                                              ; preds = %155
  br label %226

171:                                              ; preds = %155
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %6, align 4, !tbaa !9
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %6, align 4, !tbaa !9
  br label %139, !llvm.loop !32

175:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.codec_setup_info, ptr %176, i32 0, i32 14
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %178, i32 0, i32 5
  %180 = load i32, ptr %179, align 4, !tbaa !19
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [256 x ptr], ptr %177, i64 0, i64 %181
  %183 = load ptr, ptr %182, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.static_codebook, ptr %183, i32 0, i32 1
  %185 = load i64, ptr %184, align 8, !tbaa !33
  %186 = trunc i64 %185 to i32
  store i32 %186, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.codec_setup_info, ptr %187, i32 0, i32 14
  %189 = load ptr, ptr %8, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %189, i32 0, i32 5
  %191 = load i32, ptr %190, align 4, !tbaa !19
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [256 x ptr], ptr %188, i64 0, i64 %192
  %194 = load ptr, ptr %193, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.static_codebook, ptr %194, i32 0, i32 0
  %196 = load i64, ptr %195, align 8, !tbaa !34
  %197 = trunc i64 %196 to i32
  store i32 %197, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 1, ptr %17, align 4, !tbaa !9
  %198 = load i32, ptr %16, align 4, !tbaa !9
  %199 = icmp slt i32 %198, 1
  br i1 %199, label %200, label %201

200:                                              ; preds = %175
  store i32 2, ptr %13, align 4
  br label %222

201:                                              ; preds = %175
  br label %202

202:                                              ; preds = %215, %201
  %203 = load i32, ptr %16, align 4, !tbaa !9
  %204 = icmp sgt i32 %203, 0
  br i1 %204, label %205, label %218

205:                                              ; preds = %202
  %206 = load ptr, ptr %8, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %206, i32 0, i32 3
  %208 = load i32, ptr %207, align 4, !tbaa !18
  %209 = load i32, ptr %17, align 4, !tbaa !9
  %210 = mul nsw i32 %209, %208
  store i32 %210, ptr %17, align 4, !tbaa !9
  %211 = load i32, ptr %17, align 4, !tbaa !9
  %212 = load i32, ptr %15, align 4, !tbaa !9
  %213 = icmp sgt i32 %211, %212
  br i1 %213, label %214, label %215

214:                                              ; preds = %205
  store i32 2, ptr %13, align 4
  br label %222

215:                                              ; preds = %205
  %216 = load i32, ptr %16, align 4, !tbaa !9
  %217 = add nsw i32 %216, -1
  store i32 %217, ptr %16, align 4, !tbaa !9
  br label %202, !llvm.loop !35

218:                                              ; preds = %202
  %219 = load i32, ptr %17, align 4, !tbaa !9
  %220 = load ptr, ptr %8, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.vorbis_info_residue0, ptr %220, i32 0, i32 4
  store i32 %219, ptr %221, align 8, !tbaa !36
  store i32 0, ptr %13, align 4
  br label %222

222:                                              ; preds = %218, %214, %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  %223 = load i32, ptr %13, align 4
  switch i32 %223, label %228 [
    i32 0, label %224
    i32 2, label %226
  ]

224:                                              ; preds = %222
  %225 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %225, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %228

226:                                              ; preds = %222, %170, %154, %137, %123, %98, %51
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  call void @res0_free_info(ptr noundef %227)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %228

228:                                              ; preds = %226, %224, %222, %123, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %229 = load ptr, ptr %3, align 8
  ret ptr %229
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind allocsize(0,1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
attributes #4 = { nounwind allocsize(0,1) }

!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, !6, i64 48}
!12 = !{!"vorbis_info", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !6, i64 48}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"vorbis_info_residue0", !13, i64 0, !13, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !7, i64 288, !7, i64 2336, !7, i64 2592}
!16 = !{!15, !13, i64 8}
!17 = !{!15, !10, i64 16}
!18 = !{!15, !10, i64 20}
!19 = !{!15, !10, i64 28}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!24, !10, i64 32}
!24 = !{!"codec_setup_info", !7, i64 0, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !7, i64 40, !7, i64 552, !7, i64 808, !7, i64 1320, !7, i64 1576, !7, i64 2088, !7, i64 2344, !7, i64 2856, !6, i64 4904, !7, i64 4912, !25, i64 4944, !27, i64 5440, !29, i64 5488, !10, i64 5776}
!25 = !{!"", !10, i64 0, !7, i64 4, !7, i64 32, !26, i64 60, !26, i64 64, !26, i64 68, !7, i64 72, !7, i64 132, !7, i64 252, !7, i64 312, !7, i64 372}
!26 = !{!"float", !7, i64 0}
!27 = !{!"bitrate_manager_info", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !28, i64 32, !28, i64 40}
!28 = !{!"double", !7, i64 0}
!29 = !{!"highlevel_encode_setup", !10, i64 0, !6, i64 8, !28, i64 16, !28, i64 24, !26, i64 32, !10, i64 36, !13, i64 40, !13, i64 48, !28, i64 56, !13, i64 64, !13, i64 72, !28, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !28, i64 104, !28, i64 112, !10, i64 120, !28, i64 128, !28, i64 136, !28, i64 144, !28, i64 152, !7, i64 160}
!30 = !{!31, !10, i64 24}
!31 = !{!"static_codebook", !13, i64 0, !13, i64 8, !6, i64 16, !10, i64 24, !13, i64 32, !13, i64 40, !10, i64 48, !10, i64 52, !6, i64 56, !10, i64 64}
!32 = distinct !{!32, !21}
!33 = !{!31, !13, i64 8}
!34 = !{!31, !13, i64 0}
!35 = distinct !{!35, !21}
!36 = !{!15, !10, 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: nounwind uwtable
declare dso_local i64 @oggpack_read(ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @icount(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @res0_unpack(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call noalias dereferenceable_or_null(2848) ptr @calloc(i64 noundef 1, i64 noundef 2848) #2
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 24)
  store i64 %6, ptr %3, align 8, !tbaa !12
  %7 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 24)
  %8 = getelementptr inbounds i8, ptr %3, i64 8
  store i64 %7, ptr %8, align 8, !tbaa !14
  %9 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 24)
  %10 = trunc i64 %9 to i32
  %11 = add i32 %10, 1
  %12 = getelementptr inbounds i8, ptr %3, i64 16
  store i32 %11, ptr %12, align 8, !tbaa !15
  %13 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 6)
  %14 = trunc i64 %13 to i32
  %15 = add i32 %14, 1
  %16 = getelementptr inbounds i8, ptr %3, i64 20
  store i32 %15, ptr %16, align 4, !tbaa !16
  %17 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 8)
  %18 = trunc i64 %17 to i32
  %19 = getelementptr inbounds i8, ptr %3, i64 28
  store i32 %18, ptr %19, align 4, !tbaa !17
  %20 = icmp slt i32 %18, 0
  br i1 %20, label %.thread95, label %.preheader109

.preheader109:                                    ; preds = %2
  %21 = icmp ult i32 %14, 2147483647
  br i1 %21, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %.preheader109
  %22 = getelementptr inbounds i8, ptr %3, i64 32
  %23 = sext i32 %15 to i64
  br label %26

.preheader107:                                    ; preds = %.thread
  %24 = icmp sgt i32 %41, 0
  br i1 %24, label %.lr.ph116, label %._crit_edge

.lr.ph116:                                        ; preds = %.preheader107
  %25 = getelementptr inbounds i8, ptr %3, i64 288
  %wide.trip.count = zext nneg i32 %41 to i64
  br label %43

26:                                               ; preds = %.lr.ph, %.thread
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.thread ]
  %.072113 = phi i32 [ 0, %.lr.ph ], [ %41, %.thread ]
  %27 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 3)
  %28 = trunc i64 %27 to i32
  %29 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 1)
  %30 = trunc i64 %29 to i32
  %31 = icmp slt i32 %30, 0
  br i1 %31, label %.thread95, label %32

32:                                               ; preds = %26
  %.not83 = icmp eq i32 %30, 0
  br i1 %.not83, label %.thread, label %33

33:                                               ; preds = %32
  %34 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 5)
  %35 = trunc i64 %34 to i32
  %36 = icmp sgt i32 %35, -1
  %37 = shl i32 %35, 3
  %38 = or i32 %37, %28
  br i1 %36, label %.thread, label %.thread95

.thread:                                          ; preds = %32, %33
  %.175 = phi i32 [ %38, %33 ], [ %28, %32 ]
  %39 = getelementptr inbounds [64 x i32], ptr %22, i64 0, i64 %indvars.iv
  store i32 %.175, ptr %39, align 4, !tbaa !18
  %40 = tail call i32 @icount(i32 noundef %.175)
  %41 = add nsw i32 %40, %.072113
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = icmp slt i64 %indvars.iv.next, %23
  br i1 %42, label %26, label %.preheader107, !llvm.loop !19

43:                                               ; preds = %.lr.ph116, %47
  %indvars.iv127 = phi i64 [ 0, %.lr.ph116 ], [ %indvars.iv.next128, %47 ]
  %44 = tail call i64 @oggpack_read(ptr noundef %1, i32 noundef 8)
  %45 = trunc i64 %44 to i32
  %46 = icmp slt i32 %45, 0
  br i1 %46, label %.thread95, label %47

47:                                               ; preds = %43
  %48 = getelementptr inbounds [512 x i32], ptr %25, i64 0, i64 %indvars.iv127
  store i32 %45, ptr %48, align 4, !tbaa !18
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %43, !llvm.loop !21

._crit_edge:                                      ; preds = %47, %.preheader107
  %49 = getelementptr inbounds i8, ptr %5, i64 32
  %50 = load i32, ptr %49, align 8, !tbaa !22
  %.not = icmp sgt i32 %50, %18
  br i1 %.not, label %.preheader105, label %.thread95

._crit_edge.thread:                               ; preds = %.preheader109
  %51 = getelementptr inbounds i8, ptr %5, i64 32
  %52 = load i32, ptr %51, align 8, !tbaa !22
  %.not138 = icmp sgt i32 %52, %18
  br i1 %.not138, label %._crit_edge119, label %.thread95

.preheader105:                                    ; preds = %._crit_edge
  br i1 %24, label %.lr.ph118, label %._crit_edge119

.lr.ph118:                                        ; preds = %.preheader105
  %53 = getelementptr inbounds i8, ptr %3, i64 288
  %54 = getelementptr inbounds i8, ptr %5, i64 2856
  %wide.trip.count133 = zext nneg i32 %41 to i64
  br label %56

55:                                               ; preds = %59
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %exitcond134.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count133
  br i1 %exitcond134.not, label %._crit_edge119, label %56, !llvm.loop !29

56:                                               ; preds = %.lr.ph118, %55
  %indvars.iv130 = phi i64 [ 0, %.lr.ph118 ], [ %indvars.iv.next131, %55 ]
  %57 = getelementptr inbounds [512 x i32], ptr %53, i64 0, i64 %indvars.iv130
  %58 = load i32, ptr %57, align 4, !tbaa !18
  %.not82 = icmp slt i32 %58, %50
  br i1 %.not82, label %59, label %.thread95

59:                                               ; preds = %56
  %60 = sext i32 %58 to i64
  %61 = getelementptr inbounds [256 x ptr], ptr %54, i64 0, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !30
  %63 = getelementptr inbounds i8, ptr %62, i64 24
  %64 = load i32, ptr %63, align 8, !tbaa !31
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %.thread95, label %55

._crit_edge119:                                   ; preds = %55, %._crit_edge.thread, %.preheader105
  %66 = getelementptr inbounds i8, ptr %5, i64 2856
  %67 = and i64 %17, 2147483647
  %68 = getelementptr inbounds [256 x ptr], ptr %66, i64 0, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !30
  %70 = getelementptr inbounds i8, ptr %69, i64 8
  %71 = load i64, ptr %70, align 8, !tbaa !33
  %72 = trunc i64 %71 to i32
  %73 = load i64, ptr %69, align 8, !tbaa !34
  %74 = trunc i64 %73 to i32
  %75 = icmp slt i32 %74, 1
  br i1 %75, label %.thread95, label %.preheader

76:                                               ; preds = %.preheader
  %77 = add nsw i32 %.066120, -1
  %78 = icmp sgt i32 %.066120, 1
  br i1 %78, label %.preheader, label %81, !llvm.loop !35

.preheader:                                       ; preds = %._crit_edge119, %76
  %.0121 = phi i32 [ %79, %76 ], [ 1, %._crit_edge119 ]
  %.066120 = phi i32 [ %77, %76 ], [ %74, %._crit_edge119 ]
  %79 = mul nsw i32 %15, %.0121
  %80 = icmp sgt i32 %79, %72
  br i1 %80, label %.thread95, label %76

81:                                               ; preds = %76
  %82 = getelementptr inbounds i8, ptr %3, i64 24
  store i32 %79, ptr %82, align 8, !tbaa !36
  br label %83

.thread95:                                        ; preds = %33, %26, %43, %59, %56, %.preheader, %._crit_edge.thread, %._crit_edge119, %._crit_edge, %2
  tail call void @res0_free_info(ptr noundef nonnull %3)
  br label %83

83:                                               ; preds = %81, %.thread95
  %.067 = phi ptr [ null, %.thread95 ], [ %3, %81 ]
  ret ptr %.067
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind allocsize(0,1) }

!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, !11, i64 48}
!6 = !{!"vorbis_info", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !11, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"vorbis_info_residue0", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !8, i64 32, !8, i64 288, !8, i64 2336, !8, i64 2592}
!14 = !{!13, !10, i64 8}
!15 = !{!13, !7, i64 16}
!16 = !{!13, !7, i64 20}
!17 = !{!13, !7, i64 28}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!23, !7, i64 32}
!23 = !{!"codec_setup_info", !8, i64 0, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !8, i64 552, !8, i64 808, !8, i64 1320, !8, i64 1576, !8, i64 2088, !8, i64 2344, !8, i64 2856, !11, i64 4904, !8, i64 4912, !24, i64 4944, !26, i64 5440, !28, i64 5488, !7, i64 5776}
!24 = !{!"", !7, i64 0, !8, i64 4, !8, i64 32, !25, i64 60, !25, i64 64, !25, i64 68, !8, i64 72, !8, i64 132, !8, i64 252, !8, i64 312, !8, i64 372}
!25 = !{!"float", !8, i64 0}
!26 = !{!"bitrate_manager_info", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !27, i64 32, !27, i64 40}
!27 = !{!"double", !8, i64 0}
!28 = !{!"highlevel_encode_setup", !7, i64 0, !11, i64 8, !27, i64 16, !27, i64 24, !25, i64 32, !7, i64 36, !10, i64 40, !10, i64 48, !27, i64 56, !10, i64 64, !10, i64 72, !27, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !27, i64 104, !27, i64 112, !7, i64 120, !27, i64 128, !27, i64 136, !27, i64 144, !27, i64 152, !8, i64 160}
!29 = distinct !{!29, !20}
!30 = !{!11, !11, i64 0}
!31 = !{!32, !7, i64 24}
!32 = !{!"static_codebook", !10, i64 0, !10, i64 8, !11, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !7, i64 48, !7, i64 52, !11, i64 56, !7, i64 64}
!33 = !{!32, !10, i64 8}
!34 = !{!32, !10, i64 0}
!35 = distinct !{!35, !20}
!36 = !{!13, !7, i64 24}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass