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

; 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.roaring_pq_element_s = type { i64, i8, ptr }
%struct.roaring_pq_s = type { ptr, i64 }

; Function Attrs: nounwind uwtable
define dso_local ptr @roaring_bitmap_or_many_heap(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.roaring_pq_element_s, align 8
  %8 = alloca %struct.roaring_pq_element_s, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca i64, align 8
  %12 = alloca %struct.roaring_pq_element_s, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca %struct.roaring_pq_element_s, align 8
  %16 = alloca %struct.roaring_pq_element_s, align 8
  %17 = alloca ptr, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %2
  %21 = call ptr @roaring_bitmap_create()
  store ptr %21, ptr %3, align 8
  br label %131

22:                                               ; preds = %2
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %30

25:                                               ; preds = %22
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %26, i64 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call ptr @roaring_bitmap_copy(ptr noundef %28)
  store ptr %29, ptr %3, align 8
  br label %131

30:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = call ptr @create_pq(ptr noundef %31, i32 noundef %32)
  store ptr %33, ptr %6, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %123, %30
  %35 = load ptr, ptr %6, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.roaring_pq_s, ptr %35, i32 0, i32 1
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = icmp ugt i64 %37, 1
  br i1 %38, label %39, label %124

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #3
  %40 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pq_poll(ptr dead_on_unwind writable sret(%struct.roaring_pq_element_s) align 8 %7, ptr noundef %40)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #3
  %41 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pq_poll(ptr dead_on_unwind writable sret(%struct.roaring_pq_element_s) align 8 %8, ptr noundef %41)
  %42 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 1
  %43 = load i8, ptr %42, align 8, !tbaa !14, !range !17, !noundef !18
  %44 = trunc i8 %43 to i1
  br i1 %44, label %45, label %79

45:                                               ; preds = %39
  %46 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 1
  %47 = load i8, ptr %46, align 8, !tbaa !14, !range !17, !noundef !18
  %48 = trunc i8 %47 to i1
  br i1 %48, label %49, label %79

49:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %50 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !19
  %52 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = call ptr @lazy_or_from_lazy_inputs(ptr noundef %51, ptr noundef %53)
  store ptr %54, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  %55 = load ptr, ptr %9, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = icmp eq ptr %55, %57
  br i1 %58, label %59, label %64

59:                                               ; preds = %49
  %60 = load ptr, ptr %9, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !19
  %63 = icmp eq ptr %60, %62
  br label %64

64:                                               ; preds = %59, %49
  %65 = phi i1 [ false, %49 ], [ %63, %59 ]
  %66 = xor i1 %65, true
  %67 = zext i1 %66 to i8
  store i8 %67, ptr %10, align 1, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %68 = load ptr, ptr %9, align 8, !tbaa !9
  %69 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %68)
  store i64 %69, ptr %11, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #3
  %70 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %12, i32 0, i32 0
  %71 = load i64, ptr %11, align 8, !tbaa !21
  store i64 %71, ptr %70, align 8, !tbaa !22
  %72 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %12, i32 0, i32 1
  %73 = load i8, ptr %10, align 1, !tbaa !20, !range !17, !noundef !18
  %74 = trunc i8 %73 to i1
  %75 = zext i1 %74 to i8
  store i8 %75, ptr %72, align 8, !tbaa !14
  %76 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %12, i32 0, i32 2
  %77 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %77, ptr %76, align 8, !tbaa !19
  %78 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pq_add(ptr noundef %78, ptr noundef %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %123

79:                                               ; preds = %45, %39
  %80 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 1
  %81 = load i8, ptr %80, align 8, !tbaa !14, !range !17, !noundef !18
  %82 = trunc i8 %81 to i1
  br i1 %82, label %83, label %93

83:                                               ; preds = %79
  %84 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 2
  %85 = load ptr, ptr %84, align 8, !tbaa !19
  %86 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !19
  call void @roaring_bitmap_lazy_or_inplace(ptr noundef %85, ptr noundef %87, i1 noundef zeroext false)
  %88 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 2
  %89 = load ptr, ptr %88, align 8, !tbaa !19
  %90 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %89)
  %91 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 0
  store i64 %90, ptr %91, align 8, !tbaa !22
  %92 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pq_add(ptr noundef %92, ptr noundef %8)
  br label %122

93:                                               ; preds = %79
  %94 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 1
  %95 = load i8, ptr %94, align 8, !tbaa !14, !range !17, !noundef !18
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %107

97:                                               ; preds = %93
  %98 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !19
  %100 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !19
  call void @roaring_bitmap_lazy_or_inplace(ptr noundef %99, ptr noundef %101, i1 noundef zeroext false)
  %102 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !19
  %104 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %103)
  %105 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 0
  store i64 %104, ptr %105, align 8, !tbaa !22
  %106 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pq_add(ptr noundef %106, ptr noundef %7)
  br label %121

107:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %108 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %7, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !19
  %110 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %8, i32 0, i32 2
  %111 = load ptr, ptr %110, align 8, !tbaa !19
  %112 = call ptr @roaring_bitmap_lazy_or(ptr noundef %109, ptr noundef %111, i1 noundef zeroext false)
  store ptr %112, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %113 = load ptr, ptr %13, align 8, !tbaa !9
  %114 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %113)
  store i64 %114, ptr %14, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #3
  %115 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %15, i32 0, i32 0
  %116 = load i64, ptr %14, align 8, !tbaa !21
  store i64 %116, ptr %115, align 8, !tbaa !22
  %117 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %15, i32 0, i32 1
  store i8 1, ptr %117, align 8, !tbaa !14
  %118 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %15, i32 0, i32 2
  %119 = load ptr, ptr %13, align 8, !tbaa !9
  store ptr %119, ptr %118, align 8, !tbaa !19
  %120 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pq_add(ptr noundef %120, ptr noundef %15)
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %121

121:                                              ; preds = %107, %97
  br label %122

122:                                              ; preds = %121, %83
  br label %123

123:                                              ; preds = %122, %64
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #3
  br label %34, !llvm.loop !23

124:                                              ; preds = %34
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #3
  %125 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pq_poll(ptr dead_on_unwind writable sret(%struct.roaring_pq_element_s) align 8 %16, ptr noundef %125)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %126 = getelementptr inbounds %struct.roaring_pq_element_s, ptr %16, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !19
  store ptr %127, ptr %17, align 8, !tbaa !9
  %128 = load ptr, ptr %17, align 8, !tbaa !9
  call void @roaring_bitmap_repair_after_lazy(ptr noundef %128)
  %129 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pq_free(ptr noundef %129)
  %130 = load ptr, ptr %17, align 8, !tbaa !9
  store ptr %130, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %131

131:                                              ; preds = %124, %25, %20
  %132 = load ptr, ptr %3, align 8
  ret ptr %132
}

declare ptr @roaring_bitmap_create() #1

declare ptr @roaring_bitmap_copy(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @pq_poll(ptr dead_on_unwind noalias writable sret(%struct.roaring_pq_element_s) align 8, ptr noundef) #0

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

declare i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef) #1

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

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

declare void @roaring_bitmap_lazy_or_inplace(ptr noundef, ptr noundef, i1 noundef zeroext) #1

declare ptr @roaring_bitmap_lazy_or(ptr noundef, ptr noundef, i1 noundef zeroext) #1

declare void @roaring_bitmap_repair_after_lazy(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @pq_free(ptr noundef) #0

attributes #0 = { 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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"roaring_pq_s", !10, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !16, i64 8}
!15 = !{!"roaring_pq_element_s", !13, i64 0, !16, i64 8, !10, i64 16}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!15, !10, i64 16}
!20 = !{!16, !16, i64 0}
!21 = !{!13, !13, i64 0}
!22 = !{!15, !13, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; 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.roaring_pq_element_s = type { i64, i8, ptr }

; Function Attrs: nounwind uwtable
define dso_local ptr @roaring_bitmap_or_many_heap(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.roaring_pq_element_s, align 8
  %4 = alloca %struct.roaring_pq_element_s, align 8
  %5 = alloca %struct.roaring_pq_element_s, align 8
  %6 = alloca %struct.roaring_pq_element_s, align 8
  %7 = alloca %struct.roaring_pq_element_s, align 8
  switch i32 %0, label %13 [
    i32 0, label %8
    i32 1, label %10
  ]

8:                                                ; preds = %2
  %9 = tail call ptr @roaring_bitmap_create() #3
  br label %60

10:                                               ; preds = %2
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  %12 = tail call ptr @roaring_bitmap_copy(ptr noundef %11) #3
  br label %60

13:                                               ; preds = %2
  %14 = tail call ptr @create_pq(ptr noundef %1, i32 noundef %0)
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = icmp ugt i64 %16, 1
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %13
  %18 = getelementptr inbounds i8, ptr %3, i64 8
  %19 = getelementptr inbounds i8, ptr %4, i64 8
  %20 = getelementptr inbounds i8, ptr %3, i64 16
  %21 = getelementptr inbounds i8, ptr %4, i64 16
  %22 = getelementptr inbounds i8, ptr %6, i64 8
  %23 = getelementptr inbounds i8, ptr %6, i64 16
  %24 = getelementptr inbounds i8, ptr %5, i64 8
  %25 = getelementptr inbounds i8, ptr %5, i64 16
  br label %26

26:                                               ; preds = %.lr.ph, %55
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #3
  call void @pq_poll(ptr dead_on_unwind nonnull writable sret(%struct.roaring_pq_element_s) align 8 %3, ptr noundef nonnull %14)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  call void @pq_poll(ptr dead_on_unwind nonnull writable sret(%struct.roaring_pq_element_s) align 8 %4, ptr noundef nonnull %14)
  %27 = load i8, ptr %18, align 8, !tbaa !12, !range !15, !noundef !16
  %28 = trunc nuw i8 %27 to i1
  %29 = load i8, ptr %19, align 8, !tbaa !12, !range !15, !noundef !16
  %30 = trunc nuw i8 %29 to i1
  br i1 %28, label %31, label %.thread

31:                                               ; preds = %26
  %32 = load ptr, ptr %20, align 8, !tbaa !17
  %33 = load ptr, ptr %21, align 8, !tbaa !17
  br i1 %30, label %34, label %47

34:                                               ; preds = %31
  %35 = call ptr @lazy_or_from_lazy_inputs(ptr noundef %32, ptr noundef %33)
  %36 = load ptr, ptr %20, align 8, !tbaa !17
  %37 = icmp ne ptr %35, %36
  %38 = load ptr, ptr %21, align 8
  %39 = icmp ne ptr %35, %38
  %.not27 = select i1 %37, i1 true, i1 %39
  %40 = zext i1 %.not27 to i8
  %41 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %35) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  store i64 %41, ptr %5, align 8, !tbaa !18
  store i8 %40, ptr %24, align 8, !tbaa !12
  store ptr %35, ptr %25, align 8, !tbaa !17
  call void @pq_add(ptr noundef nonnull %14, ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  br label %55

.thread:                                          ; preds = %26
  br i1 %30, label %42, label %50

42:                                               ; preds = %.thread
  %43 = load ptr, ptr %21, align 8, !tbaa !17
  %44 = load ptr, ptr %20, align 8, !tbaa !17
  call void @roaring_bitmap_lazy_or_inplace(ptr noundef %43, ptr noundef %44, i1 noundef zeroext false) #3
  %45 = load ptr, ptr %21, align 8, !tbaa !17
  %46 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %45) #3
  store i64 %46, ptr %4, align 8, !tbaa !18
  call void @pq_add(ptr noundef %14, ptr noundef nonnull %4)
  br label %55

47:                                               ; preds = %31
  call void @roaring_bitmap_lazy_or_inplace(ptr noundef %32, ptr noundef %33, i1 noundef zeroext false) #3
  %48 = load ptr, ptr %20, align 8, !tbaa !17
  %49 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %48) #3
  store i64 %49, ptr %3, align 8, !tbaa !18
  call void @pq_add(ptr noundef nonnull %14, ptr noundef nonnull %3)
  br label %55

50:                                               ; preds = %.thread
  %51 = load ptr, ptr %20, align 8, !tbaa !17
  %52 = load ptr, ptr %21, align 8, !tbaa !17
  %53 = call ptr @roaring_bitmap_lazy_or(ptr noundef %51, ptr noundef %52, i1 noundef zeroext false) #3
  %54 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %53) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  store i64 %54, ptr %6, align 8, !tbaa !18
  store i8 1, ptr %22, align 8, !tbaa !12
  store ptr %53, ptr %23, align 8, !tbaa !17
  call void @pq_add(ptr noundef %14, ptr noundef nonnull %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  br label %55

55:                                               ; preds = %42, %50, %47, %34
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #3
  %56 = load i64, ptr %15, align 8, !tbaa !9
  %57 = icmp ugt i64 %56, 1
  br i1 %57, label %26, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %55, %13
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #3
  call void @pq_poll(ptr dead_on_unwind nonnull writable sret(%struct.roaring_pq_element_s) align 8 %7, ptr noundef nonnull %14)
  %58 = getelementptr inbounds i8, ptr %7, i64 16
  %59 = load ptr, ptr %58, align 8, !tbaa !17
  call void @roaring_bitmap_repair_after_lazy(ptr noundef %59) #3
  call void @pq_free(ptr noundef nonnull %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #3
  br label %60

60:                                               ; preds = %._crit_edge, %10, %8
  %.0 = phi ptr [ %9, %8 ], [ %12, %10 ], [ %59, %._crit_edge ]
  ret ptr %.0
}

declare ptr @roaring_bitmap_create() local_unnamed_addr #1

declare ptr @roaring_bitmap_copy(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @pq_poll(ptr dead_on_unwind noalias writable sret(%struct.roaring_pq_element_s) align 8, ptr noundef) local_unnamed_addr #0

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

declare i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef) local_unnamed_addr #1

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

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

declare void @roaring_bitmap_lazy_or_inplace(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

declare ptr @roaring_bitmap_lazy_or(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

declare void @roaring_bitmap_repair_after_lazy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @pq_free(ptr noundef) local_unnamed_addr #0

attributes #0 = { 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 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"roaring_pq_s", !6, i64 0, !11, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !14, i64 8}
!13 = !{!"roaring_pq_element_s", !11, i64 0, !14, i64 8, !6, i64 16}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!13, !6, i64 16}
!18 = !{!13, !11, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass