; 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.96 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.97 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.99 = external hidden unnamed_addr constant [9 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

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

declare i64 @roaring_bitmap_get_cardinality(ptr noundef) #1

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

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

declare ptr @roaring_bitmap_xor(ptr noundef, ptr noundef) #1

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

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

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

26:                                               ; preds = %45, %1
  %27 = load i32, ptr %5, align 4, !tbaa !13
  %28 = icmp ult i32 %27, 300
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %48

30:                                               ; preds = %26
  %31 = load i32, ptr %5, align 4, !tbaa !13
  %32 = urem i32 %31, 2
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %37

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

37:                                               ; preds = %34, %30
  %38 = load i32, ptr %5, align 4, !tbaa !13
  %39 = urem i32 %38, 3
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %37
  %42 = load ptr, ptr %4, align 8, !tbaa !9
  %43 = load i32, ptr %5, align 4, !tbaa !13
  call void @roaring_bitmap_add(ptr noundef %42, i32 noundef %43)
  br label %44

44:                                               ; preds = %41, %37
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %5, align 4, !tbaa !13
  %47 = add i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !13
  br label %26, !llvm.loop !15

48:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %49 = load ptr, ptr %3, align 8, !tbaa !9
  %50 = load ptr, ptr %4, align 8, !tbaa !9
  %51 = call ptr @roaring_bitmap_xor(ptr noundef %49, ptr noundef %50)
  store ptr %51, ptr %6, align 8, !tbaa !9
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  %53 = load i8, ptr %2, align 1, !tbaa !5, !range !11, !noundef !12
  %54 = trunc i8 %53 to i1
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %52, i1 noundef zeroext %54)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %55

55:                                               ; preds = %90, %48
  %56 = load i32, ptr %8, align 4, !tbaa !13
  %57 = icmp slt i32 %56, 300
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %93

59:                                               ; preds = %55
  %60 = load i32, ptr %8, align 4, !tbaa !13
  %61 = srem i32 %60, 2
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %67, label %63

63:                                               ; preds = %59
  %64 = load i32, ptr %8, align 4, !tbaa !13
  %65 = srem i32 %64, 3
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %81

67:                                               ; preds = %63, %59
  %68 = load i32, ptr %8, align 4, !tbaa !13
  %69 = srem i32 %68, 6
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %81

71:                                               ; preds = %67
  %72 = load i32, ptr %7, align 4, !tbaa !13
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %7, align 4, !tbaa !13
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = load i32, ptr %8, align 4, !tbaa !13
  %76 = call zeroext i1 @roaring_bitmap_contains(ptr noundef %74, i32 noundef %75)
  br i1 %76, label %80, label %77

77:                                               ; preds = %71
  %78 = load i32, ptr %8, align 4, !tbaa !13
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.96, i32 noundef %78)
  br label %80

80:                                               ; preds = %77, %71
  br label %89

81:                                               ; preds = %67, %63
  %82 = load ptr, ptr %6, align 8, !tbaa !9
  %83 = load i32, ptr %8, align 4, !tbaa !13
  %84 = call zeroext i1 @roaring_bitmap_contains(ptr noundef %82, i32 noundef %83)
  br i1 %84, label %85, label %88

85:                                               ; preds = %81
  %86 = load i32, ptr %8, align 4, !tbaa !13
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.97, i32 noundef %86)
  br label %88

88:                                               ; preds = %85, %81
  br label %89

89:                                               ; preds = %88, %80
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %8, align 4, !tbaa !13
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %8, align 4, !tbaa !13
  br label %55, !llvm.loop !17

93:                                               ; preds = %58
  %94 = load ptr, ptr %6, align 8, !tbaa !9
  %95 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %94)
  %96 = load i32, ptr %7, align 4, !tbaa !13
  %97 = sext i32 %96 to i64
  call void @_assert_int_equal(i64 noundef %95, i64 noundef %97, ptr noundef @.str.2, i32 noundef 1578)
  %98 = load ptr, ptr %6, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %98)
  %99 = load ptr, ptr %4, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %99)
  %100 = load ptr, ptr %3, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %100)
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #4
  %101 = call ptr @gen_bitmap(double noundef 0.000000e+00, double noundef 0x3EB0C6F7A0B5ED8D, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1000000)
  store ptr %101, ptr %9, align 8, !tbaa !9
  %102 = getelementptr inbounds ptr, ptr %9, i64 1
  %103 = call ptr @gen_bitmap(double noundef 1.000000e+00, double noundef 0xBEB0C6F7A0B5ED8D, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1000000)
  store ptr %103, ptr %102, align 8, !tbaa !9
  %104 = getelementptr inbounds ptr, ptr %9, i64 2
  %105 = call ptr @gen_bitmap(double noundef 1.000000e-05, double noundef 0.000000e+00, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 2000000)
  store ptr %105, ptr %104, align 8, !tbaa !9
  %106 = getelementptr inbounds ptr, ptr %9, i64 3
  %107 = call ptr @gen_bitmap(double noundef 1.000000e-05, double noundef 0.000000e+00, i32 noundef 3, i32 noundef 0, i32 noundef 0, i32 noundef 2000000)
  store ptr %107, ptr %106, align 8, !tbaa !9
  %108 = getelementptr inbounds ptr, ptr %9, i64 4
  %109 = call ptr @gen_bitmap(double noundef 1.000000e-01, double noundef 0.000000e+00, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 2000000)
  store ptr %109, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds ptr, ptr %9, i64 5
  %111 = call ptr @gen_bitmap(double noundef 1.000000e-03, double noundef 0x3E7AD7F29ABCAF48, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1000000)
  store ptr %111, ptr %110, align 8, !tbaa !9
  %112 = getelementptr inbounds ptr, ptr %9, i64 6
  %113 = call ptr @gen_bitmap(double noundef 0.000000e+00, double noundef 1.000000e-10, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1000000)
  store ptr %113, ptr %112, align 8, !tbaa !9
  %114 = getelementptr inbounds ptr, ptr %9, i64 7
  %115 = call ptr @gen_bitmap(double noundef 5.000000e-01, double noundef 0xBEB0C6F7A0B5ED8D, i32 noundef 1, i32 noundef 600000, i32 noundef 800000, i32 noundef 1000000)
  store ptr %115, ptr %114, align 8, !tbaa !9
  %116 = getelementptr inbounds ptr, ptr %9, i64 8
  %117 = call ptr @gen_bitmap(double noundef 1.000000e+00, double noundef 0xBEB0C6F7A0B5ED8D, i32 noundef 1, i32 noundef 300000, i32 noundef 500000, i32 noundef 1000000)
  store ptr %117, ptr %116, align 8, !tbaa !9
  %118 = getelementptr inbounds ptr, ptr %9, i64 9
  store ptr null, ptr %118, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !13
  br label %119

119:                                              ; preds = %181, %93
  %120 = load i32, ptr %10, align 4, !tbaa !13
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %121
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = icmp ne ptr %123, null
  br i1 %124, label %126, label %125

125:                                              ; preds = %119
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %184

126:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %127 = load i32, ptr %10, align 4, !tbaa !13
  store i32 %127, ptr %12, align 4, !tbaa !13
  br label %128

128:                                              ; preds = %177, %126
  %129 = load i32, ptr %12, align 4, !tbaa !13
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %130
  %132 = load ptr, ptr %131, align 8, !tbaa !9
  %133 = icmp ne ptr %132, null
  br i1 %133, label %135, label %134

134:                                              ; preds = %128
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %180

135:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %136 = load i32, ptr %10, align 4, !tbaa !13
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !9
  %140 = load i32, ptr %12, align 4, !tbaa !13
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %141
  %143 = load ptr, ptr %142, align 8, !tbaa !9
  %144 = call ptr @synthesized_xor(ptr noundef %139, ptr noundef %143)
  store ptr %144, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %145 = load i32, ptr %10, align 4, !tbaa !13
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = load i32, ptr %12, align 4, !tbaa !13
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %150
  %152 = load ptr, ptr %151, align 8, !tbaa !9
  %153 = call ptr @roaring_bitmap_xor(ptr noundef %148, ptr noundef %152)
  store ptr %153, ptr %14, align 8, !tbaa !9
  %154 = load ptr, ptr %14, align 8, !tbaa !9
  %155 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %154)
  %156 = load i32, ptr %10, align 4, !tbaa !13
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %157
  %159 = load ptr, ptr %158, align 8, !tbaa !9
  %160 = load i32, ptr %12, align 4, !tbaa !13
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = call i64 @roaring_bitmap_xor_cardinality(ptr noundef %159, ptr noundef %163)
  %165 = icmp eq i64 %155, %164
  %166 = zext i1 %165 to i32
  %167 = sext i32 %166 to i64
  call void @_assert_true(i64 noundef %167, ptr noundef @.str.98, ptr noundef @.str.2, i32 noundef 1613)
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  %168 = load ptr, ptr %13, align 8, !tbaa !9
  %169 = load ptr, ptr %14, align 8, !tbaa !9
  %170 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %168, ptr noundef %169)
  %171 = zext i1 %170 to i8
  store i8 %171, ptr %15, align 1, !tbaa !5
  %172 = load i8, ptr %15, align 1, !tbaa !5, !range !11, !noundef !12
  %173 = trunc i8 %172 to i1
  %174 = zext i1 %173 to i64
  call void @_assert_true(i64 noundef %174, ptr noundef @.str.99, ptr noundef @.str.2, i32 noundef 1617)
  %175 = load ptr, ptr %13, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %175)
  %176 = load ptr, ptr %14, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %176)
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %177

177:                                              ; preds = %135
  %178 = load i32, ptr %12, align 4, !tbaa !13
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %12, align 4, !tbaa !13
  br label %128, !llvm.loop !18

180:                                              ; preds = %134
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %10, align 4, !tbaa !13
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %10, align 4, !tbaa !13
  br label %119, !llvm.loop !19

184:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !13
  br label %185

185:                                              ; preds = %197, %184
  %186 = load i32, ptr %16, align 4, !tbaa !13
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %187
  %189 = load ptr, ptr %188, align 8, !tbaa !9
  %190 = icmp ne ptr %189, null
  br i1 %190, label %192, label %191

191:                                              ; preds = %185
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %200

192:                                              ; preds = %185
  %193 = load i32, ptr %16, align 4, !tbaa !13
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %194
  %196 = load ptr, ptr %195, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %196)
  br label %197

197:                                              ; preds = %192
  %198 = load i32, ptr %16, align 4, !tbaa !13
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %16, align 4, !tbaa !13
  br label %185, !llvm.loop !20

200:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden ptr @gen_bitmap(double noundef, double noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @synthesized_xor(ptr noundef, ptr noundef) #3

declare i64 @roaring_bitmap_xor_cardinality(ptr noundef, ptr 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 = { 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 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 #4 = { 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 = !{!"_Bool", !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 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


; 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.96 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.97 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.99 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

declare void @roaring_bitmap_free(ptr noundef) local_unnamed_addr #2

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

declare ptr @roaring_bitmap_create() local_unnamed_addr #2

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

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

declare i64 @roaring_bitmap_get_cardinality(ptr noundef) local_unnamed_addr #2

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

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

declare ptr @roaring_bitmap_xor(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @test_xor(i1 noundef zeroext %0) local_unnamed_addr #4 {
  %2 = alloca [10 x ptr], align 16
  %3 = tail call ptr @roaring_bitmap_create() #5
  tail call void @roaring_bitmap_set_copy_on_write(ptr noundef %3, i1 noundef zeroext %0)
  %4 = tail call ptr @roaring_bitmap_create() #5
  tail call void @roaring_bitmap_set_copy_on_write(ptr noundef %4, i1 noundef zeroext %0)
  br label %7

5:                                                ; preds = %15
  %6 = tail call ptr @roaring_bitmap_xor(ptr noundef %3, ptr noundef %4) #5
  tail call void @roaring_bitmap_set_copy_on_write(ptr noundef %6, i1 noundef zeroext %0)
  br label %38

7:                                                ; preds = %1, %15
  %.05272 = phi i32 [ 0, %1 ], [ %16, %15 ]
  %8 = and i32 %.05272, 1
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %7
  tail call void @roaring_bitmap_add(ptr noundef %3, i32 noundef %.05272) #5
  br label %11

11:                                               ; preds = %10, %7
  %.lhs.trunc = trunc nuw i32 %.05272 to i16
  %12 = urem i16 %.lhs.trunc, 3
  %13 = icmp eq i16 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %11
  tail call void @roaring_bitmap_add(ptr noundef %4, i32 noundef %.05272) #5
  br label %15

15:                                               ; preds = %11, %14
  %16 = add nuw nsw i32 %.05272, 1
  %exitcond.not = icmp eq i32 %16, 300
  br i1 %exitcond.not, label %5, label %7, !llvm.loop !5

17:                                               ; preds = %50
  %18 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %6) #5
  %19 = sext i32 %.1 to i64
  tail call void @_assert_int_equal(i64 noundef %18, i64 noundef %19, ptr noundef nonnull @.str.2, i32 noundef 1578) #5
  tail call void @roaring_bitmap_free(ptr noundef %6) #5
  tail call void @roaring_bitmap_free(ptr noundef %4) #5
  tail call void @roaring_bitmap_free(ptr noundef %3) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #5
  %20 = tail call ptr @gen_bitmap(double noundef 0.000000e+00, double noundef 0x3EB0C6F7A0B5ED8D, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1000000)
  store ptr %20, ptr %2, align 16, !tbaa !7
  %21 = getelementptr inbounds i8, ptr %2, i64 8
  %22 = tail call ptr @gen_bitmap(double noundef 1.000000e+00, double noundef 0xBEB0C6F7A0B5ED8D, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1000000)
  store ptr %22, ptr %21, align 8, !tbaa !7
  %23 = getelementptr inbounds i8, ptr %2, i64 16
  %24 = tail call ptr @gen_bitmap(double noundef 1.000000e-05, double noundef 0.000000e+00, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 2000000)
  store ptr %24, ptr %23, align 16, !tbaa !7
  %25 = getelementptr inbounds i8, ptr %2, i64 24
  %26 = tail call ptr @gen_bitmap(double noundef 1.000000e-05, double noundef 0.000000e+00, i32 noundef 3, i32 noundef 0, i32 noundef 0, i32 noundef 2000000)
  store ptr %26, ptr %25, align 8, !tbaa !7
  %27 = getelementptr inbounds i8, ptr %2, i64 32
  %28 = tail call ptr @gen_bitmap(double noundef 1.000000e-01, double noundef 0.000000e+00, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 2000000)
  store ptr %28, ptr %27, align 16, !tbaa !7
  %29 = getelementptr inbounds i8, ptr %2, i64 40
  %30 = tail call ptr @gen_bitmap(double noundef 1.000000e-03, double noundef 0x3E7AD7F29ABCAF48, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1000000)
  store ptr %30, ptr %29, align 8, !tbaa !7
  %31 = getelementptr inbounds i8, ptr %2, i64 48
  %32 = tail call ptr @gen_bitmap(double noundef 0.000000e+00, double noundef 1.000000e-10, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1000000)
  store ptr %32, ptr %31, align 16, !tbaa !7
  %33 = getelementptr inbounds i8, ptr %2, i64 56
  %34 = tail call ptr @gen_bitmap(double noundef 5.000000e-01, double noundef 0xBEB0C6F7A0B5ED8D, i32 noundef 1, i32 noundef 600000, i32 noundef 800000, i32 noundef 1000000)
  store ptr %34, ptr %33, align 8, !tbaa !7
  %35 = getelementptr inbounds i8, ptr %2, i64 64
  %36 = tail call ptr @gen_bitmap(double noundef 1.000000e+00, double noundef 0xBEB0C6F7A0B5ED8D, i32 noundef 1, i32 noundef 300000, i32 noundef 500000, i32 noundef 1000000)
  store ptr %36, ptr %35, align 16, !tbaa !7
  %37 = getelementptr inbounds i8, ptr %2, i64 72
  store ptr null, ptr %37, align 8, !tbaa !7
  %.not77 = icmp eq ptr %20, null
  br i1 %.not77, label %._crit_edge82, label %.lr.ph.preheader

38:                                               ; preds = %5, %50
  %.05374 = phi i32 [ 0, %5 ], [ %.1, %50 ]
  %.05473 = phi i32 [ 0, %5 ], [ %51, %50 ]
  %39 = and i32 %.05473, 1
  %40 = icmp ne i32 %39, 0
  %.lhs.trunc64 = trunc nuw i32 %.05473 to i16
  %41 = urem i16 %.lhs.trunc64, 3
  %42 = icmp ne i16 %41, 0
  %or.cond.not70 = and i1 %40, %42
  %43 = urem i16 %.lhs.trunc64, 6
  %.not61 = icmp eq i16 %43, 0
  %or.cond63 = or i1 %.not61, %or.cond.not70
  br i1 %or.cond63, label %47, label %44

44:                                               ; preds = %38
  %45 = add nsw i32 %.05374, 1
  %46 = tail call zeroext i1 @roaring_bitmap_contains(ptr noundef %6, i32 noundef %.05473)
  br i1 %46, label %50, label %.sink.split

47:                                               ; preds = %38
  %48 = tail call zeroext i1 @roaring_bitmap_contains(ptr noundef %6, i32 noundef %.05473)
  br i1 %48, label %.sink.split, label %50

.sink.split:                                      ; preds = %47, %44
  %.str.96.sink = phi ptr [ @.str.96, %44 ], [ @.str.97, %47 ]
  %.1.ph = phi i32 [ %45, %44 ], [ %.05374, %47 ]
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.96.sink, i32 noundef %.05473)
  br label %50

50:                                               ; preds = %.sink.split, %44, %47
  %.1 = phi i32 [ %45, %44 ], [ %.05374, %47 ], [ %.1.ph, %.sink.split ]
  %51 = add nuw nsw i32 %.05473, 1
  %exitcond83.not = icmp eq i32 %51, 300
  br i1 %exitcond83.not, label %17, label %38, !llvm.loop !11

.lr.ph.preheader:                                 ; preds = %17, %._crit_edge
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge ], [ 0, %17 ]
  %52 = phi ptr [ %54, %._crit_edge ], [ %20, %17 ]
  br label %.lr.ph

.preheader:                                       ; preds = %._crit_edge
  br i1 %.not77, label %._crit_edge82, label %.lr.ph81

._crit_edge:                                      ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = getelementptr inbounds [10 x ptr], ptr %2, i64 0, i64 %indvars.iv.next
  %54 = load ptr, ptr %53, align 8, !tbaa !7
  %.not = icmp eq ptr %54, null
  br i1 %.not, label %.preheader, label %.lr.ph.preheader, !llvm.loop !12

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv84 = phi i64 [ %indvars.iv, %.lr.ph.preheader ], [ %indvars.iv.next85, %.lr.ph ]
  %55 = phi ptr [ %52, %.lr.ph.preheader ], [ %65, %.lr.ph ]
  %56 = tail call ptr @synthesized_xor(ptr noundef nonnull %52, ptr noundef nonnull %55)
  %57 = tail call ptr @roaring_bitmap_xor(ptr noundef nonnull %52, ptr noundef nonnull %55) #5
  %58 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %57) #5
  %59 = tail call i64 @roaring_bitmap_xor_cardinality(ptr noundef nonnull %52, ptr noundef nonnull %55) #5
  %60 = icmp eq i64 %58, %59
  %61 = zext i1 %60 to i64
  tail call void @_assert_true(i64 noundef %61, ptr noundef nonnull @.str.98, ptr noundef nonnull @.str.2, i32 noundef 1613) #5
  %62 = tail call zeroext i1 @roaring_bitmap_equals(ptr noundef %56, ptr noundef %57) #5
  %63 = zext i1 %62 to i64
  tail call void @_assert_true(i64 noundef %63, ptr noundef nonnull @.str.99, ptr noundef nonnull @.str.2, i32 noundef 1617) #5
  tail call void @roaring_bitmap_free(ptr noundef %56) #5
  tail call void @roaring_bitmap_free(ptr noundef %57) #5
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %64 = getelementptr inbounds [10 x ptr], ptr %2, i64 0, i64 %indvars.iv.next85
  %65 = load ptr, ptr %64, align 8, !tbaa !7
  %.not60 = icmp eq ptr %65, null
  br i1 %.not60, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge82:                                    ; preds = %.lr.ph81, %17, %.preheader
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #5
  ret void

.lr.ph81:                                         ; preds = %.preheader, %.lr.ph81
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph81 ], [ 0, %.preheader ]
  %66 = phi ptr [ %68, %.lr.ph81 ], [ %20, %.preheader ]
  tail call void @roaring_bitmap_free(ptr noundef nonnull %66) #5
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %67 = getelementptr inbounds [10 x ptr], ptr %2, i64 0, i64 %indvars.iv.next89
  %68 = load ptr, ptr %67, align 8, !tbaa !7
  %.not59 = icmp eq ptr %68, null
  br i1 %.not59, label %._crit_edge82, label %.lr.ph81, !llvm.loop !14
}

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

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

declare i64 @roaring_bitmap_xor_cardinality(ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #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 }

!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 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass