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

; 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.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 }
%"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 }

@_ZN9Constants10MIN_REPEATE = external global i32, align 4
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@__PRETTY_FUNCTION__._ZN16RunLenIntEncoder17determineEncodingEv = external hidden unnamed_addr constant [43 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1

; 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: mustprogress uwtable
define dso_local void @_ZN16RunLenIntEncoder17determineEncodingEv(ptr noundef nonnull align 8 dereferenceable(168) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %2, align 8
  call void @_ZN16RunLenIntEncoder21computeZigZagLiteralsEv(ptr noundef nonnull align 8 dereferenceable(168) %15)
  %16 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 21
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 1
  %19 = load i32, ptr %18, align 4, !tbaa !19
  %20 = call noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168) %15, ptr noundef %17, i32 noundef 0, i32 noundef %19, double noundef 1.000000e+00)
  %21 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 16
  store i32 %20, ptr %21, align 8, !tbaa !20
  %22 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 1
  %23 = load i32, ptr %22, align 4, !tbaa !19
  %24 = load i32, ptr @_ZN9Constants10MIN_REPEATE, align 4, !tbaa !21
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %26, label %28

26:                                               ; preds = %1
  %27 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 0
  store i32 1, ptr %27, align 8, !tbaa !22
  br label %257

28:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #5
  store i8 1, ptr %3, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  store i8 1, ptr %4, align 1, !tbaa !23
  %29 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 9
  store i8 1, ptr %29, align 4, !tbaa !24
  %30 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 20
  %31 = load ptr, ptr %30, align 8, !tbaa !25
  %32 = getelementptr inbounds i64, ptr %31, i64 0
  %33 = load i64, ptr %32, align 8, !tbaa !26
  %34 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 19
  store i64 %33, ptr %34, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %35 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 20
  %36 = load ptr, ptr %35, align 8, !tbaa !25
  %37 = getelementptr inbounds i64, ptr %36, i64 0
  %38 = load i64, ptr %37, align 8, !tbaa !26
  store i64 %38, ptr %5, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %39 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 20
  %40 = load ptr, ptr %39, align 8, !tbaa !25
  %41 = getelementptr inbounds i64, ptr %40, i64 1
  %42 = load i64, ptr %41, align 8, !tbaa !26
  %43 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 20
  %44 = load ptr, ptr %43, align 8, !tbaa !25
  %45 = getelementptr inbounds i64, ptr %44, i64 0
  %46 = load i64, ptr %45, align 8, !tbaa !26
  %47 = sub nsw i64 %42, %46
  store i64 %47, ptr %6, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !26
  %48 = load i64, ptr %6, align 8, !tbaa !26
  %49 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 23
  %50 = load ptr, ptr %49, align 8, !tbaa !28
  %51 = getelementptr inbounds i64, ptr %50, i64 0
  store i64 %48, ptr %51, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !21
  br label %52

52:                                               ; preds = %130, %28
  %53 = load i32, ptr %9, align 4, !tbaa !21
  %54 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !19
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %133

58:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %59 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 20
  %60 = load ptr, ptr %59, align 8, !tbaa !25
  %61 = load i32, ptr %9, align 4, !tbaa !21
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i64, ptr %60, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !26
  store i64 %64, ptr %10, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %65 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 20
  %66 = load ptr, ptr %65, align 8, !tbaa !25
  %67 = load i32, ptr %9, align 4, !tbaa !21
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i64, ptr %66, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !26
  store i64 %71, ptr %11, align 8, !tbaa !26
  %72 = load i8, ptr %3, align 1, !tbaa !23, !range !29, !noundef !30
  %73 = trunc i8 %72 to i1
  br i1 %73, label %74, label %78

74:                                               ; preds = %58
  %75 = load i64, ptr %11, align 8, !tbaa !26
  %76 = load i64, ptr %10, align 8, !tbaa !26
  %77 = icmp sle i64 %75, %76
  br label %78

78:                                               ; preds = %74, %58
  %79 = phi i1 [ false, %58 ], [ %77, %74 ]
  %80 = zext i1 %79 to i8
  store i8 %80, ptr %3, align 1, !tbaa !23
  %81 = load i8, ptr %4, align 1, !tbaa !23, !range !29, !noundef !30
  %82 = trunc i8 %81 to i1
  br i1 %82, label %83, label %87

83:                                               ; preds = %78
  %84 = load i64, ptr %11, align 8, !tbaa !26
  %85 = load i64, ptr %10, align 8, !tbaa !26
  %86 = icmp sge i64 %84, %85
  br label %87

