; 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.99 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [50 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 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
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

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

; Function Attrs: nounwind uwtable
define dso_local void @test_xor_lazy(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_lazy_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
  call void @roaring_bitmap_repair_after_lazy(ptr noundef %52)
  %53 = load ptr, ptr %6, align 8, !tbaa !9
  %54 = load i8, ptr %2, align 1, !tbaa !5, !range !11, !noundef !12
  %55 = trunc i8 %54 to i1
  call void @roaring_bitmap_set_copy_on_write(ptr noundef %53, i1 noundef zeroext %55)
  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 %56

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

59:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %94

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

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

68:                                               ; preds = %64, %60
  %69 = load i32, ptr %8, align 4, !tbaa !13
  %70 = srem i32 %69, 6
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %82

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

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

81:                                               ; preds = %78, %72
  br label %90

82:                                               ; preds = %68, %64
  %83 = load ptr, ptr %6, align 8, !tbaa !9
  %84 = load i32, ptr %8, align 4, !tbaa !13
  %85 = call zeroext i1 @roaring_bitmap_contains(ptr noundef %83, i32 noundef %84)
  br i1 %85, label %86, label %89

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

89:                                               ; preds = %86, %82
  br label %90

90:                                               ; preds = %89, %81
  br label %91

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

94:                                               ; preds = %59
  %95 = load ptr, ptr %6, align 8, !tbaa !9
  %96 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %95)
  %97 = load i32, ptr %7, align 4, !tbaa !13
  %98 = sext i32 %97 to i64
  call void @_assert_int_equal(i64 noundef %96, i64 noundef %98, ptr noundef @.str.2, i32 noundef 1724)
  %99 = load ptr, ptr %6, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %99)
  %100 = load ptr, ptr %4, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %100)
  %101 = load ptr, ptr %3, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %101)
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #4
  %102 = 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 %102, ptr %9, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %9, i64 1
  %104 = 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 %104, ptr %103, align 8, !tbaa !9
  %105 = getelementptr inbounds ptr, ptr %9, i64 2
  %106 = 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 %106, ptr %105, align 8, !tbaa !9
  %107 = getelementptr inbounds ptr, ptr %9, i64 3
  %108 = 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 %108, ptr %107, align 8, !tbaa !9
  %109 = getelementptr inbounds ptr, ptr %9, i64 4
  %110 = 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 %110, ptr %109, align 8, !tbaa !9
  %111 = getelementptr inbounds ptr, ptr %9, i64 5
  %112 = 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 %112, ptr %111, align 8, !tbaa !9
  %113 = getelementptr inbounds ptr, ptr %9, i64 6
  %114 = 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 %114, ptr %113, align 8, !tbaa !9
  %115 = getelementptr inbounds ptr, ptr %9, i64 7
  %116 = 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 %116, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds ptr, ptr %9, i64 8
  %118 = 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 %118, ptr %117, align 8, !tbaa !9
  %119 = getelementptr inbounds ptr, ptr %9, i64 9
  store ptr null, ptr %119, 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 %120

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

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

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

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

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

136:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %137 = load i32, ptr %10, align 4, !tbaa !13
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %138
  %140 = load ptr, ptr %139, align 8, !tbaa !9
  %141 = load i32, ptr %12, align 4, !tbaa !13
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = call ptr @synthesized_xor(ptr noundef %140, ptr noundef %144)
  store ptr %145, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %146 = load i32, ptr %10, align 4, !tbaa !13
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !9
  %150 = load i32, ptr %12, align 4, !tbaa !13
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %151
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = call ptr @roaring_bitmap_lazy_xor(ptr noundef %149, ptr noundef %153)
  store ptr %154, ptr %14, align 8, !tbaa !9
  %155 = load ptr, ptr %14, align 8, !tbaa !9
  call void @roaring_bitmap_repair_after_lazy(ptr noundef %155)
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  %156 = load ptr, ptr %13, align 8, !tbaa !9
  %157 = load ptr, ptr %14, align 8, !tbaa !9
  %158 = call zeroext i1 @roaring_bitmap_equals(ptr noundef %156, ptr noundef %157)
  %159 = zext i1 %158 to i8
  store i8 %159, ptr %15, align 1, !tbaa !5
  %160 = load i8, ptr %15, align 1, !tbaa !5, !range !11, !noundef !12
  %161 = trunc i8 %160 to i1
  br i1 %161, label %175, label %162

162:                                              ; preds = %136
  %163 = load i32, ptr %10, align 4, !tbaa !13
  %164 = load i32, ptr %12, align 4, !tbaa !13
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.100, i32 noundef %163, i32 noundef %164)
  %166 = load ptr, ptr %14, align 8, !tbaa !9
  %167 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %166)
  %168 = trunc i64 %167 to i32
  %169 = load ptr, ptr %13, align 8, !tbaa !9
  %170 = call i64 @roaring_bitmap_get_cardinality(ptr noundef %169)
  %171 = trunc i64 %170 to i32
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str.102, i32 noundef %168, i32 noundef %171)
  %173 = load ptr, ptr %14, align 8, !tbaa !9
  %174 = load ptr, ptr %13, align 8, !tbaa !9
  call void @show_difference(ptr noundef %173, ptr noundef %174)
  br label %175

175:                                              ; preds = %162, %136
  %176 = load i8, ptr %15, align 1, !tbaa !5, !range !11, !noundef !12
  %177 = trunc i8 %176 to i1
  %178 = zext i1 %177 to i64
  call void @_assert_true(i64 noundef %178, ptr noundef @.str.99, ptr noundef @.str.2, i32 noundef 1769)
  %179 = load ptr, ptr %13, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %179)
  %180 = load ptr, ptr %14, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %180)
  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 %181

181:                                              ; preds = %175
  %182 = load i32, ptr %12, align 4, !tbaa !13
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %12, align 4, !tbaa !13
  br label %129, !llvm.loop !18

184:                                              ; preds = %135
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %10, align 4, !tbaa !13
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %10, align 4, !tbaa !13
  br label %120, !llvm.loop !19

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

189:                                              ; preds = %201, %188
  %190 = load i32, ptr %16, align 4, !tbaa !13
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %191
  %193 = load ptr, ptr %192, align 8, !tbaa !9
  %194 = icmp ne ptr %193, null
  br i1 %194, label %196, label %195

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

196:                                              ; preds = %189
  %197 = load i32, ptr %16, align 4, !tbaa !13
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %198
  %200 = load ptr, ptr %199, align 8, !tbaa !9
  call void @roaring_bitmap_free(ptr noundef %200)
  br label %201

201:                                              ; preds = %196
  %202 = load i32, ptr %16, align 4, !tbaa !13
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %16, align 4, !tbaa !13
  br label %189, !llvm.loop !20

204:                                              ; preds = %195
  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
}

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

declare void @roaring_bitmap_repair_after_lazy(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.99 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [50 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 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
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

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

; Function Attrs: nounwind uwtable
define dso_local void @test_xor_lazy(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_lazy_xor(ptr noundef %3, ptr noundef %4) #5
  tail call void @roaring_bitmap_repair_after_lazy(ptr noundef %6) #5
  tail call void @roaring_bitmap_set_copy_on_write(ptr noundef %6, i1 noundef zeroext %0)
  br label %38

7:                                                ; preds = %1, %15
  %.05878 = phi i32 [ 0, %1 ], [ %16, %15 ]
  %8 = and i32 %.05878, 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 %.05878) #5
  br label %11

11:                                               ; preds = %10, %7
  %.lhs.trunc = trunc nuw i32 %.05878 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 %.05878) #5
  br label %15

15:                                               ; preds = %11, %14
  %16 = add nuw nsw i32 %.05878, 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 1724) #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
  %.not83 = icmp eq ptr %20, null
  br i1 %.not83, label %._crit_edge88, label %.lr.ph.preheader

38:                                               ; preds = %5, %50
  %.05980 = phi i32 [ 0, %5 ], [ %.1, %50 ]
  %.06079 = phi i32 [ 0, %5 ], [ %51, %50 ]
  %39 = and i32 %.06079, 1
  %40 = icmp ne i32 %39, 0
  %.lhs.trunc70 = trunc nuw i32 %.06079 to i16
  %41 = urem i16 %.lhs.trunc70, 3
  %42 = icmp ne i16 %41, 0
  %or.cond.not76 = and i1 %40, %42
  %43 = urem i16 %.lhs.trunc70, 6
  %.not67 = icmp eq i16 %43, 0
  %or.cond69 = or i1 %.not67, %or.cond.not76
  br i1 %or.cond69, label %47, label %44

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

47:                                               ; preds = %38
  %48 = tail call zeroext i1 @roaring_bitmap_contains(ptr noundef %6, i32 noundef %.06079)
  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 ], [ %.05980, %47 ]
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.96.sink, i32 noundef %.06079)
  br label %50

50:                                               ; preds = %.sink.split, %44, %47
  %.1 = phi i32 [ %45, %44 ], [ %.05980, %47 ], [ %.1.ph, %.sink.split ]
  %51 = add nuw nsw i32 %.06079, 1
  %exitcond89.not = icmp eq i32 %51, 300
  br i1 %exitcond89.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 [ %55, %._crit_edge ], [ %20, %17 ]
  %53 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph

.preheader:                                       ; preds = %._crit_edge
  br i1 %.not83, label %._crit_edge88, label %.lr.ph87

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %68
  %indvars.iv90 = phi i64 [ %indvars.iv, %.lr.ph.preheader ], [ %indvars.iv.next91, %68 ]
  %56 = phi ptr [ %52, %.lr.ph.preheader ], [ %71, %68 ]
  %57 = tail call ptr @synthesized_xor(ptr noundef nonnull %52, ptr noundef nonnull %56)
  %58 = tail call ptr @roaring_bitmap_lazy_xor(ptr noundef nonnull %52, ptr noundef nonnull %56) #5
  tail call void @roaring_bitmap_repair_after_lazy(ptr noundef %58) #5
  %59 = tail call zeroext i1 @roaring_bitmap_equals(ptr noundef %57, ptr noundef %58) #5
  br i1 %59, label %68, label %60

60:                                               ; preds = %.lr.ph
  %61 = trunc nuw nsw i64 %indvars.iv90 to i32
  %62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.100, i32 noundef %53, i32 noundef %61)
  %63 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %58) #5
  %64 = trunc i64 %63 to i32
  %65 = tail call i64 @roaring_bitmap_get_cardinality(ptr noundef %57) #5
  %66 = trunc i64 %65 to i32
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.102, i32 noundef %64, i32 noundef %66)
  tail call void @show_difference(ptr noundef %58, ptr noundef %57)
  br label %68

68:                                               ; preds = %60, %.lr.ph
  %69 = zext i1 %59 to i64
  tail call void @_assert_true(i64 noundef %69, ptr noundef nonnull @.str.99, ptr noundef nonnull @.str.2, i32 noundef 1769) #5
  tail call void @roaring_bitmap_free(ptr noundef %57) #5
  tail call void @roaring_bitmap_free(ptr noundef %58) #5
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %70 = getelementptr inbounds [10 x ptr], ptr %2, i64 0, i64 %indvars.iv.next91
  %71 = load ptr, ptr %70, align 8, !tbaa !7
  %.not66 = icmp eq ptr %71, null
  br i1 %.not66, label %._crit_edge, label %.lr.ph, !llvm.loop !13

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

.lr.ph87:                                         ; preds = %.preheader, %.lr.ph87
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph87 ], [ 0, %.preheader ]
  %72 = phi ptr [ %74, %.lr.ph87 ], [ %20, %.preheader ]
  tail call void @roaring_bitmap_free(ptr noundef nonnull %72) #5
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %73 = getelementptr inbounds [10 x ptr], ptr %2, i64 0, i64 %indvars.iv.next95
  %74 = load ptr, ptr %73, align 8, !tbaa !7
  %.not65 = icmp eq ptr %74, null
  br i1 %.not65, label %._crit_edge88, label %.lr.ph87, !llvm.loop !14
}

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

declare void @roaring_bitmap_repair_after_lazy(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,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass