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

25:                                               ; preds = %3
  %26 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %41

28:                                               ; preds = %25, %3
  %29 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %30 = trunc i8 %29 to i1
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  call void @run_container_copy(ptr noundef %32, ptr noundef %33)
  store i32 1, ptr %9, align 4
  br label %196

34:                                               ; preds = %28
  %35 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %36 = trunc i8 %35 to i1
  br i1 %36, label %37, label %40

37:                                               ; preds = %34
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  call void @run_container_copy(ptr noundef %38, ptr noundef %39)
  store i32 1, ptr %9, align 4
  br label %196

40:                                               ; preds = %34
  br label %41

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

54:                                               ; preds = %41
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load i32, ptr %10, align 4, !tbaa !16
  call void @run_container_grow(ptr noundef %55, i32 noundef %56, i1 noundef zeroext false)
  br label %57

57:                                               ; preds = %54, %41
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.run_container_s, ptr %58, i32 0, i32 0
  store i32 0, ptr %59, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !16
  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
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.run_container_s, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  %63 = load i32, ptr %11, align 4, !tbaa !16
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds %struct.rle16_s, ptr %62, i64 %64
  %66 = getelementptr inbounds %struct.rle16_s, ptr %65, i32 0, i32 0
  %67 = load i16, ptr %66, align 2, !tbaa !19
  %68 = zext i16 %67 to i32
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.run_container_s, ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !18
  %72 = load i32, ptr %12, align 4, !tbaa !16
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.rle16_s, ptr %71, i64 %73
  %75 = getelementptr inbounds %struct.rle16_s, ptr %74, i32 0, i32 0
  %76 = load i16, ptr %75, align 2, !tbaa !19
  %77 = zext i16 %76 to i32
  %78 = icmp sle i32 %68, %77
  br i1 %78, label %79, label %91

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

91:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.run_container_s, ptr %93, i32 0, i32 2
  %95 = load ptr, ptr %94, align 8, !tbaa !18
  %96 = load i32, ptr %12, align 4, !tbaa !16
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds %struct.rle16_s, ptr %95, i64 %97
  %99 = load i32, ptr %98, align 2
  %100 = call i32 @run_container_append_first(ptr noundef %92, i32 %99)
  store i32 %100, ptr %15, align 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %13, ptr align 2 %15, i64 4, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  %101 = load i32, ptr %12, align 4, !tbaa !16
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %12, align 4, !tbaa !16
  br label %103

103:                                              ; preds = %91, %79
  br label %104

104:                                              ; preds = %156, %103
  %105 = load i32, ptr %12, align 4, !tbaa !16
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.run_container_s, ptr %106, i32 0, i32 0
  %108 = load i32, ptr %107, align 8, !tbaa !13
  %109 = icmp slt i32 %105, %108
  br i1 %109, label %110, label %116

110:                                              ; preds = %104
  %111 = load i32, ptr %11, align 4, !tbaa !16
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.run_container_s, ptr %112, i32 0, i32 0
  %114 = load i32, ptr %113, align 8, !tbaa !13
  %115 = icmp slt i32 %111, %114
  br label %116

116:                                              ; preds = %110, %104
  %117 = phi i1 [ false, %104 ], [ %115, %110 ]
  br i1 %117, label %118, label %159

118:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #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 !18
  %122 = load i32, ptr %11, align 4, !tbaa !16
  %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 !19
  %127 = zext i16 %126 to i32
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.run_container_s, ptr %128, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !18
  %131 = load i32, ptr %12, align 4, !tbaa !16
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds %struct.rle16_s, ptr %130, i64 %132
  %134 = getelementptr inbounds %struct.rle16_s, ptr %133, i32 0, i32 0
  %135 = load i16, ptr %134, align 2, !tbaa !19
  %136 = zext i16 %135 to i32
  %137 = icmp sle i32 %127, %136
  br i1 %137, label %138, label %147

138:                                              ; preds = %118
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.run_container_s, ptr %139, i32 0, i32 2
  %141 = load ptr, ptr %140, align 8, !tbaa !18
  %142 = load i32, ptr %11, align 4, !tbaa !16
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds %struct.rle16_s, ptr %141, i64 %143
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %16, ptr align 2 %144, i64 4, i1 false), !tbaa.struct !22
  %145 = load i32, ptr %11, align 4, !tbaa !16
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %11, align 4, !tbaa !16
  br label %156

147:                                              ; preds = %118
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.run_container_s, ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !18
  %151 = load i32, ptr %12, align 4, !tbaa !16
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds %struct.rle16_s, ptr %150, i64 %152
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %16, ptr align 2 %153, i64 4, i1 false), !tbaa.struct !22
  %154 = load i32, ptr %12, align 4, !tbaa !16
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %12, align 4, !tbaa !16
  br label %156

156:                                              ; preds = %147, %138
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load i32, ptr %16, align 2
  call void @run_container_append(ptr noundef %157, i32 %158, ptr noundef %13)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %104, !llvm.loop !24

159:                                              ; preds = %116
  br label %160

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

166:                                              ; preds = %160
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.run_container_s, ptr %168, i32 0, i32 2
  %170 = load ptr, ptr %169, align 8, !tbaa !18
  %171 = load i32, ptr %12, align 4, !tbaa !16
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds %struct.rle16_s, ptr %170, i64 %172
  %174 = load i32, ptr %173, align 2
  call void @run_container_append(ptr noundef %167, i32 %174, ptr noundef %13)
  %175 = load i32, ptr %12, align 4, !tbaa !16
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %12, align 4, !tbaa !16
  br label %160, !llvm.loop !26

177:                                              ; preds = %160
  br label %178

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

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

195:                                              ; preds = %178
  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 4, ptr %10) #4
  store i32 0, ptr %9, align 4
  br label %196

196:                                              ; preds = %195, %37, %31
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  %197 = load i32, ptr %9, align 4
  switch i32 %197, label %199 [
    i32 0, label %198
    i32 1, label %198
  ]

198:                                              ; preds = %196, %196
  ret void

199:                                              ; preds = %196
  unreachable
}

; 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

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: nounwind uwtable
define dso_local void @run_container_union(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.rle16_s, align 4
  %5 = tail call zeroext i1 @run_container_is_full(ptr noundef %0)
  %6 = tail call zeroext i1 @run_container_is_full(ptr noundef %1)
  %brmerge = select i1 %5, i1 true, i1 %6
  br i1 %brmerge, label %7, label %11

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

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

9:                                                ; preds = %7
  br i1 %6, label %10, label %11

10:                                               ; preds = %9
  tail call void @run_container_copy(ptr noundef %1, ptr noundef %2)
  br label %64

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

18:                                               ; preds = %11
  tail call void @run_container_grow(ptr noundef nonnull %2, i32 noundef %14, i1 noundef zeroext false)
  br label %19

19:                                               ; preds = %18, %11
  store i32 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = load i16, ptr %21, align 2, !tbaa !13
  %23 = getelementptr inbounds i8, ptr %1, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !12
  %25 = load i16, ptr %24, align 2, !tbaa !13
  %.not = icmp ugt i16 %22, %25
  %. = select i1 %.not, ptr %24, ptr %21
  %.79 = zext i1 %.not to i32
  %not..not = xor i1 %.not, true
  %.80 = zext i1 %not..not to i32
  %26 = load i32, ptr %., align 2
  %27 = tail call i32 @run_container_append_first(ptr noundef nonnull %2, i32 %26)
  store i32 %27, ptr %4, align 4
  %28 = load i32, ptr %1, align 8, !tbaa !5
  %29 = icmp sgt i32 %28, %.79
  br i1 %29, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %19
  %30 = load i32, ptr %0, align 8, !tbaa !5
  %31 = icmp sgt i32 %30, %.80
  br i1 %31, label %.lr.ph83, label %.critedge

.lr.ph:                                           ; preds = %.lr.ph83
  %32 = load i32, ptr %0, align 8, !tbaa !5
  %33 = icmp slt i32 %.2, %32
  br i1 %33, label %.lr.ph83, label %.critedge, !llvm.loop !16

.lr.ph83:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %.1596482 = phi i32 [ %.260, %.lr.ph ], [ %.79, %.lr.ph.preheader ]
  %.16581 = phi i32 [ %.2, %.lr.ph ], [ %.80, %.lr.ph.preheader ]
  %34 = load ptr, ptr %20, align 8, !tbaa !12
  %35 = zext nneg i32 %.16581 to i64
  %36 = getelementptr inbounds %struct.rle16_s, ptr %34, i64 %35
  %37 = load i16, ptr %36, align 2, !tbaa !13
  %38 = load ptr, ptr %23, align 8, !tbaa !12
  %39 = zext nneg i32 %.1596482 to i64
  %40 = getelementptr inbounds %struct.rle16_s, ptr %38, i64 %39
  %41 = load i16, ptr %40, align 2, !tbaa !13
  %.not63 = icmp ugt i16 %37, %41
  %42 = zext i1 %.not63 to i32
  %.260 = add nuw nsw i32 %.1596482, %42
  %not..not63 = xor i1 %.not63, true
  %43 = zext i1 %not..not63 to i32
  %.2 = add nuw nsw i32 %.16581, %43
  %.sroa.0.0.in = select i1 %.not63, ptr %40, ptr %36
  %.sroa.0.0 = load i32, ptr %.sroa.0.0.in, align 2
  call void @run_container_append(ptr noundef nonnull %2, i32 %.sroa.0.0, ptr noundef nonnull %4)
  %44 = load i32, ptr %1, align 8, !tbaa !5
  %45 = icmp slt i32 %.260, %44
  br i1 %45, label %.lr.ph, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph83, %.lr.ph, %.lr.ph.preheader, %19
  %46 = phi i32 [ %28, %19 ], [ %28, %.lr.ph.preheader ], [ %44, %.lr.ph ], [ %44, %.lr.ph83 ]
  %.159.lcssa = phi i32 [ %.79, %19 ], [ %.79, %.lr.ph.preheader ], [ %.260, %.lr.ph ], [ %.260, %.lr.ph83 ]
  %.1.lcssa = phi i32 [ %.80, %19 ], [ %.80, %.lr.ph.preheader ], [ %.2, %.lr.ph ], [ %.2, %.lr.ph83 ]
  %47 = icmp slt i32 %.159.lcssa, %46
  br i1 %47, label %.lr.ph71.preheader, label %.preheader

.lr.ph71.preheader:                               ; preds = %.critedge
  %48 = sext i32 %.159.lcssa to i64
  br label %.lr.ph71

.preheader:                                       ; preds = %.lr.ph71, %.critedge
  %49 = load i32, ptr %0, align 8, !tbaa !5
  %50 = icmp slt i32 %.1.lcssa, %49
  br i1 %50, label %.lr.ph73.preheader, label %._crit_edge

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

.lr.ph71:                                         ; preds = %.lr.ph71.preheader, %.lr.ph71
  %indvars.iv = phi i64 [ %48, %.lr.ph71.preheader ], [ %indvars.iv.next, %.lr.ph71 ]
  %52 = load ptr, ptr %23, align 8, !tbaa !12
  %53 = getelementptr inbounds %struct.rle16_s, ptr %52, i64 %indvars.iv
  %54 = load i32, ptr %53, align 2
  call void @run_container_append(ptr noundef nonnull %2, i32 %54, ptr noundef nonnull %4)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %55 = load i32, ptr %1, align 8, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next, %56
  br i1 %57, label %.lr.ph71, label %.preheader, !llvm.loop !18

.lr.ph73:                                         ; preds = %.lr.ph73.preheader, %.lr.ph73
  %indvars.iv75 = phi i64 [ %51, %.lr.ph73.preheader ], [ %indvars.iv.next76, %.lr.ph73 ]
  %58 = load ptr, ptr %20, align 8, !tbaa !12
  %59 = getelementptr inbounds %struct.rle16_s, ptr %58, i64 %indvars.iv75
  %60 = load i32, ptr %59, align 2
  call void @run_container_append(ptr noundef nonnull %2, i32 %60, ptr noundef nonnull %4)
  %indvars.iv.next76 = add nsw i64 %indvars.iv75, 1
  %61 = load i32, ptr %0, align 8, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next76, %62
  br i1 %63, label %.lr.ph73, label %._crit_edge, !llvm.loop !19

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

64:                                               ; preds = %._crit_edge, %10, %8
  ret void
}

; 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

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 = { 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: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass