; LLVM IR from pixelsdb/mini-pixels :: pixels-core/lib/utils (EncodingUtils)

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

%class.EncodingUtils = type { ptr, ptr }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13EncodingUtils18readRemainingLongsERKSt10shared_ptrI10ByteBufferEPliii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #2 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %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 i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  %16 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %17 = load i32, ptr %11, align 4, !tbaa !9
  %18 = load i32, ptr %12, align 4, !tbaa !9
  %19 = mul nsw i32 %17, %18
  store i32 %19, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %20) #4
  %22 = getelementptr inbounds %class.EncodingUtils, ptr %16, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = load i32, ptr %13, align 4, !tbaa !9
  %25 = call noundef i32 @_ZN10ByteBuffer4readEPhjj(ptr noundef nonnull align 8 dereferenceable(62) %21, ptr noundef %23, i32 noundef 0, i32 noundef %24)
  store i32 %25, ptr %14, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %30, %6
  %27 = load i32, ptr %14, align 4, !tbaa !9
  %28 = load i32, ptr %13, align 4, !tbaa !9
  %29 = icmp ne i32 %27, %28
  br i1 %29, label %30, label %42

30:                                               ; preds = %26
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %31) #4
  %33 = getelementptr inbounds %class.EncodingUtils, ptr %16, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load i32, ptr %14, align 4, !tbaa !9
  %36 = load i32, ptr %13, align 4, !tbaa !9
  %37 = load i32, ptr %14, align 4, !tbaa !9
  %38 = sub nsw i32 %36, %37
  %39 = call noundef i32 @_ZN10ByteBuffer4readEPhjj(ptr noundef nonnull align 8 dereferenceable(62) %32, ptr noundef %34, i32 noundef %35, i32 noundef %38)
  %40 = load i32, ptr %14, align 4, !tbaa !9
  %41 = add nsw i32 %40, %39
  store i32 %41, ptr %14, align 4, !tbaa !9
  br label %26, !llvm.loop !13

42:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  %43 = load i32, ptr %12, align 4, !tbaa !9
  switch i32 %43, label %194 [
    i32 1, label %44
    i32 2, label %68
    i32 3, label %86
    i32 4, label %104
    i32 5, label %122
    i32 6, label %140
    i32 7, label %158
    i32 8, label %176
  ]

44:                                               ; preds = %42
  br label %45

45:                                               ; preds = %48, %44
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %48, label %67

48:                                               ; preds = %45
  %49 = getelementptr inbounds %class.EncodingUtils, ptr %16, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %50, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !15
  %55 = zext i8 %54 to i32
  %56 = and i32 %55, 255
  %57 = sext i32 %56 to i64
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %10, align 4, !tbaa !9
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds i64, ptr %58, i64 %61
  store i64 %57, ptr %62, align 8, !tbaa !16
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr %11, align 4, !tbaa !9
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %15, align 4, !tbaa !9
  br label %45, !llvm.loop !18

67:                                               ; preds = %45
  br label %195

68:                                               ; preds = %42
  br label %69

69:                                               ; preds = %72, %68
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %72, label %85

72:                                               ; preds = %69
  %73 = load i32, ptr %15, align 4, !tbaa !9
  %74 = mul nsw i32 %73, 2
  %75 = call noundef i64 @_ZN13EncodingUtils11readLongBE2Ei(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %74)
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %10, align 4, !tbaa !9
  %79 = sext i32 %77 to i64
  %80 = getelementptr inbounds i64, ptr %76, i64 %79
  store i64 %75, ptr %80, align 8, !tbaa !16
  %81 = load i32, ptr %11, align 4, !tbaa !9
  %82 = add nsw i32 %81, -1
  store i32 %82, ptr %11, align 4, !tbaa !9
  %83 = load i32, ptr %15, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %15, align 4, !tbaa !9
  br label %69, !llvm.loop !19

85:                                               ; preds = %69
  br label %195

86:                                               ; preds = %42
  br label %87

87:                                               ; preds = %90, %86
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %103

90:                                               ; preds = %87
  %91 = load i32, ptr %15, align 4, !tbaa !9
  %92 = mul nsw i32 %91, 3
  %93 = call noundef i64 @_ZN13EncodingUtils11readLongBE3Ei(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %92)
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %10, align 4, !tbaa !9
  %97 = sext i32 %95 to i64
  %98 = getelementptr inbounds i64, ptr %94, i64 %97
  store i64 %93, ptr %98, align 8, !tbaa !16
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = add nsw i32 %99, -1
  store i32 %100, ptr %11, align 4, !tbaa !9
  %101 = load i32, ptr %15, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %15, align 4, !tbaa !9
  br label %87, !llvm.loop !20

103:                                              ; preds = %87
  br label %195

104:                                              ; preds = %42
  br label %105

105:                                              ; preds = %108, %104
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = icmp sgt i32 %106, 0
  br i1 %107, label %108, label %121

108:                                              ; preds = %105
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = mul nsw i32 %109, 4
  %111 = call noundef i64 @_ZN13EncodingUtils11readLongBE4Ei(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %110)
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !9
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds i64, ptr %112, i64 %115
  store i64 %111, ptr %116, align 8, !tbaa !16
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr %11, align 4, !tbaa !9
  %119 = load i32, ptr %15, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %15, align 4, !tbaa !9
  br label %105, !llvm.loop !21

121:                                              ; preds = %105
  br label %195

122:                                              ; preds = %42
  br label %123

123:                                              ; preds = %126, %122
  %124 = load i32, ptr %11, align 4, !tbaa !9
  %125 = icmp sgt i32 %124, 0
  br i1 %125, label %126, label %139

126:                                              ; preds = %123
  %127 = load i32, ptr %15, align 4, !tbaa !9
  %128 = mul nsw i32 %127, 5
  %129 = call noundef i64 @_ZN13EncodingUtils11readLongBE5Ei(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %128)
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = load i32, ptr %10, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %10, align 4, !tbaa !9
  %133 = sext i32 %131 to i64
  %134 = getelementptr inbounds i64, ptr %130, i64 %133
  store i64 %129, ptr %134, align 8, !tbaa !16
  %135 = load i32, ptr %11, align 4, !tbaa !9
  %136 = add nsw i32 %135, -1
  store i32 %136, ptr %11, align 4, !tbaa !9
  %137 = load i32, ptr %15, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %15, align 4, !tbaa !9
  br label %123, !llvm.loop !22

139:                                              ; preds = %123
  br label %195

140:                                              ; preds = %42
  br label %141

141:                                              ; preds = %144, %140
  %142 = load i32, ptr %11, align 4, !tbaa !9
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %144, label %157

144:                                              ; preds = %141
  %145 = load i32, ptr %15, align 4, !tbaa !9
  %146 = mul nsw i32 %145, 6
  %147 = call noundef i64 @_ZN13EncodingUtils11readLongBE6Ei(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %146)
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %10, align 4, !tbaa !9
  %151 = sext i32 %149 to i64
  %152 = getelementptr inbounds i64, ptr %148, i64 %151
  store i64 %147, ptr %152, align 8, !tbaa !16
  %153 = load i32, ptr %11, align 4, !tbaa !9
  %154 = add nsw i32 %153, -1
  store i32 %154, ptr %11, align 4, !tbaa !9
  %155 = load i32, ptr %15, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %15, align 4, !tbaa !9
  br label %141, !llvm.loop !23

157:                                              ; preds = %141
  br label %195

158:                                              ; preds = %42
  br label %159

159:                                              ; preds = %162, %158
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = icmp sgt i32 %160, 0
  br i1 %161, label %162, label %175

162:                                              ; preds = %159
  %163 = load i32, ptr %15, align 4, !tbaa !9
  %164 = mul nsw i32 %163, 7
  %165 = call noundef i64 @_ZN13EncodingUtils11readLongBE7Ei(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %164)
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = load i32, ptr %10, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %10, align 4, !tbaa !9
  %169 = sext i32 %167 to i64
  %170 = getelementptr inbounds i64, ptr %166, i64 %169
  store i64 %165, ptr %170, align 8, !tbaa !16
  %171 = load i32, ptr %11, align 4, !tbaa !9
  %172 = add nsw i32 %171, -1
  store i32 %172, ptr %11, align 4, !tbaa !9
  %173 = load i32, ptr %15, align 4, !tbaa !9
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %15, align 4, !tbaa !9
  br label %159, !llvm.loop !24

175:                                              ; preds = %159
  br label %195

176:                                              ; preds = %42
  br label %177

177:                                              ; preds = %180, %176
  %178 = load i32, ptr %11, align 4, !tbaa !9
  %179 = icmp sgt i32 %178, 0
  br i1 %179, label %180, label %193

180:                                              ; preds = %177
  %181 = load i32, ptr %15, align 4, !tbaa !9
  %182 = mul nsw i32 %181, 8
  %183 = call noundef i64 @_ZN13EncodingUtils11readLongBE8Ei(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %182)
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = load i32, ptr %10, align 4, !tbaa !9
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %10, align 4, !tbaa !9
  %187 = sext i32 %185 to i64
  %188 = getelementptr inbounds i64, ptr %184, i64 %187
  store i64 %183, ptr %188, align 8, !tbaa !16
  %189 = load i32, ptr %11, align 4, !tbaa !9
  %190 = add nsw i32 %189, -1
  store i32 %190, ptr %11, align 4, !tbaa !9
  %191 = load i32, ptr %15, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %15, align 4, !tbaa !9
  br label %177, !llvm.loop !25

193:                                              ; preds = %177
  br label %195

194:                                              ; preds = %42
  br label %195

195:                                              ; preds = %194, %193, %175, %157, %139, %121, %103, %85, %67
  call void @llvm.lifetime.end.p0(i64 4, 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
  ret void
}

declare noundef i32 @_ZN10ByteBuffer4readEPhjj(ptr noundef nonnull align 8 dereferenceable(62), ptr noundef, i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE2Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE3Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE4Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE5Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE6Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE7Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE8Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS13EncodingUtils", !6, i64 0, !6, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


; 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13EncodingUtils18readRemainingLongsERKSt10shared_ptrI10ByteBufferEPliii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr nocapture noundef writeonly %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #1 align 2 {
  %7 = mul nsw i32 %5, %4
  %8 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #3
  %9 = load ptr, ptr %0, align 8, !tbaa !5
  %10 = tail call noundef i32 @_ZN10ByteBuffer4readEPhjj(ptr noundef nonnull align 8 dereferenceable(62) %8, ptr noundef %9, i32 noundef 0, i32 noundef %7)
  %.not92 = icmp eq i32 %10, %7
  br i1 %.not92, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6, %.lr.ph
  %.06093 = phi i32 [ %15, %.lr.ph ], [ %10, %6 ]
  %11 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %1) #3
  %12 = load ptr, ptr %0, align 8, !tbaa !5
  %13 = sub nsw i32 %7, %.06093
  %14 = tail call noundef i32 @_ZN10ByteBuffer4readEPhjj(ptr noundef nonnull align 8 dereferenceable(62) %11, ptr noundef %12, i32 noundef %.06093, i32 noundef %13)
  %15 = add nsw i32 %14, %.06093
  %.not = icmp eq i32 %15, %7
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph, %6
  switch i32 %5, label %.loopexit [
    i32 1, label %.preheader
    i32 2, label %.preheader78
    i32 3, label %.preheader80
    i32 4, label %.preheader82
    i32 5, label %.preheader84
    i32 6, label %.preheader86
    i32 7, label %.preheader88
    i32 8, label %.preheader90
  ]

.preheader90:                                     ; preds = %._crit_edge
  %16 = icmp sgt i32 %4, 0
  br i1 %16, label %.lr.ph97.preheader, label %.loopexit

.lr.ph97.preheader:                               ; preds = %.preheader90
  %17 = sext i32 %3 to i64
  br label %.lr.ph97

.preheader88:                                     ; preds = %._crit_edge
  %18 = icmp sgt i32 %4, 0
  br i1 %18, label %.lr.ph101.preheader, label %.loopexit

.lr.ph101.preheader:                              ; preds = %.preheader88
  %19 = sext i32 %3 to i64
  br label %.lr.ph101

.preheader86:                                     ; preds = %._crit_edge
  %20 = icmp sgt i32 %4, 0
  br i1 %20, label %.lr.ph105.preheader, label %.loopexit

.lr.ph105.preheader:                              ; preds = %.preheader86
  %21 = sext i32 %3 to i64
  br label %.lr.ph105

.preheader84:                                     ; preds = %._crit_edge
  %22 = icmp sgt i32 %4, 0
  br i1 %22, label %.lr.ph109.preheader, label %.loopexit

.lr.ph109.preheader:                              ; preds = %.preheader84
  %23 = sext i32 %3 to i64
  br label %.lr.ph109

.preheader82:                                     ; preds = %._crit_edge
  %24 = icmp sgt i32 %4, 0
  br i1 %24, label %.lr.ph113.preheader, label %.loopexit

.lr.ph113.preheader:                              ; preds = %.preheader82
  %25 = sext i32 %3 to i64
  br label %.lr.ph113

.preheader80:                                     ; preds = %._crit_edge
  %26 = icmp sgt i32 %4, 0
  br i1 %26, label %.lr.ph117.preheader, label %.loopexit

.lr.ph117.preheader:                              ; preds = %.preheader80
  %27 = sext i32 %3 to i64
  br label %.lr.ph117

.preheader78:                                     ; preds = %._crit_edge
  %28 = icmp sgt i32 %4, 0
  br i1 %28, label %.lr.ph121.preheader, label %.loopexit

.lr.ph121.preheader:                              ; preds = %.preheader78
  %29 = sext i32 %3 to i64
  br label %.lr.ph121

.preheader:                                       ; preds = %._crit_edge
  %30 = icmp sgt i32 %4, 0
  br i1 %30, label %.lr.ph125, label %.loopexit

.lr.ph125:                                        ; preds = %.preheader
  %31 = load ptr, ptr %0, align 8, !tbaa !5
  %32 = sext i32 %3 to i64
  %wide.trip.count = zext nneg i32 %4 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %33 = icmp ult i32 %4, 4
  br i1 %33, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph125.new

.lr.ph125.new:                                    ; preds = %.lr.ph125
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  %invariant.gep = getelementptr i8, ptr %2, i64 8
  %invariant.gep187 = getelementptr i8, ptr %2, i64 16
  %invariant.gep189 = getelementptr i8, ptr %2, i64 24
  br label %34

34:                                               ; preds = %34, %.lr.ph125.new
  %indvars.iv160 = phi i64 [ %32, %.lr.ph125.new ], [ %indvars.iv.next161.3, %34 ]
  %indvars.iv158 = phi i64 [ 0, %.lr.ph125.new ], [ %indvars.iv.next159.3, %34 ]
  %niter = phi i64 [ 0, %.lr.ph125.new ], [ %niter.next.3, %34 ]
  %35 = getelementptr inbounds i8, ptr %31, i64 %indvars.iv158
  %36 = load i8, ptr %35, align 1, !tbaa !12
  %37 = zext i8 %36 to i64
  %38 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv160
  store i64 %37, ptr %38, align 8, !tbaa !13
  %indvars.iv.next159 = or disjoint i64 %indvars.iv158, 1
  %39 = getelementptr inbounds i8, ptr %31, i64 %indvars.iv.next159
  %40 = load i8, ptr %39, align 1, !tbaa !12
  %41 = zext i8 %40 to i64
  %gep = getelementptr i64, ptr %invariant.gep, i64 %indvars.iv160
  store i64 %41, ptr %gep, align 8, !tbaa !13
  %indvars.iv.next159.1 = or disjoint i64 %indvars.iv158, 2
  %42 = getelementptr inbounds i8, ptr %31, i64 %indvars.iv.next159.1
  %43 = load i8, ptr %42, align 1, !tbaa !12
  %44 = zext i8 %43 to i64
  %gep188 = getelementptr i64, ptr %invariant.gep187, i64 %indvars.iv160
  store i64 %44, ptr %gep188, align 8, !tbaa !13
  %indvars.iv.next159.2 = or disjoint i64 %indvars.iv158, 3
  %45 = getelementptr inbounds i8, ptr %31, i64 %indvars.iv.next159.2
  %46 = load i8, ptr %45, align 1, !tbaa !12
  %47 = zext i8 %46 to i64
  %indvars.iv.next161.3 = add nsw i64 %indvars.iv160, 4
  %gep190 = getelementptr i64, ptr %invariant.gep189, i64 %indvars.iv160
  store i64 %47, ptr %gep190, align 8, !tbaa !13
  %indvars.iv.next159.3 = add nuw nsw i64 %indvars.iv158, 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 %.loopexit.loopexit.unr-lcssa, label %34, !llvm.loop !15

.lr.ph121:                                        ; preds = %.lr.ph121.preheader, %.lr.ph121
  %indvars.iv154 = phi i64 [ %29, %.lr.ph121.preheader ], [ %indvars.iv.next155, %.lr.ph121 ]
  %.1120 = phi i32 [ 0, %.lr.ph121.preheader ], [ %51, %.lr.ph121 ]
  %48 = shl nuw nsw i32 %.1120, 1
  %49 = tail call noundef i64 @_ZN13EncodingUtils11readLongBE2Ei(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %48)
  %indvars.iv.next155 = add nsw i64 %indvars.iv154, 1
  %50 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv154
  store i64 %49, ptr %50, align 8, !tbaa !13
  %51 = add nuw nsw i32 %.1120, 1
  %exitcond157.not = icmp eq i32 %51, %4
  br i1 %exitcond157.not, label %.loopexit, label %.lr.ph121, !llvm.loop !16

.lr.ph117:                                        ; preds = %.lr.ph117.preheader, %.lr.ph117
  %indvars.iv150 = phi i64 [ %27, %.lr.ph117.preheader ], [ %indvars.iv.next151, %.lr.ph117 ]
  %.2116 = phi i32 [ 0, %.lr.ph117.preheader ], [ %55, %.lr.ph117 ]
  %52 = mul nuw nsw i32 %.2116, 3
  %53 = tail call noundef i64 @_ZN13EncodingUtils11readLongBE3Ei(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %52)
  %indvars.iv.next151 = add nsw i64 %indvars.iv150, 1
  %54 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv150
  store i64 %53, ptr %54, align 8, !tbaa !13
  %55 = add nuw nsw i32 %.2116, 1
  %exitcond153.not = icmp eq i32 %55, %4
  br i1 %exitcond153.not, label %.loopexit, label %.lr.ph117, !llvm.loop !17

.lr.ph113:                                        ; preds = %.lr.ph113.preheader, %.lr.ph113
  %indvars.iv146 = phi i64 [ %25, %.lr.ph113.preheader ], [ %indvars.iv.next147, %.lr.ph113 ]
  %.3112 = phi i32 [ 0, %.lr.ph113.preheader ], [ %59, %.lr.ph113 ]
  %56 = shl nsw i32 %.3112, 2
  %57 = tail call noundef i64 @_ZN13EncodingUtils11readLongBE4Ei(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %56)
  %indvars.iv.next147 = add nsw i64 %indvars.iv146, 1
  %58 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv146
  store i64 %57, ptr %58, align 8, !tbaa !13
  %59 = add nuw nsw i32 %.3112, 1
  %exitcond149.not = icmp eq i32 %59, %4
  br i1 %exitcond149.not, label %.loopexit, label %.lr.ph113, !llvm.loop !18

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %.lr.ph109
  %indvars.iv142 = phi i64 [ %23, %.lr.ph109.preheader ], [ %indvars.iv.next143, %.lr.ph109 ]
  %.4108 = phi i32 [ 0, %.lr.ph109.preheader ], [ %63, %.lr.ph109 ]
  %60 = mul nuw nsw i32 %.4108, 5
  %61 = tail call noundef i64 @_ZN13EncodingUtils11readLongBE5Ei(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %60)
  %indvars.iv.next143 = add nsw i64 %indvars.iv142, 1
  %62 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv142
  store i64 %61, ptr %62, align 8, !tbaa !13
  %63 = add nuw nsw i32 %.4108, 1
  %exitcond145.not = icmp eq i32 %63, %4
  br i1 %exitcond145.not, label %.loopexit, label %.lr.ph109, !llvm.loop !19

.lr.ph105:                                        ; preds = %.lr.ph105.preheader, %.lr.ph105
  %indvars.iv138 = phi i64 [ %21, %.lr.ph105.preheader ], [ %indvars.iv.next139, %.lr.ph105 ]
  %.5104 = phi i32 [ 0, %.lr.ph105.preheader ], [ %67, %.lr.ph105 ]
  %64 = mul nuw nsw i32 %.5104, 6
  %65 = tail call noundef i64 @_ZN13EncodingUtils11readLongBE6Ei(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %64)
  %indvars.iv.next139 = add nsw i64 %indvars.iv138, 1
  %66 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv138
  store i64 %65, ptr %66, align 8, !tbaa !13
  %67 = add nuw nsw i32 %.5104, 1
  %exitcond141.not = icmp eq i32 %67, %4
  br i1 %exitcond141.not, label %.loopexit, label %.lr.ph105, !llvm.loop !20

.lr.ph101:                                        ; preds = %.lr.ph101.preheader, %.lr.ph101
  %indvars.iv134 = phi i64 [ %19, %.lr.ph101.preheader ], [ %indvars.iv.next135, %.lr.ph101 ]
  %.6100 = phi i32 [ 0, %.lr.ph101.preheader ], [ %71, %.lr.ph101 ]
  %68 = mul nuw nsw i32 %.6100, 7
  %69 = tail call noundef i64 @_ZN13EncodingUtils11readLongBE7Ei(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %68)
  %indvars.iv.next135 = add nsw i64 %indvars.iv134, 1
  %70 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv134
  store i64 %69, ptr %70, align 8, !tbaa !13
  %71 = add nuw nsw i32 %.6100, 1
  %exitcond137.not = icmp eq i32 %71, %4
  br i1 %exitcond137.not, label %.loopexit, label %.lr.ph101, !llvm.loop !21

.lr.ph97:                                         ; preds = %.lr.ph97.preheader, %.lr.ph97
  %indvars.iv = phi i64 [ %17, %.lr.ph97.preheader ], [ %indvars.iv.next, %.lr.ph97 ]
  %.796 = phi i32 [ 0, %.lr.ph97.preheader ], [ %75, %.lr.ph97 ]
  %72 = shl nsw i32 %.796, 3
  %73 = tail call noundef i64 @_ZN13EncodingUtils11readLongBE8Ei(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %72)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %74 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv
  store i64 %73, ptr %74, align 8, !tbaa !13
  %75 = add nuw nsw i32 %.796, 1
  %exitcond.not = icmp eq i32 %75, %4
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph97, !llvm.loop !22

.loopexit.loopexit.unr-lcssa:                     ; preds = %34, %.lr.ph125
  %indvars.iv160.unr = phi i64 [ %32, %.lr.ph125 ], [ %indvars.iv.next161.3, %34 ]
  %indvars.iv158.unr = phi i64 [ 0, %.lr.ph125 ], [ %indvars.iv.next159.3, %34 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.epil.preheader

.epil.preheader:                                  ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv160.epil = phi i64 [ %indvars.iv.next161.epil, %.epil.preheader ], [ %indvars.iv160.unr, %.loopexit.loopexit.unr-lcssa ]
  %indvars.iv158.epil = phi i64 [ %indvars.iv.next159.epil, %.epil.preheader ], [ %indvars.iv158.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %76 = getelementptr inbounds i8, ptr %31, i64 %indvars.iv158.epil
  %77 = load i8, ptr %76, align 1, !tbaa !12
  %78 = zext i8 %77 to i64
  %indvars.iv.next161.epil = add nsw i64 %indvars.iv160.epil, 1
  %79 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv160.epil
  store i64 %78, ptr %79, align 8, !tbaa !13
  %indvars.iv.next159.epil = add nuw nsw i64 %indvars.iv158.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 %.loopexit, label %.epil.preheader, !llvm.loop !23

.loopexit:                                        ; preds = %.lr.ph97, %.lr.ph101, %.lr.ph105, %.lr.ph109, %.lr.ph113, %.lr.ph117, %.lr.ph121, %.loopexit.loopexit.unr-lcssa, %.epil.preheader, %.preheader90, %.preheader88, %.preheader86, %.preheader84, %.preheader82, %.preheader80, %.preheader78, %.preheader, %._crit_edge
  ret void
}

declare noundef i32 @_ZN10ByteBuffer4readEPhjj(ptr noundef nonnull align 8 dereferenceable(62), ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE2Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE3Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE4Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE5Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE6Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE7Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN13EncodingUtils11readLongBE8Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

attributes #0 = { mustprogress 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 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 = { "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, !7, i64 0}
!6 = !{!"_ZTS13EncodingUtils", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}


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