; 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.oggpack_buffer = type { i64, i32, ptr, ptr, i64 }
%struct.vorbis_dsp_state = type { i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr }
%struct.vorbis_info = type { i32, i32, i64, i64, i64, i64, i64, ptr }
%struct.private_state = type { ptr, [2 x i32], [2 x ptr], [2 x %struct.drft_lookup], i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.bitrate_manager_state, i64 }
%struct.drft_lookup = type { i32, ptr, ptr }
%struct.bitrate_manager_state = type { i32, i64, i64, i64, i64, i64, i64, double, ptr, i32 }
%struct.ogg_packet = type { ptr, i64, i64, i64, i64, i64 }

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i64 @oggpack_bytes(ptr noundef) #0

; 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) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @_vorbis_pack_comment(ptr noundef, ptr noundef) #0

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

25:                                               ; preds = %5
  %26 = load ptr, ptr %13, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.vorbis_info, ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !15
  %29 = icmp sle i32 %28, 0
  br i1 %29, label %35, label %30

30:                                               ; preds = %25
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.vorbis_info, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !15
  %34 = icmp sgt i32 %33, 256
  br i1 %34, label %35, label %36

35:                                               ; preds = %30, %25, %5
  store ptr null, ptr %15, align 8, !tbaa !5
  store i32 -129, ptr %12, align 4, !tbaa !9
  br label %157

36:                                               ; preds = %30
  call void @oggpack_writeinit(ptr noundef %14)
  %37 = load ptr, ptr %13, align 8, !tbaa !5
  %38 = call i32 @_vorbis_pack_info(ptr noundef %14, ptr noundef %37)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %36
  br label %157

41:                                               ; preds = %36
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.private_state, ptr %42, i32 0, i32 9
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %50

46:                                               ; preds = %41
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.private_state, ptr %47, i32 0, i32 9
  %49 = load ptr, ptr %48, align 8, !tbaa !17
  call void @free(ptr noundef %49) #6
  br label %50

50:                                               ; preds = %46, %41
  %51 = call i64 @oggpack_bytes(ptr noundef %14)
  %52 = call noalias ptr @malloc(i64 noundef %51) #7
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.private_state, ptr %53, i32 0, i32 9
  store ptr %52, ptr %54, align 8, !tbaa !17
  %55 = load ptr, ptr %15, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.private_state, ptr %55, i32 0, i32 9
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  %58 = getelementptr inbounds %struct.oggpack_buffer, ptr %14, i32 0, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !21
  %60 = call i64 @oggpack_bytes(ptr noundef %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %57, ptr align 1 %59, i64 %60, i1 false)
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.private_state, ptr %61, i32 0, i32 9
  %63 = load ptr, ptr %62, align 8, !tbaa !17
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ogg_packet, ptr %64, i32 0, i32 0
  store ptr %63, ptr %65, align 8, !tbaa !23
  %66 = call i64 @oggpack_bytes(ptr noundef %14)
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ogg_packet, ptr %67, i32 0, i32 1
  store i64 %66, ptr %68, align 8, !tbaa !25
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ogg_packet, ptr %69, i32 0, i32 2
  store i64 1, ptr %70, align 8, !tbaa !26
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ogg_packet, ptr %71, i32 0, i32 3
  store i64 0, ptr %72, align 8, !tbaa !27
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ogg_packet, ptr %73, i32 0, i32 4
  store i64 0, ptr %74, align 8, !tbaa !28
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ogg_packet, ptr %75, i32 0, i32 5
  store i64 0, ptr %76, align 8, !tbaa !29
  call void @oggpack_reset(ptr noundef %14)
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = call i32 @_vorbis_pack_comment(ptr noundef %14, ptr noundef %77)
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %50
  br label %157

81:                                               ; preds = %50
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.private_state, ptr %82, i32 0, i32 10
  %84 = load ptr, ptr %83, align 8, !tbaa !30
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %90

86:                                               ; preds = %81
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.private_state, ptr %87, i32 0, i32 10
  %89 = load ptr, ptr %88, align 8, !tbaa !30
  call void @free(ptr noundef %89) #6
  br label %90

