; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/modules/juce_audio_formats/codecs/flac/libFLAC/str_326f1ee3_FLAC (lpc)

; 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.FLAC__Subframe_LPC = type { %struct.FLAC__EntropyCodingMethod, i32, i32, i32, [32 x i32], [32 x i32], ptr }
%struct.FLAC__EntropyCodingMethod = type { i32, %union.anon.1 }
%union.anon.1 = type { %struct.FLAC__EntropyCodingMethod_PartitionedRice }
%struct.FLAC__EntropyCodingMethod_PartitionedRice = type { i32, ptr }
%struct.FLAC__EntropyCodingMethod_PartitionedRiceContents = type { ptr, ptr, i32 }

@FLAC__SUBFRAME_ZERO_PAD_LEN = external constant i32, align 4
@FLAC__SUBFRAME_TYPE_LEN = external constant i32, align 4
@FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN = external constant i32, align 4
@FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK = external constant i32, align 4
@FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN = external constant i32, align 4
@FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN = external constant i32, align 4

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

declare i32 @FLAC__bitwriter_write_raw_uint32(ptr noundef, i32 noundef, i32 noundef) #1

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

declare i32 @FLAC__bitwriter_write_unary_unsigned(ptr noundef, i32 noundef) #1

declare i32 @FLAC__bitwriter_write_raw_int32(ptr noundef, i32 noundef, i32 noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @FLAC__subframe_add_lpc(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %14 = load ptr, ptr %11, align 8, !tbaa !5
  %15 = load i32, ptr @FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK, align 4, !tbaa !9
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %16, i32 0, i32 1
  %18 = load i32, ptr %17, align 8, !tbaa !11
  %19 = sub i32 %18, 1
  %20 = shl i32 %19, 1
  %21 = or i32 %15, %20
  %22 = load i32, ptr %10, align 4, !tbaa !9
  %23 = icmp ne i32 %22, 0
  %24 = zext i1 %23 to i64
  %25 = select i1 %23, i32 1, i32 0
  %26 = or i32 %21, %25
  %27 = load i32, ptr @FLAC__SUBFRAME_ZERO_PAD_LEN, align 4, !tbaa !9
  %28 = load i32, ptr @FLAC__SUBFRAME_TYPE_LEN, align 4, !tbaa !9
  %29 = add i32 %27, %28
  %30 = load i32, ptr @FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN, align 4, !tbaa !9
  %31 = add i32 %29, %30
  %32 = call i32 @FLAC__bitwriter_write_raw_uint32(ptr noundef %14, i32 noundef %26, i32 noundef %31)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %35, label %34

34:                                               ; preds = %5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

35:                                               ; preds = %5
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %46

38:                                               ; preds = %35
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = sub i32 %40, 1
  %42 = call i32 @FLAC__bitwriter_write_unary_unsigned(ptr noundef %39, i32 noundef %41)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %45, label %44

44:                                               ; preds = %38
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

45:                                               ; preds = %38
  br label %46

46:                                               ; preds = %45, %35
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %66, %46
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !11
  %52 = icmp ult i32 %48, %51
  br i1 %52, label %53, label %69

53:                                               ; preds = %47
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %55, i32 0, i32 5
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [32 x i32], ptr %56, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = call i32 @FLAC__bitwriter_write_raw_int32(ptr noundef %54, i32 noundef %60, i32 noundef %61)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %53
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

65:                                               ; preds = %53
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %12, align 4, !tbaa !9
  %68 = add i32 %67, 1
  store i32 %68, ptr %12, align 4, !tbaa !9
  br label %47, !llvm.loop !14

69:                                               ; preds = %47
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %71, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !16
  %74 = sub i32 %73, 1
  %75 = load i32, ptr @FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN, align 4, !tbaa !9
  %76 = call i32 @FLAC__bitwriter_write_raw_uint32(ptr noundef %70, i32 noundef %74, i32 noundef %75)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %79, label %78

78:                                               ; preds = %69
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

79:                                               ; preds = %69
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %81, i32 0, i32 3
  %83 = load i32, ptr %82, align 8, !tbaa !17
  %84 = load i32, ptr @FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN, align 4, !tbaa !9
  %85 = call i32 @FLAC__bitwriter_write_raw_int32(ptr noundef %80, i32 noundef %83, i32 noundef %84)
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %79
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

88:                                               ; preds = %79
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %110, %88
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 8, !tbaa !11
  %94 = icmp ult i32 %90, %93
  br i1 %94, label %95, label %113

95:                                               ; preds = %89
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %97, i32 0, i32 4
  %99 = load i32, ptr %12, align 4, !tbaa !9
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds [32 x i32], ptr %98, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %103, i32 0, i32 2
  %105 = load i32, ptr %104, align 4, !tbaa !16
  %106 = call i32 @FLAC__bitwriter_write_raw_int32(ptr noundef %96, i32 noundef %102, i32 noundef %105)
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %109, label %108

108:                                              ; preds = %95
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

109:                                              ; preds = %95
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = add i32 %111, 1
  store i32 %112, ptr %12, align 4, !tbaa !9
  br label %89, !llvm.loop !18

113:                                              ; preds = %89
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %115, i32 0, i32 0
  %117 = call i32 @add_entropy_coding_method_(ptr noundef %114, ptr noundef %116)
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %120, label %119

119:                                              ; preds = %113
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

120:                                              ; preds = %113
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod, ptr %122, i32 0, i32 0
  %124 = load i32, ptr %123, align 8, !tbaa !19
  switch i32 %124, label %163 [
    i32 0, label %125
    i32 1, label %125
  ]

125:                                              ; preds = %120, %120
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %127, i32 0, i32 6
  %129 = load ptr, ptr %128, align 8, !tbaa !20
  %130 = load i32, ptr %8, align 4, !tbaa !9
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %131, i32 0, i32 1
  %133 = load i32, ptr %132, align 8, !tbaa !11
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %134, i32 0, i32 0
  %136 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod, ptr %135, i32 0, i32 1
  %137 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod_PartitionedRice, ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !21
  %139 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod_PartitionedRiceContents, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !22
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %141, i32 0, i32 0
  %143 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod, ptr %142, i32 0, i32 1
  %144 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod_PartitionedRice, ptr %143, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !21
  %146 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod_PartitionedRiceContents, ptr %145, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8, !tbaa !24
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %148, i32 0, i32 0
  %150 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod, ptr %149, i32 0, i32 1
  %151 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod_PartitionedRice, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 8, !tbaa !21
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.FLAC__Subframe_LPC, ptr %153, i32 0, i32 0
  %155 = getelementptr inbounds %struct.FLAC__EntropyCodingMethod, ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 8, !tbaa !19
  %157 = icmp eq i32 %156, 1
  %158 = zext i1 %157 to i32
  %159 = call i32 @add_residual_partitioned_rice_(ptr noundef %126, ptr noundef %129, i32 noundef %130, i32 noundef %133, ptr noundef %140, ptr noundef %147, i32 noundef %152, i32 noundef %158)
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %162, label %161

161:                                              ; preds = %125
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

162:                                              ; preds = %125
  br label %164

163:                                              ; preds = %120
  br label %164

164:                                              ; preds = %163, %162
  store i32 1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

165:                                              ; preds = %164, %161, %119, %108, %87, %78, %64, %44, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %166 = load i32, ptr %6, align 4
  ret i32 %166
}

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

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

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


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

@FLAC__SUBFRAME_ZERO_PAD_LEN = external local_unnamed_addr constant i32, align 4
@FLAC__SUBFRAME_TYPE_LEN = external local_unnamed_addr constant i32, align 4
@FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN = external local_unnamed_addr constant i32, align 4
@FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK = external local_unnamed_addr constant i32, align 4
@FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN = external local_unnamed_addr constant i32, align 4
@FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN = external local_unnamed_addr constant i32, align 4

declare i32 @FLAC__bitwriter_write_raw_uint32(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare i32 @FLAC__bitwriter_write_unary_unsigned(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @FLAC__bitwriter_write_raw_int32(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @FLAC__subframe_add_lpc(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = load i32, ptr @FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = shl i32 %8, 1
  %10 = add i32 %9, -2
  %.not = icmp ne i32 %3, 0
  %11 = zext i1 %.not to i32
  %12 = or i32 %6, %11
  %13 = or i32 %12, %10
  %14 = load i32, ptr @FLAC__SUBFRAME_ZERO_PAD_LEN, align 4, !tbaa !5
  %15 = load i32, ptr @FLAC__SUBFRAME_TYPE_LEN, align 4, !tbaa !5
  %16 = add i32 %15, %14
  %17 = load i32, ptr @FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN, align 4, !tbaa !5
  %18 = add i32 %16, %17
  %19 = tail call i32 @FLAC__bitwriter_write_raw_uint32(ptr noundef %4, i32 noundef %13, i32 noundef %18) #2
  %.not37 = icmp eq i32 %19, 0
  br i1 %.not37, label %.loopexit, label %20

20:                                               ; preds = %5
  br i1 %.not, label %21, label %24

21:                                               ; preds = %20
  %22 = add i32 %3, -1
  %23 = tail call i32 @FLAC__bitwriter_write_unary_unsigned(ptr noundef %4, i32 noundef %22) #2
  %.not38 = icmp eq i32 %23, 0
  br i1 %.not38, label %.loopexit, label %24

24:                                               ; preds = %21, %20
  %25 = load i32, ptr %7, align 8, !tbaa !9
  %.not50 = icmp eq i32 %25, 0
  br i1 %.not50, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %26 = getelementptr inbounds i8, ptr %0, i64 164
  br label %31

27:                                               ; preds = %31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %7, align 8, !tbaa !9
  %29 = zext i32 %28 to i64
  %30 = icmp ult i64 %indvars.iv.next, %29
  br i1 %30, label %31, label %._crit_edge, !llvm.loop !13

31:                                               ; preds = %.lr.ph, %27
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %27 ]
  %32 = getelementptr inbounds [32 x i32], ptr %26, i64 0, i64 %indvars.iv
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = tail call i32 @FLAC__bitwriter_write_raw_int32(ptr noundef %4, i32 noundef %33, i32 noundef %2) #2
  %.not44 = icmp eq i32 %34, 0
  br i1 %.not44, label %.loopexit, label %27

._crit_edge:                                      ; preds = %27, %24
  %35 = getelementptr inbounds i8, ptr %0, i64 28
  %36 = load i32, ptr %35, align 4, !tbaa !15
  %37 = add i32 %36, -1
  %38 = load i32, ptr @FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN, align 4, !tbaa !5
  %39 = tail call i32 @FLAC__bitwriter_write_raw_uint32(ptr noundef %4, i32 noundef %37, i32 noundef %38) #2
  %.not39 = icmp eq i32 %39, 0
  br i1 %.not39, label %.loopexit, label %40

40:                                               ; preds = %._crit_edge
  %41 = getelementptr inbounds i8, ptr %0, i64 32
  %42 = load i32, ptr %41, align 8, !tbaa !16
  %43 = load i32, ptr @FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN, align 4, !tbaa !5
  %44 = tail call i32 @FLAC__bitwriter_write_raw_int32(ptr noundef %4, i32 noundef %42, i32 noundef %43) #2
  %.not40 = icmp eq i32 %44, 0
  br i1 %.not40, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %40
  %45 = load i32, ptr %7, align 8, !tbaa !9
  %.not51 = icmp eq i32 %45, 0
  br i1 %.not51, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %.preheader
  %46 = getelementptr inbounds i8, ptr %0, i64 36
  br label %51

47:                                               ; preds = %51
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %48 = load i32, ptr %7, align 8, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = icmp ult i64 %indvars.iv.next55, %49
  br i1 %50, label %51, label %._crit_edge49, !llvm.loop !17

51:                                               ; preds = %.lr.ph48, %47
  %indvars.iv54 = phi i64 [ 0, %.lr.ph48 ], [ %indvars.iv.next55, %47 ]
  %52 = getelementptr inbounds [32 x i32], ptr %46, i64 0, i64 %indvars.iv54
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = load i32, ptr %35, align 4, !tbaa !15
  %55 = tail call i32 @FLAC__bitwriter_write_raw_int32(ptr noundef %4, i32 noundef %53, i32 noundef %54) #2
  %.not43 = icmp eq i32 %55, 0
  br i1 %.not43, label %.loopexit, label %47

._crit_edge49:                                    ; preds = %47, %.preheader
  %56 = tail call i32 @add_entropy_coding_method_(ptr noundef %4, ptr noundef nonnull %0)
  %.not41 = icmp eq i32 %56, 0
  br i1 %.not41, label %.loopexit, label %57

57:                                               ; preds = %._crit_edge49
  %58 = load i32, ptr %0, align 8, !tbaa !18
  %switch = icmp ult i32 %58, 2
  br i1 %switch, label %59, label %73

59:                                               ; preds = %57
  %60 = getelementptr inbounds i8, ptr %0, i64 296
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  %62 = load i32, ptr %7, align 8, !tbaa !9
  %63 = getelementptr inbounds i8, ptr %0, i64 8
  %64 = getelementptr inbounds i8, ptr %0, i64 16
  %65 = load ptr, ptr %64, align 8, !tbaa !20
  %66 = load ptr, ptr %65, align 8, !tbaa !21
  %67 = getelementptr inbounds i8, ptr %65, i64 8
  %68 = load ptr, ptr %67, align 8, !tbaa !23
  %69 = load i32, ptr %63, align 8, !tbaa !20
  %70 = icmp eq i32 %58, 1
  %71 = zext i1 %70 to i32
  %72 = tail call i32 @add_residual_partitioned_rice_(ptr noundef %4, ptr noundef %61, i32 noundef %1, i32 noundef %62, ptr noundef %66, ptr noundef %68, i32 noundef %69, i32 noundef %71)
  %.not42 = icmp eq i32 %72, 0
  br i1 %.not42, label %.loopexit, label %73

73:                                               ; preds = %57, %59
  br label %.loopexit

.loopexit:                                        ; preds = %31, %51, %59, %._crit_edge49, %40, %._crit_edge, %21, %5, %73
  %.035 = phi i32 [ 1, %73 ], [ 0, %5 ], [ 0, %21 ], [ 0, %._crit_edge ], [ 0, %40 ], [ 0, %._crit_edge49 ], [ 0, %59 ], [ 0, %51 ], [ 0, %31 ]
  ret i32 %.035
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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, !6, i64 24}
!10 = !{!"", !11, i64 0, !6, i64 24, !6, i64 28, !6, i64 32, !7, i64 36, !7, i64 164, !12, i64 296}
!11 = !{!"", !6, i64 0, !7, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!10, !6, i64 28}
!16 = !{!10, !6, i64 32}
!17 = distinct !{!17, !14}
!18 = !{!10, !6, i64 0}
!19 = !{!10, !12, i64 296}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !12, i64 0}
!22 = !{!"", !12, i64 0, !12, i64 8, !6, i64 16}
!23 = !{!22, !12, i64 8}


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