; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-03-27 (A - Associated Vertices - tjz)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [157 x i64] }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@seq = external dso_local global [10001 x i32], align 16
@scnt = external dso_local global i32, align 4
@sno = external dso_local global [10001 x i32], align 16
@sw = external dso_local global [10001 x i32], align 16
@ans = external dso_local global i32, align 4
@vis = external dso_local global [10001 x i8], align 16
@e1 = external dso_local global [10001 x %"class.std::vector"], align 16
@r1 = external dso_local global [10001 x %"class.std::vector"], align 16
@e2 = external dso_local global [10001 x %"class.std::vector"], align 16
@r2 = external dso_local global [10001 x %"class.std::vector"], align 16
@f = external dso_local global [10001 x %"class.std::bitset"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4pfs1i(i32 noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4pfs2i(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs1i(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs2i(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  br label %16

16:                                               ; preds = %20, %0
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr @m, align 4, !tbaa !5
  %19 = icmp ne i32 %17, 0
  br i1 %19, label %20, label %32

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %3, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e1, i64 0, i64 %27
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @r1, i64 0, i64 %30
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %16, !llvm.loop !9

32:                                               ; preds = %16
  store i32 0, ptr @scnt, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = mul i64 %34, 1
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 %35, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %50, %32
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %53

41:                                               ; preds = %36
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !11, !range !13, !noundef !14
  %46 = trunc i8 %45 to i1
  br i1 %46, label %49, label %47

47:                                               ; preds = %41
  %48 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z4pfs1i(i32 noundef %48)
  br label %49

49:                                               ; preds = %47, %41
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %4, align 4, !tbaa !5
  br label %36, !llvm.loop !15

53:                                               ; preds = %40
  store i32 0, ptr @scnt, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = mul i64 %55, 1
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 %56, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = sub nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %80, %53
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = icmp sge i32 %60, 0
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %83

63:                                               ; preds = %59
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10001 x i32], ptr @seq, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !11, !range !13, !noundef !14
  %71 = trunc i8 %70 to i1
  br i1 %71, label %79, label %72

72:                                               ; preds = %63
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [10001 x i32], ptr @seq, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  call void @_Z4pfs2i(i32 noundef %76)
  %77 = load i32, ptr @scnt, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @scnt, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %72, %63
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = add nsw i32 %81, -1
  store i32 %82, ptr %5, align 4, !tbaa !5
  br label %59, !llvm.loop !16

83:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %163, %83
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %166

89:                                               ; preds = %84
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10001 x %"class.std::bitset"], ptr @f, i64 0, i64 %94
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = call noundef nonnull align 8 dereferenceable(1256) ptr @_ZNSt6bitsetILm10001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(1256) %95, i64 noundef %97, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e1, i64 0, i64 %100
  %102 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %101) #7
  %103 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %102, ptr %103, align 8
  br label %104

104:                                              ; preds = %133, %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e1, i64 0, i64 %106
  %108 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %107) #7
  %109 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  %110 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br i1 %110, label %112, label %111

111:                                              ; preds = %104
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %135

112:                                              ; preds = %104
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10001 x %"class.std::bitset"], ptr @f, i64 0, i64 %117
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = call noundef nonnull align 8 dereferenceable(1256) ptr @_ZNSt6bitsetILm10001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(1256) %118, i64 noundef %121, i1 noundef zeroext true)
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e2, i64 0, i64 %127
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %131
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %128, ptr noundef nonnull align 4 dereferenceable(4) %132)
  br label %133

133:                                              ; preds = %112
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br label %104, !llvm.loop !17

135:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %136 = load i32, ptr %6, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @r1, i64 0, i64 %137
  %139 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %138) #7
  %140 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %139, ptr %140, align 8
  br label %141

141:                                              ; preds = %160, %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @r1, i64 0, i64 %143
  %145 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %144) #7
  %146 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  %147 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br i1 %147, label %149, label %148

148:                                              ; preds = %141
  store i32 16, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %162

149:                                              ; preds = %141
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @r2, i64 0, i64 %154
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %158
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %155, ptr noundef nonnull align 4 dereferenceable(4) %159)
  br label %160

160:                                              ; preds = %149
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %141, !llvm.loop !18

162:                                              ; preds = %148
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %6, align 4, !tbaa !5
  br label %84, !llvm.loop !19

166:                                              ; preds = %88
  %167 = load i32, ptr @scnt, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = mul i64 %168, 1
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 %169, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %184, %166
  %171 = load i32, ptr %12, align 4, !tbaa !5
  %172 = load i32, ptr @scnt, align 4, !tbaa !5
  %173 = icmp slt i32 %171, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %170
  store i32 19, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %187

175:                                              ; preds = %170
  %176 = load i32, ptr %12, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %177
  %179 = load i8, ptr %178, align 1, !tbaa !11, !range !13, !noundef !14
  %180 = trunc i8 %179 to i1
  br i1 %180, label %183, label %181

181:                                              ; preds = %175
  %182 = load i32, ptr %12, align 4, !tbaa !5
  call void @_Z4dfs1i(i32 noundef %182)
  br label %183

183:                                              ; preds = %181, %175
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %12, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %12, align 4, !tbaa !5
  br label %170, !llvm.loop !20

187:                                              ; preds = %174
  %188 = load i32, ptr @scnt, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = mul i64 %189, 1
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 %190, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %205, %187
  %192 = load i32, ptr %13, align 4, !tbaa !5
  %193 = load i32, ptr @scnt, align 4, !tbaa !5
  %194 = icmp slt i32 %192, %193
  br i1 %194, label %196, label %195

195:                                              ; preds = %191
  store i32 22, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %208

196:                                              ; preds = %191
  %197 = load i32, ptr %13, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %198
  %200 = load i8, ptr %199, align 1, !tbaa !11, !range !13, !noundef !14
  %201 = trunc i8 %200 to i1
  br i1 %201, label %204, label %202

202:                                              ; preds = %196
  %203 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z4dfs2i(i32 noundef %203)
  br label %204

204:                                              ; preds = %202, %196
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %13, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %13, align 4, !tbaa !5
  br label %191, !llvm.loop !21

208:                                              ; preds = %195
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %229, %208
  %210 = load i32, ptr %14, align 4, !tbaa !5
  %211 = load i32, ptr @scnt, align 4, !tbaa !5
  %212 = icmp slt i32 %210, %211
  br i1 %212, label %214, label %213

213:                                              ; preds = %209
  store i32 25, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %232

214:                                              ; preds = %209
  %215 = load i32, ptr %14, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [10001 x %"class.std::bitset"], ptr @f, i64 0, i64 %216
  %218 = call noundef i64 @_ZNKSt6bitsetILm10001EE5countEv(ptr noundef nonnull align 8 dereferenceable(1256) %217) #7
  %219 = load i32, ptr %14, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [10001 x i32], ptr @sw, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = mul i64 %218, %223
  %225 = load i32, ptr @ans, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = add i64 %226, %224
  %228 = trunc i64 %227 to i32
  store i32 %228, ptr @ans, align 4, !tbaa !5
  br label %229

229:                                              ; preds = %214
  %230 = load i32, ptr %14, align 4, !tbaa !5
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %14, align 4, !tbaa !5
  br label %209, !llvm.loop !22

232:                                              ; preds = %213
  %233 = load i32, ptr @ans, align 4, !tbaa !5
  %234 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %233)
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(1256) ptr @_ZNSt6bitsetILm10001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(1256), i64 noundef, i1 noundef zeroext) #0 align 2

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

declare i32 @printf(ptr noundef, ...) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [157 x i64] }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@seq = external dso_local local_unnamed_addr global [10001 x i32], align 16
@scnt = external dso_local local_unnamed_addr global i32, align 4
@sno = external dso_local global [10001 x i32], align 16
@sw = external dso_local local_unnamed_addr global [10001 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local local_unnamed_addr global [10001 x i8], align 16
@e1 = external dso_local global [10001 x %"class.std::vector"], align 16
@r1 = external dso_local global [10001 x %"class.std::vector"], align 16
@e2 = external dso_local global [10001 x %"class.std::vector"], align 16
@r2 = external dso_local global [10001 x %"class.std::vector"], align 16
@f = external dso_local global [10001 x %"class.std::bitset"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4pfs1i(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4pfs2i(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs1i(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs2i(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr @m, align 4, !tbaa !5
  %.not38 = icmp eq i32 %8, 0
  br i1 %.not38, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr %1, align 4, !tbaa !5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %12 to i64
  %16 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e1, i64 0, i64 %15
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @r1, i64 0, i64 %18
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %0
  store i32 0, ptr @scnt, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %23, i1 false)
  %24 = icmp sgt i32 %22, 0
  br i1 %24, label %.lr.ph41, label %._crit_edge42.thread

._crit_edge42.thread:                             ; preds = %._crit_edge
  store i32 0, ptr @scnt, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %23, i1 false)
  br label %._crit_edge59.thread

._crit_edge42:                                    ; preds = %33
  store i32 0, ptr @scnt, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %35, i1 false)
  %25 = icmp sgt i32 %34, 0
  br i1 %25, label %.lr.ph46.preheader, label %._crit_edge59.thread

.lr.ph46.preheader:                               ; preds = %._crit_edge42
  %26 = zext nneg i32 %34 to i64
  br label %.lr.ph46

.lr.ph41:                                         ; preds = %._crit_edge, %33
  %27 = phi i32 [ %34, %33 ], [ %22, %._crit_edge ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %33 ], [ 0, %._crit_edge ]
  %28 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %indvars.iv
  %29 = load i8, ptr %28, align 1, !tbaa !11, !range !13, !noundef !14
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %33, label %31

31:                                               ; preds = %.lr.ph41
  %32 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_Z4pfs1i(i32 noundef %32)
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %.lr.ph41, %31
  %34 = phi i32 [ %27, %.lr.ph41 ], [ %.pre, %31 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %.lr.ph41, label %._crit_edge42, !llvm.loop !15

.preheader:                                       ; preds = %48
  %.pre87 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp sgt i32 %.pre87, 0
  br i1 %37, label %.lr.ph54, label %._crit_edge55

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %48
  %38 = phi i32 [ 0, %.lr.ph46.preheader ], [ %49, %48 ]
  %indvars.iv72 = phi i64 [ %26, %.lr.ph46.preheader ], [ %indvars.iv.next73, %48 ]
  %indvars.iv.next73 = add nsw i64 %indvars.iv72, -1
  %39 = getelementptr inbounds [10001 x i32], ptr @seq, i64 0, i64 %indvars.iv.next73
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !11, !range !13, !noundef !14
  %44 = trunc nuw i8 %43 to i1
  br i1 %44, label %48, label %45

45:                                               ; preds = %.lr.ph46
  call void @_Z4pfs2i(i32 noundef %40)
  %46 = load i32, ptr @scnt, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr @scnt, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %.lr.ph46, %45
  %49 = phi i32 [ %38, %.lr.ph46 ], [ %47, %45 ]
  %50 = icmp ugt i64 %indvars.iv72, 1
  br i1 %50, label %.lr.ph46, label %.preheader, !llvm.loop !16

._crit_edge55.loopexit:                           ; preds = %._crit_edge52
  %.pre88 = load i32, ptr @scnt, align 4, !tbaa !5
  br label %._crit_edge55

._crit_edge55:                                    ; preds = %._crit_edge55.loopexit, %.preheader
  %51 = phi i32 [ %.pre88, %._crit_edge55.loopexit ], [ %49, %.preheader ]
  %52 = sext i32 %51 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %52, i1 false)
  %53 = icmp sgt i32 %51, 0
  br i1 %53, label %.lr.ph58, label %._crit_edge59.thread

.lr.ph54:                                         ; preds = %.preheader, %._crit_edge52
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %._crit_edge52 ], [ 0, %.preheader ]
  %54 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %indvars.iv75
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [10001 x %"class.std::bitset"], ptr @f, i64 0, i64 %56
  %58 = call noundef nonnull align 8 dereferenceable(1256) ptr @_ZNSt6bitsetILm10001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(1256) %57, i64 noundef %indvars.iv75, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %59 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e1, i64 0, i64 %indvars.iv75
  %60 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #7
  store ptr %60, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %61 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #7
  store ptr %61, ptr %4, align 8
  %62 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %62, label %.lr.ph48, label %._crit_edge49

._crit_edge49:                                    ; preds = %.lr.ph48, %.lr.ph54
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %63 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @r1, i64 0, i64 %indvars.iv75
  %64 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #7
  store ptr %64, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %65 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #7
  store ptr %65, ptr %6, align 8
  %66 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %66, label %.lr.ph51, label %._crit_edge52

.lr.ph48:                                         ; preds = %.lr.ph54, %.lr.ph48
  %67 = load i32, ptr %54, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [10001 x %"class.std::bitset"], ptr @f, i64 0, i64 %68
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(1256) ptr @_ZNSt6bitsetILm10001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(1256) %69, i64 noundef %72, i1 noundef zeroext true)
  %74 = load i32, ptr %54, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e2, i64 0, i64 %75
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %79
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %76, ptr noundef nonnull align 4 dereferenceable(4) %80)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %82 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #7
  store ptr %82, ptr %4, align 8
  %83 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %83, label %.lr.ph48, label %._crit_edge49, !llvm.loop !17

._crit_edge52:                                    ; preds = %.lr.ph51, %._crit_edge49
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = icmp slt i64 %indvars.iv.next76, %85
  br i1 %86, label %.lr.ph54, label %._crit_edge55.loopexit, !llvm.loop !18

.lr.ph51:                                         ; preds = %._crit_edge49, %.lr.ph51
  %87 = load i32, ptr %54, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @r2, i64 0, i64 %88
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [10001 x i32], ptr @sno, i64 0, i64 %92
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 4 dereferenceable(4) %93)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %95 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #7
  store ptr %95, ptr %6, align 8
  %96 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %96, label %.lr.ph51, label %._crit_edge52, !llvm.loop !19

._crit_edge59.thread:                             ; preds = %._crit_edge42, %._crit_edge42.thread, %._crit_edge55
  %.pre-phi91.ph = phi i64 [ %52, %._crit_edge55 ], [ 0, %._crit_edge42.thread ], [ 0, %._crit_edge42 ]
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %.pre-phi91.ph, i1 false)
  br label %._crit_edge64.thread

._crit_edge59:                                    ; preds = %104
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %106, i1 false)
  %97 = icmp sgt i32 %105, 0
  br i1 %97, label %.lr.ph63, label %._crit_edge64.thread

.lr.ph58:                                         ; preds = %._crit_edge55, %104
  %98 = phi i32 [ %105, %104 ], [ %51, %._crit_edge55 ]
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %104 ], [ 0, %._crit_edge55 ]
  %99 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %indvars.iv78
  %100 = load i8, ptr %99, align 1, !tbaa !11, !range !13, !noundef !14
  %101 = trunc nuw i8 %100 to i1
  br i1 %101, label %104, label %102

102:                                              ; preds = %.lr.ph58
  %103 = trunc nuw nsw i64 %indvars.iv78 to i32
  call void @_Z4dfs1i(i32 noundef %103)
  %.pre89 = load i32, ptr @scnt, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %.lr.ph58, %102
  %105 = phi i32 [ %98, %.lr.ph58 ], [ %.pre89, %102 ]
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %106 = sext i32 %105 to i64
  %107 = icmp slt i64 %indvars.iv.next79, %106
  br i1 %107, label %.lr.ph58, label %._crit_edge59, !llvm.loop !20

._crit_edge64.thread:                             ; preds = %._crit_edge59, %._crit_edge59.thread
  store i32 0, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge68

._crit_edge64:                                    ; preds = %115
  %108 = icmp sgt i32 %116, 0
  store i32 0, ptr @ans, align 4, !tbaa !5
  br i1 %108, label %.lr.ph67, label %._crit_edge68

.lr.ph63:                                         ; preds = %._crit_edge59, %115
  %109 = phi i32 [ %116, %115 ], [ %105, %._crit_edge59 ]
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %115 ], [ 0, %._crit_edge59 ]
  %110 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %indvars.iv81
  %111 = load i8, ptr %110, align 1, !tbaa !11, !range !13, !noundef !14
  %112 = trunc nuw i8 %111 to i1
  br i1 %112, label %115, label %113

113:                                              ; preds = %.lr.ph63
  %114 = trunc nuw nsw i64 %indvars.iv81 to i32
  call void @_Z4dfs2i(i32 noundef %114)
  %.pre90 = load i32, ptr @scnt, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %.lr.ph63, %113
  %116 = phi i32 [ %109, %.lr.ph63 ], [ %.pre90, %113 ]
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %117 = sext i32 %116 to i64
  %118 = icmp slt i64 %indvars.iv.next82, %117
  br i1 %118, label %.lr.ph63, label %._crit_edge64, !llvm.loop !21

._crit_edge68:                                    ; preds = %.lr.ph67, %._crit_edge64.thread, %._crit_edge64
  %119 = phi i32 [ 0, %._crit_edge64 ], [ 0, %._crit_edge64.thread ], [ %128, %.lr.ph67 ]
  %120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %119)
  ret i32 0

.lr.ph67:                                         ; preds = %._crit_edge64, %.lr.ph67
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %.lr.ph67 ], [ 0, %._crit_edge64 ]
  %121 = getelementptr inbounds [10001 x %"class.std::bitset"], ptr @f, i64 0, i64 %indvars.iv84
  %122 = call noundef i64 @_ZNKSt6bitsetILm10001EE5countEv(ptr noundef nonnull align 8 dereferenceable(1256) %121) #7
  %123 = getelementptr inbounds [10001 x i32], ptr @sw, i64 0, i64 %indvars.iv84
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = load i32, ptr @ans, align 4, !tbaa !5
  %126 = trunc i64 %122 to i32
  %127 = mul i32 %124, %126
  %128 = add i32 %127, %125
  store i32 %128, ptr @ans, align 4, !tbaa !5
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %129 = load i32, ptr @scnt, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = icmp slt i64 %indvars.iv.next85, %130
  br i1 %131, label %.lr.ph67, label %._crit_edge68, !llvm.loop !22
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(1256) ptr @_ZNSt6bitsetILm10001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(1256), i64 noundef, i1 noundef zeroext) local_unnamed_addr #0 align 2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


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