; LLVM IR from AnzoDK/RPAudio :: includes/minimp3/huffopt (huffopt)

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

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @read_codebook(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %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 [30 x i8], align 16
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %16 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %16, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store ptr null, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 -1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  br label %17

17:                                               ; preds = %34, %1
  %18 = load ptr, ptr %3, align 8, !tbaa !9
  %19 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %18, ptr noundef @.str.2, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8)
  %20 = icmp ne i32 4, %19
  br i1 %20, label %21, label %24

21:                                               ; preds = %17
  %22 = load ptr, ptr %3, align 8, !tbaa !9
  %23 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %22, ptr noundef @.str.3)
  br label %24

24:                                               ; preds = %21, %17
  br label %25

25:                                               ; preds = %24
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = icmp ne i32 %26, %27
  br i1 %28, label %29, label %34

29:                                               ; preds = %25
  %30 = load ptr, ptr %3, align 8, !tbaa !9
  %31 = call i32 @feof(ptr noundef %30) #4
  %32 = icmp ne i32 %31, 0
  %33 = xor i1 %32, true
  br label %34

34:                                               ; preds = %29, %25
  %35 = phi i1 [ false, %25 ], [ %33, %29 ]
  br i1 %35, label %17, label %36, !llvm.loop !11

36:                                               ; preds = %34
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = icmp eq i32 %37, %38
  br i1 %39, label %40, label %106

40:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %102, %40
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = mul nsw i32 %43, %44
  %46 = icmp slt i32 %42, %45
  br i1 %46, label %47, label %105

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 30, ptr %15) #4
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = icmp slt i32 %48, 32
  br i1 %49, label %50, label %60

50:                                               ; preds = %47
  br label %51

51:                                               ; preds = %56, %50
  %52 = load ptr, ptr %3, align 8, !tbaa !9
  %53 = getelementptr inbounds [30 x i8], ptr %15, i64 0, i64 0
  %54 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %52, ptr noundef @.str.4, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %53)
  %55 = icmp ne i32 4, %54
  br i1 %55, label %56, label %59

56:                                               ; preds = %51
  %57 = load ptr, ptr %3, align 8, !tbaa !9
  %58 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %57, ptr noundef @.str.3)
  br label %51, !llvm.loop !13

59:                                               ; preds = %51
  br label %70

60:                                               ; preds = %47
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %66, %60
  %62 = load ptr, ptr %3, align 8, !tbaa !9
  %63 = getelementptr inbounds [30 x i8], ptr %15, i64 0, i64 0
  %64 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %62, ptr noundef @.str.5, ptr noundef %12, ptr noundef %13, ptr noundef %63)
  %65 = icmp ne i32 3, %64
  br i1 %65, label %66, label %69

66:                                               ; preds = %61
  %67 = load ptr, ptr %3, align 8, !tbaa !9
  %68 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %67, ptr noundef @.str.3)
  br label %61, !llvm.loop !14

69:                                               ; preds = %61
  br label %70

70:                                               ; preds = %69, %59
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %86, %70
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %75, label %89

75:                                               ; preds = %71
  %76 = load i32, ptr %14, align 4, !tbaa !5
  %77 = shl i32 %76, 1
  store i32 %77, ptr %14, align 4, !tbaa !5
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [30 x i8], ptr %15, i64 0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !15
  %82 = sext i8 %81 to i32
  %83 = sub nsw i32 %82, 48
  %84 = load i32, ptr %14, align 4, !tbaa !5
  %85 = or i32 %84, %83
  store i32 %85, ptr %14, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %75
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %10, align 4, !tbaa !5
  br label %71, !llvm.loop !16

89:                                               ; preds = %71
  %90 = load ptr, ptr %4, align 8, !tbaa !9
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = shl i32 %91, 16
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = add nsw i32 %92, %93
  %95 = load i32, ptr %14, align 4, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !5
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = icmp slt i32 %97, 32
  %99 = zext i1 %98 to i64
  %100 = select i1 %98, i32 0, i32 1
  %101 = call ptr @huff_create(ptr noundef %90, i32 noundef %94, i32 noundef %95, i32 noundef %96, i32 noundef 0, i32 noundef %100)
  store ptr %101, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 30, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %102

102:                                              ; preds = %89
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %9, align 4, !tbaa !5
  br label %41, !llvm.loop !17

105:                                              ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %106

106:                                              ; preds = %105, %36
  %107 = load ptr, ptr %3, align 8, !tbaa !9
  %108 = call i32 @fclose(ptr noundef %107)
  %109 = load ptr, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret ptr %109
}

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #3

declare i32 @fclose(ptr noundef) #2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; 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 [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @read_codebook(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [30 x i8], align 16
  %10 = tail call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 -1, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  br label %11

11:                                               ; preds = %17, %1
  %12 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %10, ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5) #4
  %.not = icmp eq i32 %12, 4
  br i1 %.not, label %15, label %13

13:                                               ; preds = %11
  %14 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %10, ptr noundef nonnull @.str.3) #4
  br label %15

15:                                               ; preds = %11, %13
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %.not26 = icmp eq i32 %16, %0
  br i1 %.not26, label %.preheader31, label %17

17:                                               ; preds = %15
  %18 = call i32 @feof(ptr noundef %10) #4
  %.not27 = icmp eq i32 %18, 0
  br i1 %.not27, label %11, label %.critedge, !llvm.loop !9

.critedge:                                        ; preds = %17
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp eq i32 %.pre, %0
  br i1 %19, label %.preheader31, label %.loopexit32

.preheader31:                                     ; preds = %15, %.critedge
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = mul nsw i32 %21, %20
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph42, label %.loopexit32

.lr.ph42:                                         ; preds = %.preheader31
  %24 = icmp sgt i32 %0, 31
  %25 = zext i1 %24 to i32
  br i1 %24, label %.lr.ph42.split.us, label %.preheader

.lr.ph42.split.us:                                ; preds = %.lr.ph42, %._crit_edge.us
  %.02241.us = phi i32 [ %37, %._crit_edge.us ], [ 0, %.lr.ph42 ]
  %.02340.us = phi ptr [ %36, %._crit_edge.us ], [ null, %.lr.ph42 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %9) #4
  %26 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %10, ptr noundef nonnull @.str.5, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #4
  %.not2834.us = icmp eq i32 %26, 3
  br i1 %.not2834.us, label %.loopexit.us, label %.lr.ph35.us

.lr.ph35.us:                                      ; preds = %.lr.ph42.split.us, %.lr.ph35.us
  %27 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %10, ptr noundef nonnull @.str.3) #4
  %28 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %10, ptr noundef nonnull @.str.5, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #4
  %.not28.us = icmp eq i32 %28, 3
  br i1 %.not28.us, label %.loopexit.us, label %.lr.ph35.us, !llvm.loop !11

._crit_edge.us.loopexit.unr-lcssa:                ; preds = %.lr.ph38.us, %.lr.ph38.us.preheader
  %.lcssa.ph = phi i32 [ poison, %.lr.ph38.us.preheader ], [ %65, %.lr.ph38.us ]
  %indvars.iv49.unr = phi i64 [ 0, %.lr.ph38.us.preheader ], [ %indvars.iv.next50.3, %.lr.ph38.us ]
  %.037.us.unr = phi i32 [ 0, %.lr.ph38.us.preheader ], [ %65, %.lr.ph38.us ]
  %lcmp.mod69.not = icmp eq i64 %xtraiter67, 0
  br i1 %lcmp.mod69.not, label %._crit_edge.us, label %.lr.ph38.us.epil

.lr.ph38.us.epil:                                 ; preds = %._crit_edge.us.loopexit.unr-lcssa, %.lr.ph38.us.epil
  %indvars.iv49.epil = phi i64 [ %indvars.iv.next50.epil, %.lr.ph38.us.epil ], [ %indvars.iv49.unr, %._crit_edge.us.loopexit.unr-lcssa ]
  %.037.us.epil = phi i32 [ %34, %.lr.ph38.us.epil ], [ %.037.us.unr, %._crit_edge.us.loopexit.unr-lcssa ]
  %epil.iter68 = phi i64 [ %epil.iter68.next, %.lr.ph38.us.epil ], [ 0, %._crit_edge.us.loopexit.unr-lcssa ]
  %29 = shl i32 %.037.us.epil, 1
  %30 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv49.epil
  %31 = load i8, ptr %30, align 1, !tbaa !12
  %32 = sext i8 %31 to i32
  %33 = add nsw i32 %32, -48
  %34 = or i32 %33, %29
  %indvars.iv.next50.epil = add nuw nsw i64 %indvars.iv49.epil, 1
  %epil.iter68.next = add i64 %epil.iter68, 1
  %epil.iter68.cmp.not = icmp eq i64 %epil.iter68.next, %xtraiter67
  br i1 %epil.iter68.cmp.not, label %._crit_edge.us, label %.lr.ph38.us.epil, !llvm.loop !13

._crit_edge.us:                                   ; preds = %._crit_edge.us.loopexit.unr-lcssa, %.lr.ph38.us.epil, %.loopexit.us
  %.0.lcssa.us = phi i32 [ 0, %.loopexit.us ], [ %.lcssa.ph, %._crit_edge.us.loopexit.unr-lcssa ], [ %34, %.lr.ph38.us.epil ]
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = call ptr @huff_create(ptr noundef %.02340.us, i32 noundef %35, i32 noundef %.0.lcssa.us, i32 noundef %66, i32 noundef 0, i32 noundef %25)
  call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %37 = add nuw nsw i32 %.02241.us, 1
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = mul nsw i32 %39, %38
  %41 = icmp slt i32 %37, %40
  br i1 %41, label %.lr.ph42.split.us, label %.loopexit32, !llvm.loop !15

.lr.ph38.us:                                      ; preds = %.lr.ph38.us, %.lr.ph38.us.preheader.new
  %indvars.iv49 = phi i64 [ 0, %.lr.ph38.us.preheader.new ], [ %indvars.iv.next50.3, %.lr.ph38.us ]
  %.037.us = phi i32 [ 0, %.lr.ph38.us.preheader.new ], [ %65, %.lr.ph38.us ]
  %niter72 = phi i64 [ 0, %.lr.ph38.us.preheader.new ], [ %niter72.next.3, %.lr.ph38.us ]
  %42 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv49
  %43 = load i8, ptr %42, align 4, !tbaa !12
  %44 = sext i8 %43 to i32
  %indvars.iv.next50 = or disjoint i64 %indvars.iv49, 1
  %45 = shl i32 %.037.us, 2
  %46 = shl nsw i32 %44, 1
  %47 = add nsw i32 %46, 1073741728
  %48 = or i32 %45, %47
  %49 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv.next50
  %50 = load i8, ptr %49, align 1, !tbaa !12
  %51 = sext i8 %50 to i32
  %52 = add nsw i32 %51, 1073741776
  %53 = or i32 %52, %48
  %indvars.iv.next50.1 = or disjoint i64 %indvars.iv49, 2
  %54 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv.next50.1
  %55 = load i8, ptr %54, align 2, !tbaa !12
  %56 = sext i8 %55 to i32
  %indvars.iv.next50.2 = or disjoint i64 %indvars.iv49, 3
  %57 = shl i32 %53, 2
  %58 = shl nsw i32 %56, 1
  %59 = add nsw i32 %58, -96
  %60 = or i32 %57, %59
  %61 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv.next50.2
  %62 = load i8, ptr %61, align 1, !tbaa !12
  %63 = sext i8 %62 to i32
  %64 = add nsw i32 %63, -48
  %65 = or i32 %64, %60
  %indvars.iv.next50.3 = add nuw nsw i64 %indvars.iv49, 4
  %niter72.next.3 = add i64 %niter72, 4
  %niter72.ncmp.3 = icmp eq i64 %niter72.next.3, %unroll_iter71
  br i1 %niter72.ncmp.3, label %._crit_edge.us.loopexit.unr-lcssa, label %.lr.ph38.us, !llvm.loop !16

.loopexit.us:                                     ; preds = %.lr.ph35.us, %.lr.ph42.split.us
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph38.us.preheader, label %._crit_edge.us

.lr.ph38.us.preheader:                            ; preds = %.loopexit.us
  %wide.trip.count52 = zext nneg i32 %66 to i64
  %xtraiter67 = and i64 %wide.trip.count52, 3
  %68 = icmp ult i32 %66, 4
  br i1 %68, label %._crit_edge.us.loopexit.unr-lcssa, label %.lr.ph38.us.preheader.new

.lr.ph38.us.preheader.new:                        ; preds = %.lr.ph38.us.preheader
  %unroll_iter71 = and i64 %wide.trip.count52, 2147483644
  br label %.lr.ph38.us

.preheader:                                       ; preds = %.lr.ph42, %._crit_edge
  %.02241 = phi i32 [ %110, %._crit_edge ], [ 0, %.lr.ph42 ]
  %.02340 = phi ptr [ %109, %._crit_edge ], [ null, %.lr.ph42 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %9) #4
  %69 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %10, ptr noundef nonnull @.str.4, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #4
  %.not2933 = icmp eq i32 %69, 4
  br i1 %.not2933, label %.loopexit30, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %70 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %10, ptr noundef nonnull @.str.3) #4
  %71 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %10, ptr noundef nonnull @.str.4, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #4
  %.not29 = icmp eq i32 %71, 4
  br i1 %.not29, label %.loopexit30, label %.lr.ph, !llvm.loop !17

.loopexit30:                                      ; preds = %.lr.ph, %.preheader
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph38.preheader, label %._crit_edge

.lr.ph38.preheader:                               ; preds = %.loopexit30
  %wide.trip.count = zext nneg i32 %72 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %74 = icmp ult i32 %72, 4
  br i1 %74, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph38.preheader.new

.lr.ph38.preheader.new:                           ; preds = %.lr.ph38.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph38

.lr.ph38:                                         ; preds = %.lr.ph38, %.lr.ph38.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %indvars.iv.next.3, %.lr.ph38 ]
  %.037 = phi i32 [ 0, %.lr.ph38.preheader.new ], [ %98, %.lr.ph38 ]
  %niter = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %niter.next.3, %.lr.ph38 ]
  %75 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv
  %76 = load i8, ptr %75, align 4, !tbaa !12
  %77 = sext i8 %76 to i32
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %78 = shl i32 %.037, 2
  %79 = shl nsw i32 %77, 1
  %80 = add nsw i32 %79, 1073741728
  %81 = or i32 %78, %80
  %82 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv.next
  %83 = load i8, ptr %82, align 1, !tbaa !12
  %84 = sext i8 %83 to i32
  %85 = add nsw i32 %84, 1073741776
  %86 = or i32 %85, %81
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %87 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv.next.1
  %88 = load i8, ptr %87, align 2, !tbaa !12
  %89 = sext i8 %88 to i32
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %90 = shl i32 %86, 2
  %91 = shl nsw i32 %89, 1
  %92 = add nsw i32 %91, -96
  %93 = or i32 %90, %92
  %94 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv.next.2
  %95 = load i8, ptr %94, align 1, !tbaa !12
  %96 = sext i8 %95 to i32
  %97 = add nsw i32 %96, -48
  %98 = or i32 %97, %93
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph38, !llvm.loop !16

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph38, %.lr.ph38.preheader
  %.lcssa64.ph = phi i32 [ poison, %.lr.ph38.preheader ], [ %98, %.lr.ph38 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph38.preheader ], [ %indvars.iv.next.3, %.lr.ph38 ]
  %.037.unr = phi i32 [ 0, %.lr.ph38.preheader ], [ %98, %.lr.ph38 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph38.epil

.lr.ph38.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph38.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph38.epil ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.037.epil = phi i32 [ %104, %.lr.ph38.epil ], [ %.037.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph38.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %99 = shl i32 %.037.epil, 1
  %100 = getelementptr inbounds [30 x i8], ptr %9, i64 0, i64 %indvars.iv.epil
  %101 = load i8, ptr %100, align 1, !tbaa !12
  %102 = sext i8 %101 to i32
  %103 = add nsw i32 %102, -48
  %104 = or i32 %103, %99
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph38.epil, !llvm.loop !18

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph38.epil, %.loopexit30
  %.0.lcssa = phi i32 [ 0, %.loopexit30 ], [ %.lcssa64.ph, %._crit_edge.loopexit.unr-lcssa ], [ %104, %.lr.ph38.epil ]
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = shl i32 %105, 16
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = add nsw i32 %106, %107
  %109 = call ptr @huff_create(ptr noundef %.02340, i32 noundef %108, i32 noundef %.0.lcssa, i32 noundef %72, i32 noundef 0, i32 noundef %25)
  call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %110 = add nuw nsw i32 %.02241, 1
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = mul nsw i32 %112, %111
  %114 = icmp slt i32 %110, %113
  br i1 %114, label %.preheader, label %.loopexit32, !llvm.loop !15

.loopexit32:                                      ; preds = %._crit_edge, %._crit_edge.us, %.preheader31, %.critedge
  %.1 = phi ptr [ null, %.critedge ], [ null, %.preheader31 ], [ %36, %._crit_edge.us ], [ %109, %._crit_edge ]
  %115 = call i32 @fclose(ptr noundef %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  ret ptr %.1
}

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #3

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

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

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !14}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass