; LLVM IR from jermp/2i_bench :: external/CRoaring/tests/cpp_unit.ll (Z12test_exampleb)

; 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.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@__const._Z12test_exampleb.values = external hidden unnamed_addr constant [3 x i32], align 4
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z23roaring_iterator_sumalljPv(i32 noundef, ptr noundef) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #3

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #5

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12test_exampleb(i1 noundef zeroext %0) #6 {
  %2 = alloca i8, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [3 x i32], align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca [3 x ptr], align 16
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = zext i1 %0 to i8
  store i8 %24, ptr %2, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #12
  %25 = call ptr @roaring_bitmap_create()
  store ptr %25, ptr %3, align 8, !tbaa !9
  %26 = load ptr, ptr %3, align 8, !tbaa !9
  %27 = load i8, ptr %2, align 1, !tbaa !5, !range !11, !noundef !12
  %28 = trunc i8 %27 to i1
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %26, i1 noundef zeroext %28)
  %29 = load ptr, ptr %3, align 8, !tbaa !9
  %30 = ptrtoint ptr %29 to i64
  call void @_assert_int_not_equal(i64 noundef %30, i64 noundef 0, ptr noundef @.str.1, i32 noundef 54)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #12
  store i32 100, ptr %4, align 4, !tbaa !13
  br label %31

31:                                               ; preds = %38, %1
  %32 = load i32, ptr %4, align 4, !tbaa !13
  %33 = icmp ult i32 %32, 1000
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #12
  br label %41

35:                                               ; preds = %31
  %36 = load ptr, ptr %3, align 8, !tbaa !9
  %37 = load i32, ptr %4, align 4, !tbaa !13
  call void @roaring_bitmap_add(ptr noundef %36, i32 noundef %37)
  br label %38

38:                                               ; preds = %35
  %39 = load i32, ptr %4, align 4, !tbaa !13
  %40 = add i32 %39, 1
  store i32 %40, ptr %4, align 4, !tbaa !13
  br label %31, !llvm.loop !15

41:                                               ; preds = %34
  %42 = load ptr, ptr %3, align 8, !tbaa !9
  %43 = call zeroext i1 @roaring_bitmap_contains(ptr noundef %42, i32 noundef 500)
  %44 = zext i1 %43 to i64
  call void @_assert_true(i64 noundef %44, ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 61)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #12
  %45 = load ptr, ptr %3, align 8, !tbaa !9
  %46 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %45)
  store i64 %46, ptr %5, align 8, !tbaa !17
  %47 = load i64, ptr %5, align 8, !tbaa !17
  %48 = trunc i64 %47 to i32
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %48)
  %50 = load i64, ptr %5, align 8, !tbaa !17
  call void @_assert_int_equal(i64 noundef 900, i64 noundef %50, ptr noundef @.str.1, i32 noundef 66)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #12
  %51 = load ptr, ptr %3, align 8, !tbaa !9
  %52 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %51)
  store i64 %52, ptr %6, align 8, !tbaa !17
  %53 = load ptr, ptr %3, align 8, !tbaa !9
  %54 = call zeroext i1 @roaring_bitmap_run_optimize(ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #12
  %55 = load ptr, ptr %3, align 8, !tbaa !9
  %56 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %55)
  store i64 %56, ptr %7, align 8, !tbaa !17
  %57 = load i64, ptr %6, align 8, !tbaa !17
  %58 = load i64, ptr %7, align 8, !tbaa !17
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %57, i64 noundef %58)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #12
  %60 = call ptr (i64, ...) @roaring_bitmap_of(i64 noundef 5, i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 5, i32 noundef 6)
  store ptr %60, ptr %8, align 8, !tbaa !9
  %61 = load ptr, ptr %8, align 8, !tbaa !9
  %62 = ptrtoint ptr %61 to i64
  call void @_assert_int_not_equal(i64 noundef %62, i64 noundef 0, ptr noundef @.str.1, i32 noundef 77)
  %63 = load ptr, ptr %8, align 8, !tbaa !9
  call void @roaring_bitmap_printf(ptr noundef %63)
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #12
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 @__const._Z12test_exampleb.values, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #12
  %65 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 0
  %66 = call ptr @roaring_bitmap_of_ptr(i64 noundef 3, ptr noundef %65)
  store ptr %66, ptr %10, align 8, !tbaa !9
  %67 = load ptr, ptr %10, align 8, !tbaa !9
  %68 = load i8, ptr %2, align 1, !tbaa !5, !range !11, !noundef !12
  %69 = trunc i8 %68 to i1
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %67, i1 noundef zeroext %69)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #12
  %70 = load ptr, ptr %3, align 8, !tbaa !9
  %71 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %70)
  store i64 %71, ptr %11, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #12
  %72 = load i64, ptr %11, align 8, !tbaa !17
  %73 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %72, i64 4)
  %74 = extractvalue { i64, i1 } %73, 1
  %75 = extractvalue { i64, i1 } %73, 0
  %76 = select i1 %74, i64 -1, i64 %75
  %77 = call noalias noundef nonnull ptr @_Znam(i64 noundef %76) #13
  store ptr %77, ptr %12, align 8, !tbaa !9
  %78 = load ptr, ptr %12, align 8, !tbaa !9
  %79 = ptrtoint ptr %78 to i64
  call void @_assert_int_not_equal(i64 noundef %79, i64 noundef 0, ptr noundef @.str.1, i32 noundef 87)
  %80 = load ptr, ptr %3, align 8, !tbaa !9
  %81 = load ptr, ptr %12, align 8, !tbaa !9
  call void @roaring_bitmap_to_uint32_array(ptr noundef %80, ptr noundef %81)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #12
  %82 = load i64, ptr %11, align 8, !tbaa !17
  %83 = load ptr, ptr %12, align 8, !tbaa !9
  %84 = call ptr @roaring_bitmap_of_ptr(i64 noundef %82, ptr noundef %83)
  store ptr %84, ptr %13, align 8, !tbaa !9
  %85 = load ptr, ptr %12, align 8, !tbaa !9
  %86 = icmp eq ptr %85, null
  br i1 %86, label %88, label %87