90:                                               ; preds = %86, %81
  %91 = call i64 @oggpack_bytes(ptr noundef %14)
  %92 = call noalias ptr @malloc(i64 noundef %91) #7
  %93 = load ptr, ptr %15, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.private_state, ptr %93, i32 0, i32 10
  store ptr %92, ptr %94, align 8, !tbaa !30
  %95 = load ptr, ptr %15, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.private_state, ptr %95, i32 0, i32 10
  %97 = load ptr, ptr %96, align 8, !tbaa !30
  %98 = getelementptr inbounds %struct.oggpack_buffer, ptr %14, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !21
  %100 = call i64 @oggpack_bytes(ptr noundef %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %97, ptr align 1 %99, i64 %100, i1 false)
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.private_state, ptr %101, i32 0, i32 10
  %103 = load ptr, ptr %102, align 8, !tbaa !30
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.ogg_packet, ptr %104, i32 0, i32 0
  store ptr %103, ptr %105, align 8, !tbaa !23
  %106 = call i64 @oggpack_bytes(ptr noundef %14)
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ogg_packet, ptr %107, i32 0, i32 1
  store i64 %106, ptr %108, align 8, !tbaa !25
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ogg_packet, ptr %109, i32 0, i32 2
  store i64 0, ptr %110, align 8, !tbaa !26
  %111 = load ptr, ptr %10, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ogg_packet, ptr %111, i32 0, i32 3
  store i64 0, ptr %112, align 8, !tbaa !27
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.ogg_packet, ptr %113, i32 0, i32 4
  store i64 0, ptr %114, align 8, !tbaa !28
  %115 = load ptr, ptr %10, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.ogg_packet, ptr %115, i32 0, i32 5
  store i64 1, ptr %116, align 8, !tbaa !29
  call void @oggpack_reset(ptr noundef %14)
  %117 = load ptr, ptr %13, align 8, !tbaa !5
  %118 = call i32 @_vorbis_pack_books(ptr noundef %14, ptr noundef %117)
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %90
  br label %157

121:                                              ; preds = %90
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.private_state, ptr %122, i32 0, i32 11
  %124 = load ptr, ptr %123, align 8, !tbaa !31
  %125 = icmp ne ptr %124, null
  br i1 %125, label %126, label %130

126:                                              ; preds = %121
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.private_state, ptr %127, i32 0, i32 11
  %129 = load ptr, ptr %128, align 8, !tbaa !31
  call void @free(ptr noundef %129) #6
  br label %130

130:                                              ; preds = %126, %121
  %131 = call i64 @oggpack_bytes(ptr noundef %14)
  %132 = call noalias ptr @malloc(i64 noundef %131) #7
  %133 = load ptr, ptr %15, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.private_state, ptr %133, i32 0, i32 11
  store ptr %132, ptr %134, align 8, !tbaa !31
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.private_state, ptr %135, i32 0, i32 11
  %137 = load ptr, ptr %136, align 8, !tbaa !31
  %138 = getelementptr inbounds %struct.oggpack_buffer, ptr %14, i32 0, i32 2
  %139 = load ptr, ptr %138, align 8, !tbaa !21
  %140 = call i64 @oggpack_bytes(ptr noundef %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %137, ptr align 1 %139, i64 %140, i1 false)
  %141 = load ptr, ptr %15, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.private_state, ptr %141, i32 0, i32 11
  %143 = load ptr, ptr %142, align 8, !tbaa !31
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.ogg_packet, ptr %144, i32 0, i32 0
  store ptr %143, ptr %145, align 8, !tbaa !23
  %146 = call i64 @oggpack_bytes(ptr noundef %14)
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ogg_packet, ptr %147, i32 0, i32 1
  store i64 %146, ptr %148, align 8, !tbaa !25
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.ogg_packet, ptr %149, i32 0, i32 2
  store i64 0, ptr %150, align 8, !tbaa !26
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.ogg_packet, ptr %151, i32 0, i32 3
  store i64 0, ptr %152, align 8, !tbaa !27
  %153 = load ptr, ptr %11, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ogg_packet, ptr %153, i32 0, i32 4
  store i64 0, ptr %154, align 8, !tbaa !28
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.ogg_packet, ptr %155, i32 0, i32 5
  store i64 2, ptr %156, align 8, !tbaa !29
  call void @oggpack_writeclear(ptr noundef %14)
  store i32 0, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %205

157:                                              ; preds = %120, %80, %40, %35
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %158, i8 0, i64 48, i1 false)
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %159, i8 0, i64 48, i1 false)
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %160, i8 0, i64 48, i1 false)
  %161 = load ptr, ptr %15, align 8, !tbaa !5
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %203

163:                                              ; preds = %157
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.vorbis_info, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 4, !tbaa !15
  %167 = icmp sgt i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %163
  call void @oggpack_writeclear(ptr noundef %14)
  br label %169

169:                                              ; preds = %168, %163
  %170 = load ptr, ptr %15, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.private_state, ptr %170, i32 0, i32 9
  %172 = load ptr, ptr %171, align 8, !tbaa !17
  %173 = icmp ne ptr %172, null
  br i1 %173, label %174, label %178

174:                                              ; preds = %169
  %175 = load ptr, ptr %15, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.private_state, ptr %175, i32 0, i32 9
  %177 = load ptr, ptr %176, align 8, !tbaa !17
  call void @free(ptr noundef %177) #6
  br label %178

178:                                              ; preds = %174, %169
  %179 = load ptr, ptr %15, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.private_state, ptr %179, i32 0, i32 10
  %181 = load ptr, ptr %180, align 8, !tbaa !30
  %182 = icmp ne ptr %181, null
  br i1 %182, label %183, label %187

183:                                              ; preds = %178
  %184 = load ptr, ptr %15, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.private_state, ptr %184, i32 0, i32 10
  %186 = load ptr, ptr %185, align 8, !tbaa !30
  call void @free(ptr noundef %186) #6
  br label %187

187:                                              ; preds = %183, %178
  %188 = load ptr, ptr %15, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.private_state, ptr %188, i32 0, i32 11
  %190 = load ptr, ptr %189, align 8, !tbaa !31
  %191 = icmp ne ptr %190, null
  br i1 %191, label %192, label %196

192:                                              ; preds = %187
  %193 = load ptr, ptr %15, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.private_state, ptr %193, i32 0, i32 11
  %195 = load ptr, ptr %194, align 8, !tbaa !31
  call void @free(ptr noundef %195) #6
  br label %196

196:                                              ; preds = %192, %187
  %197 = load ptr, ptr %15, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.private_state, ptr %197, i32 0, i32 9
  store ptr null, ptr %198, align 8, !tbaa !17
  %199 = load ptr, ptr %15, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.private_state, ptr %199, i32 0, i32 10
  store ptr null, ptr %200, align 8, !tbaa !30
  %201 = load ptr, ptr %15, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.private_state, ptr %201, i32 0, i32 11
  store ptr null, ptr %202, align 8, !tbaa !31
  br label %203

203:                                              ; preds = %196, %157
  %204 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %204, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %205

205:                                              ; preds = %203, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %206 = load i32, ptr %6, align 4
  ret i32 %206
}

; Function Attrs: nounwind uwtable
declare hidden i32 @_vorbis_pack_info(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @_vorbis_pack_books(ptr noundef, ptr noundef) #0

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

!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 8}
!12 = !{!"vorbis_dsp_state", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !6, i64 136}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !6, i64 136}
!15 = !{!16, !10, i64 4}
!16 = !{!"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}
!17 = !{!18, !6, i64 120}
!18 = !{!"private_state", !6, i64 0, !7, i64 8, !7, i64 16, !7, i64 32, !10, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !19, i64 144, !13, i64 224}
!19 = !{!"bitrate_manager_state", !10, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !20, i64 56, !6, i64 64, !10, i64 72}
!20 = !{!"double", !7, i64 0}
!21 = !{!22, !6, i64 16}
!22 = !{!"", !13, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !13, i64 32}
!23 = !{!24, !6, i64 0}
!24 = !{!"", !6, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!25 = !{!24, !13, i64 8}
!26 = !{!24, !13, i64 16}
!27 = !{!24, !13, i64 24}
!28 = !{!24, !13, i64 32}
!29 = !{!24, !13, i64 40}
!30 = !{!18, !6, i64 128}
!31 = !{!18, !6, i64 136}


; 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"

%struct.oggpack_buffer = type { i64, i32, ptr, ptr, i64 }

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -130, 1) i32 @vorbis_analysis_headerout(ptr nocapture noundef readonly %0, ptr noundef %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #0 {
  %6 = alloca %struct.oggpack_buffer, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 136
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %62, label %11

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %8, i64 4
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = add i32 %13, -257
  %or.cond = icmp ult i32 %14, -256
  br i1 %or.cond, label %62, label %15

15:                                               ; preds = %11
  call void @oggpack_writeinit(ptr noundef nonnull %6)
  %16 = call i32 @_vorbis_pack_info(ptr noundef nonnull %6, ptr noundef nonnull %8)
  %.not66 = icmp eq i32 %16, 0
  br i1 %.not66, label %17, label %62

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %10, i64 120
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %.not67 = icmp eq ptr %19, null
  br i1 %.not67, label %21, label %20

20:                                               ; preds = %17
  call void @free(ptr noundef nonnull %19) #6
  br label %21

21:                                               ; preds = %20, %17
  %22 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  %23 = call noalias ptr @malloc(i64 noundef %22) #7
  store ptr %23, ptr %18, align 8, !tbaa !15
  %24 = getelementptr inbounds i8, ptr %6, i64 16
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  %26 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %23, ptr align 1 %25, i64 %26, i1 false)
  %27 = load ptr, ptr %18, align 8, !tbaa !15
  store ptr %27, ptr %2, align 8, !tbaa !21
  %28 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  %29 = getelementptr inbounds i8, ptr %2, i64 8
  store i64 %28, ptr %29, align 8, !tbaa !23
  %30 = getelementptr inbounds i8, ptr %2, i64 16
  store i64 1, ptr %30, align 8, !tbaa !24
  %31 = getelementptr inbounds i8, ptr %2, i64 24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %31, i8 0, i64 24, i1 false)
  call void @oggpack_reset(ptr noundef nonnull %6)
  %32 = call i32 @_vorbis_pack_comment(ptr noundef nonnull %6, ptr noundef %1)
  %.not68 = icmp eq i32 %32, 0
  br i1 %.not68, label %33, label %62

33:                                               ; preds = %21
  %34 = getelementptr inbounds i8, ptr %10, i64 128
  %35 = load ptr, ptr %34, align 8, !tbaa !25
  %.not69 = icmp eq ptr %35, null
  br i1 %.not69, label %37, label %36

36:                                               ; preds = %33
  call void @free(ptr noundef nonnull %35) #6
  br label %37

37:                                               ; preds = %36, %33
  %38 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  %39 = call noalias ptr @malloc(i64 noundef %38) #7
  store ptr %39, ptr %34, align 8, !tbaa !25
  %40 = load ptr, ptr %24, align 8, !tbaa !19
  %41 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %39, ptr align 1 %40, i64 %41, i1 false)
  %42 = load ptr, ptr %34, align 8, !tbaa !25
  store ptr %42, ptr %3, align 8, !tbaa !21
  %43 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  %44 = getelementptr inbounds i8, ptr %3, i64 8
  store i64 %43, ptr %44, align 8, !tbaa !23
  %45 = getelementptr inbounds i8, ptr %3, i64 16
  %46 = getelementptr inbounds i8, ptr %3, i64 40
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %45, i8 0, i64 24, i1 false)
  store i64 1, ptr %46, align 8, !tbaa !26
  call void @oggpack_reset(ptr noundef nonnull %6)
  %47 = call i32 @_vorbis_pack_books(ptr noundef nonnull %6, ptr noundef nonnull %8)
  %.not70 = icmp eq i32 %47, 0
  br i1 %.not70, label %48, label %62

48:                                               ; preds = %37
  %49 = getelementptr inbounds i8, ptr %10, i64 136
  %50 = load ptr, ptr %49, align 8, !tbaa !27
  %.not71 = icmp eq ptr %50, null
  br i1 %.not71, label %52, label %51

51:                                               ; preds = %48
  call void @free(ptr noundef nonnull %50) #6
  br label %52

52:                                               ; preds = %51, %48
  %53 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  %54 = call noalias ptr @malloc(i64 noundef %53) #7
  store ptr %54, ptr %49, align 8, !tbaa !27
  %55 = load ptr, ptr %24, align 8, !tbaa !19
  %56 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %54, ptr align 1 %55, i64 %56, i1 false)
  %57 = load ptr, ptr %49, align 8, !tbaa !27
  store ptr %57, ptr %4, align 8, !tbaa !21
  %58 = call i64 @oggpack_bytes(ptr noundef nonnull %6)
  %59 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %58, ptr %59, align 8, !tbaa !23
  %60 = getelementptr inbounds i8, ptr %4, i64 16
  %61 = getelementptr inbounds i8, ptr %4, i64 40
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %60, i8 0, i64 24, i1 false)
  store i64 2, ptr %61, align 8, !tbaa !26
  call void @oggpack_writeclear(ptr noundef nonnull %6)
  br label %81

62:                                               ; preds = %5, %11, %37, %21, %15
  %.057 = phi i32 [ -130, %15 ], [ -130, %21 ], [ -130, %37 ], [ -129, %11 ], [ -129, %5 ]
  %.0 = phi ptr [ %10, %15 ], [ %10, %21 ], [ %10, %37 ], [ null, %11 ], [ null, %5 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %2, i8 0, i64 48, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %3, i8 0, i64 48, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %4, i8 0, i64 48, i1 false)
  %.not72 = icmp eq ptr %.0, null
  br i1 %.not72, label %81, label %63

63:                                               ; preds = %62
  %64 = getelementptr inbounds i8, ptr %8, i64 4
  %65 = load i32, ptr %64, align 4, !tbaa !13
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  call void @oggpack_writeclear(ptr noundef nonnull %6)
  br label %68

68:                                               ; preds = %67, %63
  %69 = getelementptr inbounds i8, ptr %.0, i64 120
  %70 = load ptr, ptr %69, align 8, !tbaa !15
  %.not73 = icmp eq ptr %70, null
  br i1 %.not73, label %72, label %71

71:                                               ; preds = %68
  call void @free(ptr noundef nonnull %70) #6
  br label %72

72:                                               ; preds = %71, %68
  %73 = getelementptr inbounds i8, ptr %.0, i64 128
  %74 = load ptr, ptr %73, align 8, !tbaa !25
  %.not74 = icmp eq ptr %74, null
  br i1 %.not74, label %76, label %75

75:                                               ; preds = %72
  call void @free(ptr noundef nonnull %74) #6
  br label %76

76:                                               ; preds = %75, %72
  %77 = getelementptr inbounds i8, ptr %.0, i64 136
  %78 = load ptr, ptr %77, align 8, !tbaa !27
  %.not75 = icmp eq ptr %78, null
  br i1 %.not75, label %80, label %79

79:                                               ; preds = %76
  call void @free(ptr noundef nonnull %78) #6
  br label %80

80:                                               ; preds = %79, %76
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %69, i8 0, i64 24, i1 false)
  br label %81

81:                                               ; preds = %62, %80, %52
  %.056 = phi i32 [ 0, %52 ], [ %.057, %80 ], [ %.057, %62 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #6
  ret i32 %.056
}

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 8}
!6 = !{!"vorbis_dsp_state", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !10, i64 136}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !10, i64 136}
!13 = !{!14, !7, i64 4}
!14 = !{!"vorbis_info", !7, i64 0, !7, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !10, i64 48}
!15 = !{!16, !10, i64 120}
!16 = !{!"private_state", !10, i64 0, !8, i64 8, !8, i64 16, !8, i64 32, !7, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !17, i64 144, !11, i64 224}
!17 = !{!"bitrate_manager_state", !7, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !18, i64 56, !10, i64 64, !7, i64 72}
!18 = !{!"double", !8, i64 0}
!19 = !{!20, !10, i64 16}
!20 = !{!"", !11, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !11, i64 32}
!21 = !{!22, !10, i64 0}
!22 = !{!"", !10, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!23 = !{!22, !11, i64 8}
!24 = !{!22, !11, i64 16}
!25 = !{!16, !10, i64 128}
!26 = !{!22, !11, i64 40}
!27 = !{!16, !10, i64 136}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass