; 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.75 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [59 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 ptr @roaring_bitmap_from_range(i64 noundef, i64 noundef, i32 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 void @_assert_true(i64 noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare i64 @roaring_bitmap_get_cardinality(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @check_bitmap_from_range(i32 noundef, i64 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @test_bitmap_from_range() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = call ptr @roaring_bitmap_from_range(i64 noundef 1, i64 noundef 10, i32 noundef 0)
  %11 = icmp eq ptr %10, null
  %12 = zext i1 %11 to i32
  %13 = sext i32 %12 to i64
  call void @_assert_true(i64 noundef %13, ptr noundef @.str.75, ptr noundef @.str.2, i32 noundef 873)
  %14 = call ptr @roaring_bitmap_from_range(i64 noundef 5, i64 noundef 1, i32 noundef 3)
  %15 = icmp eq ptr %14, null
  %16 = zext i1 %15 to i32
  %17 = sext i32 %16 to i64
  call void @_assert_true(i64 noundef %17, ptr noundef @.str.76, ptr noundef @.str.2, i32 noundef 874)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 16, ptr %1, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %82, %0
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp ult i32 %19, 262144
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = sub i32 %23, 10
  store i32 %24, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 16, ptr %4, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %78, %22
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp ult i32 %26, 262144
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 5, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %81

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = add i32 %30, %31
  store i32 %32, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %44, %29
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = icmp ule i32 %34, 64
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %33
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = zext i32 %39 to i64
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = call zeroext i1 @check_bitmap_from_range(i32 noundef %38, i64 noundef %40, i32 noundef %41)
  %43 = zext i1 %42 to i64
  call void @_assert_true(i64 noundef %43, ptr noundef @.str.77, ptr noundef @.str.2, i32 noundef 881)
  br label %44

44:                                               ; preds = %37
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = mul i32 %45, 2
  store i32 %46, ptr %6, align 4, !tbaa !5
  br label %33, !llvm.loop !9

47:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %59, %47
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = icmp ule i32 %49, 81
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 11, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %62

52:                                               ; preds = %48
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = zext i32 %54 to i64
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = call zeroext i1 @check_bitmap_from_range(i32 noundef %53, i64 noundef %55, i32 noundef %56)
  %58 = zext i1 %57 to i64
  call void @_assert_true(i64 noundef %58, ptr noundef @.str.77, ptr noundef @.str.2, i32 noundef 885)
  br label %59

59:                                               ; preds = %52
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = mul i32 %60, 3
  store i32 %61, ptr %7, align 4, !tbaa !5
  br label %48, !llvm.loop !11

62:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %74, %62
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = icmp ule i32 %64, 125
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  store i32 14, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %77

67:                                               ; preds = %63
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = zext i32 %69 to i64
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = call zeroext i1 @check_bitmap_from_range(i32 noundef %68, i64 noundef %70, i32 noundef %71)
  %73 = zext i1 %72 to i64
  call void @_assert_true(i64 noundef %73, ptr noundef @.str.77, ptr noundef @.str.2, i32 noundef 889)
  br label %74

74:                                               ; preds = %67
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = mul i32 %75, 5
  store i32 %76, ptr %8, align 4, !tbaa !5
  br label %63, !llvm.loop !12

77:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = mul i32 %79, 2
  store i32 %80, ptr %4, align 4, !tbaa !5
  br label %25, !llvm.loop !13

81:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %1, align 4, !tbaa !5
  %84 = mul i32 %83, 2
  store i32 %84, ptr %1, align 4, !tbaa !5
  br label %18, !llvm.loop !14

85:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %86 = call ptr @roaring_bitmap_from_range(i64 noundef 0, i64 noundef -1, i32 noundef 1)
  store ptr %86, ptr %9, align 8, !tbaa !15
  %87 = load ptr, ptr %9, align 8, !tbaa !15
  %88 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %87)
  %89 = icmp eq i64 %88, 4294967296
  %90 = zext i1 %89 to i32
  %91 = sext i32 %90 to i64
  call void @_assert_true(i64 noundef %91, ptr noundef @.str.78, ptr noundef @.str.2, i32 noundef 896)
  %92 = load ptr, ptr %9, align 8, !tbaa !15
  call void @roaring_bitmap_free(ptr noundef %92)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !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.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [59 x i8], align 1

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

declare void @roaring_bitmap_free(ptr noundef) local_unnamed_addr #0

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

declare i64 @roaring_bitmap_get_cardinality(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @check_bitmap_from_range(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @test_bitmap_from_range() local_unnamed_addr #1 {
  %1 = tail call ptr @roaring_bitmap_from_range(i64 noundef 1, i64 noundef 10, i32 noundef 0) #2
  %2 = icmp eq ptr %1, null
  %3 = zext i1 %2 to i64
  tail call void @_assert_true(i64 noundef %3, ptr noundef nonnull @.str.75, ptr noundef nonnull @.str.2, i32 noundef 873) #2
  %4 = tail call ptr @roaring_bitmap_from_range(i64 noundef 5, i64 noundef 1, i32 noundef 3) #2
  %5 = icmp eq ptr %4, null
  %6 = zext i1 %5 to i64
  tail call void @_assert_true(i64 noundef %6, ptr noundef nonnull @.str.76, ptr noundef nonnull @.str.2, i32 noundef 874) #2
  br label %12

7:                                                ; preds = %14
  %8 = tail call ptr @roaring_bitmap_from_range(i64 noundef 0, i64 noundef -1, i32 noundef 1) #2
  %9 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %8) #2
  %10 = icmp eq i64 %9, 4294967296
  %11 = zext i1 %10 to i64
  tail call void @_assert_true(i64 noundef %11, ptr noundef nonnull @.str.78, ptr noundef nonnull @.str.2, i32 noundef 896) #2
  tail call void @roaring_bitmap_free(ptr noundef %8) #2
  ret void

12:                                               ; preds = %0, %14
  %.032 = phi i32 [ 16, %0 ], [ %15, %14 ]
  %13 = add nsw i32 %.032, -10
  br label %.preheader27

14:                                               ; preds = %.preheader27
  %15 = shl nuw nsw i32 %.032, 1
  %16 = icmp ult i32 %.032, 131072
  br i1 %16, label %12, label %7, !llvm.loop !5

.preheader27:                                     ; preds = %12, %.preheader27
  %.02631 = phi i32 [ 16, %12 ], [ %51, %.preheader27 ]
  %17 = add nuw nsw i32 %.02631, %.032
  %18 = zext nneg i32 %17 to i64
  %19 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 1)
  %20 = zext i1 %19 to i64
  tail call void @_assert_true(i64 noundef %20, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 881) #2
  %21 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 2)
  %22 = zext i1 %21 to i64
  tail call void @_assert_true(i64 noundef %22, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 881) #2
  %23 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 4)
  %24 = zext i1 %23 to i64
  tail call void @_assert_true(i64 noundef %24, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 881) #2
  %25 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 8)
  %26 = zext i1 %25 to i64
  tail call void @_assert_true(i64 noundef %26, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 881) #2
  %27 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 16)
  %28 = zext i1 %27 to i64
  tail call void @_assert_true(i64 noundef %28, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 881) #2
  %29 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 32)
  %30 = zext i1 %29 to i64
  tail call void @_assert_true(i64 noundef %30, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 881) #2
  %31 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 64)
  %32 = zext i1 %31 to i64
  tail call void @_assert_true(i64 noundef %32, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 881) #2
  %33 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 1)
  %34 = zext i1 %33 to i64
  tail call void @_assert_true(i64 noundef %34, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 885) #2
  %35 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 3)
  %36 = zext i1 %35 to i64
  tail call void @_assert_true(i64 noundef %36, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 885) #2
  %37 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 9)
  %38 = zext i1 %37 to i64
  tail call void @_assert_true(i64 noundef %38, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 885) #2
  %39 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 27)
  %40 = zext i1 %39 to i64
  tail call void @_assert_true(i64 noundef %40, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 885) #2
  %41 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 81)
  %42 = zext i1 %41 to i64
  tail call void @_assert_true(i64 noundef %42, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 885) #2
  %43 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 1)
  %44 = zext i1 %43 to i64
  tail call void @_assert_true(i64 noundef %44, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 889) #2
  %45 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 5)
  %46 = zext i1 %45 to i64
  tail call void @_assert_true(i64 noundef %46, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 889) #2
  %47 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 25)
  %48 = zext i1 %47 to i64
  tail call void @_assert_true(i64 noundef %48, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 889) #2
  %49 = tail call zeroext i1 @check_bitmap_from_range(i32 noundef %13, i64 noundef %18, i32 noundef 125)
  %50 = zext i1 %49 to i64
  tail call void @_assert_true(i64 noundef %50, ptr noundef nonnull @.str.77, ptr noundef nonnull @.str.2, i32 noundef 889) #2
  %51 = shl nuw nsw i32 %.02631, 1
  %52 = icmp ult i32 %.02631, 131072
  br i1 %52, label %.preheader27, label %14, !llvm.loop !7
}

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


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass