; LLVM IR from bqi343/cp-notebook :: Implementations/content/data-structures/STL (5) (bset_test)

; 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"

%struct.bset = type { i32, %"class.std::vector.8" }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.13" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.17" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@.str.2 = external hidden unnamed_addr constant [114 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 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 @__gxx_personality_v0(...)

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psEv() #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.bset, align 8
  %6 = alloca %"class.std::vector.13", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca i32, align 4
  %14 = alloca %struct.bset, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Bit_reference", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.bset, align 8
  %20 = alloca %"class.std::set", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair.17", align 8
  %24 = alloca i32, align 4
  %25 = alloca %"class.std::set", align 8
  %26 = alloca %"struct.std::pair.17", align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %155, %0
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 1000
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %34 = call i32 @rand() #8
  %35 = srem i32 %34, 1000
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #8
  %37 = load i32, ptr %4, align 4, !tbaa !5
  call void @_ZN4bsetC2Ei(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %37)
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #8
  call void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %48, %33
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %55

43:                                               ; preds = %38
  %44 = call i32 @rand() #8
  %45 = and i32 %44, 1
  %46 = icmp ne i32 %45, 0
  invoke void @_ZNSt6vectorIbSaIbEE9push_backEb(ptr noundef nonnull align 8 dereferenceable(40) %6, i1 noundef zeroext %46)
          to label %47 unwind label %51

47:                                               ; preds = %43
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %7, align 4, !tbaa !5
  br label %38, !llvm.loop !9

51:                                               ; preds = %43
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %8, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %161

55:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %86, %55
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = call noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %6) #8
  %59 = trunc i64 %58 to i32
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 noundef %64)
          to label %66 unwind label %77

66:                                               ; preds = %62
  %67 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 0
  %68 = extractvalue { ptr, i64 } %65, 0
  store ptr %68, ptr %67, align 8
  %69 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 1
  %70 = extractvalue { ptr, i64 } %65, 1
  store i64 %70, ptr %69, align 8
  %71 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  br i1 %71, label %72, label %85

72:                                               ; preds = %66
  %73 = load i32, ptr %11, align 4, !tbaa !5
  invoke void @_ZN4bset3setEi(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %73)
          to label %74 unwind label %81

74:                                               ; preds = %72
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %10, align 4, !tbaa !5
  br label %85

77:                                               ; preds = %62
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %8, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  br label %89

81:                                               ; preds = %72
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %8, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %9, align 4
  br label %89

85:                                               ; preds = %74, %66
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %11, align 4, !tbaa !5
  br label %56, !llvm.loop !11

89:                                               ; preds = %81, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %160

90:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %91 = call i32 @rand() #8
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = srem i32 %91, %92
  store i32 %93, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #8
  %94 = load i32, ptr %13, align 4, !tbaa !5
  invoke void @_ZN4bset5shiftEi(ptr dead_on_unwind writable sret(%struct.bset) align 8 %14, ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %94)
          to label %95 unwind label %101

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %138, %95
  %97 = load i32, ptr %15, align 4, !tbaa !5
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %105, label %100

100:                                              ; preds = %96
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %142

101:                                              ; preds = %90
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %8, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %9, align 4
  br label %159

105:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  %106 = load i32, ptr %15, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 noundef %107)
          to label %109 unwind label %129

109:                                              ; preds = %105
  %110 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 0
  %111 = extractvalue { ptr, i64 } %108, 0
  store ptr %111, ptr %110, align 8
  %112 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 1
  %113 = extractvalue { ptr, i64 } %108, 1
  store i64 %113, ptr %112, align 8
  %114 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %16) #8
  %115 = zext i1 %114 to i32
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = load i32, ptr %13, align 4, !tbaa !5
  %118 = add nsw i32 %116, %117
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = srem i32 %118, %119
  %121 = invoke noundef zeroext i1 @_ZNK4bset3getEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %120)
          to label %122 unwind label %129

122:                                              ; preds = %109
  %123 = zext i1 %121 to i32
  %124 = icmp ne i32 %115, %123
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  br i1 %124, label %125, label %137

125:                                              ; preds = %122
  invoke void @_Z2prRK4bset(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %126 unwind label %133

126:                                              ; preds = %125
  invoke void @_ZN6output2psEv()
          to label %127 unwind label %133

127:                                              ; preds = %126
  invoke void @_Z2prRK4bset(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %128 unwind label %133

128:                                              ; preds = %127
  call void @exit(i32 noundef 0) #9
  unreachable

129:                                              ; preds = %109, %105
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %8, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  br label %141

133:                                              ; preds = %127, %126, %125
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %8, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %9, align 4
  br label %141

137:                                              ; preds = %122
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %15, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %15, align 4, !tbaa !5
  br label %96, !llvm.loop !12

141:                                              ; preds = %133, %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %158

142:                                              ; preds = %100
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = invoke noundef i32 @_ZN4bset5countEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %145 unwind label %149

145:                                              ; preds = %142
  %146 = icmp eq i32 %143, %144
  br i1 %146, label %147, label %148

147:                                              ; preds = %145
  br label %154

148:                                              ; preds = %145
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.2, i32 noundef 288, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

149:                                              ; preds = %142
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %8, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %9, align 4
  br label %158

153:                                              ; No predecessors!
  br label %154

154:                                              ; preds = %153, %147
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #8
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %2, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %2, align 4, !tbaa !5
  br label %29, !llvm.loop !13

158:                                              ; preds = %149, %141
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  br label %159

159:                                              ; preds = %158, %101
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %160

160:                                              ; preds = %159, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %161

161:                                              ; preds = %160, %51
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #8
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %249

162:                                              ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %242, %162
  %164 = load i32, ptr %17, align 4, !tbaa !5
  %165 = icmp slt i32 %164, 1000
  br i1 %165, label %167, label %166

166:                                              ; preds = %163
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %247

167:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %168 = call i32 @rand() #8
  %169 = srem i32 %168, 1000
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #8
  %171 = load i32, ptr %18, align 4, !tbaa !5
  call void @_ZN4bsetC2Ei(ptr noundef nonnull align 8 dereferenceable(32) %19, i32 noundef %171)
  call void @llvm.lifetime.start.p0(i64 48, ptr %20) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %191, %167
  %173 = load i32, ptr %21, align 4, !tbaa !5
  %174 = call i32 @rand() #8
  %175 = srem i32 %174, 20
  %176 = add nsw i32 %175, 1
  %177 = icmp slt i32 %173, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %172
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %198

179:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %180 = call i32 @rand() #8
  %181 = load i32, ptr %18, align 4, !tbaa !5
  %182 = srem i32 %180, %181
  store i32 %182, ptr %22, align 4, !tbaa !5
  %183 = load i32, ptr %22, align 4, !tbaa !5
  invoke void @_ZN4bset3setEi(ptr noundef nonnull align 8 dereferenceable(32) %19, i32 noundef %183)
          to label %184 unwind label %194

184:                                              ; preds = %179
  %185 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %20, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %186 unwind label %194

186:                                              ; preds = %184
  %187 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 0
  %188 = extractvalue { ptr, i8 } %185, 0
  store ptr %188, ptr %187, align 8
  %189 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 1
  %190 = extractvalue { ptr, i8 } %185, 1
  store i8 %190, ptr %189, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %191

191:                                              ; preds = %186
  %192 = load i32, ptr %21, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %21, align 4, !tbaa !5
  br label %172, !llvm.loop !14

194:                                              ; preds = %184, %179
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %8, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %246

198:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 -1, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %25) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %25) #8
  br label %199

199:                                              ; preds = %228, %198
  %200 = load i32, ptr %24, align 4, !tbaa !5
  %201 = getelementptr inbounds %struct.bset, ptr %19, i32 0, i32 0
  %202 = load i32, ptr %201, align 8, !tbaa !15
  %203 = icmp ne i32 %200, %202
  br i1 %203, label %204, label %229

204:                                              ; preds = %199
  %205 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %206 unwind label %220

206:                                              ; preds = %204
  %207 = getelementptr inbounds { ptr, i8 }, ptr %26, i32 0, i32 0
  %208 = extractvalue { ptr, i8 } %205, 0
  store ptr %208, ptr %207, align 8
  %209 = getelementptr inbounds { ptr, i8 }, ptr %26, i32 0, i32 1
  %210 = extractvalue { ptr, i8 } %205, 1
  store i8 %210, ptr %209, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %211 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %211, ptr %27, align 4, !tbaa !5
  %212 = load i32, ptr %24, align 4, !tbaa !5
  %213 = invoke noundef i32 @_ZN4bset8findNextEi(ptr noundef nonnull align 8 dereferenceable(32) %19, i32 noundef %212)
          to label %214 unwind label %224

214:                                              ; preds = %206
  store i32 %213, ptr %24, align 4, !tbaa !5
  %215 = load i32, ptr %24, align 4, !tbaa !5
  %216 = load i32, ptr %27, align 4, !tbaa !5
  %217 = icmp eq i32 %215, %216
  br i1 %217, label %218, label %228

218:                                              ; preds = %214
  invoke void @_ZN6output2psIA7_cJiEEEvRKT_DpRKT0_(ptr noundef nonnull align 1 dereferenceable(7) @.str.17, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %219 unwind label %224

219:                                              ; preds = %218
  call void @exit(i32 noundef 0) #9
  unreachable

220:                                              ; preds = %231, %204
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %8, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %9, align 4
  br label %245

224:                                              ; preds = %218, %206
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %8, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %245

228:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %199, !llvm.loop !22

229:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 -1, ptr %28, align 4, !tbaa !5
  %230 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %231 unwind label %236

231:                                              ; preds = %229
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  %232 = invoke noundef zeroext i1 @_ZSteqIiSt4lessIiESaIiEEbRKSt3setIT_T0_T1_ES9_(ptr noundef nonnull align 8 dereferenceable(48) %20, ptr noundef nonnull align 8 dereferenceable(48) %25)
          to label %233 unwind label %220

233:                                              ; preds = %231
  br i1 %232, label %234, label %235

234:                                              ; preds = %233
  br label %241

235:                                              ; preds = %233
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.2, i32 noundef 313, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

236:                                              ; preds = %229
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %8, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %245

240:                                              ; No predecessors!
  br label %241

241:                                              ; preds = %240, %234
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %25) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %20) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %20) #8
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %17, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %17, align 4, !tbaa !5
  br label %163, !llvm.loop !23

245:                                              ; preds = %236, %224, %220
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %25) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %246

246:                                              ; preds = %245, %194
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %20) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %20) #8
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %249

247:                                              ; preds = %166
  call void @_ZN6output2psIA3_cJEEEvRKT_DpRKT0_(ptr noundef nonnull align 1 dereferenceable(3) @.str.19)
  %248 = load i32, ptr %1, align 4
  ret i32 %248

249:                                              ; preds = %246, %161
  %250 = load ptr, ptr %8, align 8
  %251 = load i32, ptr %9, align 4
  %252 = insertvalue { ptr, i32 } poison, ptr %250, 0
  %253 = insertvalue { ptr, i32 } %252, i32 %251, 1
  resume { ptr, i32 } %253
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4bsetC2Ei(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEE9push_backEb(ptr noundef nonnull align 8 dereferenceable(40), i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4bset3setEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4bset5shiftEi(ptr dead_on_unwind noalias writable sret(%struct.bset) align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4bset3getEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2prRK4bset(ptr noundef nonnull align 8 dereferenceable(32)) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4bset5countEv(ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4bset8findNextEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIA7_cJiEEEvRKT_DpRKT0_(ptr noundef nonnull align 1 dereferenceable(7), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSteqIiSt4lessIiESaIiEEbRKSt3setIT_T0_T1_ES9_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIA3_cJEEEvRKT_DpRKT0_(ptr noundef nonnull align 1 dereferenceable(3)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress norecurse 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 "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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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++ 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, !6, i64 0}
!16 = !{!"_ZTS4bset", !6, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt6vectorImSaImEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseImSaImEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !21, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"any pointer", !7, i64 0}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


; 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"

%struct.bset = type { i32, %"class.std::vector.8" }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.13" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [114 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psEv() local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %struct.bset, align 8
  %2 = alloca %"class.std::vector.13", align 8
  %3 = alloca %"struct.std::_Bit_reference", align 8
  %4 = alloca %struct.bset, align 8
  %5 = alloca %"struct.std::_Bit_reference", align 8
  %6 = alloca %struct.bset, align 8
  %7 = alloca %"class.std::set", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::set", align 8
  %11 = alloca i32, align 4
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  %13 = getelementptr inbounds i8, ptr %5, i64 8
  br label %14

14:                                               ; preds = %0, %72
  %.078 = phi i32 [ 0, %0 ], [ %73, %72 ]
  %15 = call i32 @rand() #8
  %16 = srem i32 %15, 1000
  %17 = add nsw i32 %16, 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #8
  call void @_ZN4bsetC2Ei(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %17)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #8
  call void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #8
  %.not5369 = icmp slt i32 %16, 0
  br i1 %.not5369, label %.preheader66, label %.lr.ph

.preheader66:                                     ; preds = %24, %14
  %18 = call noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %2) #8
  %19 = trunc i64 %18 to i32
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph73, label %._crit_edge

.lr.ph:                                           ; preds = %14, %24
  %.03270 = phi i32 [ %25, %24 ], [ 0, %14 ]
  %21 = call i32 @rand() #8
  %22 = and i32 %21, 1
  %23 = icmp ne i32 %22, 0
  invoke void @_ZNSt6vectorIbSaIbEE9push_backEb(ptr noundef nonnull align 8 dereferenceable(40) %2, i1 noundef zeroext %23)
          to label %24 unwind label %26

24:                                               ; preds = %.lr.ph
  %25 = add nuw nsw i32 %.03270, 1
  %exitcond.not = icmp eq i32 %.03270, %16
  br i1 %exitcond.not, label %.preheader66, label %.lr.ph, !llvm.loop !5

26:                                               ; preds = %.lr.ph
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %75

._crit_edge:                                      ; preds = %43, %.preheader66
  %.043.lcssa = phi i32 [ 0, %.preheader66 ], [ %.144, %43 ]
  %28 = call i32 @rand() #8
  %29 = srem i32 %28, %17
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  invoke void @_ZN4bset5shiftEi(ptr dead_on_unwind nonnull writable sret(%struct.bset) align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %29)
          to label %.preheader65 unwind label %50

.preheader65:                                     ; preds = %._crit_edge
  br i1 %.not5369, label %._crit_edge77, label %.lr.ph76.preheader

.lr.ph76.preheader:                               ; preds = %.preheader65
  %wide.trip.count = zext nneg i32 %17 to i64
  br label %.lr.ph76

.lr.ph73:                                         ; preds = %.preheader66, %43
  %indvars.iv = phi i64 [ %indvars.iv.next, %43 ], [ 0, %.preheader66 ]
  %.04372 = phi i32 [ %.144, %43 ], [ 0, %.preheader66 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  %30 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %2, i64 noundef %indvars.iv)
          to label %31 unwind label %39

31:                                               ; preds = %.lr.ph73
  %32 = extractvalue { ptr, i64 } %30, 0
  store ptr %32, ptr %3, align 8
  %33 = extractvalue { ptr, i64 } %30, 1
  store i64 %33, ptr %12, align 8
  %34 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  br i1 %34, label %35, label %43

35:                                               ; preds = %31
  %36 = trunc nuw nsw i64 %indvars.iv to i32
  invoke void @_ZN4bset3setEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %36)
          to label %37 unwind label %41

37:                                               ; preds = %35
  %38 = add nsw i32 %.04372, 1
  br label %43

39:                                               ; preds = %.lr.ph73
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  br label %75

41:                                               ; preds = %35
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %75

43:                                               ; preds = %31, %37
  %.144 = phi i32 [ %38, %37 ], [ %.04372, %31 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = call noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %2) #8
  %sext = shl i64 %44, 32
  %45 = ashr exact i64 %sext, 32
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %.lr.ph73, label %._crit_edge, !llvm.loop !7

47:                                               ; preds = %53
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond89.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count
  br i1 %exitcond89.not, label %._crit_edge77, label %.lr.ph76, !llvm.loop !8

._crit_edge77:                                    ; preds = %47, %.preheader65
  %48 = call noundef i32 @_ZN4bset5countEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %49 = icmp eq i32 %.043.lcssa, %48
  br i1 %49, label %72, label %71

50:                                               ; preds = %._crit_edge
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %74

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %47
  %indvars.iv86 = phi i64 [ 0, %.lr.ph76.preheader ], [ %indvars.iv.next87, %47 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %52 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %2, i64 noundef %indvars.iv86)
          to label %53 unwind label %66

53:                                               ; preds = %.lr.ph76
  %54 = extractvalue { ptr, i64 } %52, 0
  store ptr %54, ptr %5, align 8
  %55 = extractvalue { ptr, i64 } %52, 1
  store i64 %55, ptr %13, align 8
  %56 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  %57 = trunc i64 %indvars.iv86 to i32
  %58 = add i32 %29, %57
  %59 = srem i32 %58, %17
  %60 = call noundef zeroext i1 @_ZNK4bset3getEi(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %59)
  %61 = xor i1 %56, %60
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  br i1 %61, label %62, label %47

62:                                               ; preds = %53
  invoke void @_Z2prRK4bset(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %63 unwind label %68

63:                                               ; preds = %62
  invoke void @_ZN6output2psEv()
          to label %64 unwind label %68

64:                                               ; preds = %63
  invoke void @_Z2prRK4bset(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %65 unwind label %68

65:                                               ; preds = %64
  call void @exit(i32 noundef 0) #9
  unreachable

66:                                               ; preds = %.lr.ph76
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  br label %70

68:                                               ; preds = %64, %63, %62
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %70

70:                                               ; preds = %68, %66
  %.pn56 = phi { ptr, i32 } [ %69, %68 ], [ %67, %66 ]
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  br label %74

71:                                               ; preds = %._crit_edge77
  call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.2, i32 noundef 288, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

72:                                               ; preds = %._crit_edge77
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #8
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  %73 = add nuw nsw i32 %.078, 1
  %exitcond90.not = icmp eq i32 %73, 1000
  br i1 %exitcond90.not, label %.preheader, label %14, !llvm.loop !9

74:                                               ; preds = %70, %50
  %.pn56.pn = phi { ptr, i32 } [ %.pn56, %70 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  br label %75

75:                                               ; preds = %74, %41, %39, %26
  %.pn62 = phi { ptr, i32 } [ %27, %26 ], [ %.pn56.pn, %74 ], [ %42, %41 ], [ %40, %39 ]
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #8
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  br label %117

76:                                               ; preds = %113
  call void @_ZN6output2psIA3_cJEEEvRKT_DpRKT0_(ptr noundef nonnull align 1 dereferenceable(3) @.str.19)
  ret i32 0

.preheader:                                       ; preds = %72, %113
  %.04584 = phi i32 [ %114, %113 ], [ 0, %72 ]
  %77 = call i32 @rand() #8
  %78 = srem i32 %77, 1000
  %79 = add nsw i32 %78, 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #8
  call void @_ZN4bsetC2Ei(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %79)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  %80 = call i32 @rand() #8
  %81 = srem i32 %80, 20
  %.not79 = icmp slt i32 %81, 0
  br i1 %.not79, label %._crit_edge83, label %.lr.ph82

._crit_edge83:                                    ; preds = %86, %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 -1, ptr %9, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %10) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #8
  %.pre = load i32, ptr %9, align 4, !tbaa !10
  br label %92

.lr.ph82:                                         ; preds = %.preheader, %86
  %.04280 = phi i32 [ %87, %86 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %82 = call i32 @rand() #8
  %83 = srem i32 %82, %79
  store i32 %83, ptr %8, align 4, !tbaa !10
  invoke void @_ZN4bset3setEi(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %83)
          to label %84 unwind label %90

84:                                               ; preds = %.lr.ph82
  %85 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %86 unwind label %90

86:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  %87 = add nuw nsw i32 %.04280, 1
  %88 = call i32 @rand() #8
  %89 = srem i32 %88, 20
  %.not.not = icmp slt i32 %.04280, %89
  br i1 %.not.not, label %.lr.ph82, label %._crit_edge83, !llvm.loop !14

90:                                               ; preds = %84, %.lr.ph82
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %116

92:                                               ; preds = %97, %._crit_edge83
  %93 = phi i32 [ %99, %97 ], [ %.pre, %._crit_edge83 ]
  %94 = load i32, ptr %6, align 8, !tbaa !15
  %.not49 = icmp eq i32 %93, %94
  br i1 %.not49, label %105, label %95

95:                                               ; preds = %92
  %96 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %97 unwind label %.loopexit

97:                                               ; preds = %95
  %98 = load i32, ptr %9, align 4, !tbaa !10
  %99 = call noundef i32 @_ZN4bset8findNextEi(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %98)
  store i32 %99, ptr %9, align 4, !tbaa !10
  %100 = icmp eq i32 %99, %98
  br i1 %100, label %101, label %92, !llvm.loop !22

101:                                              ; preds = %97
  invoke void @_ZN6output2psIA7_cJiEEEvRKT_DpRKT0_(ptr noundef nonnull align 1 dereferenceable(7) @.str.17, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %102 unwind label %103

102:                                              ; preds = %101
  call void @exit(i32 noundef 0) #9
  unreachable

.loopexit:                                        ; preds = %95
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %115

.loopexit.split-lp:                               ; preds = %107
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %115

103:                                              ; preds = %101
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %115

105:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  store i32 -1, ptr %11, align 4, !tbaa !10
  %106 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %107 unwind label %111

107:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  %108 = invoke noundef zeroext i1 @_ZSteqIiSt4lessIiESaIiEEbRKSt3setIT_T0_T1_ES9_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(48) %10)
          to label %109 unwind label %.loopexit.split-lp

109:                                              ; preds = %107
  br i1 %108, label %113, label %110

110:                                              ; preds = %109
  call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.2, i32 noundef 313, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

111:                                              ; preds = %105
  %112 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  br label %115

113:                                              ; preds = %109
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #8
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  %114 = add nuw nsw i32 %.04584, 1
  %exitcond91.not = icmp eq i32 %114, 1000
  br i1 %exitcond91.not, label %76, label %.preheader, !llvm.loop !23

115:                                              ; preds = %.loopexit, %.loopexit.split-lp, %111, %103
  %.pn = phi { ptr, i32 } [ %104, %103 ], [ %112, %111 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  br label %116

116:                                              ; preds = %115, %90
  %.pn51 = phi { ptr, i32 } [ %91, %90 ], [ %.pn, %115 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #8
  call void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  br label %117

117:                                              ; preds = %116, %75
  %.pn62.pn = phi { ptr, i32 } [ %.pn62, %75 ], [ %.pn51, %116 ]
  resume { ptr, i32 } %.pn62.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4bsetC2Ei(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEE9push_backEb(ptr noundef nonnull align 8 dereferenceable(40), i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4bset3setEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4bset5shiftEi(ptr dead_on_unwind noalias writable sret(%struct.bset) align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4bset3getEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2prRK4bset(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4bset5countEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4bsetD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4bset8findNextEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIA7_cJiEEEvRKT_DpRKT0_(ptr noundef nonnull align 1 dereferenceable(7), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSteqIiSt4lessIiESaIiEEbRKSt3setIT_T0_T1_ES9_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIA3_cJEEEvRKT_DpRKT0_(ptr noundef nonnull align 1 dereferenceable(3)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress norecurse 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 "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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = distinct !{!14, !6}
!15 = !{!16, !11, i64 0}
!16 = !{!"_ZTS4bset", !11, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt6vectorImSaImEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseImSaImEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !21, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"any pointer", !12, i64 0}
!22 = distinct !{!22, !6}
!23 = distinct !{!23, !6}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass