; LLVM IR from pixelsdb/mini-pixels :: pixels-core/lib/encoding/RunLenIntEncoder.ll (ZN16RunLenIntEncoder9writeIntsEPliii)

; 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.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%class.RunLenIntEncoder = type { i32, i32, i32, i32, i8, i8, i64, i64, i32, i8, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i64, ptr, ptr, ptr, ptr, %class.EncodingUtils, %"class.std::shared_ptr" }
%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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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

declare void @_ZN10ByteBuffer3putEh(ptr noundef nonnull align 8 dereferenceable(62), i8 noundef zeroext) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16RunLenIntEncoder9writeIntsEPliii(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::shared_ptr", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::shared_ptr", align 8
  %15 = alloca %"class.std::shared_ptr", align 8
  %16 = alloca %"class.std::shared_ptr", align 8
  %17 = alloca %"class.std::shared_ptr", align 8
  %18 = alloca %"class.std::shared_ptr", align 8
  %19 = alloca %"class.std::shared_ptr", align 8
  %20 = alloca %"class.std::shared_ptr", align 8
  %21 = alloca %"class.std::shared_ptr", align 8
  %22 = alloca %"class.std::shared_ptr", align 8
  %23 = alloca %"class.std::shared_ptr", align 8
  %24 = alloca i32, align 4
  %25 = alloca i8, align 1
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  %29 = load ptr, ptr %6, align 8
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %41, label %32

32:                                               ; preds = %5
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %41, label %35

35:                                               ; preds = %32
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = icmp slt i32 %36, 1
  br i1 %37, label %41, label %38

38:                                               ; preds = %35
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = icmp slt i32 %39, 1
  br i1 %40, label %41, label %42

41:                                               ; preds = %38, %35, %32, %5
  br label %238

42:                                               ; preds = %38
  %43 = load i32, ptr %10, align 4, !tbaa !9
  switch i32 %43, label %165 [
    i32 1, label %44
    i32 2, label %55
    i32 4, label %66
    i32 8, label %77
    i32 16, label %88
    i32 24, label %99
    i32 32, label %110
    i32 40, label %121
    i32 48, label %132
    i32 56, label %143
    i32 64, label %154
  ]

44:                                               ; preds = %42
  %45 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %49) #4
  invoke void @_ZN13EncodingUtils16unrolledBitPack1EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef %46, i32 noundef %47, i32 noundef %48, ptr noundef %11)
          to label %50 unwind label %51

50:                                               ; preds = %44
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  br label %238

51:                                               ; preds = %44
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %12, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  br label %239

55:                                               ; preds = %42
  %56 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %60) #4
  invoke void @_ZN13EncodingUtils16unrolledBitPack2EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef %57, i32 noundef %58, i32 noundef %59, ptr noundef %14)
          to label %61 unwind label %62

61:                                               ; preds = %55
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  br label %238

62:                                               ; preds = %55
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %12, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  br label %239

66:                                               ; preds = %42
  %67 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %71) #4
  invoke void @_ZN13EncodingUtils16unrolledBitPack4EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef %68, i32 noundef %69, i32 noundef %70, ptr noundef %15)
          to label %72 unwind label %73

72:                                               ; preds = %66
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  br label %238

73:                                               ; preds = %66
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %12, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  br label %239

77:                                               ; preds = %42
  %78 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %82) #4
  invoke void @_ZN13EncodingUtils16unrolledBitPack8EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %78, ptr noundef %79, i32 noundef %80, i32 noundef %81, ptr noundef %16)
          to label %83 unwind label %84

83:                                               ; preds = %77
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #4
  br label %238

84:                                               ; preds = %77
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %12, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #4
  br label %239

88:                                               ; preds = %42
  %89 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %93) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack16EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %89, ptr noundef %90, i32 noundef %91, i32 noundef %92, ptr noundef %17)
          to label %94 unwind label %95

94:                                               ; preds = %88
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #4
  br label %238

95:                                               ; preds = %88
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %12, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #4
  br label %239

99:                                               ; preds = %42
  %100 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %104) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack24EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %100, ptr noundef %101, i32 noundef %102, i32 noundef %103, ptr noundef %18)
          to label %105 unwind label %106

105:                                              ; preds = %99
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #4
  br label %238

106:                                              ; preds = %99
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %12, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #4
  br label %239

110:                                              ; preds = %42
  %111 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %115) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack32EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %111, ptr noundef %112, i32 noundef %113, i32 noundef %114, ptr noundef %19)
          to label %116 unwind label %117

116:                                              ; preds = %110
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #4
  br label %238

117:                                              ; preds = %110
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %12, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #4
  br label %239

121:                                              ; preds = %42
  %122 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = load i32, ptr %8, align 4, !tbaa !9
  %125 = load i32, ptr %9, align 4, !tbaa !9
  %126 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %126) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack40EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %122, ptr noundef %123, i32 noundef %124, i32 noundef %125, ptr noundef %20)
          to label %127 unwind label %128

127:                                              ; preds = %121
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #4
  br label %238

128:                                              ; preds = %121
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %12, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #4
  br label %239

132:                                              ; preds = %42
  %133 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = load i32, ptr %8, align 4, !tbaa !9
  %136 = load i32, ptr %9, align 4, !tbaa !9
  %137 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %137) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack48EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %133, ptr noundef %134, i32 noundef %135, i32 noundef %136, ptr noundef %21)
          to label %138 unwind label %139

138:                                              ; preds = %132
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #4
  br label %238

139:                                              ; preds = %132
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %12, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #4
  br label %239

143:                                              ; preds = %42
  %144 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = load i32, ptr %8, align 4, !tbaa !9
  %147 = load i32, ptr %9, align 4, !tbaa !9
  %148 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %148) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack56EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %144, ptr noundef %145, i32 noundef %146, i32 noundef %147, ptr noundef %22)
          to label %149 unwind label %150

149:                                              ; preds = %143
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #4
  br label %238

150:                                              ; preds = %143
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %12, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #4
  br label %239

154:                                              ; preds = %42
  %155 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 24
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = load i32, ptr %8, align 4, !tbaa !9
  %158 = load i32, ptr %9, align 4, !tbaa !9
  %159 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %159) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack64EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %155, ptr noundef %156, i32 noundef %157, i32 noundef %158, ptr noundef %23)
          to label %160 unwind label %161

160:                                              ; preds = %154
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #4
  br label %238

161:                                              ; preds = %154
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %12, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %13, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #4
  br label %239

165:                                              ; preds = %42
  br label %166

166:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 8, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #4
  store i8 0, ptr %25, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %167 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %167, ptr %26, align 4, !tbaa !9
  br label %168

168:                                              ; preds = %227, %166
  %169 = load i32, ptr %26, align 4, !tbaa !9
  %170 = load i32, ptr %8, align 4, !tbaa !9
  %171 = load i32, ptr %9, align 4, !tbaa !9
  %172 = add nsw i32 %170, %171
  %173 = icmp slt i32 %169, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  br label %230

175:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = load i32, ptr %26, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds i64, ptr %176, i64 %178
  %180 = load i64, ptr %179, align 8, !tbaa !12
  store i64 %180, ptr %27, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  %181 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %181, ptr %28, align 4, !tbaa !9
  br label %182

182:                                              ; preds = %186, %175
  %183 = load i32, ptr %28, align 4, !tbaa !9
  %184 = load i32, ptr %24, align 4, !tbaa !9
  %185 = icmp sgt i32 %183, %184
  br i1 %185, label %186, label %208

186:                                              ; preds = %182
  %187 = load i64, ptr %27, align 8, !tbaa !12
  %188 = load i32, ptr %28, align 4, !tbaa !9
  %189 = load i32, ptr %24, align 4, !tbaa !9
  %190 = sub nsw i32 %188, %189
  %191 = zext i32 %190 to i64
  %192 = lshr i64 %187, %191
  %193 = load i8, ptr %25, align 1, !tbaa !11
  %194 = zext i8 %193 to i64
  %195 = or i64 %194, %192
  %196 = trunc i64 %195 to i8
  store i8 %196, ptr %25, align 1, !tbaa !11
  %197 = load i32, ptr %24, align 4, !tbaa !9
  %198 = load i32, ptr %28, align 4, !tbaa !9
  %199 = sub nsw i32 %198, %197
  store i32 %199, ptr %28, align 4, !tbaa !9
  %200 = load i32, ptr %28, align 4, !tbaa !9
  %201 = zext i32 %200 to i64
  %202 = shl i64 1, %201
  %203 = sub nsw i64 %202, 1
  %204 = load i64, ptr %27, align 8, !tbaa !12
  %205 = and i64 %204, %203
  store i64 %205, ptr %27, align 8, !tbaa !12
  %206 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  %207 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %206) #4
  call void @_ZN10ByteBuffer8putBytesEPhj(ptr noundef nonnull align 8 dereferenceable(62) %207, ptr noundef %25, i32 noundef 1)
  store i8 0, ptr %25, align 1, !tbaa !11
  store i32 8, ptr %24, align 4, !tbaa !9
  br label %182, !llvm.loop !14

208:                                              ; preds = %182
  %209 = load i32, ptr %28, align 4, !tbaa !9
  %210 = load i32, ptr %24, align 4, !tbaa !9
  %211 = sub nsw i32 %210, %209
  store i32 %211, ptr %24, align 4, !tbaa !9
  %212 = load i64, ptr %27, align 8, !tbaa !12
  %213 = load i32, ptr %24, align 4, !tbaa !9
  %214 = zext i32 %213 to i64
  %215 = shl i64 %212, %214
  %216 = load i8, ptr %25, align 1, !tbaa !11
  %217 = zext i8 %216 to i64
  %218 = or i64 %217, %215
  %219 = trunc i64 %218 to i8
  store i8 %219, ptr %25, align 1, !tbaa !11
  %220 = load i32, ptr %24, align 4, !tbaa !9
  %221 = icmp eq i32 %220, 0
  br i1 %221, label %222, label %226

222:                                              ; preds = %208
  %223 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  %224 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %223) #4
  %225 = load i8, ptr %25, align 1, !tbaa !11
  call void @_ZN10ByteBuffer3putEh(ptr noundef nonnull align 8 dereferenceable(62) %224, i8 noundef zeroext %225)
  store i8 0, ptr %25, align 1, !tbaa !11
  store i32 8, ptr %24, align 4, !tbaa !9
  br label %226

226:                                              ; preds = %222, %208
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %26, align 4, !tbaa !9
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %26, align 4, !tbaa !9
  br label %168, !llvm.loop !16

230:                                              ; preds = %174
  %231 = load i32, ptr %24, align 4, !tbaa !9
  %232 = icmp ne i32 %231, 8
  br i1 %232, label %233, label %237

233:                                              ; preds = %230
  %234 = getelementptr inbounds %class.RunLenIntEncoder, ptr %29, i32 0, i32 25
  %235 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %234) #4
  %236 = load i8, ptr %25, align 1, !tbaa !11
  call void @_ZN10ByteBuffer3putEh(ptr noundef nonnull align 8 dereferenceable(62) %235, i8 noundef zeroext %236)
  store i8 0, ptr %25, align 1, !tbaa !11
  store i32 8, ptr %24, align 4, !tbaa !9
  br label %237

237:                                              ; preds = %233, %230
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %238

238:                                              ; preds = %237, %160, %149, %138, %127, %116, %105, %94, %83, %72, %61, %50, %41
  ret void

239:                                              ; preds = %161, %150, %139, %128, %117, %106, %95, %84, %73, %62, %51
  %240 = load ptr, ptr %12, align 8
  %241 = load i32, ptr %13, align 4
  %242 = insertvalue { ptr, i32 } poison, ptr %240, 0
  %243 = insertvalue { ptr, i32 } %242, i32 %241, 1
  resume { ptr, i32 } %243
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

declare void @_ZN13EncodingUtils16unrolledBitPack1EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils16unrolledBitPack2EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils16unrolledBitPack4EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils16unrolledBitPack8EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils17unrolledBitPack16EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils17unrolledBitPack24EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils17unrolledBitPack32EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils17unrolledBitPack40EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils17unrolledBitPack48EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils17unrolledBitPack56EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN13EncodingUtils17unrolledBitPack64EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN10ByteBuffer8putBytesEPhj(ptr noundef nonnull align 8 dereferenceable(62), ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #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 = { "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 = { 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 #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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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)) local_unnamed_addr #1 align 2

declare void @_ZN10ByteBuffer3putEh(ptr noundef nonnull align 8 dereferenceable(62), i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16RunLenIntEncoder9writeIntsEPliii(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::shared_ptr", align 8
  %7 = alloca %"class.std::shared_ptr", align 8
  %8 = alloca %"class.std::shared_ptr", align 8
  %9 = alloca %"class.std::shared_ptr", align 8
  %10 = alloca %"class.std::shared_ptr", align 8
  %11 = alloca %"class.std::shared_ptr", align 8
  %12 = alloca %"class.std::shared_ptr", align 8
  %13 = alloca %"class.std::shared_ptr", align 8
  %14 = alloca %"class.std::shared_ptr", align 8
  %15 = alloca %"class.std::shared_ptr", align 8
  %16 = alloca %"class.std::shared_ptr", align 8
  %17 = alloca i8, align 1
  %18 = icmp eq ptr %1, null
  %19 = icmp slt i32 %2, 0
  %or.cond = or i1 %18, %19
  %20 = icmp slt i32 %3, 1
  %or.cond3 = or i1 %or.cond, %20
  %21 = icmp slt i32 %4, 1
  %or.cond5 = or i1 %or.cond3, %21
  br i1 %or.cond5, label %132, label %22

22:                                               ; preds = %5
  switch i32 %4, label %.lr.ph87 [
    i32 1, label %23
    i32 2, label %29
    i32 4, label %35
    i32 8, label %41
    i32 16, label %47
    i32 24, label %53
    i32 32, label %59
    i32 40, label %65
    i32 48, label %71
    i32 56, label %77
    i32 64, label %83
  ]

23:                                               ; preds = %22
  %24 = getelementptr inbounds i8, ptr %0, i64 136
  %25 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %25) #4
  invoke void @_ZN13EncodingUtils16unrolledBitPack1EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %6)
          to label %26 unwind label %27

26:                                               ; preds = %23
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  br label %132

27:                                               ; preds = %23
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %133

29:                                               ; preds = %22
  %30 = getelementptr inbounds i8, ptr %0, i64 136
  %31 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %31) #4
  invoke void @_ZN13EncodingUtils16unrolledBitPack2EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %7)
          to label %32 unwind label %33

32:                                               ; preds = %29
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  br label %132

33:                                               ; preds = %29
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %133

35:                                               ; preds = %22
  %36 = getelementptr inbounds i8, ptr %0, i64 136
  %37 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %37) #4
  invoke void @_ZN13EncodingUtils16unrolledBitPack4EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %8)
          to label %38 unwind label %39

38:                                               ; preds = %35
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #4
  br label %132

39:                                               ; preds = %35
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %133

41:                                               ; preds = %22
  %42 = getelementptr inbounds i8, ptr %0, i64 136
  %43 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %43) #4
  invoke void @_ZN13EncodingUtils16unrolledBitPack8EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %9)
          to label %44 unwind label %45

44:                                               ; preds = %41
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  br label %132

45:                                               ; preds = %41
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %133

47:                                               ; preds = %22
  %48 = getelementptr inbounds i8, ptr %0, i64 136
  %49 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %49) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack16EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %10)
          to label %50 unwind label %51

50:                                               ; preds = %47
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #4
  br label %132

51:                                               ; preds = %47
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %133

53:                                               ; preds = %22
  %54 = getelementptr inbounds i8, ptr %0, i64 136
  %55 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %55) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack24EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %11)
          to label %56 unwind label %57

56:                                               ; preds = %53
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  br label %132

57:                                               ; preds = %53
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %133

59:                                               ; preds = %22
  %60 = getelementptr inbounds i8, ptr %0, i64 136
  %61 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %61) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack32EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %12)
          to label %62 unwind label %63

62:                                               ; preds = %59
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  br label %132

63:                                               ; preds = %59
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %133

65:                                               ; preds = %22
  %66 = getelementptr inbounds i8, ptr %0, i64 136
  %67 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %67) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack40EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %13)
          to label %68 unwind label %69

68:                                               ; preds = %65
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  br label %132

69:                                               ; preds = %65
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %133

71:                                               ; preds = %22
  %72 = getelementptr inbounds i8, ptr %0, i64 136
  %73 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %73) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack48EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %72, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %14)
          to label %74 unwind label %75

74:                                               ; preds = %71
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  br label %132

75:                                               ; preds = %71
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %133

77:                                               ; preds = %22
  %78 = getelementptr inbounds i8, ptr %0, i64 136
  %79 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %79) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack56EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %78, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %15)
          to label %80 unwind label %81

80:                                               ; preds = %77
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  br label %132

81:                                               ; preds = %77
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %133

83:                                               ; preds = %22
  %84 = getelementptr inbounds i8, ptr %0, i64 136
  %85 = getelementptr inbounds i8, ptr %0, i64 152
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %85) #4
  invoke void @_ZN13EncodingUtils17unrolledBitPack64EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16) %84, ptr noundef nonnull %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %16)
          to label %86 unwind label %87

86:                                               ; preds = %83
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #4
  br label %132

87:                                               ; preds = %83
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %133

.lr.ph87:                                         ; preds = %22
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #4
  %89 = add nuw nsw i32 %3, %2
  %90 = getelementptr inbounds i8, ptr %0, i64 152
  %91 = zext nneg i32 %2 to i64
  br label %.backedge

._crit_edge88:                                    ; preds = %121
  %92 = icmp eq i32 %115, 8
  br i1 %92, label %._crit_edge88.thread, label %128

.backedge:                                        ; preds = %.backedge.backedge, %.lr.ph87
  %93 = phi i8 [ 0, %.lr.ph87 ], [ %.be, %.backedge.backedge ]
  %indvars.iv = phi i64 [ %91, %.lr.ph87 ], [ %indvars.iv.be, %.backedge.backedge ]
  %.07084 = phi i32 [ 8, %.lr.ph87 ], [ %.07084.be, %.backedge.backedge ]
  %94 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = icmp slt i32 %.07084, %4
  br i1 %96, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.backedge
  %97 = sub nsw i32 %4, %.07084
  %98 = zext i32 %97 to i64
  %99 = lshr i64 %95, %98
  %100 = trunc i64 %99 to i8
  %101 = or i8 %93, %100
  store i8 %101, ptr %17, align 1, !tbaa !9
  %notmask.peel = shl nsw i64 -1, %98
  %102 = xor i64 %notmask.peel, -1
  %103 = and i64 %95, %102
  %104 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %90) #4
  call void @_ZN10ByteBuffer8putBytesEPhj(ptr noundef nonnull align 8 dereferenceable(62) %104, ptr noundef nonnull %17, i32 noundef 1)
  %105 = icmp sgt i32 %97, 8
  br i1 %105, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.081 = phi i32 [ %106, %.lr.ph ], [ %97, %.lr.ph.preheader ]
  %.06880 = phi i64 [ %111, %.lr.ph ], [ %103, %.lr.ph.preheader ]
  %106 = add nsw i32 %.081, -8
  %107 = zext nneg i32 %106 to i64
  %108 = lshr i64 %.06880, %107
  %109 = trunc i64 %108 to i8
  store i8 %109, ptr %17, align 1, !tbaa !9
  %notmask = shl nsw i64 -1, %107
  %110 = xor i64 %notmask, -1
  %111 = and i64 %.06880, %110
  %112 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %90) #4
  call void @_ZN10ByteBuffer8putBytesEPhj(ptr noundef nonnull align 8 dereferenceable(62) %112, ptr noundef nonnull %17, i32 noundef 1)
  store i8 0, ptr %17, align 1, !tbaa !9
  %113 = icmp ugt i32 %.081, 16
  br i1 %113, label %.lr.ph, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph.preheader, %.backedge
  %114 = phi i8 [ %93, %.backedge ], [ 0, %.lr.ph.preheader ], [ 0, %.lr.ph ]
  %.1.lcssa = phi i32 [ %.07084, %.backedge ], [ 8, %.lr.ph.preheader ], [ 8, %.lr.ph ]
  %.068.lcssa = phi i64 [ %95, %.backedge ], [ %103, %.lr.ph.preheader ], [ %111, %.lr.ph ]
  %.0.lcssa = phi i32 [ %4, %.backedge ], [ %97, %.lr.ph.preheader ], [ %106, %.lr.ph ]
  %115 = sub nsw i32 %.1.lcssa, %.0.lcssa
  %116 = zext nneg i32 %115 to i64
  %117 = shl i64 %.068.lcssa, %116
  %118 = trunc i64 %117 to i8
  %119 = or i8 %114, %118
  store i8 %119, ptr %17, align 1, !tbaa !9
  %120 = icmp eq i32 %115, 0
  br i1 %120, label %.thread, label %121

121:                                              ; preds = %._crit_edge
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %122 = trunc nuw i64 %indvars.iv.next to i32
  %123 = icmp sgt i32 %89, %122
  br i1 %123, label %.backedge.backedge, label %._crit_edge88

.backedge.backedge:                               ; preds = %121, %.thread
  %.be = phi i8 [ %119, %121 ], [ 0, %.thread ]
  %indvars.iv.be = phi i64 [ %indvars.iv.next, %121 ], [ %indvars.iv.next93, %.thread ]
  %.07084.be = phi i32 [ %115, %121 ], [ 8, %.thread ]
  br label %.backedge, !llvm.loop !13

.thread:                                          ; preds = %._crit_edge
  %124 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %90) #4
  %125 = load i8, ptr %17, align 1, !tbaa !9
  call void @_ZN10ByteBuffer3putEh(ptr noundef nonnull align 8 dereferenceable(62) %124, i8 noundef zeroext %125)
  store i8 0, ptr %17, align 1, !tbaa !9
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv, 1
  %126 = trunc nuw i64 %indvars.iv.next93 to i32
  %127 = icmp sgt i32 %89, %126
  br i1 %127, label %.backedge.backedge, label %._crit_edge88.thread

128:                                              ; preds = %._crit_edge88
  %129 = getelementptr inbounds i8, ptr %0, i64 152
  %130 = call noundef ptr @_ZNKSt19__shared_ptr_accessI10ByteBufferLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %129) #4
  %131 = load i8, ptr %17, align 1, !tbaa !9
  call void @_ZN10ByteBuffer3putEh(ptr noundef nonnull align 8 dereferenceable(62) %130, i8 noundef zeroext %131)
  br label %._crit_edge88.thread

._crit_edge88.thread:                             ; preds = %.thread, %128, %._crit_edge88
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #4
  br label %132

132:                                              ; preds = %5, %._crit_edge88.thread, %86, %80, %74, %68, %62, %56, %50, %44, %38, %32, %26
  ret void

133:                                              ; preds = %87, %81, %75, %69, %63, %57, %51, %45, %39, %33, %27
  %.sink = phi ptr [ %16, %87 ], [ %15, %81 ], [ %14, %75 ], [ %13, %69 ], [ %12, %63 ], [ %11, %57 ], [ %10, %51 ], [ %9, %45 ], [ %8, %39 ], [ %7, %33 ], [ %6, %27 ]
  %.pn = phi { ptr, i32 } [ %88, %87 ], [ %82, %81 ], [ %76, %75 ], [ %70, %69 ], [ %64, %63 ], [ %58, %57 ], [ %52, %51 ], [ %46, %45 ], [ %40, %39 ], [ %34, %33 ], [ %28, %27 ]
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.sink) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

declare void @_ZN13EncodingUtils16unrolledBitPack1EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils16unrolledBitPack2EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils16unrolledBitPack4EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils16unrolledBitPack8EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils17unrolledBitPack16EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils17unrolledBitPack24EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils17unrolledBitPack32EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils17unrolledBitPack40EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils17unrolledBitPack48EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils17unrolledBitPack56EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN13EncodingUtils17unrolledBitPack64EPliiSt10shared_ptrI10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

attributes #0 = { mustprogress 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 = { "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 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !11}


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