; LLVM IR from reworks-org/galaxy :: deps/sfml_deps/vorbis-src/vq (bookutil)

; 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.codebook = type { i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32 }
%struct.static_codebook = type { i64, i64, ptr, i32, i64, i64, i32, i32, ptr, i32 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1

; 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 ptr @get_line(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @reset_next_value() #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @find_seek_to(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @codebook_load(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %9 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 96) #8
  store ptr %9, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %10 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 72) #8
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.codebook, ptr %11, i32 0, i32 3
  store ptr %10, ptr %12, align 8, !tbaa !9
  store ptr %10, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = call noalias ptr @fopen(ptr noundef %13, ptr noundef @.str)
  store ptr %14, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %21

17:                                               ; preds = %1
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str.1, ptr noundef %19) #7
  call void @exit(i32 noundef 1) #9
  unreachable

21:                                               ; preds = %1
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call ptr @find_seek_to(ptr noundef %22, ptr noundef @.str.2)
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call ptr @get_line(ptr noundef %24)
  store ptr %25, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.static_codebook, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.static_codebook, ptr %29, i32 0, i32 1
  %31 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %26, ptr noundef @.str.3, ptr noundef %28, ptr noundef %30) #7
  %32 = icmp ne i32 %31, 2
  br i1 %32, label %33, label %38

33:                                               ; preds = %21
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.4, ptr noundef %35, ptr noundef %36) #7
  call void @exit(i32 noundef 1) #9
  unreachable

38:                                               ; preds = %21
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call ptr @get_line(ptr noundef %39)
  store ptr %40, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = call ptr @get_line(ptr noundef %41)
  store ptr %42, ptr %7, align 8, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.static_codebook, ptr %44, i32 0, i32 3
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.static_codebook, ptr %46, i32 0, i32 4
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.static_codebook, ptr %48, i32 0, i32 5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.static_codebook, ptr %50, i32 0, i32 6
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.static_codebook, ptr %52, i32 0, i32 7
  %54 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %43, ptr noundef @.str.5, ptr noundef %45, ptr noundef %47, ptr noundef %49, ptr noundef %51, ptr noundef %53) #7
  %55 = icmp ne i32 %54, 5
  br i1 %55, label %56, label %61

56:                                               ; preds = %38
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.4, ptr noundef %58, ptr noundef %59) #7
  call void @exit(i32 noundef 1) #9
  unreachable

61:                                               ; preds = %38
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.static_codebook, ptr %62, i32 0, i32 3
  %64 = load i32, ptr %63, align 8, !tbaa !14
  switch i32 %64, label %79 [
    i32 0, label %65
    i32 1, label %66
    i32 2, label %70
  ]

65:                                               ; preds = %61
  store i32 0, ptr %5, align 4, !tbaa !13
  br label %79

66:                                               ; preds = %61
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = call i64 @_book_maptype1_quantvals(ptr noundef %67)
  %69 = trunc i64 %68 to i32
  store i32 %69, ptr %5, align 4, !tbaa !13
  br label %79

70:                                               ; preds = %61
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.static_codebook, ptr %71, i32 0, i32 1
  %73 = load i64, ptr %72, align 8, !tbaa !16
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.static_codebook, ptr %74, i32 0, i32 0
  %76 = load i64, ptr %75, align 8, !tbaa !17
  %77 = mul nsw i64 %73, %76
  %78 = trunc i64 %77 to i32
  store i32 %78, ptr %5, align 4, !tbaa !13
  br label %79

79:                                               ; preds = %70, %66, %65, %61
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = call ptr @find_seek_to(ptr noundef %80, ptr noundef @.str.6)
  call void @reset_next_value()
  %82 = load i32, ptr %5, align 4, !tbaa !13
  %83 = sext i32 %82 to i64
  %84 = mul i64 8, %83
  %85 = call noalias ptr @malloc(i64 noundef %84) #10
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.static_codebook, ptr %86, i32 0, i32 8
  store ptr %85, ptr %87, align 8, !tbaa !18
  store i64 0, ptr %8, align 8, !tbaa !19
  br label %88

88:                                               ; preds = %107, %79
  %89 = load i64, ptr %8, align 8, !tbaa !19
  %90 = load i32, ptr %5, align 4, !tbaa !13
  %91 = sext i32 %90 to i64
  %92 = icmp slt i64 %89, %91
  br i1 %92, label %93, label %110

93:                                               ; preds = %88
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.static_codebook, ptr %95, i32 0, i32 8
  %97 = load ptr, ptr %96, align 8, !tbaa !18
  %98 = load i64, ptr %8, align 8, !tbaa !19
  %99 = getelementptr inbounds i64, ptr %97, i64 %98
  %100 = call i32 @get_next_ivalue(ptr noundef %94, ptr noundef %99)
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %106

102:                                              ; preds = %93
  %103 = load ptr, ptr @stderr, align 8, !tbaa !5
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.7, ptr noundef %104) #7
  call void @exit(i32 noundef 1) #9
  unreachable

106:                                              ; preds = %93
  br label %107

107:                                              ; preds = %106
  %108 = load i64, ptr %8, align 8, !tbaa !19
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %8, align 8, !tbaa !19
  br label %88, !llvm.loop !20

110:                                              ; preds = %88
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = call ptr @find_seek_to(ptr noundef %111, ptr noundef @.str.8)
  call void @reset_next_value()
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.static_codebook, ptr %113, i32 0, i32 1
  %115 = load i64, ptr %114, align 8, !tbaa !16
  %116 = mul i64 8, %115
  %117 = call noalias ptr @malloc(i64 noundef %116) #10
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.static_codebook, ptr %118, i32 0, i32 2
  store ptr %117, ptr %119, align 8, !tbaa !22
  store i64 0, ptr %8, align 8, !tbaa !19
  br label %120

120:                                              ; preds = %140, %110
  %121 = load i64, ptr %8, align 8, !tbaa !19
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.static_codebook, ptr %122, i32 0, i32 1
  %124 = load i64, ptr %123, align 8, !tbaa !16
  %125 = icmp slt i64 %121, %124
  br i1 %125, label %126, label %143

126:                                              ; preds = %120
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.static_codebook, ptr %128, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !22
  %131 = load i64, ptr %8, align 8, !tbaa !19
  %132 = getelementptr inbounds i64, ptr %130, i64 %131
  %133 = call i32 @get_next_ivalue(ptr noundef %127, ptr noundef %132)
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %139

135:                                              ; preds = %126
  %136 = load ptr, ptr @stderr, align 8, !tbaa !5
  %137 = load ptr, ptr %2, align 8, !tbaa !5
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef @.str.7, ptr noundef %137) #7
  call void @exit(i32 noundef 1) #9
  unreachable

139:                                              ; preds = %126
  br label %140

140:                                              ; preds = %139
  %141 = load i64, ptr %8, align 8, !tbaa !19
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %8, align 8, !tbaa !19
  br label %120, !llvm.loop !23

143:                                              ; preds = %120
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = call i32 @fclose(ptr noundef %144)
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = call i32 @vorbis_book_init_encode(ptr noundef %146, ptr noundef %147)
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.static_codebook, ptr %150, i32 0, i32 1
  %152 = load i64, ptr %151, align 8, !tbaa !16
  %153 = trunc i64 %152 to i32
  %154 = call ptr @_book_unquantize(ptr noundef %149, i32 noundef %153, ptr noundef null)
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.codebook, ptr %155, i32 0, i32 4
  store ptr %154, ptr %156, align 8, !tbaa !24
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret ptr %157
}

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #5

declare i64 @_book_maptype1_quantvals(ptr noundef) #4

declare i32 @fclose(ptr noundef) #4

declare i32 @vorbis_book_init_encode(ptr noundef, ptr noundef) #4

declare ptr @_book_unquantize(ptr noundef, i32 noundef, ptr noundef) #4

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) "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 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 #4 = { "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 = { 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 #6 = { noreturn 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { noreturn nounwind }
attributes #10 = { 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, !6, i64 24}
!10 = !{!"codebook", !11, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!15, !12, i64 24}
!15 = !{!"static_codebook", !11, i64 0, !11, i64 8, !6, i64 16, !12, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !12, i64 52, !6, i64 56, !12, i64 64}
!16 = !{!15, !11, i64 8}
!17 = !{!15, !11, i64 0}
!18 = !{!15, !6, i64 56}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!15, !6, i64 16}
!23 = distinct !{!23, !21}
!24 = !{!10, !6, i64 32}


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

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @reset_next_value() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @codebook_load(ptr noundef %0) local_unnamed_addr #0 {
  %2 = tail call noalias dereferenceable_or_null(96) ptr @calloc(i64 noundef 1, i64 noundef 96) #6
  %3 = tail call noalias dereferenceable_or_null(72) ptr @calloc(i64 noundef 1, i64 noundef 72) #6
  %4 = getelementptr inbounds i8, ptr %2, i64 24
  store ptr %3, ptr %4, align 8, !tbaa !5
  %5 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %10

7:                                                ; preds = %1
  %8 = load ptr, ptr @stderr, align 8, !tbaa !12
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.1, ptr noundef %0) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

10:                                               ; preds = %1
  %11 = tail call ptr @find_seek_to(ptr noundef nonnull %5, ptr noundef nonnull @.str.2)
  %12 = tail call ptr @get_line(ptr noundef nonnull %5)
  %13 = getelementptr inbounds i8, ptr %3, i64 8
  %14 = tail call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %12, ptr noundef nonnull @.str.3, ptr noundef %3, ptr noundef nonnull %13) #9
  %.not = icmp eq i32 %14, 2
  br i1 %.not, label %18, label %15

15:                                               ; preds = %10
  %16 = load ptr, ptr @stderr, align 8, !tbaa !12
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.4, ptr noundef %0, ptr noundef %12) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

18:                                               ; preds = %10
  %19 = tail call ptr @get_line(ptr noundef nonnull %5)
  %20 = tail call ptr @get_line(ptr noundef nonnull %5)
  %21 = getelementptr inbounds i8, ptr %3, i64 24
  %22 = getelementptr inbounds i8, ptr %3, i64 32
  %23 = getelementptr inbounds i8, ptr %3, i64 40
  %24 = getelementptr inbounds i8, ptr %3, i64 48
  %25 = getelementptr inbounds i8, ptr %3, i64 52
  %26 = tail call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %20, ptr noundef nonnull @.str.5, ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %24, ptr noundef nonnull %25) #9
  %.not53 = icmp eq i32 %26, 5
  br i1 %.not53, label %30, label %27

27:                                               ; preds = %18
  %28 = load ptr, ptr @stderr, align 8, !tbaa !12
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.4, ptr noundef %0, ptr noundef %20) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

30:                                               ; preds = %18
  %31 = load i32, ptr %21, align 8, !tbaa !13
  switch i32 %31, label %38 [
    i32 2, label %34
    i32 1, label %32
  ]

32:                                               ; preds = %30
  %33 = tail call i64 @_book_maptype1_quantvals(ptr noundef nonnull %3) #9
  br label %38

34:                                               ; preds = %30
  %35 = load i64, ptr %13, align 8, !tbaa !15
  %36 = load i64, ptr %3, align 8, !tbaa !16
  %37 = mul nsw i64 %36, %35
  br label %38

38:                                               ; preds = %34, %32, %30
  %.051 = phi i64 [ %37, %34 ], [ %33, %32 ], [ 0, %30 ]
  %39 = tail call ptr @find_seek_to(ptr noundef nonnull %5, ptr noundef nonnull @.str.6)
  tail call void @reset_next_value()
  %sext = shl i64 %.051, 32
  %40 = ashr exact i64 %sext, 32
  %41 = ashr exact i64 %sext, 29
  %42 = tail call noalias ptr @malloc(i64 noundef %41) #10
  %43 = getelementptr inbounds i8, ptr %3, i64 56
  store ptr %42, ptr %43, align 8, !tbaa !17
  %44 = icmp sgt i64 %40, 0
  br i1 %44, label %.lr.ph, label %._crit_edge