87:                                               ; preds = %83, %78
  %88 = phi i1 [ false, %78 ], [ %86, %83 ]
  %89 = zext i1 %88 to i8
  store i8 %89, ptr %4, align 1, !tbaa !23
  %90 = load i64, ptr %10, align 8, !tbaa !26
  %91 = load i64, ptr %11, align 8, !tbaa !26
  %92 = sub nsw i64 %90, %91
  store i64 %92, ptr %7, align 8, !tbaa !26
  %93 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 19
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %95 = load i64, ptr %94, align 8, !tbaa !26
  %96 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 19
  store i64 %95, ptr %96, align 8, !tbaa !27
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %98 = load i64, ptr %97, align 8, !tbaa !26
  store i64 %98, ptr %5, align 8, !tbaa !26
  %99 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 9
  %100 = load i8, ptr %99, align 4, !tbaa !24, !range !29, !noundef !30
  %101 = trunc i8 %100 to i1
  br i1 %101, label %102, label %106

102:                                              ; preds = %87
  %103 = load i64, ptr %7, align 8, !tbaa !26
  %104 = load i64, ptr %6, align 8, !tbaa !26
  %105 = icmp eq i64 %103, %104
  br label %106

106:                                              ; preds = %102, %87
  %107 = phi i1 [ false, %87 ], [ %105, %102 ]
  %108 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 9
  %109 = zext i1 %107 to i8
  store i8 %109, ptr %108, align 4, !tbaa !24
  %110 = load i32, ptr %9, align 4, !tbaa !21
  %111 = icmp sgt i32 %110, 1
  br i1 %111, label %112, label %129

112:                                              ; preds = %106
  %113 = load i64, ptr %7, align 8, !tbaa !26
  %114 = call noundef i64 @_ZSt3absl(i64 noundef %113)
  %115 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 23
  %116 = load ptr, ptr %115, align 8, !tbaa !28
  %117 = load i32, ptr %9, align 4, !tbaa !21
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i64, ptr %116, i64 %119
  store i64 %114, ptr %120, align 8, !tbaa !26
  %121 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 23
  %122 = load ptr, ptr %121, align 8, !tbaa !28
  %123 = load i32, ptr %9, align 4, !tbaa !21
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i64, ptr %122, i64 %125
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %126)
  %128 = load i64, ptr %127, align 8, !tbaa !26
  store i64 %128, ptr %8, align 8, !tbaa !26
  br label %129

129:                                              ; preds = %112, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %9, align 4, !tbaa !21
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %9, align 4, !tbaa !21
  br label %52, !llvm.loop !31

133:                                              ; preds = %57
  %134 = load i64, ptr %5, align 8, !tbaa !26
  %135 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 19
  %136 = load i64, ptr %135, align 8, !tbaa !27
  %137 = call noundef zeroext i1 @_ZN16RunLenIntEncoder14isSafeSubtractEll(ptr noundef nonnull align 8 dereferenceable(168) %15, i64 noundef %134, i64 noundef %136)
  br i1 %137, label %140, label %138

138:                                              ; preds = %133
  %139 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 0
  store i32 1, ptr %139, align 8, !tbaa !22
  store i32 1, ptr %12, align 4
  br label %256

140:                                              ; preds = %133
  %141 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 19
  %142 = load i64, ptr %141, align 8, !tbaa !27
  %143 = load i64, ptr %5, align 8, !tbaa !26
  %144 = icmp eq i64 %142, %143
  br i1 %144, label %145, label %161

145:                                              ; preds = %140
  %146 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 9
  %147 = load i8, ptr %146, align 4, !tbaa !24, !range !29, !noundef !30
  %148 = trunc i8 %147 to i1
  br i1 %148, label %149, label %150

149:                                              ; preds = %145
  br label %152

150:                                              ; preds = %145
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 166, ptr noundef @__PRETTY_FUNCTION__._ZN16RunLenIntEncoder17determineEncodingEv) #6
  unreachable

151:                                              ; No predecessors!
  br label %152

152:                                              ; preds = %151, %149
  %153 = load i64, ptr %7, align 8, !tbaa !26
  %154 = icmp eq i64 %153, 0
  br i1 %154, label %155, label %156

155:                                              ; preds = %152
  br label %158

156:                                              ; preds = %152
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 167, ptr noundef @__PRETTY_FUNCTION__._ZN16RunLenIntEncoder17determineEncodingEv) #6
  unreachable

157:                                              ; No predecessors!
  br label %158

158:                                              ; preds = %157, %155
  %159 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 7
  store i64 0, ptr %159, align 8, !tbaa !33
  %160 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 0
  store i32 3, ptr %160, align 8, !tbaa !22
  store i32 1, ptr %12, align 4
  br label %256

161:                                              ; preds = %140
  %162 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 9
  %163 = load i8, ptr %162, align 4, !tbaa !24, !range !29, !noundef !30
  %164 = trunc i8 %163 to i1
  br i1 %164, label %165, label %176

165:                                              ; preds = %161
  %166 = load i64, ptr %7, align 8, !tbaa !26
  %167 = load i64, ptr %6, align 8, !tbaa !26
  %168 = icmp eq i64 %166, %167
  br i1 %168, label %169, label %170

169:                                              ; preds = %165
  br label %172

170:                                              ; preds = %165
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 176, ptr noundef @__PRETTY_FUNCTION__._ZN16RunLenIntEncoder17determineEncodingEv) #6
  unreachable

171:                                              ; No predecessors!
  br label %172

172:                                              ; preds = %171, %169
  %173 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 0
  store i32 3, ptr %173, align 8, !tbaa !22
  %174 = load i64, ptr %7, align 8, !tbaa !26
  %175 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 7
  store i64 %174, ptr %175, align 8, !tbaa !33
  store i32 1, ptr %12, align 4
  br label %256

176:                                              ; preds = %161
  %177 = load i64, ptr %6, align 8, !tbaa !26
  %178 = icmp ne i64 %177, 0
  br i1 %178, label %179, label %191

179:                                              ; preds = %176
  %180 = load i64, ptr %8, align 8, !tbaa !26
  %181 = call noundef i32 @_ZN16RunLenIntEncoder18findClosestNumBitsEl(ptr noundef nonnull align 8 dereferenceable(168) %15, i64 noundef %180)
  %182 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 8
  store i32 %181, ptr %182, align 8, !tbaa !34
  %183 = load i8, ptr %3, align 1, !tbaa !23, !range !29, !noundef !30
  %184 = trunc i8 %183 to i1
  br i1 %184, label %188, label %185

185:                                              ; preds = %179
  %186 = load i8, ptr %4, align 1, !tbaa !23, !range !29, !noundef !30
  %187 = trunc i8 %186 to i1
  br i1 %187, label %188, label %190

188:                                              ; preds = %185, %179
  %189 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 0
  store i32 3, ptr %189, align 8, !tbaa !22
  store i32 1, ptr %12, align 4
  br label %256

190:                                              ; preds = %185
  br label %191

191:                                              ; preds = %190, %176
  %192 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 21
  %193 = load ptr, ptr %192, align 8, !tbaa !9
  %194 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 1
  %195 = load i32, ptr %194, align 4, !tbaa !19
  %196 = call noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168) %15, ptr noundef %193, i32 noundef 0, i32 noundef %195, double noundef 9.000000e-01)
  %197 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 15
  store i32 %196, ptr %197, align 4, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %198 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 16
  %199 = load i32, ptr %198, align 8, !tbaa !20
  %200 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 15
  %201 = load i32, ptr %200, align 4, !tbaa !35
  %202 = sub nsw i32 %199, %201
  store i32 %202, ptr %13, align 4, !tbaa !21
  %203 = load i32, ptr %13, align 4, !tbaa !21
  %204 = icmp sgt i32 %203, 1
  br i1 %204, label %205, label %253

205:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !21
  br label %206

206:                                              ; preds = %227, %205
  %207 = load i32, ptr %14, align 4, !tbaa !21
  %208 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 1
  %209 = load i32, ptr %208, align 4, !tbaa !19
  %210 = icmp slt i32 %207, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %206
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %230

212:                                              ; preds = %206
  %213 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 20
  %214 = load ptr, ptr %213, align 8, !tbaa !25
  %215 = load i32, ptr %14, align 4, !tbaa !21
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds i64, ptr %214, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !26
  %219 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 19
  %220 = load i64, ptr %219, align 8, !tbaa !27
  %221 = sub nsw i64 %218, %220
  %222 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 22
  %223 = load ptr, ptr %222, align 8, !tbaa !36
  %224 = load i32, ptr %14, align 4, !tbaa !21
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds i64, ptr %223, i64 %225
  store i64 %221, ptr %226, align 8, !tbaa !26
  br label %227

227:                                              ; preds = %212
  %228 = load i32, ptr %14, align 4, !tbaa !21
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %14, align 4, !tbaa !21
  br label %206, !llvm.loop !37

230:                                              ; preds = %211
  %231 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 22
  %232 = load ptr, ptr %231, align 8, !tbaa !36
  %233 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 1
  %234 = load i32, ptr %233, align 4, !tbaa !19
  %235 = call noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168) %15, ptr noundef %232, i32 noundef 0, i32 noundef %234, double noundef 0x3FEE666666666666)
  %236 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 17
  store i32 %235, ptr %236, align 4, !tbaa !38
  %237 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 22
  %238 = load ptr, ptr %237, align 8, !tbaa !36
  %239 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 1
  %240 = load i32, ptr %239, align 4, !tbaa !19
  %241 = call noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168) %15, ptr noundef %238, i32 noundef 0, i32 noundef %240, double noundef 1.000000e+00)
  %242 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 18
  store i32 %241, ptr %242, align 8, !tbaa !39
  %243 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 18
  %244 = load i32, ptr %243, align 8, !tbaa !39
  %245 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 17
  %246 = load i32, ptr %245, align 4, !tbaa !38
  %247 = sub nsw i32 %244, %246
  %248 = icmp ne i32 %247, 0
  br i1 %248, label %249, label %251

249:                                              ; preds = %230
  %250 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 0
  store i32 2, ptr %250, align 8, !tbaa !22
  call void @_ZN16RunLenIntEncoder18preparePatchedBlobEv(ptr noundef nonnull align 8 dereferenceable(168) %15)
  store i32 1, ptr %12, align 4
  br label %255

251:                                              ; preds = %230
  %252 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 0
  store i32 1, ptr %252, align 8, !tbaa !22
  store i32 1, ptr %12, align 4
  br label %255

253:                                              ; preds = %191
  %254 = getelementptr inbounds %class.RunLenIntEncoder, ptr %15, i32 0, i32 0
  store i32 1, ptr %254, align 8, !tbaa !22
  store i32 1, ptr %12, align 4
  br label %255

255:                                              ; preds = %253, %251, %249
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %256

256:                                              ; preds = %255, %188, %172, %158, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  br label %257

257:                                              ; preds = %256, %26
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16RunLenIntEncoder21computeZigZagLiteralsEv(ptr noundef nonnull align 8 dereferenceable(168)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef, i32 noundef, i32 noundef, double noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absl(i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN16RunLenIntEncoder14isSafeSubtractEll(ptr noundef nonnull align 8 dereferenceable(168), i64 noundef, i64 noundef) #3 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16RunLenIntEncoder18preparePatchedBlobEv(ptr noundef nonnull align 8 dereferenceable(168)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #3 = { 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 #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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, !6, i64 112}
!10 = !{!"_ZTS16RunLenIntEncoder", !11, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !13, i64 16, !13, i64 17, !14, i64 24, !14, i64 32, !12, i64 40, !13, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !6, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !14, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !15, i64 136, !16, i64 152}
!11 = !{!"_ZTSN16RunLenIntEncoder12EncodingTypeE", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTS13EncodingUtils", !6, i64 0, !6, i64 8}
!16 = !{!"_ZTSSt10shared_ptrI10ByteBufferE", !17, i64 0}
!17 = !{!"_ZTSSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !18, i64 8}
!18 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!19 = !{!10, !12, i64 4}
!20 = !{!10, !12, i64 80}
!21 = !{!12, !12, i64 0}
!22 = !{!10, !11, i64 0}
!23 = !{!13, !13, i64 0}
!24 = !{!10, !13, i64 44}
!25 = !{!10, !6, i64 104}
!26 = !{!14, !14, i64 0}
!27 = !{!10, !14, i64 96}
!28 = !{!10, !6, i64 128}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!10, !14, i64 32}
!34 = !{!10, !12, i64 40}
!35 = !{!10, !12, i64 76}
!36 = !{!10, !6, i64 120}
!37 = distinct !{!37, !32}
!38 = !{!10, !12, i64 84}
!39 = !{!10, !12, i64 88}


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

@_ZN9Constants10MIN_REPEATE = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@__PRETTY_FUNCTION__._ZN16RunLenIntEncoder17determineEncodingEv = external hidden unnamed_addr constant [43 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1

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

; 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 uwtable
define dso_local void @_ZN16RunLenIntEncoder17determineEncodingEv(ptr noundef nonnull align 8 dereferenceable(168) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  tail call void @_ZN16RunLenIntEncoder21computeZigZagLiteralsEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  %5 = getelementptr inbounds i8, ptr %0, i64 112
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !18
  %9 = tail call noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef %6, i32 noundef 0, i32 noundef %8, double noundef 1.000000e+00)
  %10 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 %9, ptr %10, align 8, !tbaa !19
  %11 = load i32, ptr %7, align 4, !tbaa !18
  %12 = load i32, ptr @_ZN9Constants10MIN_REPEATE, align 4, !tbaa !20
  %.not = icmp sgt i32 %11, %12
  br i1 %.not, label %14, label %13

13:                                               ; preds = %1
  store i32 1, ptr %0, align 8, !tbaa !21
  br label %163

14:                                               ; preds = %1
  %15 = getelementptr inbounds i8, ptr %0, i64 44
  store i8 1, ptr %15, align 4, !tbaa !22
  %16 = getelementptr inbounds i8, ptr %0, i64 104
  %17 = load ptr, ptr %16, align 8, !tbaa !23
  %18 = load i64, ptr %17, align 8, !tbaa !24
  %19 = getelementptr inbounds i8, ptr %0, i64 96
  store i64 %18, ptr %19, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  store i64 %18, ptr %2, align 8, !tbaa !24
  %20 = getelementptr inbounds i8, ptr %17, i64 8
  %21 = load i64, ptr %20, align 8, !tbaa !24
  %22 = load i64, ptr %17, align 8, !tbaa !24
  %23 = sub nsw i64 %21, %22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store i64 0, ptr %3, align 8, !tbaa !24
  %24 = getelementptr inbounds i8, ptr %0, i64 128
  %25 = load ptr, ptr %24, align 8, !tbaa !26
  store i64 %23, ptr %25, align 8, !tbaa !24
  %26 = icmp sgt i32 %11, 1
  br i1 %26, label %27, label %._crit_edge

27:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %28 = load i64, ptr %20, align 8, !tbaa !24
  store i64 %28, ptr %4, align 8, !tbaa !24
  %29 = load i64, ptr %17, align 8, !tbaa !24
  %30 = icmp sle i64 %29, %28
  %31 = icmp sge i64 %29, %28
  %32 = sub nsw i64 %28, %29
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %34 = load i64, ptr %33, align 8, !tbaa !24
  store i64 %34, ptr %19, align 8, !tbaa !25
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %36 = load i64, ptr %35, align 8, !tbaa !24
  store i64 %36, ptr %2, align 8, !tbaa !24
  %37 = load i8, ptr %15, align 4, !tbaa !22, !range !27, !noundef !28
  %38 = trunc nuw i8 %37 to i1
  %39 = icmp eq i64 %32, %23
  %40 = select i1 %38, i1 %39, i1 false
  %41 = zext i1 %40 to i8
  store i8 %41, ptr %15, align 4, !tbaa !22
  %.pre = load i32, ptr %7, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %42 = icmp sgt i32 %.pre, 2
  br i1 %42, label %.lr.ph.peel.next, label %._crit_edge.loopexit

._crit_edge.loopexit:                             ; preds = %.lr.ph.peel.next, %27
  %.lcssa45 = phi i1 [ %30, %27 ], [ %54, %.lr.ph.peel.next ]
  %.lcssa44 = phi i1 [ %31, %27 ], [ %56, %.lr.ph.peel.next ]
  %.lcssa = phi i64 [ %32, %27 ], [ %57, %.lr.ph.peel.next ]
  %43 = select i1 %.lcssa45, i1 true, i1 %.lcssa44
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %14
  %.031.lcssa = phi i64 [ 0, %14 ], [ %.lcssa, %._crit_edge.loopexit ]
  %.028.lcssa = phi i1 [ true, %14 ], [ %43, %._crit_edge.loopexit ]
  %44 = load i64, ptr %2, align 8, !tbaa !24
  %45 = load i64, ptr %19, align 8, !tbaa !25
  %46 = call noundef zeroext i1 @_ZN16RunLenIntEncoder14isSafeSubtractEll(ptr noundef nonnull align 8 dereferenceable(168) %0, i64 noundef %44, i64 noundef %45)
  br i1 %46, label %76, label %75

.lr.ph.peel.next:                                 ; preds = %27, %.lr.ph.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.peel.next ], [ 2, %27 ]
  %.02837 = phi i1 [ %54, %.lr.ph.peel.next ], [ %30, %27 ]
  %.02936 = phi i1 [ %56, %.lr.ph.peel.next ], [ %31, %27 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %47 = load ptr, ptr %16, align 8, !tbaa !23
  %48 = getelementptr inbounds i64, ptr %47, i64 %indvars.iv
  %49 = load i64, ptr %48, align 8, !tbaa !24
  store i64 %49, ptr %4, align 8, !tbaa !24
  %50 = add nsw i64 %indvars.iv, -1
  %51 = getelementptr inbounds i64, ptr %47, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !24
  %53 = icmp sle i64 %52, %49
  %54 = select i1 %.02837, i1 %53, i1 false
  %55 = icmp sge i64 %52, %49
  %56 = select i1 %.02936, i1 %55, i1 false
  %57 = sub nsw i64 %49, %52
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %59 = load i64, ptr %58, align 8, !tbaa !24
  store i64 %59, ptr %19, align 8, !tbaa !25
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %61 = load i64, ptr %60, align 8, !tbaa !24
  store i64 %61, ptr %2, align 8, !tbaa !24
  %62 = load i8, ptr %15, align 4, !tbaa !22, !range !27, !noundef !28
  %63 = trunc nuw i8 %62 to i1
  %64 = icmp eq i64 %57, %23
  %65 = select i1 %63, i1 %64, i1 false
  %66 = zext i1 %65 to i8
  store i8 %66, ptr %15, align 4, !tbaa !22
  %67 = call noundef i64 @_ZSt3absl(i64 noundef %57)
  %68 = load ptr, ptr %24, align 8, !tbaa !26
  %69 = getelementptr inbounds i64, ptr %68, i64 %50
  store i64 %67, ptr %69, align 8, !tbaa !24
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %69)
  %71 = load i64, ptr %70, align 8, !tbaa !24
  store i64 %71, ptr %3, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %72 = load i32, ptr %7, align 4, !tbaa !18
  %73 = sext i32 %72 to i64
  %74 = icmp slt i64 %indvars.iv.next, %73
  br i1 %74, label %.lr.ph.peel.next, label %._crit_edge.loopexit, !llvm.loop !29

75:                                               ; preds = %._crit_edge
  store i32 1, ptr %0, align 8, !tbaa !21
  br label %162

76:                                               ; preds = %._crit_edge
  %77 = load i64, ptr %19, align 8, !tbaa !25
  %78 = load i64, ptr %2, align 8, !tbaa !24
  %79 = icmp eq i64 %77, %78
  %80 = load i8, ptr %15, align 4, !tbaa !22, !range !27, !noundef !28
  %81 = trunc nuw i8 %80 to i1
  br i1 %79, label %82, label %89

82:                                               ; preds = %76
  br i1 %81, label %84, label %83

83:                                               ; preds = %82
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 166, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16RunLenIntEncoder17determineEncodingEv) #6
  unreachable

84:                                               ; preds = %82
  %85 = icmp eq i64 %.031.lcssa, 0
  br i1 %85, label %87, label %86

86:                                               ; preds = %84
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 167, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16RunLenIntEncoder17determineEncodingEv) #6
  unreachable

87:                                               ; preds = %84
  %88 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 0, ptr %88, align 8, !tbaa !32
  store i32 3, ptr %0, align 8, !tbaa !21
  br label %162

89:                                               ; preds = %76
  br i1 %81, label %90, label %95

90:                                               ; preds = %89
  %91 = icmp eq i64 %.031.lcssa, %23
  br i1 %91, label %93, label %92

92:                                               ; preds = %90
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 176, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16RunLenIntEncoder17determineEncodingEv) #6
  unreachable

93:                                               ; preds = %90
  store i32 3, ptr %0, align 8, !tbaa !21
  %94 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 %23, ptr %94, align 8, !tbaa !32
  br label %162

95:                                               ; preds = %89
  %.not33 = icmp eq i64 %21, %22
  br i1 %.not33, label %101, label %96

96:                                               ; preds = %95
  %97 = load i64, ptr %3, align 8, !tbaa !24
  %98 = call noundef i32 @_ZN16RunLenIntEncoder18findClosestNumBitsEl(ptr noundef nonnull align 8 dereferenceable(168) %0, i64 noundef %97)
  %99 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %98, ptr %99, align 8, !tbaa !33
  br i1 %.028.lcssa, label %100, label %101

100:                                              ; preds = %96
  store i32 3, ptr %0, align 8, !tbaa !21
  br label %162

101:                                              ; preds = %96, %95
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = load i32, ptr %7, align 4, !tbaa !18
  %104 = call noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef %102, i32 noundef 0, i32 noundef %103, double noundef 9.000000e-01)
  %105 = getelementptr inbounds i8, ptr %0, i64 76
  store i32 %104, ptr %105, align 4, !tbaa !34
  %106 = load i32, ptr %10, align 8, !tbaa !19
  %107 = sub nsw i32 %106, %104
  %108 = icmp sgt i32 %107, 1
  br i1 %108, label %.preheader, label %161

.preheader:                                       ; preds = %101
  %109 = load i32, ptr %7, align 4, !tbaa !18
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %.lr.ph41, label %.preheader.._crit_edge42_crit_edge

.preheader.._crit_edge42_crit_edge:               ; preds = %.preheader
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 120
  %.pre50 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !35
  br label %._crit_edge42

.lr.ph41:                                         ; preds = %.preheader
  %111 = load ptr, ptr %16, align 8, !tbaa !23
  %112 = getelementptr inbounds i8, ptr %0, i64 120
  %113 = load ptr, ptr %112, align 8, !tbaa !35
  %wide.trip.count = zext nneg i32 %109 to i64
  %min.iters.check = icmp ult i32 %109, 14
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph41
  %indvars.iv47.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph41 ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv47.prol = phi i64 [ %indvars.iv.next48.prol, %scalar.ph.prol ], [ %indvars.iv47.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %114 = getelementptr inbounds i64, ptr %111, i64 %indvars.iv47.prol
  %115 = load i64, ptr %114, align 8, !tbaa !24
  %116 = load i64, ptr %19, align 8, !tbaa !25
  %117 = sub nsw i64 %115, %116
  %118 = getelementptr inbounds i64, ptr %113, i64 %indvars.iv47.prol
  store i64 %117, ptr %118, align 8, !tbaa !24
  %indvars.iv.next48.prol = add nuw nsw i64 %indvars.iv47.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !36

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv47.unr = phi i64 [ %indvars.iv47.ph, %scalar.ph.preheader ], [ %indvars.iv.next48.prol, %scalar.ph.prol ]
  %119 = sub nsw i64 %indvars.iv47.ph, %wide.trip.count
  %120 = icmp ugt i64 %119, -4
  br i1 %120, label %._crit_edge42, label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph41
  %121 = shl nuw nsw i64 %wide.trip.count, 3
  %scevgep = getelementptr i8, ptr %113, i64 %121
  %scevgep57 = getelementptr i8, ptr %111, i64 %121
  %scevgep58 = getelementptr inbounds i8, ptr %0, i64 104
  %bound0 = icmp ult ptr %113, %scevgep57
  %bound1 = icmp ult ptr %111, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound059 = icmp ult ptr %113, %scevgep58
  %bound160 = icmp ult ptr %19, %scevgep
  %found.conflict61 = and i1 %bound059, %bound160
  %conflict.rdx = or i1 %found.conflict, %found.conflict61
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %122 = getelementptr inbounds i64, ptr %111, i64 %index
  %123 = getelementptr inbounds i8, ptr %122, i64 16
  %wide.load = load <2 x i64>, ptr %122, align 8, !tbaa !24, !alias.scope !38
  %wide.load62 = load <2 x i64>, ptr %123, align 8, !tbaa !24, !alias.scope !38
  %124 = load <2 x i64>, ptr %19, align 8
  %broadcast.splat64 = shufflevector <2 x i64> %124, <2 x i64> poison, <2 x i32> zeroinitializer
  %125 = sub nsw <2 x i64> %wide.load, %broadcast.splat64
  %126 = sub nsw <2 x i64> %wide.load62, %broadcast.splat64
  %127 = getelementptr inbounds i64, ptr %113, i64 %index
  %128 = getelementptr inbounds i8, ptr %127, i64 16
  store <2 x i64> %125, ptr %127, align 8, !tbaa !24, !alias.scope !41, !noalias !43
  store <2 x i64> %126, ptr %128, align 8, !tbaa !24, !alias.scope !41, !noalias !43
  %index.next = add nuw i64 %index, 4
  %129 = icmp eq i64 %index.next, %n.vec
  br i1 %129, label %middle.block, label %vector.body, !llvm.loop !45

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge42, label %scalar.ph.preheader

._crit_edge42:                                    ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.preheader.._crit_edge42_crit_edge
  %130 = phi ptr [ %.pre50, %.preheader.._crit_edge42_crit_edge ], [ %113, %middle.block ], [ %113, %scalar.ph ], [ %113, %scalar.ph.prol.loopexit ]
  %131 = getelementptr inbounds i8, ptr %0, i64 120
  %132 = call noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef %130, i32 noundef 0, i32 noundef %109, double noundef 0x3FEE666666666666)
  %133 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 %132, ptr %133, align 4, !tbaa !48
  %134 = load ptr, ptr %131, align 8, !tbaa !35
  %135 = load i32, ptr %7, align 4, !tbaa !18
  %136 = call noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef %134, i32 noundef 0, i32 noundef %135, double noundef 1.000000e+00)
  %137 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %136, ptr %137, align 8, !tbaa !49
  %138 = load i32, ptr %133, align 4, !tbaa !48
  %.not34 = icmp eq i32 %136, %138
  br i1 %.not34, label %160, label %159

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv47 = phi i64 [ %indvars.iv.next48.3, %scalar.ph ], [ %indvars.iv47.unr, %scalar.ph.prol.loopexit ]
  %139 = getelementptr inbounds i64, ptr %111, i64 %indvars.iv47
  %140 = load i64, ptr %139, align 8, !tbaa !24
  %141 = load i64, ptr %19, align 8, !tbaa !25
  %142 = sub nsw i64 %140, %141
  %143 = getelementptr inbounds i64, ptr %113, i64 %indvars.iv47
  store i64 %142, ptr %143, align 8, !tbaa !24
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %144 = getelementptr inbounds i64, ptr %111, i64 %indvars.iv.next48
  %145 = load i64, ptr %144, align 8, !tbaa !24
  %146 = load i64, ptr %19, align 8, !tbaa !25
  %147 = sub nsw i64 %145, %146
  %148 = getelementptr inbounds i64, ptr %113, i64 %indvars.iv.next48
  store i64 %147, ptr %148, align 8, !tbaa !24
  %indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 2
  %149 = getelementptr inbounds i64, ptr %111, i64 %indvars.iv.next48.1
  %150 = load i64, ptr %149, align 8, !tbaa !24
  %151 = load i64, ptr %19, align 8, !tbaa !25
  %152 = sub nsw i64 %150, %151
  %153 = getelementptr inbounds i64, ptr %113, i64 %indvars.iv.next48.1
  store i64 %152, ptr %153, align 8, !tbaa !24
  %indvars.iv.next48.2 = add nuw nsw i64 %indvars.iv47, 3
  %154 = getelementptr inbounds i64, ptr %111, i64 %indvars.iv.next48.2
  %155 = load i64, ptr %154, align 8, !tbaa !24
  %156 = load i64, ptr %19, align 8, !tbaa !25
  %157 = sub nsw i64 %155, %156
  %158 = getelementptr inbounds i64, ptr %113, i64 %indvars.iv.next48.2
  store i64 %157, ptr %158, align 8, !tbaa !24
  %indvars.iv.next48.3 = add nuw nsw i64 %indvars.iv47, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next48.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge42, label %scalar.ph, !llvm.loop !50

159:                                              ; preds = %._crit_edge42
  store i32 2, ptr %0, align 8, !tbaa !21
  call void @_ZN16RunLenIntEncoder18preparePatchedBlobEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  br label %162

160:                                              ; preds = %._crit_edge42
  store i32 1, ptr %0, align 8, !tbaa !21
  br label %162

161:                                              ; preds = %101
  store i32 1, ptr %0, align 8, !tbaa !21
  br label %162

162:                                              ; preds = %159, %160, %161, %100, %93, %87, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %163

163:                                              ; preds = %162, %13
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16RunLenIntEncoder21computeZigZagLiteralsEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16RunLenIntEncoder14percentileBitsEPliid(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absl(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN16RunLenIntEncoder14isSafeSubtractEll(ptr noundef nonnull align 8 dereferenceable(168), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16RunLenIntEncoder18findClosestNumBitsEl(ptr noundef nonnull align 8 dereferenceable(168), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16RunLenIntEncoder18preparePatchedBlobEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #3 = { 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 #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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, !13, i64 112}
!6 = !{!"_ZTS16RunLenIntEncoder", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !11, i64 16, !11, i64 17, !12, i64 24, !12, i64 32, !10, i64 40, !11, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !13, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !12, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !14, i64 136, !15, i64 152}
!7 = !{!"_ZTSN16RunLenIntEncoder12EncodingTypeE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"_ZTS13EncodingUtils", !13, i64 0, !13, i64 8}
!15 = !{!"_ZTSSt10shared_ptrI10ByteBufferE", !16, i64 0}
!16 = !{!"_ZTSSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EE", !13, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !13, i64 0}
!18 = !{!6, !10, i64 4}
!19 = !{!6, !10, i64 80}
!20 = !{!10, !10, i64 0}
!21 = !{!6, !7, i64 0}
!22 = !{!6, !11, i64 44}
!23 = !{!6, !13, i64 104}
!24 = !{!12, !12, i64 0}
!25 = !{!6, !12, i64 96}
!26 = !{!6, !13, i64 128}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !30, !31}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!"llvm.loop.peeled.count", i32 1}
!32 = !{!6, !12, i64 32}
!33 = !{!6, !10, i64 40}
!34 = !{!6, !10, i64 76}
!35 = !{!6, !13, i64 120}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.unroll.disable"}
!38 = !{!39}
!39 = distinct !{!39, !40}
!40 = distinct !{!40, !"LVerDomain"}
!41 = !{!42}
!42 = distinct !{!42, !40}
!43 = !{!39, !44}
!44 = distinct !{!44, !40}
!45 = distinct !{!45, !30, !46, !47}
!46 = !{!"llvm.loop.isvectorized", i32 1}
!47 = !{!"llvm.loop.unroll.runtime.disable"}
!48 = !{!6, !10, i64 84}
!49 = !{!6, !10, i64 88}
!50 = distinct !{!50, !30, !46}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass