; LLVM IR from tangjz/acm-icpc :: 51nod (1323)

; 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::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [7 x i64] }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@all = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@a = external dso_local global [400 x i32], align 16
@que = external dso_local global [3640 x i32], align 16
@mat = external dso_local global [3640 x %"class.std::bitset"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %22

22:                                               ; preds = %348, %0
  %23 = load i32, ptr @t, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr @t, align 4, !tbaa !5
  %25 = icmp ne i32 %23, 0
  br i1 %25, label %26, label %351

26:                                               ; preds = %22
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = mul nsw i32 %28, %29
  store i32 %30, ptr @all, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %91, %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @all, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %31
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr @a, i64 %38
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %39)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [400 x i32], ptr @a, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  store i32 %44, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %78, %36
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = mul nsw i32 %46, %47
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = icmp sle i32 %48, %49
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %45
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = srem i32 %53, %54
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %77

57:                                               ; preds = %52
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sdiv i32 %59, %58
  store i32 %60, ptr %4, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %67, %57
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = srem i32 %62, %63
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %71

66:                                               ; preds = %61
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sdiv i32 %69, %68
  store i32 %70, ptr %4, align 4, !tbaa !5
  br label %61, !llvm.loop !9

71:                                               ; preds = %61
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = load i32, ptr @tot, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @tot, align 4, !tbaa !5
  %75 = sext i32 %73 to i64
  %76 = getelementptr inbounds [3640 x i32], ptr @que, i64 0, i64 %75
  store i32 %72, ptr %76, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %71, %52
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !5
  br label %45, !llvm.loop !11

81:                                               ; preds = %51
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = icmp sgt i32 %82, 1
  br i1 %83, label %84, label %90

84:                                               ; preds = %81
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr @tot, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr @tot, align 4, !tbaa !5
  %88 = sext i32 %86 to i64
  %89 = getelementptr inbounds [3640 x i32], ptr @que, i64 0, i64 %88
  store i32 %85, ptr %89, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %84, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %2, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %2, align 4, !tbaa !5
  br label %31, !llvm.loop !12

94:                                               ; preds = %35
  %95 = load i32, ptr @tot, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr @que, i64 %96
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %97)
  %98 = load i32, ptr @tot, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr @que, i64 %99
  %101 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %100)
  %102 = ptrtoint ptr %101 to i64
  %103 = sub i64 %102, ptrtoint (ptr @que to i64)
  %104 = sdiv exact i64 %103, 4
  %105 = trunc i64 %104 to i32
  store i32 %105, ptr @tot, align 4, !tbaa !5
  store i32 0, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %164, %94
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = load i32, ptr @tot, align 4, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %167

111:                                              ; preds = %106
  %112 = load i32, ptr @m, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %113
  %115 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE5resetEv(ptr noundef nonnull align 8 dereferenceable(56) %114) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %158, %111
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = load i32, ptr @all, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %161

121:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %134, %121
  %123 = load i32, ptr %7, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [400 x i32], ptr @a, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [3640 x i32], ptr @que, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = srem i32 %126, %130
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %146

133:                                              ; preds = %122
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [3640 x i32], ptr @que, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [400 x i32], ptr @a, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sdiv i32 %142, %138
  store i32 %143, ptr %141, align 4, !tbaa !5
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %8, align 4, !tbaa !5
  br label %122, !llvm.loop !13

146:                                              ; preds = %122
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = and i32 %147, 1
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %157

150:                                              ; preds = %146
  %151 = load i32, ptr @m, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %152
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %153, i64 noundef %155, i1 noundef zeroext true)
  br label %157

157:                                              ; preds = %150, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %7, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %7, align 4, !tbaa !5
  br label %116, !llvm.loop !14

161:                                              ; preds = %120
  %162 = load i32, ptr @m, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr @m, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %161
  %165 = load i32, ptr %6, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %6, align 4, !tbaa !5
  br label %106, !llvm.loop !15

167:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %237, %167
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = load i32, ptr @n, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %168
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %240

173:                                              ; preds = %168
  %174 = load i32, ptr @m, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %175
  %177 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE5resetEv(ptr noundef nonnull align 8 dereferenceable(56) %176) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %178 = load i32, ptr %9, align 4, !tbaa !5
  %179 = load i32, ptr @n, align 4, !tbaa !5
  %180 = mul nsw i32 %178, %179
  store i32 %180, ptr %11, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %193, %173
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = load i32, ptr @n, align 4, !tbaa !5
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %198

186:                                              ; preds = %181
  %187 = load i32, ptr @m, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %188
  %190 = load i32, ptr %11, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %189, i64 noundef %191, i1 noundef zeroext true)
  br label %193

193:                                              ; preds = %186
  %194 = load i32, ptr %10, align 4, !tbaa !5
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %10, align 4, !tbaa !5
  %196 = load i32, ptr %11, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %11, align 4, !tbaa !5
  br label %181, !llvm.loop !16

198:                                              ; preds = %185
  %199 = load i32, ptr @m, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr @m, align 4, !tbaa !5
  %201 = sext i32 %199 to i64
  %202 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %201
  %203 = load i32, ptr @all, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %202, i64 noundef %204, i1 noundef zeroext true)
  %206 = load i32, ptr @m, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %207
  %209 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE5resetEv(ptr noundef nonnull align 8 dereferenceable(56) %208) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %210 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %210, ptr %13, align 4, !tbaa !5
  br label %211

211:                                              ; preds = %223, %198
  %212 = load i32, ptr %12, align 4, !tbaa !5
  %213 = load i32, ptr @n, align 4, !tbaa !5
  %214 = icmp slt i32 %212, %213
  br i1 %214, label %216, label %215

215:                                              ; preds = %211
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %229

216:                                              ; preds = %211
  %217 = load i32, ptr @m, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %218
  %220 = load i32, ptr %13, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %219, i64 noundef %221, i1 noundef zeroext true)
  br label %223

223:                                              ; preds = %216
  %224 = load i32, ptr %12, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %12, align 4, !tbaa !5
  %226 = load i32, ptr @n, align 4, !tbaa !5
  %227 = load i32, ptr %13, align 4, !tbaa !5
  %228 = add nsw i32 %227, %226
  store i32 %228, ptr %13, align 4, !tbaa !5
  br label %211, !llvm.loop !17

229:                                              ; preds = %215
  %230 = load i32, ptr @m, align 4, !tbaa !5
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr @m, align 4, !tbaa !5
  %232 = sext i32 %230 to i64
  %233 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %232
  %234 = load i32, ptr @all, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %233, i64 noundef %235, i1 noundef zeroext true)
  br label %237

237:                                              ; preds = %229
  %238 = load i32, ptr %9, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %9, align 4, !tbaa !5
  br label %168, !llvm.loop !18

240:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %319, %240
  %242 = load i32, ptr %16, align 4, !tbaa !5
  %243 = load i32, ptr @all, align 4, !tbaa !5
  %244 = icmp slt i32 %242, %243
  br i1 %244, label %246, label %245

245:                                              ; preds = %241
  store i32 31, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %322

246:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 -1, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %247 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %247, ptr %18, align 4, !tbaa !5
  br label %248

248:                                              ; preds = %263, %246
  %249 = load i32, ptr %18, align 4, !tbaa !5
  %250 = load i32, ptr @m, align 4, !tbaa !5
  %251 = icmp slt i32 %249, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %248
  store i32 34, ptr %3, align 4
  br label %266

253:                                              ; preds = %248
  %254 = load i32, ptr %18, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %255
  %257 = load i32, ptr %16, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = call noundef zeroext i1 @_ZNKSt6bitsetILm401EE4testEm(ptr noundef nonnull align 8 dereferenceable(56) %256, i64 noundef %258)
  br i1 %259, label %260, label %262

260:                                              ; preds = %253
  %261 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %261, ptr %17, align 4, !tbaa !5
  store i32 34, ptr %3, align 4
  br label %266

262:                                              ; preds = %253
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %18, align 4, !tbaa !5
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %18, align 4, !tbaa !5
  br label %248, !llvm.loop !19

266:                                              ; preds = %260, %252
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %267

267:                                              ; preds = %266
  %268 = load i32, ptr %17, align 4, !tbaa !5
  %269 = icmp eq i32 %268, -1
  br i1 %269, label %270, label %278

270:                                              ; preds = %267
  %271 = load i32, ptr %15, align 4, !tbaa !5
  %272 = shl i32 %271, 1
  store i32 %272, ptr %15, align 4, !tbaa !5
  %273 = icmp sge i32 %272, 1000000007
  br i1 %273, label %274, label %277

274:                                              ; preds = %270
  %275 = load i32, ptr %15, align 4, !tbaa !5
  %276 = sub nsw i32 %275, 1000000007
  store i32 %276, ptr %15, align 4, !tbaa !5
  br label %277

277:                                              ; preds = %274, %270
  store i32 33, ptr %3, align 4
  br label %316

278:                                              ; preds = %267
  %279 = load i32, ptr %14, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %280
  %282 = load i32, ptr %17, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %283
  call void @_ZSt4swapISt6bitsetILm401EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(56) %281, ptr noundef nonnull align 8 dereferenceable(56) %284) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %285

285:                                              ; preds = %310, %278
  %286 = load i32, ptr %19, align 4, !tbaa !5
  %287 = load i32, ptr @m, align 4, !tbaa !5
  %288 = icmp slt i32 %286, %287
  br i1 %288, label %290, label %289

289:                                              ; preds = %285
  store i32 37, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %313

290:                                              ; preds = %285
  %291 = load i32, ptr %19, align 4, !tbaa !5
  %292 = load i32, ptr %14, align 4, !tbaa !5
  %293 = icmp ne i32 %291, %292
  br i1 %293, label %294, label %309

294:                                              ; preds = %290
  %295 = load i32, ptr %19, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %296
  %298 = load i32, ptr %16, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = call noundef zeroext i1 @_ZNKSt6bitsetILm401EE4testEm(ptr noundef nonnull align 8 dereferenceable(56) %297, i64 noundef %299)
  br i1 %300, label %301, label %309

301:                                              ; preds = %294
  %302 = load i32, ptr %14, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %303
  %305 = load i32, ptr %19, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %306
  %308 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(56) %307, ptr noundef nonnull align 8 dereferenceable(56) %304) #7
  br label %309

309:                                              ; preds = %301, %294, %290
  br label %310

310:                                              ; preds = %309
  %311 = load i32, ptr %19, align 4, !tbaa !5
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %19, align 4, !tbaa !5
  br label %285, !llvm.loop !20

313:                                              ; preds = %289
  %314 = load i32, ptr %14, align 4, !tbaa !5
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %14, align 4, !tbaa !5
  store i32 0, ptr %3, align 4
  br label %316

316:                                              ; preds = %313, %277
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  %317 = load i32, ptr %3, align 4
  switch i32 %317, label %352 [
    i32 0, label %318
    i32 33, label %319
  ]

318:                                              ; preds = %316
  br label %319

319:                                              ; preds = %318, %316
  %320 = load i32, ptr %16, align 4, !tbaa !5
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr %16, align 4, !tbaa !5
  br label %241, !llvm.loop !21

322:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %323 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %323, ptr %20, align 4, !tbaa !5
  br label %324

324:                                              ; preds = %344, %322
  %325 = load i32, ptr %20, align 4, !tbaa !5
  %326 = load i32, ptr @m, align 4, !tbaa !5
  %327 = icmp slt i32 %325, %326
  br i1 %327, label %329, label %328

328:                                              ; preds = %324
  store i32 40, ptr %3, align 4
  br label %347

329:                                              ; preds = %324
  %330 = load i32, ptr %20, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %331
  %333 = call noundef i64 @_ZNKSt6bitsetILm401EE5countEv(ptr noundef nonnull align 8 dereferenceable(56) %332) #7
  %334 = icmp eq i64 %333, 1
  br i1 %334, label %335, label %343

335:                                              ; preds = %329
  %336 = load i32, ptr %20, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %337
  %339 = load i32, ptr @all, align 4, !tbaa !5
  %340 = sext i32 %339 to i64
  %341 = call noundef zeroext i1 @_ZNKSt6bitsetILm401EE4testEm(ptr noundef nonnull align 8 dereferenceable(56) %338, i64 noundef %340)
  br i1 %341, label %342, label %343

342:                                              ; preds = %335
  store i32 0, ptr %15, align 4, !tbaa !5
  store i32 40, ptr %3, align 4
  br label %347

343:                                              ; preds = %335, %329
  br label %344

344:                                              ; preds = %343
  %345 = load i32, ptr %20, align 4, !tbaa !5
  %346 = add nsw i32 %345, 1
  store i32 %346, ptr %20, align 4, !tbaa !5
  br label %324, !llvm.loop !22

347:                                              ; preds = %342, %328
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %348

348:                                              ; preds = %347
  %349 = load i32, ptr %15, align 4, !tbaa !5
  %350 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %349)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %22, !llvm.loop !23

351:                                              ; preds = %22
  ret i32 0

352:                                              ; preds = %316
  unreachable
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i1 noundef zeroext) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm401EE4testEm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt6bitsetILm401EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #6

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

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

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #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 = { 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 = 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}
!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"

%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [7 x i64] }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@all = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [400 x i32], align 16
@que = external dso_local global [3640 x i32], align 16
@mat = external dso_local global [3640 x %"class.std::bitset"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not153 = icmp eq i32 %2, 0
  br i1 %.not153, label %._crit_edge156, label %.lr.ph155

.lr.ph155:                                        ; preds = %0, %._crit_edge149
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = mul nsw i32 %5, %5
  store i32 %6, ptr @all, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  %.not157 = icmp eq i32 %5, 0
  br i1 %.not157, label %._crit_edge108, label %.lr.ph107

._crit_edge108:                                   ; preds = %41, %.lr.ph155
  %7 = phi i32 [ 0, %.lr.ph155 ], [ %42, %41 ]
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds i32, ptr @que, i64 %8
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %9)
  %10 = load i32, ptr @tot, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds i32, ptr @que, i64 %11
  %13 = tail call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %12)
  %14 = ptrtoint ptr %13 to i64
  %15 = sub i64 %14, ptrtoint (ptr @que to i64)
  %16 = lshr exact i64 %15, 2
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr @tot, align 4, !tbaa !5
  store i32 0, ptr @m, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph119, label %.preheader100

.lr.ph107:                                        ; preds = %.lr.ph155, %41
  %indvars.iv = phi i64 [ %indvars.iv.next, %41 ], [ 0, %.lr.ph155 ]
  %19 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %20 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %19)
  %21 = load i32, ptr %19, align 4, !tbaa !5
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %.not94102 = icmp slt i32 %21, 4
  br i1 %.not94102, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %33, %.lr.ph107
  %22 = phi i32 [ %tot.promoted, %.lr.ph107 ], [ %34, %33 ]
  %.086.lcssa = phi i32 [ %21, %.lr.ph107 ], [ %.288, %33 ]
  %23 = icmp sgt i32 %.086.lcssa, 1
  br i1 %23, label %37, label %41

.lr.ph:                                           ; preds = %.lr.ph107, %33
  %.085104 = phi i32 [ %35, %33 ], [ 2, %.lr.ph107 ]
  %.086103 = phi i32 [ %.288, %33 ], [ %21, %.lr.ph107 ]
  %24 = phi i32 [ %34, %33 ], [ %tot.promoted, %.lr.ph107 ]
  %25 = srem i32 %.086103, %.085104
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %.preheader96, label %33

.preheader96:                                     ; preds = %.lr.ph, %.preheader96
  %.086.pn = phi i32 [ %.187, %.preheader96 ], [ %.086103, %.lr.ph ]
  %.187 = sdiv i32 %.086.pn, %.085104
  %27 = srem i32 %.187, %.085104
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %.preheader96, label %29, !llvm.loop !9

29:                                               ; preds = %.preheader96
  %30 = add nsw i32 %24, 1
  store i32 %30, ptr @tot, align 4, !tbaa !5
  %31 = sext i32 %24 to i64
  %32 = getelementptr inbounds [3640 x i32], ptr @que, i64 0, i64 %31
  store i32 %.085104, ptr %32, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %.lr.ph, %29
  %34 = phi i32 [ %30, %29 ], [ %24, %.lr.ph ]
  %.288 = phi i32 [ %.187, %29 ], [ %.086103, %.lr.ph ]
  %35 = add nuw nsw i32 %.085104, 1
  %36 = mul nuw nsw i32 %35, %35
  %.not94 = icmp sgt i32 %36, %.288
  br i1 %.not94, label %._crit_edge, label %.lr.ph, !llvm.loop !11

37:                                               ; preds = %._crit_edge
  %38 = add nsw i32 %22, 1
  store i32 %38, ptr @tot, align 4, !tbaa !5
  %39 = sext i32 %22 to i64
  %40 = getelementptr inbounds [3640 x i32], ptr @que, i64 0, i64 %39
  store i32 %.086.lcssa, ptr %40, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %37, %._crit_edge
  %42 = phi i32 [ %38, %37 ], [ %22, %._crit_edge ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %43 = load i32, ptr @all, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv.next, %44
  br i1 %45, label %.lr.ph107, label %._crit_edge108, !llvm.loop !12

.preheader100:                                    ; preds = %._crit_edge116, %._crit_edge108
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph131, label %.preheader99

.lr.ph119:                                        ; preds = %._crit_edge108, %._crit_edge116
  %48 = phi i32 [ %61, %._crit_edge116 ], [ 0, %._crit_edge108 ]
  %indvars.iv164 = phi i64 [ %indvars.iv.next165, %._crit_edge116 ], [ 0, %._crit_edge108 ]
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %49
  %51 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE5resetEv(ptr noundef nonnull align 8 dereferenceable(56) %50) #6
  %52 = load i32, ptr @all, align 4, !tbaa !5
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.preheader.lr.ph, label %._crit_edge116

.preheader.lr.ph:                                 ; preds = %.lr.ph119
  %54 = getelementptr inbounds [3640 x i32], ptr @que, i64 0, i64 %indvars.iv164
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %.thread182
  %55 = phi i32 [ %52, %.preheader.lr.ph ], [ %77, %.thread182 ]
  %indvars.iv161 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next162, %.thread182 ]
  %56 = getelementptr inbounds [400 x i32], ptr @a, i64 0, i64 %indvars.iv161
  %57 = load i32, ptr %54, align 4, !tbaa !5
  %.promoted = load i32, ptr %56, align 4, !tbaa !5
  %58 = srem i32 %.promoted, %57
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %.lr.ph110, label %.thread182

._crit_edge116:                                   ; preds = %.thread182, %.lr.ph119
  %60 = load i32, ptr @m, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr @m, align 4, !tbaa !5
  %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
  %62 = load i32, ptr @tot, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next165, %63
  br i1 %64, label %.lr.ph119, label %.preheader100, !llvm.loop !13

.lr.ph110:                                        ; preds = %.preheader, %.lr.ph110
  %.082109 = phi i32 [ %67, %.lr.ph110 ], [ 0, %.preheader ]
  %65 = phi i32 [ %66, %.lr.ph110 ], [ %.promoted, %.preheader ]
  %66 = sdiv i32 %65, %57
  %67 = add nuw nsw i32 %.082109, 1
  %68 = srem i32 %66, %57
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %.lr.ph110, label %70, !llvm.loop !14

70:                                               ; preds = %.lr.ph110
  store i32 %66, ptr %56, align 4, !tbaa !5
  %71 = and i32 %.082109, 1
  %.not93.not = icmp eq i32 %71, 0
  br i1 %.not93.not, label %72, label %.thread182

72:                                               ; preds = %70
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %74
  %76 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %75, i64 noundef %indvars.iv161, i1 noundef zeroext true)
  %.pre = load i32, ptr @all, align 4, !tbaa !5
  br label %.thread182

.thread182:                                       ; preds = %.preheader, %72, %70
  %77 = phi i32 [ %.pre, %72 ], [ %55, %70 ], [ %55, %.preheader ]
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next162, %78
  br i1 %79, label %.preheader, label %._crit_edge116, !llvm.loop !15

.preheader99:                                     ; preds = %._crit_edge129, %.preheader100
  %80 = load i32, ptr @all, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.preheader97, label %.preheader98

.lr.ph131:                                        ; preds = %.preheader100, %._crit_edge129
  %.081130 = phi i32 [ %117, %._crit_edge129 ], [ 0, %.preheader100 ]
  %82 = load i32, ptr @m, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %83
  %85 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE5resetEv(ptr noundef nonnull align 8 dereferenceable(56) %84) #6
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp sgt i32 %86, 0
  br i1 %87, label %.lr.ph123.preheader, label %._crit_edge124

.lr.ph123.preheader:                              ; preds = %.lr.ph131
  %88 = mul i32 %86, %.081130
  %89 = sext i32 %88 to i64
  br label %.lr.ph123

._crit_edge124:                                   ; preds = %.lr.ph123, %.lr.ph131
  %90 = load i32, ptr @m, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr @m, align 4, !tbaa !5
  %92 = sext i32 %90 to i64
  %93 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %92
  %94 = load i32, ptr @all, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %93, i64 noundef %95, i1 noundef zeroext true)
  %97 = load i32, ptr @m, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %98
  %100 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE5resetEv(ptr noundef nonnull align 8 dereferenceable(56) %99) #6
  %101 = load i32, ptr @n, align 4, !tbaa !5
  %102 = icmp sgt i32 %101, 0
  br i1 %102, label %.lr.ph128, label %._crit_edge129

.lr.ph123:                                        ; preds = %.lr.ph123.preheader, %.lr.ph123
  %indvars.iv167 = phi i64 [ %89, %.lr.ph123.preheader ], [ %indvars.iv.next168, %.lr.ph123 ]
  %.080120 = phi i32 [ 0, %.lr.ph123.preheader ], [ %107, %.lr.ph123 ]
  %103 = load i32, ptr @m, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %104
  %106 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %105, i64 noundef %indvars.iv167, i1 noundef zeroext true)
  %107 = add nuw nsw i32 %.080120, 1
  %indvars.iv.next168 = add nsw i64 %indvars.iv167, 1
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %.lr.ph123, label %._crit_edge124, !llvm.loop !16

._crit_edge129:                                   ; preds = %.lr.ph128, %._crit_edge124
  %110 = load i32, ptr @m, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr @m, align 4, !tbaa !5
  %112 = sext i32 %110 to i64
  %113 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %112
  %114 = load i32, ptr @all, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %113, i64 noundef %115, i1 noundef zeroext true)
  %117 = add nuw nsw i32 %.081130, 1
  %118 = load i32, ptr @n, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %.lr.ph131, label %.preheader99, !llvm.loop !17

.lr.ph128:                                        ; preds = %._crit_edge124, %.lr.ph128
  %.077126 = phi i32 [ %127, %.lr.ph128 ], [ %.081130, %._crit_edge124 ]
  %.078125 = phi i32 [ %125, %.lr.ph128 ], [ 0, %._crit_edge124 ]
  %120 = load i32, ptr @m, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %121
  %123 = sext i32 %.077126 to i64
  %124 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EE3setEmb(ptr noundef nonnull align 8 dereferenceable(56) %122, i64 noundef %123, i1 noundef zeroext true)
  %125 = add nuw nsw i32 %.078125, 1
  %126 = load i32, ptr @n, align 4, !tbaa !5
  %127 = add nsw i32 %126, %.077126
  %128 = icmp slt i32 %125, %126
  br i1 %128, label %.lr.ph128, label %._crit_edge129, !llvm.loop !18

.preheader98:                                     ; preds = %165, %.preheader99
  %.075.lcssa = phi i32 [ 0, %.preheader99 ], [ %.176, %165 ]
  %.074.lcssa = phi i32 [ 1, %.preheader99 ], [ %.2, %165 ]
  %129 = load i32, ptr @m, align 4, !tbaa !5
  %130 = icmp slt i32 %.075.lcssa, %129
  br i1 %130, label %.lr.ph148.preheader, label %._crit_edge149

.lr.ph148.preheader:                              ; preds = %.preheader98
  %131 = sext i32 %.075.lcssa to i64
  br label %.lr.ph148

.preheader97:                                     ; preds = %.preheader99, %165
  %indvars.iv176 = phi i64 [ %indvars.iv.next177, %165 ], [ 0, %.preheader99 ]
  %.074140 = phi i32 [ %.2, %165 ], [ 1, %.preheader99 ]
  %.075138 = phi i32 [ %.176, %165 ], [ 0, %.preheader99 ]
  %132 = load i32, ptr @m, align 4, !tbaa !5
  %133 = icmp slt i32 %.075138, %132
  br i1 %133, label %.lr.ph133, label %.thread

.lr.ph133:                                        ; preds = %.preheader97
  %134 = sext i32 %.075138 to i64
  br label %135

135:                                              ; preds = %.lr.ph133, %138
  %indvars.iv170 = phi i64 [ %134, %.lr.ph133 ], [ %indvars.iv.next171, %138 ]
  %136 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %indvars.iv170
  %137 = tail call noundef zeroext i1 @_ZNKSt6bitsetILm401EE4testEm(ptr noundef nonnull align 8 dereferenceable(56) %136, i64 noundef %indvars.iv176)
  br i1 %137, label %142, label %138

138:                                              ; preds = %135
  %indvars.iv.next171 = add nsw i64 %indvars.iv170, 1
  %139 = load i32, ptr @m, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = icmp slt i64 %indvars.iv.next171, %140
  br i1 %141, label %135, label %.thread, !llvm.loop !19

142:                                              ; preds = %135
  %143 = icmp eq i64 %indvars.iv170, -1
  br i1 %143, label %.thread, label %147

.thread:                                          ; preds = %138, %.preheader97, %142
  %144 = shl i32 %.074140, 1
  %145 = icmp sgt i32 %144, 1000000006
  %146 = add nsw i32 %144, -1000000007
  %spec.select = select i1 %145, i32 %146, i32 %144
  br label %165

147:                                              ; preds = %142
  %148 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %134
  %sext = shl i64 %indvars.iv170, 32
  %149 = ashr exact i64 %sext, 32
  %150 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %149
  tail call void @_ZSt4swapISt6bitsetILm401EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(56) %148, ptr noundef nonnull align 8 dereferenceable(56) %150) #6
  %151 = load i32, ptr @m, align 4, !tbaa !5
  %152 = icmp sgt i32 %151, 0
  br i1 %152, label %.lr.ph136, label %._crit_edge137

.lr.ph136:                                        ; preds = %147
  %153 = zext i32 %.075138 to i64
  br label %155

._crit_edge137:                                   ; preds = %161, %147
  %154 = add nsw i32 %.075138, 1
  br label %165

155:                                              ; preds = %.lr.ph136, %161
  %indvars.iv173 = phi i64 [ 0, %.lr.ph136 ], [ %indvars.iv.next174, %161 ]
  %.not92 = icmp eq i64 %indvars.iv173, %153
  br i1 %.not92, label %161, label %156

156:                                              ; preds = %155
  %157 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %indvars.iv173
  %158 = tail call noundef zeroext i1 @_ZNKSt6bitsetILm401EE4testEm(ptr noundef nonnull align 8 dereferenceable(56) %157, i64 noundef %indvars.iv176)
  br i1 %158, label %159, label %161

159:                                              ; preds = %156
  %160 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6bitsetILm401EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(56) %157, ptr noundef nonnull align 8 dereferenceable(56) %148) #6
  br label %161

161:                                              ; preds = %155, %156, %159
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %162 = load i32, ptr @m, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = icmp slt i64 %indvars.iv.next174, %163
  br i1 %164, label %155, label %._crit_edge137, !llvm.loop !20

165:                                              ; preds = %._crit_edge137, %.thread
  %.176 = phi i32 [ %.075138, %.thread ], [ %154, %._crit_edge137 ]
  %.2 = phi i32 [ %spec.select, %.thread ], [ %.074140, %._crit_edge137 ]
  %indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
  %166 = load i32, ptr @all, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = icmp slt i64 %indvars.iv.next177, %167
  br i1 %168, label %.preheader97, label %.preheader98, !llvm.loop !21

.lr.ph148:                                        ; preds = %.lr.ph148.preheader, %176
  %indvars.iv179 = phi i64 [ %131, %.lr.ph148.preheader ], [ %indvars.iv.next180, %176 ]
  %169 = getelementptr inbounds [3640 x %"class.std::bitset"], ptr @mat, i64 0, i64 %indvars.iv179
  %170 = tail call noundef i64 @_ZNKSt6bitsetILm401EE5countEv(ptr noundef nonnull align 8 dereferenceable(56) %169) #6
  %171 = icmp eq i64 %170, 1
  br i1 %171, label %172, label %176

172:                                              ; preds = %.lr.ph148
  %173 = load i32, ptr @all, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = tail call noundef zeroext i1 @_ZNKSt6bitsetILm401EE4testEm(ptr noundef nonnull align 8 dereferenceable(56) %169, i64 noundef %174)
  br i1 %175, label %._crit_edge149, label %176

176:                                              ; preds = %.lr.ph148, %172
  %indvars.iv.next180 = add nsw i64 %indvars.iv179, 1
  %177 = load i32, ptr @m, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = icmp slt i64 %indvars.iv.next180, %178
  br i1 %179, label %.lr.ph148, label %._crit_edge149, !llvm.loop !22

._crit_edge149:                                   ; preds = %176, %172, %.preheader98
  %.3 = phi i32 [ %.074.lcssa, %.preheader98 ], [ 0, %172 ], [ %.074.lcssa, %176 ]
  %180 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.3)
  %181 = load i32, ptr @t, align 4, !tbaa !5
  %182 = add nsw i32 %181, -1
  store i32 %182, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %181, 0
  br i1 %.not, label %._crit_edge156, label %.lr.ph155, !llvm.loop !23

._crit_edge156:                                   ; preds = %._crit_edge149, %0
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt6bitsetILm401EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5

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

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

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

attributes #0 = { 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 #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 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 = { 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 #6 = { 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 = 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}
!23 = distinct !{!23, !10}


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