45:                                               ; preds = %.lr.ph
  %46 = add nuw nsw i64 %.056, 1
  %exitcond.not = icmp eq i64 %46, %40
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !18

.lr.ph:                                           ; preds = %38, %45
  %.056 = phi i64 [ %46, %45 ], [ 0, %38 ]
  %47 = load ptr, ptr %43, align 8, !tbaa !17
  %48 = getelementptr inbounds i64, ptr %47, i64 %.056
  %49 = tail call i32 @get_next_ivalue(ptr noundef nonnull %5, ptr noundef %48)
  %.not55 = icmp eq i32 %49, 0
  br i1 %.not55, label %45, label %50

50:                                               ; preds = %.lr.ph
  %51 = load ptr, ptr @stderr, align 8, !tbaa !12
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.7, ptr noundef %0) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

._crit_edge:                                      ; preds = %45, %38
  %53 = tail call ptr @find_seek_to(ptr noundef nonnull %5, ptr noundef nonnull @.str.8)
  tail call void @reset_next_value()
  %54 = load i64, ptr %13, align 8, !tbaa !15
  %55 = shl i64 %54, 3
  %56 = tail call noalias ptr @malloc(i64 noundef %55) #10
  %57 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %56, ptr %57, align 8, !tbaa !20
  %58 = icmp sgt i64 %54, 0
  br i1 %58, label %.lr.ph59, label %._crit_edge60

59:                                               ; preds = %.lr.ph59
  %60 = add nuw nsw i64 %.157, 1
  %61 = load i64, ptr %13, align 8, !tbaa !15
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %.lr.ph59, label %._crit_edge60, !llvm.loop !21

.lr.ph59:                                         ; preds = %._crit_edge, %59
  %.157 = phi i64 [ %60, %59 ], [ 0, %._crit_edge ]
  %63 = load ptr, ptr %57, align 8, !tbaa !20
  %64 = getelementptr inbounds i64, ptr %63, i64 %.157
  %65 = tail call i32 @get_next_ivalue(ptr noundef nonnull %5, ptr noundef %64)
  %.not54 = icmp eq i32 %65, 0
  br i1 %.not54, label %59, label %66

66:                                               ; preds = %.lr.ph59
  %67 = load ptr, ptr @stderr, align 8, !tbaa !12
  %68 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.7, ptr noundef %0) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

._crit_edge60:                                    ; preds = %59, %._crit_edge
  %69 = tail call i32 @fclose(ptr noundef nonnull %5)
  %70 = tail call i32 @vorbis_book_init_encode(ptr noundef %2, ptr noundef nonnull %3) #9
  %71 = load i64, ptr %13, align 8, !tbaa !15
  %72 = trunc i64 %71 to i32
  %73 = tail call ptr @_book_unquantize(ptr noundef nonnull %3, i32 noundef %72, ptr noundef null) #9
  %74 = getelementptr inbounds i8, ptr %2, i64 32
  store ptr %73, ptr %74, align 8, !tbaa !22
  ret ptr %2
}

; 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 #2

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare i64 @_book_maptype1_quantvals(ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

declare i32 @vorbis_book_init_encode(ptr noundef, ptr noundef) local_unnamed_addr #5

declare ptr @_book_unquantize(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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,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 #2 = { 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 #3 = { nofree 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 #4 = { noreturn 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 = { "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 #6 = { nounwind allocsize(0,1) }
attributes #7 = { cold nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { 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 24}
!6 = !{!"codebook", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !11, i64 24}
!14 = !{!"static_codebook", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !7, i64 32, !7, i64 40, !11, i64 48, !11, i64 52, !10, i64 56, !11, i64 64}
!15 = !{!14, !7, i64 8}
!16 = !{!14, !7, i64 0}
!17 = !{!14, !10, i64 56}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!14, !10, i64 16}
!21 = distinct !{!21, !19}
!22 = !{!6, !10, i64 32}


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