; LLVM IR from jermp/2i_bench :: external/CRoaring/src/containers (run)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.rle16_s = type { i16, i16 }
%struct.run_container_s = type { i32, i32, ptr }

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @run_container_is_full(ptr noundef) #0

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare dso_local void @run_container_grow(ptr noundef, i32 noundef, i1 noundef zeroext) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @run_container_append_first(ptr noundef, i32) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @run_container_append(ptr noundef, i32, ptr noundef) #0

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

26:                                               ; preds = %2
  %27 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %40

29:                                               ; preds = %26, %2
  %30 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  store i32 1, ptr %7, align 4
  br label %209

33:                                               ; preds = %29
  %34 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %35 = trunc i8 %34 to i1
  br i1 %35, label %36, label %39

36:                                               ; preds = %33
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  call void @run_container_copy(ptr noundef %37, ptr noundef %38)
  store i32 1, ptr %7, align 4
  br label %209

39:                                               ; preds = %33
  br label %40

40:                                               ; preds = %39, %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.run_container_s, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !13
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.run_container_s, ptr %44, i32 0, i32 0
  %46 = load i32, ptr %45, align 8, !tbaa !13
  %47 = add nsw i32 %43, %46
  store i32 %47, ptr %8, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %48 = load i32, ptr %8, align 4, !tbaa !16
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.run_container_s, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = add nsw i32 %48, %51
  store i32 %52, ptr %9, align 4, !tbaa !16
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.run_container_s, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !17
  %56 = load i32, ptr %9, align 4, !tbaa !16
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %58, label %61

58:                                               ; preds = %40
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !16
  call void @run_container_grow(ptr noundef %59, i32 noundef %60, i1 noundef zeroext true)
  br label %61

61:                                               ; preds = %58, %40
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.run_container_s, ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !18
  %65 = load i32, ptr %8, align 4, !tbaa !16
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %struct.rle16_s, ptr %64, i64 %66
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.run_container_s, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.run_container_s, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 8, !tbaa !13
  %74 = sext i32 %73 to i64
  %75 = mul i64 %74, 4
  call void @llvm.memmove.p0.p0.i64(ptr align 2 %67, ptr align 2 %70, i64 %75, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.run_container_s, ptr %76, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !18
  %79 = load i32, ptr %8, align 4, !tbaa !16
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds %struct.rle16_s, ptr %78, i64 %80
  store ptr %81, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.run_container_s, ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !13
  store i32 %84, ptr %11, align 4, !tbaa !16
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.run_container_s, ptr %85, i32 0, i32 0
  store i32 0, ptr %86, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = load i32, ptr %12, align 4, !tbaa !16
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %struct.rle16_s, ptr %87, i64 %89
  %91 = getelementptr inbounds %struct.rle16_s, ptr %90, i32 0, i32 0
  %92 = load i16, ptr %91, align 2, !tbaa !19
  %93 = zext i16 %92 to i32
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.run_container_s, ptr %94, i32 0, i32 2
  %96 = load ptr, ptr %95, align 8, !tbaa !18
  %97 = load i32, ptr %13, align 4, !tbaa !16
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds %struct.rle16_s, ptr %96, i64 %98
  %100 = getelementptr inbounds %struct.rle16_s, ptr %99, i32 0, i32 0
  %101 = load i16, ptr %100, align 2, !tbaa !19
  %102 = zext i16 %101 to i32
  %103 = icmp sle i32 %93, %102
  br i1 %103, label %104, label %114

104:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = load i32, ptr %12, align 4, !tbaa !16
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.rle16_s, ptr %106, i64 %108
  %110 = load i32, ptr %109, align 2
  %111 = call i32 @run_container_append_first(ptr noundef %105, i32 %110)
  store i32 %111, ptr %15, align 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %14, ptr align 2 %15, i64 4, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  %112 = load i32, ptr %12, align 4, !tbaa !16
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %12, align 4, !tbaa !16
  br label %126

114:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.run_container_s, ptr %116, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !18
  %119 = load i32, ptr %13, align 4, !tbaa !16
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %struct.rle16_s, ptr %118, i64 %120
  %122 = load i32, ptr %121, align 2
  %123 = call i32 @run_container_append_first(ptr noundef %115, i32 %122)
  store i32 %123, ptr %16, align 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %14, ptr align 2 %16, i64 4, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %124 = load i32, ptr %13, align 4, !tbaa !16
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %13, align 4, !tbaa !16
  br label %126

126:                                              ; preds = %114, %104
  br label %127

127:                                              ; preds = %173, %126
  %128 = load i32, ptr %13, align 4, !tbaa !16
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.run_container_s, ptr %129, i32 0, i32 0
  %131 = load i32, ptr %130, align 8, !tbaa !13
  %132 = icmp slt i32 %128, %131
  br i1 %132, label %133, label %137

133:                                              ; preds = %127
  %134 = load i32, ptr %12, align 4, !tbaa !16
  %135 = load i32, ptr %11, align 4, !tbaa !16
  %136 = icmp slt i32 %134, %135
  br label %137

137:                                              ; preds = %133, %127
  %138 = phi i1 [ false, %127 ], [ %136, %133 ]
  br i1 %138, label %139, label %176

139:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = load i32, ptr %12, align 4, !tbaa !16
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds %struct.rle16_s, ptr %140, i64 %142
  %144 = getelementptr inbounds %struct.rle16_s, ptr %143, i32 0, i32 0
  %145 = load i16, ptr %144, align 2, !tbaa !19
  %146 = zext i16 %145 to i32
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.run_container_s, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %148, align 8, !tbaa !18
  %150 = load i32, ptr %13, align 4, !tbaa !16
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds %struct.rle16_s, ptr %149, i64 %151
  %153 = getelementptr inbounds %struct.rle16_s, ptr %152, i32 0, i32 0
  %154 = load i16, ptr %153, align 2, !tbaa !19
  %155 = zext i16 %154 to i32
  %156 = icmp sle i32 %146, %155
  br i1 %156, label %157, label %164

157:                                              ; preds = %139
  %158 = load ptr, ptr %10, align 8, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !16
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds %struct.rle16_s, ptr %158, i64 %160
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %17, ptr align 2 %161, i64 4, i1 false), !tbaa.struct !22
  %162 = load i32, ptr %12, align 4, !tbaa !16
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %12, align 4, !tbaa !16
  br label %173

164:                                              ; preds = %139
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.run_container_s, ptr %165, i32 0, i32 2
  %167 = load ptr, ptr %166, align 8, !tbaa !18
  %168 = load i32, ptr %13, align 4, !tbaa !16
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds %struct.rle16_s, ptr %167, i64 %169
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %17, ptr align 2 %170, i64 4, i1 false), !tbaa.struct !22
  %171 = load i32, ptr %13, align 4, !tbaa !16
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %13, align 4, !tbaa !16
  br label %173

173:                                              ; preds = %164, %157
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = load i32, ptr %17, align 2
  call void @run_container_append(ptr noundef %174, i32 %175, ptr noundef %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %127, !llvm.loop !24

176:                                              ; preds = %137
  br label %177

177:                                              ; preds = %183, %176
  %178 = load i32, ptr %13, align 4, !tbaa !16
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.run_container_s, ptr %179, i32 0, i32 0
  %181 = load i32, ptr %180, align 8, !tbaa !13
  %182 = icmp slt i32 %178, %181
  br i1 %182, label %183, label %194

183:                                              ; preds = %177
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.run_container_s, ptr %185, i32 0, i32 2
  %187 = load ptr, ptr %186, align 8, !tbaa !18
  %188 = load i32, ptr %13, align 4, !tbaa !16
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds %struct.rle16_s, ptr %187, i64 %189
  %191 = load i32, ptr %190, align 2
  call void @run_container_append(ptr noundef %184, i32 %191, ptr noundef %14)
  %192 = load i32, ptr %13, align 4, !tbaa !16
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %13, align 4, !tbaa !16
  br label %177, !llvm.loop !26

194:                                              ; preds = %177
  br label %195

195:                                              ; preds = %199, %194
  %196 = load i32, ptr %12, align 4, !tbaa !16
  %197 = load i32, ptr %11, align 4, !tbaa !16
  %198 = icmp slt i32 %196, %197
  br i1 %198, label %199, label %208

199:                                              ; preds = %195
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = load ptr, ptr %10, align 8, !tbaa !5
  %202 = load i32, ptr %12, align 4, !tbaa !16
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds %struct.rle16_s, ptr %201, i64 %203
  %205 = load i32, ptr %204, align 2
  call void @run_container_append(ptr noundef %200, i32 %205, ptr noundef %14)
  %206 = load i32, ptr %12, align 4, !tbaa !16
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %12, align 4, !tbaa !16
  br label %195, !llvm.loop !27

208:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  store i32 0, ptr %7, align 4
  br label %209

209:                                              ; preds = %208, %36, %32
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  %210 = load i32, ptr %7, align 4
  switch i32 %210, label %212 [
    i32 0, label %211
    i32 1, label %211
  ]

211:                                              ; preds = %209, %209
  ret void

212:                                              ; preds = %209
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #2

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

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

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


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

%struct.rle16_s = type { i16, i16 }

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @run_container_is_full(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @run_container_grow(ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @run_container_append_first(ptr noundef, i32) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @run_container_append(ptr noundef, i32, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @run_container_union_inplace(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.rle16_s, align 4
  %4 = tail call zeroext i1 @run_container_is_full(ptr noundef %0)
  %5 = tail call zeroext i1 @run_container_is_full(ptr noundef %1)
  %brmerge = select i1 %4, i1 true, i1 %5
  br i1 %brmerge, label %6, label %9

6:                                                ; preds = %2
  br i1 %4, label %65, label %7

7:                                                ; preds = %6
  br i1 %5, label %8, label %9

8:                                                ; preds = %7
  tail call void @run_container_copy(ptr noundef %1, ptr noundef %0)
  br label %65

9:                                                ; preds = %2, %7
  %10 = load i32, ptr %0, align 8, !tbaa !5
  %11 = load i32, ptr %1, align 8, !tbaa !5
  %12 = add nsw i32 %11, %10
  %13 = add nsw i32 %12, %10
  %14 = getelementptr inbounds i8, ptr %0, i64 4
  %15 = load i32, ptr %14, align 4, !tbaa !11
  %16 = icmp slt i32 %15, %13
  br i1 %16, label %17, label %18

17:                                               ; preds = %9
  tail call void @run_container_grow(ptr noundef nonnull %0, i32 noundef %13, i1 noundef zeroext true)
  %.pre = load i32, ptr %0, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %17, %9
  %19 = phi i32 [ %.pre, %17 ], [ %10, %9 ]
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = sext i32 %12 to i64
  %23 = getelementptr inbounds %struct.rle16_s, ptr %21, i64 %22
  %24 = sext i32 %19 to i64
  %25 = shl nsw i64 %24, 2
  tail call void @llvm.memmove.p0.p0.i64(ptr align 2 %23, ptr align 2 %21, i64 %25, i1 false)
  %26 = load ptr, ptr %20, align 8, !tbaa !12
  %27 = getelementptr inbounds %struct.rle16_s, ptr %26, i64 %22
  %28 = load i32, ptr %0, align 8, !tbaa !5
  store i32 0, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %29 = load i16, ptr %27, align 2, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %1, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = load i16, ptr %31, align 2, !tbaa !13
  %.not = icmp ugt i16 %29, %32
  %. = select i1 %.not, ptr %31, ptr %27
  %.84 = zext i1 %.not to i32
  %not..not = xor i1 %.not, true
  %.85 = zext i1 %not..not to i32
  %33 = load i32, ptr %., align 2
  %34 = tail call i32 @run_container_append_first(ptr noundef nonnull %0, i32 %33)
  store i32 %34, ptr %3, align 4
  %35 = load i32, ptr %1, align 8, !tbaa !5
  %36 = icmp sgt i32 %35, %.84
  %37 = icmp sgt i32 %28, %.85
  %38 = select i1 %36, i1 %37, i1 false
  br i1 %38, label %.lr.ph, label %.preheader71

.preheader71:                                     ; preds = %.lr.ph, %18
  %39 = phi i32 [ %35, %18 ], [ %51, %.lr.ph ]
  %.166.lcssa = phi i32 [ %.84, %18 ], [ %.267, %.lr.ph ]
  %.1.lcssa = phi i32 [ %.85, %18 ], [ %.2, %.lr.ph ]
  %40 = icmp slt i32 %.166.lcssa, %39
  br i1 %40, label %.lr.ph76.preheader, label %.preheader

.lr.ph76.preheader:                               ; preds = %.preheader71
  %41 = sext i32 %.166.lcssa to i64
  br label %.lr.ph76

.lr.ph:                                           ; preds = %18, %.lr.ph
  %.173 = phi i32 [ %.2, %.lr.ph ], [ %.85, %18 ]
  %.16672 = phi i32 [ %.267, %.lr.ph ], [ %.84, %18 ]
  %42 = zext nneg i32 %.173 to i64
  %43 = getelementptr inbounds %struct.rle16_s, ptr %27, i64 %42
  %44 = load i16, ptr %43, align 2, !tbaa !13
  %45 = load ptr, ptr %30, align 8, !tbaa !12
  %46 = zext nneg i32 %.16672 to i64
  %47 = getelementptr inbounds %struct.rle16_s, ptr %45, i64 %46
  %48 = load i16, ptr %47, align 2, !tbaa !13
  %.not70 = icmp ugt i16 %44, %48
  %49 = zext i1 %.not70 to i32
  %.267 = add nuw nsw i32 %.16672, %49
  %not..not70 = xor i1 %.not70, true
  %50 = zext i1 %not..not70 to i32
  %.2 = add nuw nsw i32 %.173, %50
  %.sroa.0.0.in = select i1 %.not70, ptr %47, ptr %43
  %.sroa.0.0 = load i32, ptr %.sroa.0.0.in, align 2
  call void @run_container_append(ptr noundef nonnull %0, i32 %.sroa.0.0, ptr noundef nonnull %3)
  %51 = load i32, ptr %1, align 8, !tbaa !5
  %52 = icmp slt i32 %.267, %51
  %53 = icmp slt i32 %.2, %28
  %54 = select i1 %52, i1 %53, i1 false
  br i1 %54, label %.lr.ph, label %.preheader71, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph76, %.preheader71
  %55 = icmp slt i32 %.1.lcssa, %28
  br i1 %55, label %.lr.ph78.preheader, label %._crit_edge

.lr.ph78.preheader:                               ; preds = %.preheader
  %56 = sext i32 %.1.lcssa to i64
  br label %.lr.ph78

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %.lr.ph76
  %indvars.iv = phi i64 [ %41, %.lr.ph76.preheader ], [ %indvars.iv.next, %.lr.ph76 ]
  %57 = load ptr, ptr %30, align 8, !tbaa !12
  %58 = getelementptr inbounds %struct.rle16_s, ptr %57, i64 %indvars.iv
  %59 = load i32, ptr %58, align 2
  call void @run_container_append(ptr noundef nonnull %0, i32 %59, ptr noundef nonnull %3)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %60 = load i32, ptr %1, align 8, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next, %61
  br i1 %62, label %.lr.ph76, label %.preheader, !llvm.loop !18

.lr.ph78:                                         ; preds = %.lr.ph78.preheader, %.lr.ph78
  %indvars.iv80 = phi i64 [ %56, %.lr.ph78.preheader ], [ %indvars.iv.next81, %.lr.ph78 ]
  %63 = getelementptr inbounds %struct.rle16_s, ptr %27, i64 %indvars.iv80
  %64 = load i32, ptr %63, align 2
  call void @run_container_append(ptr noundef nonnull %0, i32 %64, ptr noundef nonnull %3)
  %indvars.iv.next81 = add nsw i64 %indvars.iv80, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next81 to i32
  %exitcond.not = icmp eq i32 %28, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph78, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph78, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %65

65:                                               ; preds = %6, %._crit_edge, %8
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #3

attributes #0 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 0}
!6 = !{!"run_container_s", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 8}
!13 = !{!14, !15, i64 0}
!14 = !{!"rle16_s", !15, i64 0, !15, i64 2}
!15 = !{!"short", !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}


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