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

; 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.array_container_s = type { i32, i32, ptr }
%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 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare void @run_container_grow(ptr noundef, i32 noundef, i1 noundef zeroext) #3

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @run_container_append_value(ptr noundef, i16 noundef zeroext, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @array_run_container_inplace_union(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.rle16_s, align 2
  %12 = alloca %struct.rle16_s, align 2
  %13 = alloca %struct.rle16_s, align 2
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call zeroext i1 @run_container_is_full(ptr noundef %14)
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  br label %194

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.array_container_s, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.run_container_s, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !12
  %24 = add nsw i32 %20, %23
  store i32 %24, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %25 = load i32, ptr %5, align 4, !tbaa !14
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.run_container_s, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !12
  %29 = add nsw i32 %25, %28
  store i32 %29, ptr %6, align 4, !tbaa !14
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.run_container_s, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !15
  %33 = load i32, ptr %6, align 4, !tbaa !14
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %35, label %38

35:                                               ; preds = %17
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = load i32, ptr %6, align 4, !tbaa !14
  call void @run_container_grow(ptr noundef %36, i32 noundef %37, i1 noundef zeroext true)
  br label %38

38:                                               ; preds = %35, %17
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.run_container_s, ptr %39, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !16
  %42 = load i32, ptr %5, align 4, !tbaa !14
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct.rle16_s, ptr %41, i64 %43
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.run_container_s, ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.run_container_s, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !12
  %51 = sext i32 %50 to i64
  %52 = mul i64 %51, 4
  call void @llvm.memmove.p0.p0.i64(ptr align 2 %44, ptr align 2 %47, i64 %52, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.run_container_s, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = load i32, ptr %5, align 4, !tbaa !14
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %struct.rle16_s, ptr %55, i64 %57
  store ptr %58, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.run_container_s, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !12
  store i32 %61, ptr %10, align 4, !tbaa !14
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.run_container_s, ptr %62, i32 0, i32 0
  store i32 0, ptr %63, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !14
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %struct.rle16_s, ptr %64, i64 %66
  %68 = getelementptr inbounds %struct.rle16_s, ptr %67, i32 0, i32 0
  %69 = load i16, ptr %68, align 2, !tbaa !17
  %70 = zext i16 %69 to i32
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.array_container_s, ptr %71, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !20
  %74 = load i32, ptr %9, align 4, !tbaa !14
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i16, ptr %73, i64 %75
  %77 = load i16, ptr %76, align 2, !tbaa !21
  %78 = zext i16 %77 to i32
  %79 = icmp sle i32 %70, %78
  br i1 %79, label %80, label %90

80:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = load i32, ptr %8, align 4, !tbaa !14
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds %struct.rle16_s, ptr %82, i64 %84
  %86 = load i32, ptr %85, align 2
  %87 = call i32 @run_container_append_first(ptr noundef %81, i32 %86)
  store i32 %87, ptr %12, align 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %11, ptr align 2 %12, i64 4, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %88 = load i32, ptr %8, align 4, !tbaa !14
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %8, align 4, !tbaa !14
  br label %102

90:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.array_container_s, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !20
  %95 = load i32, ptr %9, align 4, !tbaa !14
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i16, ptr %94, i64 %96
  %98 = load i16, ptr %97, align 2, !tbaa !21
  %99 = call i32 @run_container_append_value_first(ptr noundef %91, i16 noundef zeroext %98)
  store i32 %99, ptr %13, align 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %11, ptr align 2 %13, i64 4, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %100 = load i32, ptr %9, align 4, !tbaa !14
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %9, align 4, !tbaa !14
  br label %102

102:                                              ; preds = %90, %80
  br label %103

103:                                              ; preds = %152, %102
  %104 = load i32, ptr %8, align 4, !tbaa !14
  %105 = load i32, ptr %10, align 4, !tbaa !14
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %113

107:                                              ; preds = %103
  %108 = load i32, ptr %9, align 4, !tbaa !14
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.array_container_s, ptr %109, i32 0, i32 0
  %111 = load i32, ptr %110, align 8, !tbaa !9
  %112 = icmp slt i32 %108, %111
  br label %113

113:                                              ; preds = %107, %103
  %114 = phi i1 [ false, %103 ], [ %112, %107 ]
  br i1 %114, label %115, label %153

115:                                              ; preds = %113
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !14
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds %struct.rle16_s, ptr %116, i64 %118
  %120 = getelementptr inbounds %struct.rle16_s, ptr %119, i32 0, i32 0
  %121 = load i16, ptr %120, align 2, !tbaa !17
  %122 = zext i16 %121 to i32
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.array_container_s, ptr %123, i32 0, i32 2
  %125 = load ptr, ptr %124, align 8, !tbaa !20
  %126 = load i32, ptr %9, align 4, !tbaa !14
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i16, ptr %125, i64 %127
  %129 = load i16, ptr %128, align 2, !tbaa !21
  %130 = zext i16 %129 to i32
  %131 = icmp sle i32 %122, %130
  br i1 %131, label %132, label %141

132:                                              ; preds = %115
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = load i32, ptr %8, align 4, !tbaa !14
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %struct.rle16_s, ptr %134, i64 %136
  %138 = load i32, ptr %137, align 2
  call void @run_container_append(ptr noundef %133, i32 %138, ptr noundef %11)
  %139 = load i32, ptr %8, align 4, !tbaa !14
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %8, align 4, !tbaa !14
  br label %152

141:                                              ; preds = %115
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.array_container_s, ptr %143, i32 0, i32 2
  %145 = load ptr, ptr %144, align 8, !tbaa !20
  %146 = load i32, ptr %9, align 4, !tbaa !14
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i16, ptr %145, i64 %147
  %149 = load i16, ptr %148, align 2, !tbaa !21
  call void @run_container_append_value(ptr noundef %142, i16 noundef zeroext %149, ptr noundef %11)
  %150 = load i32, ptr %9, align 4, !tbaa !14
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %9, align 4, !tbaa !14
  br label %152

152:                                              ; preds = %141, %132
  br label %103, !llvm.loop !23

153:                                              ; preds = %113
  %154 = load i32, ptr %9, align 4, !tbaa !14
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.array_container_s, ptr %155, i32 0, i32 0
  %157 = load i32, ptr %156, align 8, !tbaa !9
  %158 = icmp slt i32 %154, %157
  br i1 %158, label %159, label %178

159:                                              ; preds = %153
  br label %160

160:                                              ; preds = %166, %159
  %161 = load i32, ptr %9, align 4, !tbaa !14
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.array_container_s, ptr %162, i32 0, i32 0
  %164 = load i32, ptr %163, align 8, !tbaa !9
  %165 = icmp slt i32 %161, %164
  br i1 %165, label %166, label %177

166:                                              ; preds = %160
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.array_container_s, ptr %168, i32 0, i32 2
  %170 = load ptr, ptr %169, align 8, !tbaa !20
  %171 = load i32, ptr %9, align 4, !tbaa !14
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds i16, ptr %170, i64 %172
  %174 = load i16, ptr %173, align 2, !tbaa !21
  call void @run_container_append_value(ptr noundef %167, i16 noundef zeroext %174, ptr noundef %11)
  %175 = load i32, ptr %9, align 4, !tbaa !14
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %9, align 4, !tbaa !14
  br label %160, !llvm.loop !25

177:                                              ; preds = %160
  br label %193

178:                                              ; preds = %153
  br label %179

179:                                              ; preds = %183, %178
  %180 = load i32, ptr %8, align 4, !tbaa !14
  %181 = load i32, ptr %10, align 4, !tbaa !14
  %182 = icmp slt i32 %180, %181
  br i1 %182, label %183, label %192

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

192:                                              ; preds = %179
  br label %193

193:                                              ; preds = %192, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %194

194:                                              ; preds = %193, %16
  ret void
}

; 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 = { "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 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 #5 = { 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, !11, i64 0}
!10 = !{!"array_container_s", !11, i64 0, !11, i64 4, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"run_container_s", !11, i64 0, !11, i64 4, !6, i64 8}
!14 = !{!11, !11, i64 0}
!15 = !{!13, !11, i64 4}
!16 = !{!13, !6, i64 8}
!17 = !{!18, !19, i64 0}
!18 = !{!"rle16_s", !19, i64 0, !19, i64 2}
!19 = !{!"short", !7, i64 0}
!20 = !{!10, !6, i64 8}
!21 = !{!19, !19, i64 0}
!22 = !{i64 0, i64 2, !21, i64 2, i64 2, !21}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}


; 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

declare void @run_container_grow(ptr noundef, i32 noundef, i1 noundef zeroext) 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 i32 @run_container_append_value_first(ptr noundef, i16 noundef zeroext) 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: inlinehint nounwind uwtable
declare hidden void @run_container_append_value(ptr noundef, i16 noundef zeroext, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @array_run_container_inplace_union(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca %struct.rle16_s, align 4
  %4 = tail call zeroext i1 @run_container_is_full(ptr noundef %1)
  br i1 %4, label %66, label %5

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

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

14:                                               ; preds = %13, %5
  %15 = phi i32 [ %.pre, %13 ], [ %7, %5 ]
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %18 = sext i32 %8 to i64
  %19 = getelementptr inbounds %struct.rle16_s, ptr %17, i64 %18
  %20 = sext i32 %15 to i64
  %21 = shl nsw i64 %20, 2
  tail call void @llvm.memmove.p0.p0.i64(ptr align 2 %19, ptr align 2 %17, i64 %21, i1 false)
  %22 = load ptr, ptr %16, align 8, !tbaa !14
  %23 = getelementptr inbounds %struct.rle16_s, ptr %22, i64 %18
  %24 = load i32, ptr %1, align 8, !tbaa !11
  store i32 0, ptr %1, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %25 = load i16, ptr %23, align 2, !tbaa !15
  %26 = getelementptr inbounds i8, ptr %0, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !18
  %28 = load i16, ptr %27, align 2, !tbaa !19
  %.not = icmp ugt i16 %25, %28
  br i1 %.not, label %32, label %29

29:                                               ; preds = %14
  %30 = load i32, ptr %23, align 2
  %31 = tail call i32 @run_container_append_first(ptr noundef nonnull %1, i32 %30)
  br label %34

32:                                               ; preds = %14
  %33 = tail call i32 @run_container_append_value_first(ptr noundef nonnull %1, i16 noundef zeroext %28)
  br label %34

34:                                               ; preds = %32, %29
  %storemerge = phi i32 [ %33, %32 ], [ %31, %29 ]
  %.059 = phi i32 [ 1, %32 ], [ 0, %29 ]
  %.0 = phi i32 [ 0, %32 ], [ 1, %29 ]
  store i32 %storemerge, ptr %3, align 4
  %35 = icmp slt i32 %.0, %24
  br i1 %35, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %34, %51
  %.168 = phi i32 [ %.2, %51 ], [ %.0, %34 ]
  %.16067 = phi i32 [ %.261, %51 ], [ %.059, %34 ]
  %36 = load i32, ptr %0, align 8, !tbaa !5
  %37 = icmp slt i32 %.16067, %36
  br i1 %37, label %38, label %.critedge

38:                                               ; preds = %.lr.ph
  %39 = sext i32 %.168 to i64
  %40 = getelementptr inbounds %struct.rle16_s, ptr %23, i64 %39
  %41 = load i16, ptr %40, align 2, !tbaa !15
  %42 = load ptr, ptr %26, align 8, !tbaa !18
  %43 = sext i32 %.16067 to i64
  %44 = getelementptr inbounds i16, ptr %42, i64 %43
  %45 = load i16, ptr %44, align 2, !tbaa !19
  %.not64 = icmp ugt i16 %41, %45
  br i1 %.not64, label %49, label %46

46:                                               ; preds = %38
  %47 = load i32, ptr %40, align 2
  call void @run_container_append(ptr noundef nonnull %1, i32 %47, ptr noundef nonnull %3)
  %48 = add nsw i32 %.168, 1
  br label %51

49:                                               ; preds = %38
  call void @run_container_append_value(ptr noundef nonnull %1, i16 noundef zeroext %45, ptr noundef nonnull %3)
  %50 = add nsw i32 %.16067, 1
  br label %51

51:                                               ; preds = %49, %46
  %.261 = phi i32 [ %.16067, %46 ], [ %50, %49 ]
  %.2 = phi i32 [ %48, %46 ], [ %.168, %49 ]
  %52 = icmp slt i32 %.2, %24
  br i1 %52, label %.lr.ph, label %.critedge, !llvm.loop !20

.critedge:                                        ; preds = %.lr.ph, %51, %34
  %.160.lcssa = phi i32 [ %.059, %34 ], [ %.261, %51 ], [ %.16067, %.lr.ph ]
  %.1.lcssa = phi i32 [ %.0, %34 ], [ %.2, %51 ], [ %.168, %.lr.ph ]
  %53 = load i32, ptr %0, align 8, !tbaa !5
  %54 = icmp slt i32 %.160.lcssa, %53
  br i1 %54, label %.lr.ph76.preheader, label %.preheader65

.preheader65:                                     ; preds = %.critedge
  %55 = icmp slt i32 %.1.lcssa, %24
  br i1 %55, label %.lr.ph74.preheader, label %.loopexit

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

.lr.ph76.preheader:                               ; preds = %.critedge
  %57 = sext i32 %.160.lcssa to i64
  br label %.lr.ph76

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %.lr.ph76
  %indvars.iv79 = phi i64 [ %57, %.lr.ph76.preheader ], [ %indvars.iv.next80, %.lr.ph76 ]
  %58 = load ptr, ptr %26, align 8, !tbaa !18
  %59 = getelementptr inbounds i16, ptr %58, i64 %indvars.iv79
  %60 = load i16, ptr %59, align 2, !tbaa !19
  call void @run_container_append_value(ptr noundef nonnull %1, i16 noundef zeroext %60, ptr noundef nonnull %3)
  %indvars.iv.next80 = add nsw i64 %indvars.iv79, 1
  %61 = load i32, ptr %0, align 8, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next80, %62
  br i1 %63, label %.lr.ph76, label %.loopexit, !llvm.loop !22

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %.lr.ph74
  %indvars.iv = phi i64 [ %56, %.lr.ph74.preheader ], [ %indvars.iv.next, %.lr.ph74 ]
  %64 = getelementptr inbounds %struct.rle16_s, ptr %23, i64 %indvars.iv
  %65 = load i32, ptr %64, align 2
  call void @run_container_append(ptr noundef nonnull %1, i32 %65, ptr noundef nonnull %3)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %24, %lftr.wideiv
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph74, !llvm.loop !23

.loopexit:                                        ; preds = %.lr.ph74, %.lr.ph76, %.preheader65
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %66

66:                                               ; preds = %2, %.loopexit
  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) #4

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = !{!"array_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 = !{!12, !7, i64 0}
!12 = !{!"run_container_s", !7, i64 0, !7, i64 4, !10, i64 8}
!13 = !{!12, !7, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!16, !17, i64 0}
!16 = !{!"rle16_s", !17, i64 0, !17, i64 2}
!17 = !{!"short", !8, i64 0}
!18 = !{!6, !10, i64 8}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}


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