87:                                               ; preds = %41
  call void @_ZdaPv(ptr noundef %85) #14
  br label %88

88:                                               ; preds = %87, %41
  %89 = load ptr, ptr %13, align 8, !tbaa !9
  %90 = ptrtoint ptr %89 to i64
  call void @_assert_int_not_equal(i64 noundef %90, i64 noundef 0, ptr noundef @.str.1, i32 noundef 92)
  %91 = load ptr, ptr %3, align 8, !tbaa !9
  %92 = load ptr, ptr %13, align 8, !tbaa !9
  %93 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %91, ptr noundef %92)
  %94 = zext i1 %93 to i64
  call void @_assert_true(i64 noundef %94, ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 95)
  %95 = load ptr, ptr %13, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %95)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #12
  %96 = load ptr, ptr %10, align 8, !tbaa !9
  %97 = call ptr @roaring_bitmap_copy(ptr noundef %96)
  store ptr %97, ptr %14, align 8, !tbaa !9
  %98 = load ptr, ptr %14, align 8, !tbaa !9
  %99 = load i8, ptr %2, align 1, !tbaa !5, !range !11, !noundef !12
  %100 = trunc i8 %99 to i1
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %98, i1 noundef zeroext %100)
  %101 = load ptr, ptr %10, align 8, !tbaa !9
  %102 = load ptr, ptr %14, align 8, !tbaa !9
  %103 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %101, ptr noundef %102)
  %104 = zext i1 %103 to i64
  call void @_assert_true(i64 noundef %104, ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 101)
  %105 = load ptr, ptr %14, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %105)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #12
  %106 = load ptr, ptr %3, align 8, !tbaa !9
  %107 = load ptr, ptr %8, align 8, !tbaa !9
  %108 = call ptr @roaring_bitmap_or(ptr noundef %106, ptr noundef %107)
  store ptr %108, ptr %15, align 8, !tbaa !9
  %109 = load ptr, ptr %15, align 8, !tbaa !9
  %110 = load i8, ptr %2, align 1, !tbaa !5, !range !11, !noundef !12
  %111 = trunc i8 %110 to i1
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %109, i1 noundef zeroext %111)
  %112 = load ptr, ptr %15, align 8, !tbaa !9
  %113 = load ptr, ptr %10, align 8, !tbaa !9
  call void @roaring_bitmap_or_inplace(ptr noundef %112, ptr noundef %113)
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #12
  %114 = load ptr, ptr %3, align 8, !tbaa !9
  store ptr %114, ptr %16, align 8, !tbaa !9
  %115 = getelementptr inbounds ptr, ptr %16, i64 1
  %116 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %116, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds ptr, ptr %16, i64 2
  %118 = load ptr, ptr %10, align 8, !tbaa !9
  store ptr %118, ptr %117, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #12
  %119 = getelementptr inbounds [3 x ptr], ptr %16, i64 0, i64 0
  %120 = call ptr @roaring_bitmap_or_many(i64 noundef 3, ptr noundef %119)
  store ptr %120, ptr %17, align 8, !tbaa !9
  %121 = load ptr, ptr %15, align 8, !tbaa !9
  %122 = load ptr, ptr %17, align 8, !tbaa !9
  %123 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %121, ptr noundef %122)
  %124 = zext i1 %123 to i64
  call void @_assert_true(i64 noundef %124, ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 113)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #12
  %125 = getelementptr inbounds [3 x ptr], ptr %16, i64 0, i64 0
  %126 = call ptr @roaring_bitmap_or_many_heap(i32 noundef 3, ptr noundef %125)
  store ptr %126, ptr %18, align 8, !tbaa !9
  %127 = load ptr, ptr %15, align 8, !tbaa !9
  %128 = load ptr, ptr %18, align 8, !tbaa !9
  %129 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %127, ptr noundef %128)
  %130 = zext i1 %129 to i64
  call void @_assert_true(i64 noundef %130, ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 116)
  %131 = load ptr, ptr %15, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %131)
  %132 = load ptr, ptr %17, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %132)
  %133 = load ptr, ptr %18, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %133)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #12
  %134 = load ptr, ptr %3, align 8, !tbaa !9
  %135 = load ptr, ptr %8, align 8, !tbaa !9
  %136 = call ptr @roaring_bitmap_and(ptr noundef %134, ptr noundef %135)
  store ptr %136, ptr %19, align 8, !tbaa !9
  %137 = load ptr, ptr %19, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %137)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #12
  %138 = load ptr, ptr %3, align 8, !tbaa !9
  %139 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %138)
  store i64 %139, ptr %20, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #12
  %140 = load i64, ptr %20, align 8, !tbaa !17
  %141 = call noalias ptr @malloc(i64 noundef %140) #15
  store ptr %141, ptr %21, align 8, !tbaa !9
  %142 = load ptr, ptr %3, align 8, !tbaa !9
  %143 = load ptr, ptr %21, align 8, !tbaa !9
  %144 = call i64 @roaring_bitmap_portable_serialize(ptr noundef %142, ptr noundef %143)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #12
  %145 = load ptr, ptr %21, align 8, !tbaa !9
  %146 = call ptr @roaring_bitmap_portable_deserialize(ptr noundef %145)
  store ptr %146, ptr %22, align 8, !tbaa !9
  %147 = load i64, ptr %20, align 8, !tbaa !17
  %148 = load ptr, ptr %22, align 8, !tbaa !9
  %149 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %148)
  %150 = icmp eq i64 %147, %149
  %151 = zext i1 %150 to i64
  call void @_assert_true(i64 noundef %151, ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 130)
  %152 = load ptr, ptr %3, align 8, !tbaa !9
  %153 = load ptr, ptr %22, align 8, !tbaa !9
  %154 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %152, ptr noundef %153)
  %155 = zext i1 %154 to i64
  call void @_assert_true(i64 noundef %155, ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 131)
  %156 = load ptr, ptr %22, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %156)
  %157 = load ptr, ptr %21, align 8, !tbaa !9
  call void @free(ptr noundef %157) #12
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #12
  store i32 0, ptr %23, align 4, !tbaa !13
  %158 = load ptr, ptr %3, align 8, !tbaa !9
  %159 = call zeroext i1 @roaring_iterate(ptr noundef %158, ptr noundef @_Z23roaring_iterator_sumalljPv, ptr noundef %23)
  %160 = load ptr, ptr %3, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %160)
  %161 = load ptr, ptr %8, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %161)
  %162 = load ptr, ptr %10, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %162)
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #12
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #12
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #12
  ret void
}

declare ptr @roaring_bitmap_create() #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @roaring_bitmap_set_copy_on_write(ptr noundef, i1 noundef zeroext) #7

declare void @_assert_int_not_equal(i64 noundef, i64 noundef, ptr noundef, i32 noundef) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local zeroext i1 @roaring_bitmap_contains(ptr noundef, i32 noundef) #8

declare i64 @roaring_bitmap_get_cardinality(ptr noundef) #4

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

declare void @_assert_int_equal(i64 noundef, i64 noundef, ptr noundef, i32 noundef) #4

declare i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef) #4

declare zeroext i1 @roaring_bitmap_run_optimize(ptr noundef) #4

declare ptr @roaring_bitmap_of(i64 noundef, ...) #4

declare void @roaring_bitmap_printf(ptr noundef) #4

declare ptr @roaring_bitmap_of_ptr(i64 noundef, ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #9

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

declare zeroext i1 @roaring_bitmap_equals(ptr noundef, ptr noundef) #4

declare void @roaring_bitmap_free(ptr noundef) #4

declare ptr @roaring_bitmap_copy(ptr noundef) #4

declare ptr @roaring_bitmap_or(ptr noundef, ptr noundef) #4

declare void @roaring_bitmap_or_inplace(ptr noundef, ptr noundef) #4

declare ptr @roaring_bitmap_or_many(i64 noundef, ptr noundef) #4

declare ptr @roaring_bitmap_or_many_heap(i32 noundef, ptr noundef) #4

declare ptr @roaring_bitmap_and(ptr noundef, ptr noundef) #4

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

declare i64 @roaring_bitmap_portable_serialize(ptr noundef, ptr noundef) #4

declare ptr @roaring_bitmap_portable_deserialize(ptr noundef) #4

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

declare zeroext i1 @roaring_iterate(ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { mustprogress 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 = { nobuiltin 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 #4 = { "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 = { nobuiltin 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 #6 = { mustprogress 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 #7 = { inlinehint mustprogress 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 #8 = { inlinehint mustprogress 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { 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 #11 = { 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 #12 = { nounwind }
attributes #13 = { builtin allocsize(0) }
attributes #14 = { builtin nounwind }
attributes #15 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, 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"

@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@__const._Z12test_exampleb.values = external hidden unnamed_addr constant [3 x i32], align 4
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z23roaring_iterator_sumalljPv(i32 noundef, ptr noundef) #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 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12test_exampleb(i1 noundef zeroext %0) local_unnamed_addr #6 {
  %2 = alloca [3 x i32], align 4
  %3 = alloca [3 x ptr], align 16
  %4 = alloca i32, align 4
  %5 = tail call ptr @roaring_bitmap_create()
  tail call void @roaring_bitmap_set_copy_on_write(ptr noundef %5, i1 noundef zeroext %0)
  %6 = ptrtoint ptr %5 to i64
  tail call void @_assert_int_not_equal(i64 noundef %6, i64 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 54)
  br label %54

7:                                                ; preds = %54
  %8 = tail call zeroext i1 @roaring_bitmap_contains(ptr noundef %5, i32 noundef 500)
  %9 = zext i1 %8 to i64
  tail call void @_assert_true(i64 noundef %9, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 61)
  %10 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %5)
  %11 = trunc i64 %10 to i32
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %11)
  tail call void @_assert_int_equal(i64 noundef 900, i64 noundef %10, ptr noundef nonnull @.str.1, i32 noundef 66)
  %13 = tail call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %5)
  %14 = tail call zeroext i1 @roaring_bitmap_run_optimize(ptr noundef %5)
  %15 = tail call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %5)
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %13, i64 noundef %15)
  %17 = tail call ptr (i64, ...) @roaring_bitmap_of(i64 noundef 5, i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 5, i32 noundef 6)
  %18 = ptrtoint ptr %17 to i64
  tail call void @_assert_int_not_equal(i64 noundef %18, i64 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 77)
  tail call void @roaring_bitmap_printf(ptr noundef %17)
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) @__const._Z12test_exampleb.values, i64 12, i1 false)
  %20 = call ptr @roaring_bitmap_of_ptr(i64 noundef 3, ptr noundef nonnull %2)
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %20, i1 noundef zeroext %0)
  %21 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %5)
  %22 = icmp ugt i64 %21, 4611686018427387903
  %23 = shl i64 %21, 2
  %24 = select i1 %22, i64 -1, i64 %23
  %25 = call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #13
  %26 = ptrtoint ptr %25 to i64
  call void @_assert_int_not_equal(i64 noundef %26, i64 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 87)
  call void @roaring_bitmap_to_uint32_array(ptr noundef %5, ptr noundef nonnull %25)
  %27 = call ptr @roaring_bitmap_of_ptr(i64 noundef %21, ptr noundef nonnull %25)
  call void @_ZdaPv(ptr noundef nonnull %25) #14
  %28 = ptrtoint ptr %27 to i64
  call void @_assert_int_not_equal(i64 noundef %28, i64 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 92)
  %29 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %5, ptr noundef %27)
  %30 = zext i1 %29 to i64
  call void @_assert_true(i64 noundef %30, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 95)
  call void @roaring_bitmap_free(ptr noundef %27)
  %31 = call ptr @roaring_bitmap_copy(ptr noundef %20)
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %31, i1 noundef zeroext %0)
  %32 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %20, ptr noundef %31)
  %33 = zext i1 %32 to i64
  call void @_assert_true(i64 noundef %33, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 101)
  call void @roaring_bitmap_free(ptr noundef %31)
  %34 = call ptr @roaring_bitmap_or(ptr noundef %5, ptr noundef %17)
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %34, i1 noundef zeroext %0)
  call void @roaring_bitmap_or_inplace(ptr noundef %34, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #12
  store ptr %5, ptr %3, align 16, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %17, ptr %35, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %20, ptr %36, align 16, !tbaa !5
  %37 = call ptr @roaring_bitmap_or_many(i64 noundef 3, ptr noundef nonnull %3)
  %38 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %34, ptr noundef %37)
  %39 = zext i1 %38 to i64
  call void @_assert_true(i64 noundef %39, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 113)
  %40 = call ptr @roaring_bitmap_or_many_heap(i32 noundef 3, ptr noundef nonnull %3)
  %41 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %34, ptr noundef %40)
  %42 = zext i1 %41 to i64
  call void @_assert_true(i64 noundef %42, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 116)
  call void @roaring_bitmap_free(ptr noundef %34)
  call void @roaring_bitmap_free(ptr noundef %37)
  call void @roaring_bitmap_free(ptr noundef %40)
  %43 = call ptr @roaring_bitmap_and(ptr noundef %5, ptr noundef %17)
  call void @roaring_bitmap_free(ptr noundef %43)
  %44 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %5)
  %45 = call noalias ptr @malloc(i64 noundef %44) #15
  %46 = call i64 @roaring_bitmap_portable_serialize(ptr noundef %5, ptr noundef %45)
  %47 = call ptr @roaring_bitmap_portable_deserialize(ptr noundef %45)
  %48 = call i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef %47)
  %49 = icmp eq i64 %44, %48
  %50 = zext i1 %49 to i64
  call void @_assert_true(i64 noundef %50, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 130)
  %51 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %5, ptr noundef %47)
  %52 = zext i1 %51 to i64
  call void @_assert_true(i64 noundef %52, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 131)
  call void @roaring_bitmap_free(ptr noundef %47)
  call void @free(ptr noundef %45) #12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #12
  store i32 0, ptr %4, align 4, !tbaa !9
  %53 = call zeroext i1 @roaring_iterate(ptr noundef %5, ptr noundef nonnull @_Z23roaring_iterator_sumalljPv, ptr noundef nonnull %4)
  call void @roaring_bitmap_free(ptr noundef %5)
  call void @roaring_bitmap_free(ptr noundef %17)
  call void @roaring_bitmap_free(ptr noundef %20)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #12
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #12
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #12
  ret void

54:                                               ; preds = %1, %54
  %.071 = phi i32 [ 100, %1 ], [ %55, %54 ]
  tail call void @roaring_bitmap_add(ptr noundef %5, i32 noundef %.071)
  %55 = add nuw nsw i32 %.071, 1
  %exitcond.not = icmp eq i32 %55, 1000
  br i1 %exitcond.not, label %7, label %54, !llvm.loop !11
}

declare ptr @roaring_bitmap_create() local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @roaring_bitmap_set_copy_on_write(ptr noundef, i1 noundef zeroext) local_unnamed_addr #7

declare void @_assert_int_not_equal(i64 noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local zeroext i1 @roaring_bitmap_contains(ptr noundef, i32 noundef) local_unnamed_addr #8

declare i64 @roaring_bitmap_get_cardinality(ptr noundef) local_unnamed_addr #4

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

declare void @_assert_int_equal(i64 noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i64 @roaring_bitmap_portable_size_in_bytes(ptr noundef) local_unnamed_addr #4

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

declare ptr @roaring_bitmap_of(i64 noundef, ...) local_unnamed_addr #4

declare void @roaring_bitmap_printf(ptr noundef) local_unnamed_addr #4

declare ptr @roaring_bitmap_of_ptr(i64 noundef, ptr noundef) local_unnamed_addr #4

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

declare zeroext i1 @roaring_bitmap_equals(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @roaring_bitmap_free(ptr noundef) local_unnamed_addr #4

declare ptr @roaring_bitmap_copy(ptr noundef) local_unnamed_addr #4

declare ptr @roaring_bitmap_or(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @roaring_bitmap_or_inplace(ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @roaring_bitmap_or_many(i64 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @roaring_bitmap_or_many_heap(i32 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @roaring_bitmap_and(ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i64 @roaring_bitmap_portable_serialize(ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @roaring_bitmap_portable_deserialize(ptr noundef) local_unnamed_addr #4

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

declare zeroext i1 @roaring_iterate(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nobuiltin 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 #4 = { "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 = { nobuiltin 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 #6 = { mustprogress 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 #7 = { inlinehint mustprogress 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 #8 = { inlinehint mustprogress 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 #9 = { 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 #10 = { 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 #11 = { 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 #12 = { nounwind }
attributes #13 = { builtin allocsize(0) }
attributes #14 = { builtin nounwind }
attributes #15 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass