; LLVM IR from hit9/bitproto :: lib/c (bitproto)

; 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.BpProcessorContext = type { i8, i32, ptr }
%struct.BpArrayDescriptor = type { i8, i32, %struct.BpType }
%struct.BpType = type { i32, i32, i32, ptr, ptr, i32 }

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @BpEndecodeArray(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i16, align 2
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.BpProcessorContext, ptr %19, i32 0, i32 1
  %21 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %21, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #3
  store i16 0, ptr %8, align 2, !tbaa !14
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.BpArrayDescriptor, ptr %22, i32 0, i32 0
  %24 = load i8, ptr %23, align 8, !tbaa !16, !range !19, !noundef !20
  %25 = trunc i8 %24 to i1
  br i1 %25, label %26, label %39

26:                                               ; preds = %3
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.BpProcessorContext, ptr %27, i32 0, i32 0
  %29 = load i8, ptr %28, align 8, !tbaa !21, !range !19, !noundef !20
  %30 = trunc i8 %29 to i1
  br i1 %30, label %31, label %34

31:                                               ; preds = %26
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  call void @BpEncodeArrayExtensibleAhead(ptr noundef %32, ptr noundef %33)
  br label %38

34:                                               ; preds = %26
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call zeroext i16 @BpDecodeArrayExtensibleAhead(ptr noundef %35, ptr noundef %36)
  store i16 %37, ptr %8, align 2, !tbaa !14
  br label %38

38:                                               ; preds = %34, %31
  br label %39

39:                                               ; preds = %38, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.BpArrayDescriptor, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !22
  store i32 %42, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.BpArrayDescriptor, ptr %43, i32 0, i32 2
  %45 = getelementptr inbounds %struct.BpType, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !23
  store i32 %46, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.BpArrayDescriptor, ptr %47, i32 0, i32 2
  %49 = getelementptr inbounds %struct.BpType, ptr %48, i32 0, i32 2
  %50 = load i32, ptr %49, align 8, !tbaa !24
  store i32 %50, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.BpArrayDescriptor, ptr %51, i32 0, i32 2
  store ptr %52, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.BpType, ptr %53, i32 0, i32 0
  %55 = load i32, ptr %54, align 8, !tbaa !25
  store i32 %55, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.BpType, ptr %56, i32 0, i32 5
  %58 = load i32, ptr %57, align 8, !tbaa !26
  store i32 %58, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %59, ptr %15, align 8, !tbaa !5
  %60 = load i32, ptr %10, align 4, !tbaa !13
  %61 = call zeroext i1 @BpIsNbitsStandard(i32 noundef %60)
  br i1 %61, label %62, label %99

62:                                               ; preds = %39
  %63 = load i32, ptr %13, align 4, !tbaa !13
  %64 = call zeroext i1 @BpIsBaseIntegerType(i32 noundef %63)
  br i1 %64, label %68, label %65

65:                                               ; preds = %62
  %66 = load i32, ptr %14, align 4, !tbaa !13
  %67 = call zeroext i1 @BpIsBaseIntegerType(i32 noundef %66)
  br i1 %67, label %68, label %99

68:                                               ; preds = %65, %62
  %69 = load i32, ptr %10, align 4, !tbaa !13
  %70 = load i32, ptr %9, align 4, !tbaa !13
  %71 = mul nsw i32 %69, %70
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  call void @BpEndecodeBaseType(i32 noundef %71, ptr noundef %72, ptr noundef %73)
  %74 = load i32, ptr %13, align 4, !tbaa !13
  %75 = icmp eq i32 %74, 2
  br i1 %75, label %79, label %76

76:                                               ; preds = %68
  %77 = load i32, ptr %14, align 4, !tbaa !13
  %78 = icmp eq i32 %77, 2
  br i1 %78, label %79, label %98

79:                                               ; preds = %76, %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !13
  br label %80

80:                                               ; preds = %94, %79
  %81 = load i32, ptr %16, align 4, !tbaa !13
  %82 = load i32, ptr %9, align 4, !tbaa !13
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %97

85:                                               ; preds = %80
  %86 = load i32, ptr %11, align 4, !tbaa !13
  %87 = load i32, ptr %10, align 4, !tbaa !13
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  call void @BpHandleIntSignAfterEndecode(i32 noundef %86, i32 noundef %87, ptr noundef %88, ptr noundef %89)
  %90 = load i32, ptr %11, align 4, !tbaa !13
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = sext i32 %90 to i64
  %93 = getelementptr inbounds i8, ptr %91, i64 %92
  store ptr %93, ptr %15, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %85
  %95 = load i32, ptr %16, align 4, !tbaa !13
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %16, align 4, !tbaa !13
  br label %80, !llvm.loop !27

97:                                               ; preds = %84
  br label %98

98:                                               ; preds = %97, %76
  br label %132

99:                                               ; preds = %65, %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !13
  br label %100

100:                                              ; preds = %128, %99
  %101 = load i32, ptr %17, align 4, !tbaa !13
  %102 = load i32, ptr %9, align 4, !tbaa !13
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  br label %131

105:                                              ; preds = %100
  %106 = load i32, ptr %13, align 4, !tbaa !13
  switch i32 %106, label %123 [
    i32 1, label %107
    i32 3, label %107
    i32 4, label %107
    i32 5, label %107
    i32 2, label %111
    i32 6, label %116
    i32 8, label %116
  ]

107:                                              ; preds = %105, %105, %105, %105
  %108 = load i32, ptr %10, align 4, !tbaa !13
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  call void @BpEndecodeBaseType(i32 noundef %108, ptr noundef %109, ptr noundef %110)
  br label %123

111:                                              ; preds = %105
  %112 = load i32, ptr %11, align 4, !tbaa !13
  %113 = load i32, ptr %10, align 4, !tbaa !13
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  call void @BpEndecodeInt(i32 noundef %112, i32 noundef %113, ptr noundef %114, ptr noundef %115)
  br label %123

116:                                              ; preds = %105, %105
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.BpArrayDescriptor, ptr %117, i32 0, i32 2
  %119 = getelementptr inbounds %struct.BpType, ptr %118, i32 0, i32 3
  %120 = load ptr, ptr %119, align 8, !tbaa !29
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  call void %120(ptr noundef %121, ptr noundef %122)
  br label %123

123:                                              ; preds = %116, %111, %107, %105
  %124 = load i32, ptr %11, align 4, !tbaa !13
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = sext i32 %124 to i64
  %127 = getelementptr inbounds i8, ptr %125, i64 %126
  store ptr %127, ptr %15, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %123
  %129 = load i32, ptr %17, align 4, !tbaa !13
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %17, align 4, !tbaa !13
  br label %100, !llvm.loop !30

131:                                              ; preds = %104
  br label %132

132:                                              ; preds = %131, %98
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.BpArrayDescriptor, ptr %133, i32 0, i32 0
  %135 = load i8, ptr %134, align 8, !tbaa !16, !range !19, !noundef !20
  %136 = trunc i8 %135 to i1
  br i1 %136, label %137, label %161

137:                                              ; preds = %132
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.BpProcessorContext, ptr %138, i32 0, i32 0
  %140 = load i8, ptr %139, align 8, !tbaa !21, !range !19, !noundef !20
  %141 = trunc i8 %140 to i1
  br i1 %141, label %161, label %142

142:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %143 = load i32, ptr %7, align 4, !tbaa !13
  %144 = load i16, ptr %8, align 2, !tbaa !14
  %145 = zext i16 %144 to i32
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.BpArrayDescriptor, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !22
  %149 = mul nsw i32 %145, %148
  %150 = add nsw i32 %143, %149
  store i32 %150, ptr %18, align 4, !tbaa !13
  %151 = load i32, ptr %18, align 4, !tbaa !13
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.BpProcessorContext, ptr %152, i32 0, i32 1
  %154 = load i32, ptr %153, align 4, !tbaa !9
  %155 = icmp sge i32 %151, %154
  br i1 %155, label %156, label %160

156:                                              ; preds = %142
  %157 = load i32, ptr %18, align 4, !tbaa !13
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.BpProcessorContext, ptr %158, i32 0, i32 1
  store i32 %157, ptr %159, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %156, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %161

161:                                              ; preds = %160, %137, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret void
}

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @BpIsNbitsStandard(i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @BpIsBaseIntegerType(i32 noundef) #2

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

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 = { inlinehint 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, !12, i64 4}
!10 = !{!"BpProcessorContext", !11, i64 0, !12, i64 4, !6, i64 8}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !11, i64 0}
!17 = !{!"BpArrayDescriptor", !11, i64 0, !12, i64 4, !18, i64 8}
!18 = !{!"BpType", !12, i64 0, !12, i64 4, !12, i64 8, !6, i64 16, !6, i64 24, !12, i64 32}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!10, !11, i64 0}
!22 = !{!17, !12, i64 4}
!23 = !{!17, !12, i64 12}
!24 = !{!17, !12, i64 16}
!25 = !{!18, !12, i64 0}
!26 = !{!18, !12, i64 32}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!17, !6, i64 24}
!30 = distinct !{!30, !28}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

; Function Attrs: nounwind uwtable
define dso_local void @BpEndecodeArray(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %1, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = load i8, ptr %0, align 8, !tbaa !12, !range !15, !noundef !16
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %8, label %15

8:                                                ; preds = %3
  %9 = load i8, ptr %1, align 8, !tbaa !17, !range !15, !noundef !16
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %11, label %12

11:                                               ; preds = %8
  tail call void @BpEncodeArrayExtensibleAhead(ptr noundef nonnull %0, ptr noundef nonnull %1)
  br label %15

12:                                               ; preds = %8
  %13 = tail call zeroext i16 @BpDecodeArrayExtensibleAhead(ptr noundef nonnull %0, ptr noundef nonnull %1)
  %14 = zext i16 %13 to i32
  br label %15

15:                                               ; preds = %11, %12, %3
  %.0 = phi i32 [ 0, %11 ], [ %14, %12 ], [ 0, %3 ]
  %16 = getelementptr inbounds i8, ptr %0, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = getelementptr inbounds i8, ptr %0, i64 12
  %20 = load i32, ptr %19, align 4, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = load i32, ptr %21, align 8, !tbaa !20
  %23 = load i32, ptr %18, align 8, !tbaa !21
  %24 = getelementptr inbounds i8, ptr %0, i64 40
  %25 = load i32, ptr %24, align 8, !tbaa !22
  %26 = tail call zeroext i1 @BpIsNbitsStandard(i32 noundef %20)
  br i1 %26, label %27, label %40

27:                                               ; preds = %15
  %28 = tail call zeroext i1 @BpIsBaseIntegerType(i32 noundef %23)
  br i1 %28, label %31, label %29

29:                                               ; preds = %27
  %30 = tail call zeroext i1 @BpIsBaseIntegerType(i32 noundef %25)
  br i1 %30, label %31, label %40

31:                                               ; preds = %29, %27
  %32 = mul nsw i32 %20, %17
  tail call void @BpEndecodeBaseType(i32 noundef %32, ptr noundef nonnull %1, ptr noundef %2)
  %33 = icmp eq i32 %23, 2
  %34 = icmp eq i32 %25, 2
  %or.cond = select i1 %33, i1 true, i1 %34
  %35 = icmp sgt i32 %17, 0
  %or.cond73 = select i1 %or.cond, i1 %35, i1 false
  br i1 %or.cond73, label %.lr.ph72, label %.loopexit

.lr.ph72:                                         ; preds = %31
  %36 = sext i32 %22 to i64
  br label %37

37:                                               ; preds = %.lr.ph72, %37
  %.05871 = phi i32 [ 0, %.lr.ph72 ], [ %39, %37 ]
  %.05970 = phi ptr [ %2, %.lr.ph72 ], [ %38, %37 ]
  tail call void @BpHandleIntSignAfterEndecode(i32 noundef %22, i32 noundef %20, ptr noundef %1, ptr noundef %.05970)
  %38 = getelementptr inbounds i8, ptr %.05970, i64 %36
  %39 = add nuw nsw i32 %.05871, 1
  %exitcond81.not = icmp eq i32 %39, %17
  br i1 %exitcond81.not, label %.loopexit, label %37, !llvm.loop !23

40:                                               ; preds = %29, %15
  %41 = icmp sgt i32 %17, 0
  br i1 %41, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %40
  %42 = getelementptr inbounds i8, ptr %0, i64 24
  %43 = sext i32 %22 to i64
  switch i32 %23, label %.loopexit [
    i32 1, label %.lr.ph.split.us.preheader
    i32 3, label %.lr.ph.split.us.preheader
    i32 4, label %.lr.ph.split.us.preheader
    i32 5, label %.lr.ph.split.us.preheader
    i32 2, label %.lr.ph.split.us64
    i32 6, label %.lr.ph.split.us67.preheader
    i32 8, label %.lr.ph.split.us67.preheader
  ]

.lr.ph.split.us67.preheader:                      ; preds = %.lr.ph, %.lr.ph
  br label %.lr.ph.split.us67

.lr.ph.split.us.preheader:                        ; preds = %.lr.ph, %.lr.ph, %.lr.ph, %.lr.ph
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader, %.lr.ph.split.us
  %.05763.us = phi i32 [ %45, %.lr.ph.split.us ], [ 0, %.lr.ph.split.us.preheader ]
  %.162.us = phi ptr [ %44, %.lr.ph.split.us ], [ %2, %.lr.ph.split.us.preheader ]
  tail call void @BpEndecodeBaseType(i32 noundef %20, ptr noundef %1, ptr noundef %.162.us)
  %44 = getelementptr inbounds i8, ptr %.162.us, i64 %43
  %45 = add nuw nsw i32 %.05763.us, 1
  %exitcond80.not = icmp eq i32 %45, %17
  br i1 %exitcond80.not, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !25

.lr.ph.split.us64:                                ; preds = %.lr.ph, %.lr.ph.split.us64
  %.05763.us65 = phi i32 [ %47, %.lr.ph.split.us64 ], [ 0, %.lr.ph ]
  %.162.us66 = phi ptr [ %46, %.lr.ph.split.us64 ], [ %2, %.lr.ph ]
  tail call void @BpEndecodeInt(i32 noundef %22, i32 noundef %20, ptr noundef %1, ptr noundef %.162.us66)
  %46 = getelementptr inbounds i8, ptr %.162.us66, i64 %43
  %47 = add nuw nsw i32 %.05763.us65, 1
  %exitcond78.not = icmp eq i32 %47, %17
  br i1 %exitcond78.not, label %.loopexit, label %.lr.ph.split.us64, !llvm.loop !25

.lr.ph.split.us67:                                ; preds = %.lr.ph.split.us67.preheader, %.lr.ph.split.us67
  %.05763.us68 = phi i32 [ %50, %.lr.ph.split.us67 ], [ 0, %.lr.ph.split.us67.preheader ]
  %.162.us69 = phi ptr [ %49, %.lr.ph.split.us67 ], [ %2, %.lr.ph.split.us67.preheader ]
  %48 = load ptr, ptr %42, align 8, !tbaa !26
  tail call void %48(ptr noundef %.162.us69, ptr noundef %1) #2
  %49 = getelementptr inbounds i8, ptr %.162.us69, i64 %43
  %50 = add nuw nsw i32 %.05763.us68, 1
  %exitcond.not = icmp eq i32 %50, %17
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph.split.us67, !llvm.loop !25

.loopexit:                                        ; preds = %.lr.ph.split.us67, %.lr.ph.split.us64, %.lr.ph.split.us, %37, %.lr.ph, %40, %31
  %51 = load i8, ptr %0, align 8, !tbaa !12, !range !15, !noundef !16
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %53, label %62

53:                                               ; preds = %.loopexit
  %54 = load i8, ptr %1, align 8, !tbaa !17, !range !15, !noundef !16
  %55 = trunc nuw i8 %54 to i1
  br i1 %55, label %62, label %56

56:                                               ; preds = %53
  %57 = load i32, ptr %16, align 4, !tbaa !18
  %58 = mul nsw i32 %57, %.0
  %59 = add nsw i32 %58, %5
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %.not = icmp slt i32 %59, %60
  br i1 %.not, label %62, label %61

61:                                               ; preds = %56
  store i32 %59, ptr %4, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %56, %61, %53, %.loopexit
  ret void
}

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @BpIsNbitsStandard(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @BpIsBaseIntegerType(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @BpHandleIntSignAfterEndecode(i32 noundef, i32 noundef, 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 = { inlinehint 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, !10, i64 4}
!6 = !{!"BpProcessorContext", !7, i64 0, !10, i64 4, !11, i64 8}
!7 = !{!"_Bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"BpArrayDescriptor", !7, i64 0, !10, i64 4, !14, i64 8}
!14 = !{!"BpType", !10, i64 0, !10, i64 4, !10, i64 8, !11, i64 16, !11, i64 24, !10, i64 32}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!6, !7, i64 0}
!18 = !{!13, !10, i64 4}
!19 = !{!13, !10, i64 12}
!20 = !{!13, !10, i64 16}
!21 = !{!14, !10, i64 0}
!22 = !{!14, !10, i64 32}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = !{!13, !11, i64 24}


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