; 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.23 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [47 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 zeroext i1 @roaring_bitmap_contains_range(ptr noundef, i64 noundef, i64 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

; Function Attrs: inlinehint nounwind uwtable
declare zeroext i1 @roaring_bitmap_contains(ptr noundef, i32 noundef) #2

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

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

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

; Function Attrs: nounwind
declare i32 @rand() #4

; Function Attrs: nounwind uwtable
define dso_local void @test_contains_range() #5 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  %18 = call noalias ptr @malloc(i64 noundef 400000) #7
  store ptr %18, ptr %1, align 8, !tbaa !5
  %19 = load ptr, ptr %1, align 8, !tbaa !5
  %20 = ptrtoint ptr %19 to i64
  call void @_assert_true(i64 noundef %20, ptr noundef @.str.89, ptr noundef @.str.2, i32 noundef 1289)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %130, %0
  %22 = load i32, ptr %2, align 4, !tbaa !9
  %23 = icmp ule i32 %22, 64
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %133

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %26 = call ptr @roaring_bitmap_create()
  store ptr %26, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = ptrtoint ptr %27 to i64
  call void @_assert_true(i64 noundef %28, ptr noundef @.str.23, ptr noundef @.str.2, i32 noundef 1292)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %43, %25
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = icmp ult i32 %30, 100000
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %46

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %34 = call i32 @rand() #6
  %35 = srem i32 %34, 200000
  store i32 %35, ptr %6, align 4, !tbaa !9
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = load i32, ptr %6, align 4, !tbaa !9
  call void @roaring_bitmap_add(ptr noundef %36, i32 noundef %37)
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = load ptr, ptr %1, align 8, !tbaa !5
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %39, i64 %41
  store i32 %38, ptr %42, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %43

43:                                               ; preds = %33
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = add i32 %44, 1
  store i32 %45, ptr %5, align 4, !tbaa !9
  br label %29, !llvm.loop !11

46:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !13
  br label %47

47:                                               ; preds = %125, %46
  %48 = load i64, ptr %7, align 8, !tbaa !13
  %49 = icmp ult i64 %48, 100000
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %128

51:                                               ; preds = %47
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = load ptr, ptr %1, align 8, !tbaa !5
  %54 = load i64, ptr %7, align 8, !tbaa !13
  %55 = getelementptr inbounds i32, ptr %53, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !9
  %57 = zext i32 %56 to i64
  %58 = load ptr, ptr %1, align 8, !tbaa !5
  %59 = load i64, ptr %7, align 8, !tbaa !13
  %60 = getelementptr inbounds i32, ptr %58, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = load i32, ptr %2, align 4, !tbaa !9
  %63 = add i32 %61, %62
  %64 = zext i32 %63 to i64
  %65 = call zeroext i1 @roaring_bitmap_contains_range(ptr noundef %52, i64 noundef %57, i64 noundef %64)
  br i1 %65, label %66, label %90

66:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %67 = load ptr, ptr %1, align 8, !tbaa !5
  %68 = load i64, ptr %7, align 8, !tbaa !13
  %69 = getelementptr inbounds i32, ptr %67, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !9
  store i32 %70, ptr %8, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %86, %66
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = load ptr, ptr %1, align 8, !tbaa !5
  %74 = load i64, ptr %7, align 8, !tbaa !13
  %75 = getelementptr inbounds i32, ptr %73, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = load i32, ptr %2, align 4, !tbaa !9
  %78 = add i32 %76, %77
  %79 = icmp ult i32 %72, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %71
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %89

81:                                               ; preds = %71
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = load i32, ptr %8, align 4, !tbaa !9
  %84 = call zeroext i1 @roaring_bitmap_contains(ptr noundef %82, i32 noundef %83)
  %85 = zext i1 %84 to i64
  call void @_assert_true(i64 noundef %85, ptr noundef @.str.90, ptr noundef @.str.2, i32 noundef 1300)
  br label %86

86:                                               ; preds = %81
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = add i32 %87, 1
  store i32 %88, ptr %8, align 4, !tbaa !9
  br label %71, !llvm.loop !15

89:                                               ; preds = %80
  br label %124

90:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %91 = load ptr, ptr %1, align 8, !tbaa !5
  %92 = load i64, ptr %7, align 8, !tbaa !13
  %93 = getelementptr inbounds i32, ptr %91, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !9
  store i32 %94, ptr %10, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %114, %90
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = load ptr, ptr %1, align 8, !tbaa !5
  %98 = load i64, ptr %7, align 8, !tbaa !13
  %99 = getelementptr inbounds i32, ptr %97, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = load i32, ptr %2, align 4, !tbaa !9
  %102 = add i32 %100, %101
  %103 = icmp ult i32 %96, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %95
  store i32 14, ptr %3, align 4
  br label %117

105:                                              ; preds = %95
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = call zeroext i1 @roaring_bitmap_contains(ptr noundef %106, i32 noundef %107)
  br i1 %108, label %109, label %112

109:                                              ; preds = %105
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = add i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !9
  br label %113

112:                                              ; preds = %105
  store i32 14, ptr %3, align 4
  br label %117

113:                                              ; preds = %109
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %10, align 4, !tbaa !9
  %116 = add i32 %115, 1
  store i32 %116, ptr %10, align 4, !tbaa !9
  br label %95, !llvm.loop !16

117:                                              ; preds = %112, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %9, align 4, !tbaa !9
  %120 = load i32, ptr %2, align 4, !tbaa !9
  %121 = icmp ne i32 %119, %120
  %122 = zext i1 %121 to i32
  %123 = sext i32 %122 to i64
  call void @_assert_true(i64 noundef %123, ptr noundef @.str.91, ptr noundef @.str.2, i32 noundef 1308)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %124

124:                                              ; preds = %118, %89
  br label %125

125:                                              ; preds = %124
  %126 = load i64, ptr %7, align 8, !tbaa !13
  %127 = add i64 %126, 1
  store i64 %127, ptr %7, align 8, !tbaa !13
  br label %47, !llvm.loop !17

128:                                              ; preds = %50
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  call void @roaring_bitmap_free(ptr noundef %129)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %130

130:                                              ; preds = %128
  %131 = load i32, ptr %2, align 4, !tbaa !9
  %132 = add i32 %131, 1
  store i32 %132, ptr %2, align 4, !tbaa !9
  br label %21, !llvm.loop !18

133:                                              ; preds = %24
  %134 = load ptr, ptr %1, align 8, !tbaa !5
  call void @free(ptr noundef %134) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %135

135:                                              ; preds = %212, %133
  %136 = load i32, ptr %11, align 4, !tbaa !9
  %137 = icmp ule i32 %136, 64
  br i1 %137, label %139, label %138

138:                                              ; preds = %135
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %215

139:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %140 = call ptr @roaring_bitmap_create()
  store ptr %140, ptr %12, align 8, !tbaa !5
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  %142 = ptrtoint ptr %141 to i64
  call void @_assert_true(i64 noundef %142, ptr noundef @.str.23, ptr noundef @.str.2, i32 noundef 1316)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = mul i32 %143, 2
  store i32 %144, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %171, %139
  %146 = load i32, ptr %14, align 4, !tbaa !9
  %147 = icmp ult i32 %146, 130000
  br i1 %147, label %149, label %148

148:                                              ; preds = %145
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %175

149:                                              ; preds = %145
  %150 = load i32, ptr %14, align 4, !tbaa !9
  %151 = load i32, ptr %13, align 4, !tbaa !9
  %152 = urem i32 %150, %151
  %153 = icmp eq i32 %152, 0
  br i1 %153, label %154, label %170

154:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %155 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %155, ptr %15, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %166, %154
  %157 = load i32, ptr %15, align 4, !tbaa !9
  %158 = load i32, ptr %14, align 4, !tbaa !9
  %159 = load i32, ptr %11, align 4, !tbaa !9
  %160 = add i32 %158, %159
  %161 = icmp ult i32 %157, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %156
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %169

163:                                              ; preds = %156
  %164 = load ptr, ptr %12, align 8, !tbaa !5
  %165 = load i32, ptr %15, align 4, !tbaa !9
  call void @roaring_bitmap_add(ptr noundef %164, i32 noundef %165)
  br label %166

166:                                              ; preds = %163
  %167 = load i32, ptr %15, align 4, !tbaa !9
  %168 = add i32 %167, 1
  store i32 %168, ptr %15, align 4, !tbaa !9
  br label %156, !llvm.loop !19

169:                                              ; preds = %162
  br label %170

170:                                              ; preds = %169, %149
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = load i32, ptr %14, align 4, !tbaa !9
  %174 = add i32 %173, %172
  store i32 %174, ptr %14, align 4, !tbaa !9
  br label %145, !llvm.loop !20

175:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %176

176:                                              ; preds = %206, %175
  %177 = load i32, ptr %16, align 4, !tbaa !9
  %178 = icmp ult i32 %177, 130000
  br i1 %178, label %180, label %179

179:                                              ; preds = %176
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %210

180:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = load i32, ptr %16, align 4, !tbaa !9
  %183 = zext i32 %182 to i64
  %184 = load i32, ptr %16, align 4, !tbaa !9
  %185 = load i32, ptr %11, align 4, !tbaa !9
  %186 = add i32 %184, %185
  %187 = zext i32 %186 to i64
  %188 = call zeroext i1 @roaring_bitmap_contains_range(ptr noundef %181, i64 noundef %183, i64 noundef %187)
  %189 = zext i1 %188 to i8
  store i8 %189, ptr %17, align 1, !tbaa !21
  %190 = load i32, ptr %16, align 4, !tbaa !9
  %191 = load i32, ptr %13, align 4, !tbaa !9
  %192 = urem i32 %190, %191
  %193 = icmp eq i32 %192, 0
  br i1 %193, label %194, label %198

194:                                              ; preds = %180
  %195 = load i8, ptr %17, align 1, !tbaa !21, !range !23, !noundef !24
  %196 = trunc i8 %195 to i1
  %197 = zext i1 %196 to i32
  br label %203

198:                                              ; preds = %180
  %199 = load i8, ptr %17, align 1, !tbaa !21, !range !23, !noundef !24
  %200 = trunc i8 %199 to i1
  %201 = xor i1 %200, true
  %202 = zext i1 %201 to i32
  br label %203

203:                                              ; preds = %198, %194
  %204 = phi i32 [ %197, %194 ], [ %202, %198 ]
  %205 = sext i32 %204 to i64
  call void @_assert_true(i64 noundef %205, ptr noundef @.str.92, ptr noundef @.str.2, i32 noundef 1325)
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  br label %206

206:                                              ; preds = %203
  %207 = load i32, ptr %11, align 4, !tbaa !9
  %208 = load i32, ptr %16, align 4, !tbaa !9
  %209 = add i32 %208, %207
  store i32 %209, ptr %16, align 4, !tbaa !9
  br label %176, !llvm.loop !25

210:                                              ; preds = %179
  %211 = load ptr, ptr %12, align 8, !tbaa !5
  call void @roaring_bitmap_free(ptr noundef %211)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %212

212:                                              ; preds = %210
  %213 = load i32, ptr %11, align 4, !tbaa !9
  %214 = add i32 %213, 1
  store i32 %214, ptr %11, align 4, !tbaa !9
  br label %135, !llvm.loop !26

215:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !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}
!21 = !{!22, !22, i64 0}
!22 = !{!"_Bool", !7, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !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.23 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [47 x i8], align 1

declare zeroext i1 @roaring_bitmap_contains_range(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

declare void @roaring_bitmap_free(ptr noundef) local_unnamed_addr #0

declare ptr @roaring_bitmap_create() local_unnamed_addr #0

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

; Function Attrs: inlinehint nounwind uwtable
declare zeroext i1 @roaring_bitmap_contains(ptr noundef, i32 noundef) local_unnamed_addr #1

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

; 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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @test_contains_range() local_unnamed_addr #5 {
  %1 = tail call noalias dereferenceable_or_null(400000) ptr @malloc(i64 noundef 400000) #6
  %2 = ptrtoint ptr %1 to i64
  tail call void @_assert_true(i64 noundef %2, ptr noundef nonnull @.str.89, ptr noundef nonnull @.str.2, i32 noundef 1289) #7
  br label %4

3:                                                ; preds = %11
  tail call void @free(ptr noundef %1) #7
  br label %41

4:                                                ; preds = %0, %11
  %.090 = phi i32 [ 1, %0 ], [ %12, %11 ]
  %5 = tail call ptr @roaring_bitmap_create() #7
  %6 = ptrtoint ptr %5 to i64
  tail call void @_assert_true(i64 noundef %6, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.2, i32 noundef 1292) #7
  br label %7

7:                                                ; preds = %4, %7
  %indvars.iv = phi i64 [ 0, %4 ], [ %indvars.iv.next, %7 ]
  %8 = tail call i32 @rand() #7
  %9 = srem i32 %8, 200000
  tail call void @roaring_bitmap_add(ptr noundef %5, i32 noundef %9) #7
  %10 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  store i32 %9, ptr %10, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 100000
  br i1 %exitcond.not, label %.preheader80, label %7, !llvm.loop !9

11:                                               ; preds = %.loopexit79
  tail call void @roaring_bitmap_free(ptr noundef %5) #7
  %12 = add nuw nsw i32 %.090, 1
  %exitcond97.not = icmp eq i32 %12, 65
  br i1 %exitcond97.not, label %3, label %4, !llvm.loop !11

.preheader80:                                     ; preds = %7, %.loopexit79
  %.07789 = phi i64 [ %39, %.loopexit79 ], [ 0, %7 ]
  %13 = getelementptr inbounds i32, ptr %1, i64 %.07789
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = zext i32 %14 to i64
  %16 = add i32 %14, %.090
  %17 = zext i32 %16 to i64
  %18 = tail call zeroext i1 @roaring_bitmap_contains_range(ptr noundef %5, i64 noundef %15, i64 noundef %17) #7
  %19 = load i32, ptr %13, align 4, !tbaa !5
  %20 = add i32 %19, %.090
  %21 = icmp ult i32 %19, %20
  br i1 %18, label %22, label %29

22:                                               ; preds = %.preheader80
  br i1 %21, label %.lr.ph88, label %.loopexit79

.lr.ph88:                                         ; preds = %22, %.lr.ph88
  %.07686 = phi i32 [ %25, %.lr.ph88 ], [ %19, %22 ]
  %23 = tail call zeroext i1 @roaring_bitmap_contains(ptr noundef %5, i32 noundef %.07686)
  %24 = zext i1 %23 to i64
  tail call void @_assert_true(i64 noundef %24, ptr noundef nonnull @.str.90, ptr noundef nonnull @.str.2, i32 noundef 1300) #7
  %25 = add nuw i32 %.07686, 1
  %26 = load i32, ptr %13, align 4, !tbaa !5
  %27 = add i32 %26, %.090
  %28 = icmp ult i32 %25, %27
  br i1 %28, label %.lr.ph88, label %.loopexit79, !llvm.loop !12

29:                                               ; preds = %.preheader80
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %29, %31
  %.07483 = phi i32 [ %33, %31 ], [ %19, %29 ]
  %.07582 = phi i32 [ %32, %31 ], [ 0, %29 ]
  %30 = tail call zeroext i1 @roaring_bitmap_contains(ptr noundef %5, i32 noundef %.07483)
  br i1 %30, label %31, label %._crit_edge

31:                                               ; preds = %.lr.ph
  %32 = add i32 %.07582, 1
  %33 = add nuw i32 %.07483, 1
  %34 = load i32, ptr %13, align 4, !tbaa !5
  %35 = add i32 %34, %.090
  %36 = icmp ult i32 %33, %35
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %31, %.lr.ph, %29
  %.075.lcssa = phi i32 [ 0, %29 ], [ %.07582, %.lr.ph ], [ %32, %31 ]
  %37 = icmp ne i32 %.075.lcssa, %.090
  %38 = zext i1 %37 to i64
  tail call void @_assert_true(i64 noundef %38, ptr noundef nonnull @.str.91, ptr noundef nonnull @.str.2, i32 noundef 1308) #7
  br label %.loopexit79

.loopexit79:                                      ; preds = %.lr.ph88, %22, %._crit_edge
  %39 = add nuw nsw i64 %.07789, 1
  %exitcond96.not = icmp eq i64 %39, 100000
  br i1 %exitcond96.not, label %11, label %.preheader80, !llvm.loop !14

40:                                               ; preds = %51
  ret void

41:                                               ; preds = %3, %51
  %indvars.iv101 = phi i64 [ 1, %3 ], [ %indvars.iv.next102, %51 ]
  %indvars106 = trunc i64 %indvars.iv101 to i32
  %42 = tail call ptr @roaring_bitmap_create() #7
  %43 = ptrtoint ptr %42 to i64
  tail call void @_assert_true(i64 noundef %43, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.2, i32 noundef 1316) #7
  %44 = shl nuw nsw i32 %indvars106, 1
  br label %45

45:                                               ; preds = %41, %.loopexit
  %indvars.iv98 = phi i32 [ %indvars106, %41 ], [ %indvars.iv.next99, %.loopexit ]
  %.07192 = phi i32 [ 0, %41 ], [ %49, %.loopexit ]
  %46 = urem i32 %.07192, %44
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %45, %.preheader
  %.07091 = phi i32 [ %48, %.preheader ], [ %.07192, %45 ]
  tail call void @roaring_bitmap_add(ptr noundef %42, i32 noundef %.07091) #7
  %48 = add nuw nsw i32 %.07091, 1
  %exitcond100.not = icmp eq i32 %48, %indvars.iv98
  br i1 %exitcond100.not, label %.loopexit, label %.preheader, !llvm.loop !15

.loopexit:                                        ; preds = %.preheader, %45
  %49 = add nuw nsw i32 %.07192, %indvars106
  %50 = icmp ult i32 %49, 130000
  %indvars.iv.next99 = add nuw nsw i32 %indvars.iv98, %indvars106
  br i1 %50, label %45, label %.preheader78, !llvm.loop !16

51:                                               ; preds = %.preheader78
  tail call void @roaring_bitmap_free(ptr noundef %42) #7
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next102, 65
  br i1 %exitcond107.not, label %40, label %41, !llvm.loop !17

.preheader78:                                     ; preds = %.loopexit, %.preheader78
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.preheader78 ], [ 0, %.loopexit ]
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, %indvars.iv101
  %52 = tail call zeroext i1 @roaring_bitmap_contains_range(ptr noundef %42, i64 noundef %indvars.iv103, i64 noundef %indvars.iv.next104) #7
  %53 = trunc nuw nsw i64 %indvars.iv103 to i32
  %54 = urem i32 %53, %44
  %55 = icmp ne i32 %54, 0
  %spec.select = xor i1 %52, %55
  %56 = zext i1 %spec.select to i64
  tail call void @_assert_true(i64 noundef %56, ptr noundef nonnull @.str.92, ptr noundef nonnull @.str.2, i32 noundef 1325) #7
  %57 = icmp ult i64 %indvars.iv.next104, 130000
  br i1 %57, label %.preheader78, label %51, !llvm.loop !18
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 "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 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 #6 = { nounwind allocsize(0) }
attributes #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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