; LLVM IR from jermp/2i_bench :: external/CRoaring/tests (toplevel_unit)

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

@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [25 x i8], align 1

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

declare i32 @printf(ptr noundef, ...) #1

declare void @roaring_bitmap_free(ptr noundef) #1

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

declare ptr @roaring_bitmap_create() #1

declare void @_assert_true(i64 noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare i64 @roaring_bitmap_get_cardinality(ptr noundef) #1

declare void @roaring_bitmap_add(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare void @roaring_bitmap_to_uint32_array(ptr noundef, ptr noundef) #1

declare zeroext i1 @roaring_bitmap_run_optimize(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @test_rank() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 123, ptr %1, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %190, %0
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = icmp ult i32 %17, 1000000
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %193

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %21 = call ptr @roaring_bitmap_create()
  store ptr %21, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %22 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %22, ptr %4, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %31, %20
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = add i32 1000, %25
  %27 = icmp ult i32 %24, %26
  br i1 %27, label %28, label %34

28:                                               ; preds = %23
  %29 = load ptr, ptr %3, align 8, !tbaa !9
  %30 = load i32, ptr %4, align 4, !tbaa !5
  call void @roaring_bitmap_add(ptr noundef %29, i32 noundef %30)
  br label %31

31:                                               ; preds = %28
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add i32 %32, 100
  store i32 %33, ptr %4, align 4, !tbaa !5
  br label %23, !llvm.loop !11

34:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %35 = load ptr, ptr %3, align 8, !tbaa !9
  %36 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %35)
  store i64 %36, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %37 = load i64, ptr %5, align 8, !tbaa !13
  %38 = mul i64 %37, 4
  %39 = call noalias ptr @malloc(i64 noundef %38) #6
  store ptr %39, ptr %6, align 8, !tbaa !9
  %40 = load ptr, ptr %3, align 8, !tbaa !9
  %41 = load ptr, ptr %6, align 8, !tbaa !9
  call void @roaring_bitmap_to_uint32_array(ptr noundef %40, ptr noundef %41)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %72, %34
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = add i32 1000, %44
  %46 = add i32 %45, 10
  %47 = icmp ult i32 %43, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %42
  store i32 8, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %75

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %50 = load ptr, ptr %6, align 8, !tbaa !9
  %51 = load i64, ptr %5, align 8, !tbaa !13
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = call i64 @rank(ptr noundef %50, i64 noundef %51, i32 noundef %52)
  store i64 %53, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %54 = load ptr, ptr %3, align 8, !tbaa !9
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = call i64 @roaring_bitmap_rank(ptr noundef %54, i32 noundef %55)
  store i64 %56, ptr %9, align 8, !tbaa !13
  %57 = load i64, ptr %8, align 8, !tbaa !13
  %58 = load i64, ptr %9, align 8, !tbaa !13
  %59 = icmp ne i64 %57, %58
  br i1 %59, label %60, label %66

60:                                               ; preds = %49
  %61 = load i64, ptr %8, align 8, !tbaa !13
  %62 = trunc i64 %61 to i32
  %63 = load i64, ptr %9, align 8, !tbaa !13
  %64 = trunc i64 %63 to i32
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.133, i32 noundef %62, i32 noundef %64)
  br label %66

66:                                               ; preds = %60, %49
  %67 = load i64, ptr %8, align 8, !tbaa !13
  %68 = load i64, ptr %9, align 8, !tbaa !13
  %69 = icmp eq i64 %67, %68
  %70 = zext i1 %69 to i32
  %71 = sext i32 %70 to i64
  call void @_assert_true(i64 noundef %71, ptr noundef @.str.134, ptr noundef @.str.2, i32 noundef 3197)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %72

72:                                               ; preds = %66
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = add i32 %73, 10
  store i32 %74, ptr %7, align 4, !tbaa !5
  br label %42, !llvm.loop !15

75:                                               ; preds = %48
  %76 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %76) #5
  %77 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %77, ptr %4, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %86, %75
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = load i32, ptr %1, align 4, !tbaa !5
  %81 = add i32 64000, %80
  %82 = icmp ult i32 %79, %81
  br i1 %82, label %83, label %89

83:                                               ; preds = %78
  %84 = load ptr, ptr %3, align 8, !tbaa !9
  %85 = load i32, ptr %4, align 4, !tbaa !5
  call void @roaring_bitmap_add(ptr noundef %84, i32 noundef %85)
  br label %86

86:                                               ; preds = %83
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = add i32 %87, 2
  store i32 %88, ptr %4, align 4, !tbaa !5
  br label %78, !llvm.loop !16

89:                                               ; preds = %78
  %90 = load ptr, ptr %3, align 8, !tbaa !9
  %91 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %90)
  store i64 %91, ptr %5, align 8, !tbaa !13
  %92 = load i64, ptr %5, align 8, !tbaa !13
  %93 = mul i64 %92, 4
  %94 = call noalias ptr @malloc(i64 noundef %93) #6
  store ptr %94, ptr %6, align 8, !tbaa !9
  %95 = load ptr, ptr %3, align 8, !tbaa !9
  %96 = load ptr, ptr %6, align 8, !tbaa !9
  call void @roaring_bitmap_to_uint32_array(ptr noundef %95, ptr noundef %96)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %127, %89
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = load i32, ptr %1, align 4, !tbaa !5
  %100 = add i32 64000, %99
  %101 = add i32 %100, 10
  %102 = icmp ult i32 %98, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %97
  store i32 14, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %130

104:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %105 = load ptr, ptr %6, align 8, !tbaa !9
  %106 = load i64, ptr %5, align 8, !tbaa !13
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = call i64 @rank(ptr noundef %105, i64 noundef %106, i32 noundef %107)
  store i64 %108, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %109 = load ptr, ptr %3, align 8, !tbaa !9
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = call i64 @roaring_bitmap_rank(ptr noundef %109, i32 noundef %110)
  store i64 %111, ptr %12, align 8, !tbaa !13
  %112 = load i64, ptr %11, align 8, !tbaa !13
  %113 = load i64, ptr %12, align 8, !tbaa !13
  %114 = icmp ne i64 %112, %113
  br i1 %114, label %115, label %121

115:                                              ; preds = %104
  %116 = load i64, ptr %11, align 8, !tbaa !13
  %117 = trunc i64 %116 to i32
  %118 = load i64, ptr %12, align 8, !tbaa !13
  %119 = trunc i64 %118 to i32
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.133, i32 noundef %117, i32 noundef %119)
  br label %121

121:                                              ; preds = %115, %104
  %122 = load i64, ptr %11, align 8, !tbaa !13
  %123 = load i64, ptr %12, align 8, !tbaa !13
  %124 = icmp eq i64 %122, %123
  %125 = zext i1 %124 to i32
  %126 = sext i32 %125 to i64
  call void @_assert_true(i64 noundef %126, ptr noundef @.str.134, ptr noundef @.str.2, i32 noundef 3213)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %127

127:                                              ; preds = %121
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = add i32 %128, 10
  store i32 %129, ptr %10, align 4, !tbaa !5
  br label %97, !llvm.loop !17

130:                                              ; preds = %103
  %131 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %131) #5
  %132 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %132, ptr %4, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %141, %130
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = load i32, ptr %1, align 4, !tbaa !5
  %136 = add i32 64000, %135
  %137 = icmp ult i32 %134, %136
  br i1 %137, label %138, label %144

138:                                              ; preds = %133
  %139 = load ptr, ptr %3, align 8, !tbaa !9
  %140 = load i32, ptr %4, align 4, !tbaa !5
  call void @roaring_bitmap_add(ptr noundef %139, i32 noundef %140)
  br label %141

141:                                              ; preds = %138
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = add i32 %142, 1
  store i32 %143, ptr %4, align 4, !tbaa !5
  br label %133, !llvm.loop !18

144:                                              ; preds = %133
  %145 = load ptr, ptr %3, align 8, !tbaa !9
  %146 = call zeroext i1 @roaring_bitmap_run_optimize(ptr noundef %145)
  %147 = load ptr, ptr %3, align 8, !tbaa !9
  %148 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %147)
  store i64 %148, ptr %5, align 8, !tbaa !13
  %149 = load i64, ptr %5, align 8, !tbaa !13
  %150 = mul i64 %149, 4
  %151 = call noalias ptr @malloc(i64 noundef %150) #6
  store ptr %151, ptr %6, align 8, !tbaa !9
  %152 = load ptr, ptr %3, align 8, !tbaa !9
  %153 = load ptr, ptr %6, align 8, !tbaa !9
  call void @roaring_bitmap_to_uint32_array(ptr noundef %152, ptr noundef %153)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %184, %144
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = load i32, ptr %1, align 4, !tbaa !5
  %157 = add i32 64000, %156
  %158 = add i32 %157, 10
  %159 = icmp ult i32 %155, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %154
  store i32 20, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %187

161:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %162 = load ptr, ptr %6, align 8, !tbaa !9
  %163 = load i64, ptr %5, align 8, !tbaa !13
  %164 = load i32, ptr %13, align 4, !tbaa !5
  %165 = call i64 @rank(ptr noundef %162, i64 noundef %163, i32 noundef %164)
  store i64 %165, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %166 = load ptr, ptr %3, align 8, !tbaa !9
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = call i64 @roaring_bitmap_rank(ptr noundef %166, i32 noundef %167)
  store i64 %168, ptr %15, align 8, !tbaa !13
  %169 = load i64, ptr %14, align 8, !tbaa !13
  %170 = load i64, ptr %15, align 8, !tbaa !13
  %171 = icmp ne i64 %169, %170
  br i1 %171, label %172, label %178

172:                                              ; preds = %161
  %173 = load i64, ptr %14, align 8, !tbaa !13
  %174 = trunc i64 %173 to i32
  %175 = load i64, ptr %15, align 8, !tbaa !13
  %176 = trunc i64 %175 to i32
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.133, i32 noundef %174, i32 noundef %176)
  br label %178

178:                                              ; preds = %172, %161
  %179 = load i64, ptr %14, align 8, !tbaa !13
  %180 = load i64, ptr %15, align 8, !tbaa !13
  %181 = icmp eq i64 %179, %180
  %182 = zext i1 %181 to i32
  %183 = sext i32 %182 to i64
  call void @_assert_true(i64 noundef %183, ptr noundef @.str.134, ptr noundef @.str.2, i32 noundef 3230)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %184

184:                                              ; preds = %178
  %185 = load i32, ptr %13, align 4, !tbaa !5
  %186 = add i32 %185, 10
  store i32 %186, ptr %13, align 4, !tbaa !5
  br label %154, !llvm.loop !19

187:                                              ; preds = %160
  %188 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %188) #5
  %189 = load ptr, ptr %3, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %189)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %190

190:                                              ; preds = %187
  %191 = load i32, ptr %1, align 4, !tbaa !5
  %192 = mul i32 %191, 2
  store i32 %192, ptr %1, align 4, !tbaa !5
  br label %16, !llvm.loop !20

193:                                              ; preds = %19
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden i64 @rank(ptr noundef, i64 noundef, i32 noundef) #4

declare i64 @roaring_bitmap_rank(ptr noundef, i32 noundef) #1

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 = { nounwind allocsize(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 "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 }
attributes #6 = { nounwind allocsize(0) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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

@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

declare void @roaring_bitmap_free(ptr noundef) local_unnamed_addr #1

declare ptr @roaring_bitmap_create() local_unnamed_addr #1

declare void @_assert_true(i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare i64 @roaring_bitmap_get_cardinality(ptr noundef) local_unnamed_addr #1

declare void @roaring_bitmap_add(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

declare void @roaring_bitmap_to_uint32_array(ptr noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i1 @roaring_bitmap_run_optimize(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @test_rank() local_unnamed_addr #4 {
  br label %2

1:                                                ; preds = %55
  ret void

2:                                                ; preds = %0, %55
  %.0100 = phi i32 [ 123, %0 ], [ %56, %55 ]
  %3 = tail call ptr @roaring_bitmap_create() #5
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %.0100) #5
  %4 = add nuw nsw i32 %.0100, 100
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %4) #5
  %5 = add nuw nsw i32 %.0100, 200
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %5) #5
  %6 = add nuw nsw i32 %.0100, 300
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %6) #5
  %7 = add nuw nsw i32 %.0100, 400
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %7) #5
  %8 = add nuw nsw i32 %.0100, 500
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %8) #5
  %9 = add nuw nsw i32 %.0100, 600
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %9) #5
  %10 = add nuw nsw i32 %.0100, 700
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %10) #5
  %11 = add nuw nsw i32 %.0100, 800
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %11) #5
  %12 = add nuw nsw i32 %.0100, 900
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %12) #5
  %13 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %3) #5
  %14 = shl i64 %13, 2
  %15 = tail call noalias ptr @malloc(i64 noundef %14) #6
  tail call void @roaring_bitmap_to_uint32_array(ptr noundef %3, ptr noundef %15) #5
  %16 = add nuw nsw i32 %.0100, 1010
  br label %19

17:                                               ; preds = %26
  tail call void @free(ptr noundef %15) #5
  %18 = add nuw nsw i32 %.0100, 64000
  br label %30

19:                                               ; preds = %2, %26
  %.08195 = phi i32 [ 0, %2 ], [ %28, %26 ]
  %20 = tail call i64 @rank(ptr noundef %15, i64 noundef %13, i32 noundef %.08195)
  %21 = tail call i64 @roaring_bitmap_rank(ptr noundef %3, i32 noundef %.08195) #5
  %.not92 = icmp eq i64 %20, %21
  br i1 %.not92, label %26, label %22

22:                                               ; preds = %19
  %23 = trunc i64 %20 to i32
  %24 = trunc i64 %21 to i32
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.133, i32 noundef %23, i32 noundef %24)
  br label %26

26:                                               ; preds = %22, %19
  %27 = zext i1 %.not92 to i64
  tail call void @_assert_true(i64 noundef %27, ptr noundef nonnull @.str.134, ptr noundef nonnull @.str.2, i32 noundef 3197) #5
  %28 = add nuw nsw i32 %.08195, 10
  %29 = icmp ult i32 %28, %16
  br i1 %29, label %19, label %17, !llvm.loop !5

30:                                               ; preds = %17, %30
  %.196 = phi i32 [ %.0100, %17 ], [ %31, %30 ]
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %.196) #5
  %31 = add nuw nsw i32 %.196, 2
  %32 = icmp ult i32 %31, %18
  br i1 %32, label %30, label %33, !llvm.loop !7

33:                                               ; preds = %30
  %34 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %3) #5
  %35 = shl i64 %34, 2
  %36 = tail call noalias ptr @malloc(i64 noundef %35) #6
  tail call void @roaring_bitmap_to_uint32_array(ptr noundef %3, ptr noundef %36) #5
  %37 = add nuw nsw i32 %.0100, 64010
  br label %38

.lr.ph:                                           ; preds = %45
  tail call void @free(ptr noundef %36) #5
  br label %49

38:                                               ; preds = %33, %45
  %.08097 = phi i32 [ 0, %33 ], [ %47, %45 ]
  %39 = tail call i64 @rank(ptr noundef %36, i64 noundef %34, i32 noundef %.08097)
  %40 = tail call i64 @roaring_bitmap_rank(ptr noundef %3, i32 noundef %.08097) #5
  %.not91 = icmp eq i64 %39, %40
  br i1 %.not91, label %45, label %41

41:                                               ; preds = %38
  %42 = trunc i64 %39 to i32
  %43 = trunc i64 %40 to i32
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.133, i32 noundef %42, i32 noundef %43)
  br label %45

45:                                               ; preds = %41, %38
  %46 = zext i1 %.not91 to i64
  tail call void @_assert_true(i64 noundef %46, ptr noundef nonnull @.str.134, ptr noundef nonnull @.str.2, i32 noundef 3213) #5
  %47 = add nuw nsw i32 %.08097, 10
  %48 = icmp ult i32 %47, %37
  br i1 %48, label %38, label %.lr.ph, !llvm.loop !8

49:                                               ; preds = %.lr.ph, %49
  %.298 = phi i32 [ %.0100, %.lr.ph ], [ %50, %49 ]
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %.298) #5
  %50 = add nuw nsw i32 %.298, 1
  %exitcond.not = icmp eq i32 %50, %18
  br i1 %exitcond.not, label %._crit_edge, label %49, !llvm.loop !9

._crit_edge:                                      ; preds = %49
  %51 = tail call zeroext i1 @roaring_bitmap_run_optimize(ptr noundef %3) #5
  %52 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %3) #5
  %53 = shl i64 %52, 2
  %54 = tail call noalias ptr @malloc(i64 noundef %53) #6
  tail call void @roaring_bitmap_to_uint32_array(ptr noundef %3, ptr noundef %54) #5
  br label %58

55:                                               ; preds = %65
  tail call void @free(ptr noundef %54) #5
  tail call void @roaring_bitmap_free(ptr noundef %3) #5
  %56 = shl nuw nsw i32 %.0100, 1
  %57 = icmp ult i32 %.0100, 500000
  br i1 %57, label %2, label %1, !llvm.loop !10

58:                                               ; preds = %._crit_edge, %65
  %.07899 = phi i32 [ 0, %._crit_edge ], [ %67, %65 ]
  %59 = tail call i64 @rank(ptr noundef %54, i64 noundef %52, i32 noundef %.07899)
  %60 = tail call i64 @roaring_bitmap_rank(ptr noundef %3, i32 noundef %.07899) #5
  %.not = icmp eq i64 %59, %60
  br i1 %.not, label %65, label %61

61:                                               ; preds = %58
  %62 = trunc i64 %59 to i32
  %63 = trunc i64 %60 to i32
  %64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.133, i32 noundef %62, i32 noundef %63)
  br label %65

65:                                               ; preds = %61, %58
  %66 = zext i1 %.not to i64
  tail call void @_assert_true(i64 noundef %66, ptr noundef nonnull @.str.134, ptr noundef nonnull @.str.2, i32 noundef 3230) #5
  %67 = add nuw nsw i32 %.07899, 10
  %68 = icmp ult i32 %67, %37
  br i1 %68, label %58, label %55, !llvm.loop !11
}

; Function Attrs: nounwind uwtable
declare hidden i64 @rank(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #4

declare i64 @roaring_bitmap_rank(ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { nofree nounwind "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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 }
attributes #6 = { nounwind allocsize(0) }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !6}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,SROAPass,SimplifyCFGPass,TailCallElimPass