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

; 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.run_container_s = type { i32, i32, ptr }
%struct.array_container_s = type { i32, i32, ptr }
%struct.rle16_s = type { i16, i16 }
%struct.bitset_container_s = type { i32, ptr }

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

declare ptr @bitset_container_create() #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @run_container_cardinality(ptr noundef) #2

declare ptr @array_container_create_given_capacity(i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @convert_run_to_efficient_container(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %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 !9
  %24 = call i32 @run_container_serialized_size_in_bytes(i32 noundef %23)
  store i32 %24, ptr %6, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %25 = call i32 @bitset_container_serialized_size_in_bytes()
  store i32 %25, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call i32 @run_container_cardinality(ptr noundef %26)
  store i32 %27, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %28 = load i32, ptr %8, align 4, !tbaa !12
  %29 = call i32 @array_container_serialized_size_in_bytes(i32 noundef %28)
  store i32 %29, ptr %9, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %30 = load i32, ptr %7, align 4, !tbaa !12
  %31 = load i32, ptr %9, align 4, !tbaa !12
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %35

33:                                               ; preds = %2
  %34 = load i32, ptr %7, align 4, !tbaa !12
  br label %37

35:                                               ; preds = %2
  %36 = load i32, ptr %9, align 4, !tbaa !12
  br label %37

37:                                               ; preds = %35, %33
  %38 = phi i32 [ %34, %33 ], [ %36, %35 ]
  store i32 %38, ptr %10, align 4, !tbaa !12
  %39 = load i32, ptr %6, align 4, !tbaa !12
  %40 = load i32, ptr %10, align 4, !tbaa !12
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %42, label %45

42:                                               ; preds = %37
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 3, ptr %43, align 1, !tbaa !13
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %44, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %154

45:                                               ; preds = %37
  %46 = load i32, ptr %8, align 4, !tbaa !12
  %47 = icmp sle i32 %46, 4096
  br i1 %47, label %48, label %109

48:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %49 = load i32, ptr %8, align 4, !tbaa !12
  %50 = call ptr @array_container_create_given_capacity(i32 noundef %49)
  store ptr %50, ptr %12, align 8, !tbaa !5
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.array_container_s, ptr %51, i32 0, i32 0
  store i32 0, ptr %52, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !12
  br label %53

53:                                               ; preds = %103, %48
  %54 = load i32, ptr %13, align 4, !tbaa !12
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.run_container_s, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %56, align 8, !tbaa !9
  %58 = icmp slt i32 %54, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %53
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %106

60:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.run_container_s, ptr %61, i32 0, i32 2
  %63 = load ptr, ptr %62, align 8, !tbaa !16
  %64 = load i32, ptr %13, align 4, !tbaa !12
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.rle16_s, ptr %63, i64 %65
  %67 = getelementptr inbounds %struct.rle16_s, ptr %66, i32 0, i32 0
  %68 = load i16, ptr %67, align 2, !tbaa !17
  %69 = zext i16 %68 to i32
  store i32 %69, ptr %14, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %70 = load i32, ptr %14, align 4, !tbaa !12
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.run_container_s, ptr %71, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !16
  %74 = load i32, ptr %13, align 4, !tbaa !12
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.rle16_s, ptr %73, i64 %75
  %77 = getelementptr inbounds %struct.rle16_s, ptr %76, i32 0, i32 1
  %78 = load i16, ptr %77, align 2, !tbaa !20
  %79 = zext i16 %78 to i32
  %80 = add nsw i32 %70, %79
  store i32 %80, ptr %15, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %81 = load i32, ptr %14, align 4, !tbaa !12
  store i32 %81, ptr %16, align 4, !tbaa !12
  br label %82

82:                                               ; preds = %99, %60
  %83 = load i32, ptr %16, align 4, !tbaa !12
  %84 = load i32, ptr %15, align 4, !tbaa !12
  %85 = icmp sle i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %102

87:                                               ; preds = %82
  %88 = load i32, ptr %16, align 4, !tbaa !12
  %89 = trunc i32 %88 to i16
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.array_container_s, ptr %90, i32 0, i32 2
  %92 = load ptr, ptr %91, align 8, !tbaa !21
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.array_container_s, ptr %93, i32 0, i32 0
  %95 = load i32, ptr %94, align 8, !tbaa !14
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %94, align 8, !tbaa !14
  %97 = sext i32 %95 to i64
  %98 = getelementptr inbounds i16, ptr %92, i64 %97
  store i16 %89, ptr %98, align 2, !tbaa !22
  br label %99

99:                                               ; preds = %87
  %100 = load i32, ptr %16, align 4, !tbaa !12
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %16, align 4, !tbaa !12
  br label %82, !llvm.loop !23

102:                                              ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %13, align 4, !tbaa !12
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %13, align 4, !tbaa !12
  br label %53, !llvm.loop !25

106:                                              ; preds = %59
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 2, ptr %107, align 1, !tbaa !13
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %108, ptr %3, align 8
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %154

109:                                              ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %110 = call ptr @bitset_container_create()
  store ptr %110, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !12
  br label %111

111:                                              ; preds = %145, %109
  %112 = load i32, ptr %18, align 4, !tbaa !12
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.run_container_s, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !9
  %116 = icmp slt i32 %112, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %111
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %148

118:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.run_container_s, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !16
  %122 = load i32, ptr %18, align 4, !tbaa !12
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds %struct.rle16_s, ptr %121, i64 %123
  %125 = getelementptr inbounds %struct.rle16_s, ptr %124, i32 0, i32 0
  %126 = load i16, ptr %125, align 2, !tbaa !17
  %127 = zext i16 %126 to i32
  store i32 %127, ptr %19, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %128 = load i32, ptr %19, align 4, !tbaa !12
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.run_container_s, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !16
  %132 = load i32, ptr %18, align 4, !tbaa !12
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds %struct.rle16_s, ptr %131, i64 %133
  %135 = getelementptr inbounds %struct.rle16_s, ptr %134, i32 0, i32 1
  %136 = load i16, ptr %135, align 2, !tbaa !20
  %137 = zext i16 %136 to i32
  %138 = add nsw i32 %128, %137
  store i32 %138, ptr %20, align 4, !tbaa !12
  %139 = load ptr, ptr %17, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.bitset_container_s, ptr %139, i32 0, i32 1
  %141 = load ptr, ptr %140, align 8, !tbaa !26
  %142 = load i32, ptr %19, align 4, !tbaa !12
  %143 = load i32, ptr %20, align 4, !tbaa !12
  %144 = add nsw i32 %143, 1
  call void @bitset_set_range(ptr noundef %141, i32 noundef %142, i32 noundef %144)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %145

145:                                              ; preds = %118
  %146 = load i32, ptr %18, align 4, !tbaa !12
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %18, align 4, !tbaa !12
  br label %111, !llvm.loop !28

148:                                              ; preds = %117
  %149 = load i32, ptr %8, align 4, !tbaa !12
  %150 = load ptr, ptr %17, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.bitset_container_s, ptr %150, i32 0, i32 0
  store i32 %149, ptr %151, align 8, !tbaa !29
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 1, ptr %152, align 1, !tbaa !13
  %153 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %153, ptr %3, align 8
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %154

154:                                              ; preds = %148, %106, %42
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %155 = load ptr, ptr %3, align 8
  ret ptr %155
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @run_container_serialized_size_in_bytes(i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @bitset_container_serialized_size_in_bytes() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @array_container_serialized_size_in_bytes(i32 noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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, !11, i64 0}
!10 = !{!"run_container_s", !11, i64 0, !11, i64 4, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"array_container_s", !11, i64 0, !11, i64 4, !6, i64 8}
!16 = !{!10, !6, i64 8}
!17 = !{!18, !19, i64 0}
!18 = !{!"rle16_s", !19, i64 0, !19, i64 2}
!19 = !{!"short", !7, i64 0}
!20 = !{!18, !19, i64 2}
!21 = !{!15, !6, i64 8}
!22 = !{!19, !19, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = !{!27, !6, i64 8}
!27 = !{!"bitset_container_s", !11, i64 0, !6, i64 8}
!28 = distinct !{!28, !24}
!29 = !{!27, !11, i64 0}


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

declare ptr @bitset_container_create() local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @run_container_cardinality(ptr noundef) local_unnamed_addr #1

declare ptr @array_container_create_given_capacity(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @convert_run_to_efficient_container(ptr noundef %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #2 {
  %3 = load i32, ptr %0, align 8, !tbaa !5
  %4 = tail call i32 @run_container_serialized_size_in_bytes(i32 noundef %3)
  %5 = tail call i32 @bitset_container_serialized_size_in_bytes()
  %6 = tail call i32 @run_container_cardinality(ptr noundef nonnull %0)
  %7 = tail call i32 @array_container_serialized_size_in_bytes(i32 noundef %6)
  %8 = tail call i32 @llvm.smin.i32(i32 %5, i32 %7)
  %.not = icmp sgt i32 %4, %8
  br i1 %.not, label %9, label %58

9:                                                ; preds = %2
  %10 = icmp slt i32 %6, 4097
  br i1 %10, label %11, label %38

11:                                               ; preds = %9
  %12 = tail call ptr @array_container_create_given_capacity(i32 noundef %6) #4
  store i32 0, ptr %12, align 8, !tbaa !11
  %13 = load i32, ptr %0, align 8, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph55, label %58

.lr.ph55:                                         ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %12, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  %wide.trip.count = zext nneg i32 %13 to i64
  br label %20

._crit_edge56:                                    ; preds = %.loopexit
  %19 = trunc nsw i64 %indvars.iv.next61.lcssa to i32
  store i32 %19, ptr %12, align 8, !tbaa !11
  br label %58

20:                                               ; preds = %.lr.ph55, %.loopexit
  %indvars.iv63 = phi i64 [ 0, %.lr.ph55 ], [ %indvars.iv.next64, %.loopexit ]
  %.lcssa58 = phi i64 [ 0, %.lr.ph55 ], [ %indvars.iv.next61.lcssa, %.loopexit ]
  %21 = getelementptr inbounds %struct.rle16_s, ptr %16, i64 %indvars.iv63
  %22 = load i16, ptr %21, align 2, !tbaa !15
  %23 = zext i16 %22 to i32
  %24 = getelementptr inbounds i8, ptr %21, i64 2
  %25 = load i16, ptr %24, align 2, !tbaa !18
  %26 = zext i16 %25 to i32
  %27 = add nuw nsw i32 %26, %23
  %sext = shl i64 %.lcssa58, 32
  %28 = ashr exact i64 %sext, 32
  %29 = zext i16 %25 to i64
  %30 = add nuw nsw i64 %29, 1
  %min.iters.check = icmp ult i16 %25, 15
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %20
  %indvars.iv60.ph = phi i64 [ %28, %20 ], [ %ind.end, %middle.block ]
  %.04852.ph = phi i32 [ %23, %20 ], [ %ind.end67, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %20
  %n.vec = and i64 %30, 131056
  %ind.end = add nsw i64 %28, %n.vec
  %.cast = trunc nuw nsw i64 %n.vec to i32
  %ind.end67 = add nuw nsw i32 %23, %.cast
  %.splatinsert = insertelement <8 x i16> poison, i16 %22, i64 0
  %.splat = shufflevector <8 x i16> %.splatinsert, <8 x i16> poison, <8 x i32> zeroinitializer
  %induction = add <8 x i16> %.splat, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
  %31 = getelementptr i16, ptr %18, i64 %28
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <8 x i16> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <8 x i16> %vec.ind, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
  %32 = getelementptr i16, ptr %31, i64 %index
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  store <8 x i16> %vec.ind, ptr %32, align 2, !tbaa !19
  store <8 x i16> %step.add, ptr %33, align 2, !tbaa !19
  %index.next = add nuw i64 %index, 16
  %vec.ind.next = add <8 x i16> %vec.ind, <i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16>
  %34 = icmp eq i64 %index.next, %n.vec
  br i1 %34, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %30, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

.loopexit:                                        ; preds = %scalar.ph, %middle.block
  %indvars.iv.next61.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next61, %scalar.ph ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
  br i1 %exitcond66.not, label %._crit_edge56, label %20, !llvm.loop !24

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %scalar.ph ], [ %indvars.iv60.ph, %scalar.ph.preheader ]
  %.04852 = phi i32 [ %37, %scalar.ph ], [ %.04852.ph, %scalar.ph.preheader ]
  %35 = trunc i32 %.04852 to i16
  %indvars.iv.next61 = add nsw i64 %indvars.iv60, 1
  %36 = getelementptr inbounds i16, ptr %18, i64 %indvars.iv60
  store i16 %35, ptr %36, align 2, !tbaa !19
  %37 = add nuw nsw i32 %.04852, 1
  %exitcond.not = icmp eq i32 %.04852, %27
  br i1 %exitcond.not, label %.loopexit, label %scalar.ph, !llvm.loop !25

38:                                               ; preds = %9
  %39 = tail call ptr @bitset_container_create() #4
  %40 = load i32, ptr %0, align 8, !tbaa !5
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %38
  %42 = getelementptr inbounds i8, ptr %0, i64 8
  %43 = getelementptr inbounds i8, ptr %39, i64 8
  br label %44

._crit_edge:                                      ; preds = %44, %38
  store i32 %6, ptr %39, align 8, !tbaa !26
  br label %58

44:                                               ; preds = %.lr.ph, %44
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %44 ]
  %45 = load ptr, ptr %42, align 8, !tbaa !13
  %46 = getelementptr inbounds %struct.rle16_s, ptr %45, i64 %indvars.iv
  %47 = load i16, ptr %46, align 2, !tbaa !15
  %48 = zext i16 %47 to i32
  %49 = getelementptr inbounds i8, ptr %46, i64 2
  %50 = load i16, ptr %49, align 2, !tbaa !18
  %51 = zext i16 %50 to i32
  %52 = load ptr, ptr %43, align 8, !tbaa !28
  %53 = add nuw nsw i32 %48, 1
  %54 = add nuw nsw i32 %53, %51
  tail call void @bitset_set_range(ptr noundef %52, i32 noundef %48, i32 noundef %54)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = load i32, ptr %0, align 8, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next, %56
  br i1 %57, label %44, label %._crit_edge, !llvm.loop !29

58:                                               ; preds = %11, %._crit_edge56, %2, %._crit_edge
  %.sink = phi i8 [ 1, %._crit_edge ], [ 3, %2 ], [ 2, %._crit_edge56 ], [ 2, %11 ]
  %.0 = phi ptr [ %39, %._crit_edge ], [ %0, %2 ], [ %12, %._crit_edge56 ], [ %12, %11 ]
  store i8 %.sink, ptr %1, align 1, !tbaa !30
  ret ptr %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @run_container_serialized_size_in_bytes(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @bitset_container_serialized_size_in_bytes() local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @array_container_serialized_size_in_bytes(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3

attributes #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 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!12, !7, i64 0}
!12 = !{!"array_container_s", !7, i64 0, !7, i64 4, !10, i64 8}
!13 = !{!6, !10, i64 8}
!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 = !{!16, !17, i64 2}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21, !23, !22}
!26 = !{!27, !7, i64 0}
!27 = !{!"bitset_container_s", !7, i64 0, !10, i64 8}
!28 = !{!27, !10, i64 8}
!29 = distinct !{!29, !21}
!30 = !{!8, !8, i64 0}


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