; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-05-22 (G - “Swap-Plus” Puzzle - 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"

@mat = external dso_local global [4 x [4 x i32]], align 16
@row = external dso_local global [4 x i32], align 16
@col = external dso_local global [4 x i32], align 16
@seq = external dso_local global [16 x i32], align 16
@ans = external dso_local global i32, align 4
@out = external dso_local global [32 x i32], align 16
@size = external dso_local global i32, align 4
@tmp = external dso_local global [32 x i32], align 16
@vis = external dso_local global [16 x i8], 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
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %49, %0
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp slt i32 %20, 4
  br i1 %21, label %23, label %22

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

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

24:                                               ; preds = %45, %23
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = icmp slt i32 %25, 4
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %24
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %30
  %32 = getelementptr inbounds [4 x i32], ptr %31, i64 0, i64 0
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr %32, i64 %34
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %35)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %38
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [4 x i32], ptr %39, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr %42, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %28
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %4, align 4, !tbaa !5
  br label %24, !llvm.loop !9

48:                                               ; preds = %27
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !11

52:                                               ; preds = %22
  store i32 25, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %62, %52
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = icmp slt i32 %54, 4
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %53
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %60
  store i32 %58, ptr %61, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %57
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %5, align 4, !tbaa !5
  br label %53, !llvm.loop !12

65:                                               ; preds = %56
  br label %66

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

67:                                               ; preds = %76, %66
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = icmp slt i32 %68, 4
  br i1 %69, label %71, label %70

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

71:                                               ; preds = %67
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %74
  store i32 %72, ptr %75, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %71
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %6, align 4, !tbaa !5
  br label %67, !llvm.loop !13

79:                                               ; preds = %70
  br label %80

80:                                               ; preds = %276, %79
  store i32 0, ptr @size, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %130, %80
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = icmp slt i32 %82, 4
  br i1 %83, label %85, label %84

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

85:                                               ; preds = %81
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %87
  %89 = load i8, ptr %88, align 1, !tbaa !14, !range !16, !noundef !17
  %90 = trunc i8 %89 to i1
  br i1 %90, label %129, label %91

91:                                               ; preds = %85
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %93
  store i8 1, ptr %94, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  store i32 %98, ptr %8, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %123, %91
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !14, !range !16, !noundef !17
  %104 = trunc i8 %103 to i1
  %105 = xor i1 %104, true
  br i1 %105, label %107, label %106

106:                                              ; preds = %99
  store i32 21, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %128

107:                                              ; preds = %99
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %109
  store i8 1, ptr %110, align 1, !tbaa !14
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = shl i32 %111, 4
  %113 = or i32 256, %112
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = or i32 %113, %117
  %119 = load i32, ptr @size, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr @size, align 4, !tbaa !5
  %121 = sext i32 %119 to i64
  %122 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %121
  store i32 %118, ptr %122, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %107
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr %8, align 4, !tbaa !5
  br label %99, !llvm.loop !18

128:                                              ; preds = %106
  br label %129

129:                                              ; preds = %128, %85
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %7, align 4, !tbaa !5
  br label %81, !llvm.loop !19

133:                                              ; preds = %84
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %183, %133
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = icmp slt i32 %135, 4
  br i1 %136, label %138, label %137

137:                                              ; preds = %134
  store i32 24, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %186

138:                                              ; preds = %134
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %140
  %142 = load i8, ptr %141, align 1, !tbaa !14, !range !16, !noundef !17
  %143 = trunc i8 %142 to i1
  br i1 %143, label %182, label %144

144:                                              ; preds = %138
  %145 = load i32, ptr %9, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %146
  store i8 1, ptr %147, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  store i32 %151, ptr %10, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %176, %144
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %154
  %156 = load i8, ptr %155, align 1, !tbaa !14, !range !16, !noundef !17
  %157 = trunc i8 %156 to i1
  %158 = xor i1 %157, true
  br i1 %158, label %160, label %159

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

160:                                              ; preds = %152
  %161 = load i32, ptr %10, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %162
  store i8 1, ptr %163, align 1, !tbaa !14
  %164 = load i32, ptr %10, align 4, !tbaa !5
  %165 = shl i32 %164, 4
  %166 = or i32 512, %165
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = or i32 %166, %170
  %172 = load i32, ptr @size, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr @size, align 4, !tbaa !5
  %174 = sext i32 %172 to i64
  %175 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %174
  store i32 %171, ptr %175, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %160
  %177 = load i32, ptr %10, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  store i32 %180, ptr %10, align 4, !tbaa !5
  br label %152, !llvm.loop !20

181:                                              ; preds = %159
  br label %182

182:                                              ; preds = %181, %138
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %9, align 4, !tbaa !5
  br label %134, !llvm.loop !21

186:                                              ; preds = %137
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %210, %186
  %188 = load i32, ptr %11, align 4, !tbaa !5
  %189 = icmp slt i32 %188, 16
  br i1 %189, label %191, label %190

190:                                              ; preds = %187
  store i32 30, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %213

191:                                              ; preds = %187
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = sdiv i32 %192, 4
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %197
  %199 = load i32, ptr %11, align 4, !tbaa !5
  %200 = srem i32 %199, 4
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [4 x i32], ptr %198, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = load i32, ptr %11, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [16 x i32], ptr @seq, i64 0, i64 %208
  store i32 %206, ptr %209, align 4, !tbaa !5
  br label %210

210:                                              ; preds = %191
  %211 = load i32, ptr %11, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %11, align 4, !tbaa !5
  br label %187, !llvm.loop !22

213:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %263, %213
  %215 = load i32, ptr %12, align 4, !tbaa !5
  %216 = icmp slt i32 %215, 16
  br i1 %216, label %218, label %217

217:                                              ; preds = %214
  store i32 33, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %266

218:                                              ; preds = %214
  %219 = load i32, ptr %12, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %220
  %222 = load i8, ptr %221, align 1, !tbaa !14, !range !16, !noundef !17
  %223 = trunc i8 %222 to i1
  br i1 %223, label %262, label %224

224:                                              ; preds = %218
  %225 = load i32, ptr %12, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %226
  store i8 1, ptr %227, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %228 = load i32, ptr %12, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [16 x i32], ptr @seq, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !5
  store i32 %231, ptr %13, align 4, !tbaa !5
  br label %232

232:                                              ; preds = %256, %224
  %233 = load i32, ptr %13, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %234
  %236 = load i8, ptr %235, align 1, !tbaa !14, !range !16, !noundef !17
  %237 = trunc i8 %236 to i1
  %238 = xor i1 %237, true
  br i1 %238, label %240, label %239

239:                                              ; preds = %232
  store i32 36, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %261

240:                                              ; preds = %232
  %241 = load i32, ptr %13, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %242
  store i8 1, ptr %243, align 1, !tbaa !14
  %244 = load i32, ptr %13, align 4, !tbaa !5
  %245 = shl i32 %244, 4
  %246 = or i32 768, %245
  %247 = load i32, ptr %13, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [16 x i32], ptr @seq, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !5
  %251 = or i32 %246, %250
  %252 = load i32, ptr @size, align 4, !tbaa !5
  %253 = add nsw i32 %252, 1
  store i32 %253, ptr @size, align 4, !tbaa !5
  %254 = sext i32 %252 to i64
  %255 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %254
  store i32 %251, ptr %255, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %240
  %257 = load i32, ptr %13, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [16 x i32], ptr @seq, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !5
  store i32 %260, ptr %13, align 4, !tbaa !5
  br label %232, !llvm.loop !23

261:                                              ; preds = %239
  br label %262

262:                                              ; preds = %261, %218
  br label %263

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

266:                                              ; preds = %217
  %267 = load i32, ptr @ans, align 4, !tbaa !5
  %268 = load i32, ptr @size, align 4, !tbaa !5
  %269 = icmp sgt i32 %267, %268
  br i1 %269, label %270, label %275

270:                                              ; preds = %266
  %271 = load i32, ptr @size, align 4, !tbaa !5
  store i32 %271, ptr @ans, align 4, !tbaa !5
  %272 = load i32, ptr @size, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = mul i64 %273, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @out, ptr align 16 @tmp, i64 %274, i1 false)
  br label %275

275:                                              ; preds = %270, %266
  br label %276

276:                                              ; preds = %275
  %277 = call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef @col, ptr noundef getelementptr inbounds (i32, ptr @col, i64 4))
  br i1 %277, label %80, label %278, !llvm.loop !25

278:                                              ; preds = %276
  br label %279

279:                                              ; preds = %278
  %280 = call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef @row, ptr noundef getelementptr inbounds (i32, ptr @row, i64 4))
  br i1 %280, label %66, label %281, !llvm.loop !26

281:                                              ; preds = %279
  %282 = load i32, ptr @ans, align 4, !tbaa !5
  %283 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %282)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %284

284:                                              ; preds = %304, %281
  %285 = load i32, ptr %14, align 4, !tbaa !5
  %286 = load i32, ptr @ans, align 4, !tbaa !5
  %287 = icmp slt i32 %285, %286
  br i1 %287, label %289, label %288

288:                                              ; preds = %284
  store i32 39, ptr %3, align 4
  br label %307

289:                                              ; preds = %284
  %290 = load i32, ptr %14, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [32 x i32], ptr @out, i64 0, i64 %291
  %293 = load i32, ptr %292, align 4, !tbaa !5
  %294 = ashr i32 %293, 8
  %295 = icmp eq i32 %294, 3
  br i1 %295, label %296, label %303

296:                                              ; preds = %289
  %297 = load i32, ptr %14, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds i32, ptr @out, i64 %298
  %300 = load i32, ptr @ans, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds i32, ptr @out, i64 %301
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef %299, ptr noundef %302)
  store i32 39, ptr %3, align 4
  br label %307

303:                                              ; preds = %289
  br label %304

304:                                              ; preds = %303
  %305 = load i32, ptr %14, align 4, !tbaa !5
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %14, align 4, !tbaa !5
  br label %284, !llvm.loop !27

307:                                              ; preds = %296, %288
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %308

308:                                              ; preds = %307
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %309

309:                                              ; preds = %364, %308
  %310 = load i32, ptr %15, align 4, !tbaa !5
  %311 = load i32, ptr @ans, align 4, !tbaa !5
  %312 = icmp slt i32 %310, %311
  br i1 %312, label %314, label %313

313:                                              ; preds = %309
  store i32 42, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %367

314:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %315 = load i32, ptr %15, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [32 x i32], ptr @out, i64 0, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = ashr i32 %318, 8
  store i32 %319, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %320 = load i32, ptr %15, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [32 x i32], ptr @out, i64 0, i64 %321
  %323 = load i32, ptr %322, align 4, !tbaa !5
  %324 = ashr i32 %323, 4
  %325 = and i32 %324, 15
  store i32 %325, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %326 = load i32, ptr %15, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [32 x i32], ptr @out, i64 0, i64 %327
  %329 = load i32, ptr %328, align 4, !tbaa !5
  %330 = and i32 %329, 15
  store i32 %330, ptr %18, align 4, !tbaa !5
  %331 = load i32, ptr %16, align 4, !tbaa !5
  %332 = icmp eq i32 %331, 1
  br i1 %332, label %333, label %339

333:                                              ; preds = %314
  %334 = load i32, ptr %17, align 4, !tbaa !5
  %335 = add nsw i32 97, %334
  %336 = load i32, ptr %18, align 4, !tbaa !5
  %337 = add nsw i32 97, %336
  %338 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %335, i32 noundef %337)
  br label %363

339:                                              ; preds = %314
  %340 = load i32, ptr %16, align 4, !tbaa !5
  %341 = icmp eq i32 %340, 2
  br i1 %341, label %342, label %348

342:                                              ; preds = %339
  %343 = load i32, ptr %17, align 4, !tbaa !5
  %344 = add nsw i32 1, %343
  %345 = load i32, ptr %18, align 4, !tbaa !5
  %346 = add nsw i32 1, %345
  %347 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %344, i32 noundef %346)
  br label %362

348:                                              ; preds = %339
  %349 = load i32, ptr %17, align 4, !tbaa !5
  %350 = sdiv i32 %349, 4
  %351 = add nsw i32 97, %350
  %352 = load i32, ptr %17, align 4, !tbaa !5
  %353 = srem i32 %352, 4
  %354 = add nsw i32 1, %353
  %355 = load i32, ptr %18, align 4, !tbaa !5
  %356 = sdiv i32 %355, 4
  %357 = add nsw i32 97, %356
  %358 = load i32, ptr %18, align 4, !tbaa !5
  %359 = srem i32 %358, 4
  %360 = add nsw i32 1, %359
  %361 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %351, i32 noundef %354, i32 noundef %357, i32 noundef %360)
  br label %362

362:                                              ; preds = %348, %342
  br label %363

363:                                              ; preds = %362, %333
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %364

364:                                              ; preds = %363
  %365 = load i32, ptr %15, align 4, !tbaa !5
  %366 = add nsw i32 %365, 1
  store i32 %366, ptr %15, align 4, !tbaa !5
  br label %309, !llvm.loop !28

367:                                              ; preds = %313
  ret i32 0
}

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef, ptr noundef) #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) #6

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !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"

@mat = external dso_local global [4 x [4 x i32]], align 16
@row = external dso_local global [4 x i32], align 16
@col = external dso_local global [4 x i32], align 16
@seq = external dso_local local_unnamed_addr global [16 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@out = external dso_local global [32 x i32], align 16
@size = external dso_local local_unnamed_addr global i32, align 4
@tmp = external dso_local local_unnamed_addr global [32 x i32], align 16
@vis = external dso_local local_unnamed_addr global [16 x i8], 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
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader90:
  %0 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @mat)
  %1 = load i32, ptr @mat, align 16, !tbaa !5
  %2 = add nsw i32 %1, -1
  store i32 %2, ptr @mat, align 16, !tbaa !5
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 4))
  %4 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 4), align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr getelementptr inbounds (i8, ptr @mat, i64 4), align 4, !tbaa !5
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 8))
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 8), align 8, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr getelementptr inbounds (i8, ptr @mat, i64 8), align 8, !tbaa !5
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 12))
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 12), align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr getelementptr inbounds (i8, ptr @mat, i64 12), align 4, !tbaa !5
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 16))
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 16), align 16, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr getelementptr inbounds (i8, ptr @mat, i64 16), align 16, !tbaa !5
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 20))
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 20), align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr getelementptr inbounds (i8, ptr @mat, i64 20), align 4, !tbaa !5
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 24))
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 24), align 8, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr getelementptr inbounds (i8, ptr @mat, i64 24), align 8, !tbaa !5
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 28))
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 28), align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr getelementptr inbounds (i8, ptr @mat, i64 28), align 4, !tbaa !5
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 32))
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 32), align 16, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr getelementptr inbounds (i8, ptr @mat, i64 32), align 16, !tbaa !5
  %27 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 36))
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 36), align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr getelementptr inbounds (i8, ptr @mat, i64 36), align 4, !tbaa !5
  %30 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 40))
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 40), align 8, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr getelementptr inbounds (i8, ptr @mat, i64 40), align 8, !tbaa !5
  %33 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 44))
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 44), align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr getelementptr inbounds (i8, ptr @mat, i64 44), align 4, !tbaa !5
  %36 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 48))
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 48), align 16, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr getelementptr inbounds (i8, ptr @mat, i64 48), align 16, !tbaa !5
  %39 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 52))
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 52), align 4, !tbaa !5
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr getelementptr inbounds (i8, ptr @mat, i64 52), align 4, !tbaa !5
  %42 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 56))
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 56), align 8, !tbaa !5
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr getelementptr inbounds (i8, ptr @mat, i64 56), align 8, !tbaa !5
  %45 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 60))
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @mat, i64 60), align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr getelementptr inbounds (i8, ptr @mat, i64 60), align 4, !tbaa !5
  store i32 25, ptr @ans, align 4, !tbaa !5
  store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, ptr @row, align 16, !tbaa !5
  br label %.preheader89

.preheader89:                                     ; preds = %.preheader90, %286
  store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, ptr @col, align 16, !tbaa !5
  br label %48

48:                                               ; preds = %284, %.preheader89
  store i32 0, ptr @size, align 4, !tbaa !5
  store i32 1, ptr @vis, align 16
  %.07897 = load i32, ptr @row, align 16, !tbaa !5
  %49 = sext i32 %.07897 to i64
  %50 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !9, !range !11, !noundef !12
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %.loopexit87.thread, label %.lr.ph

.lr.ph:                                           ; preds = %48, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %48 ]
  %53 = phi ptr [ %62, %.lr.ph ], [ %50, %48 ]
  %54 = phi i64 [ %61, %.lr.ph ], [ %49, %48 ]
  %.07898 = phi i32 [ %57, %.lr.ph ], [ %.07897, %48 ]
  store i8 1, ptr %53, align 1, !tbaa !9
  %55 = shl i32 %.07898, 4
  %56 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %54
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = or i32 %55, %57
  %59 = or i32 %58, 256
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv
  store i32 %59, ptr %60, align 4, !tbaa !5
  %61 = sext i32 %57 to i64
  %62 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !9, !range !11, !noundef !12
  %64 = trunc nuw i8 %63 to i1
  br i1 %64, label %.loopexit87, label %.lr.ph, !llvm.loop !13

.loopexit87:                                      ; preds = %.lr.ph
  %65 = trunc nsw i64 %indvars.iv.next to i32
  store i32 %65, ptr @size, align 4, !tbaa !5
  %.pre = load i8, ptr getelementptr inbounds (i8, ptr @vis, i64 1), align 1, !tbaa !9, !range !11
  %66 = trunc nuw i8 %.pre to i1
  br i1 %66, label %.loopexit87.1, label %.loopexit87.thread

.loopexit87.thread:                               ; preds = %48, %.loopexit87
  %.lcssa101177 = phi i32 [ %65, %.loopexit87 ], [ 0, %48 ]
  store i8 1, ptr getelementptr inbounds (i8, ptr @vis, i64 1), align 1, !tbaa !9
  %.07897.1 = load i32, ptr getelementptr inbounds (i8, ptr @row, i64 4), align 4, !tbaa !5
  %67 = sext i32 %.07897.1 to i64
  %68 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !9, !range !11, !noundef !12
  %70 = trunc nuw i8 %69 to i1
  br i1 %70, label %.loopexit87.1, label %.lr.ph.preheader.1

.lr.ph.preheader.1:                               ; preds = %.loopexit87.thread
  %71 = sext i32 %.lcssa101177 to i64
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph.1, %.lr.ph.preheader.1
  %indvars.iv.1 = phi i64 [ %71, %.lr.ph.preheader.1 ], [ %indvars.iv.next.1, %.lr.ph.1 ]
  %72 = phi ptr [ %68, %.lr.ph.preheader.1 ], [ %81, %.lr.ph.1 ]
  %73 = phi i64 [ %67, %.lr.ph.preheader.1 ], [ %80, %.lr.ph.1 ]
  %.07898.1 = phi i32 [ %.07897.1, %.lr.ph.preheader.1 ], [ %76, %.lr.ph.1 ]
  store i8 1, ptr %72, align 1, !tbaa !9
  %74 = shl i32 %.07898.1, 4
  %75 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %73
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = or i32 %74, %76
  %78 = or i32 %77, 256
  %indvars.iv.next.1 = add nsw i64 %indvars.iv.1, 1
  %79 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv.1
  store i32 %78, ptr %79, align 4, !tbaa !5
  %80 = sext i32 %76 to i64
  %81 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !9, !range !11, !noundef !12
  %83 = trunc nuw i8 %82 to i1
  br i1 %83, label %..loopexit87_crit_edge.1, label %.lr.ph.1, !llvm.loop !13

..loopexit87_crit_edge.1:                         ; preds = %.lr.ph.1
  %84 = trunc nsw i64 %indvars.iv.next.1 to i32
  store i32 %84, ptr @size, align 4, !tbaa !5
  br label %.loopexit87.1

.loopexit87.1:                                    ; preds = %..loopexit87_crit_edge.1, %.loopexit87.thread, %.loopexit87
  %.lcssa101.1 = phi i32 [ %65, %.loopexit87 ], [ %84, %..loopexit87_crit_edge.1 ], [ %.lcssa101177, %.loopexit87.thread ]
  %85 = load i8, ptr getelementptr inbounds (i8, ptr @vis, i64 2), align 2, !tbaa !9, !range !11, !noundef !12
  %86 = trunc nuw i8 %85 to i1
  br i1 %86, label %.loopexit87.2, label %87

87:                                               ; preds = %.loopexit87.1
  store i8 1, ptr getelementptr inbounds (i8, ptr @vis, i64 2), align 2, !tbaa !9
  %.07897.2 = load i32, ptr getelementptr inbounds (i8, ptr @row, i64 8), align 8, !tbaa !5
  %88 = sext i32 %.07897.2 to i64
  %89 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !9, !range !11, !noundef !12
  %91 = trunc nuw i8 %90 to i1
  br i1 %91, label %.loopexit87.2, label %.lr.ph.preheader.2

.lr.ph.preheader.2:                               ; preds = %87
  %92 = sext i32 %.lcssa101.1 to i64
  br label %.lr.ph.2

.lr.ph.2:                                         ; preds = %.lr.ph.2, %.lr.ph.preheader.2
  %indvars.iv.2 = phi i64 [ %92, %.lr.ph.preheader.2 ], [ %indvars.iv.next.2, %.lr.ph.2 ]
  %93 = phi ptr [ %89, %.lr.ph.preheader.2 ], [ %102, %.lr.ph.2 ]
  %94 = phi i64 [ %88, %.lr.ph.preheader.2 ], [ %101, %.lr.ph.2 ]
  %.07898.2 = phi i32 [ %.07897.2, %.lr.ph.preheader.2 ], [ %97, %.lr.ph.2 ]
  store i8 1, ptr %93, align 1, !tbaa !9
  %95 = shl i32 %.07898.2, 4
  %96 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %94
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = or i32 %95, %97
  %99 = or i32 %98, 256
  %indvars.iv.next.2 = add nsw i64 %indvars.iv.2, 1
  %100 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv.2
  store i32 %99, ptr %100, align 4, !tbaa !5
  %101 = sext i32 %97 to i64
  %102 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !9, !range !11, !noundef !12
  %104 = trunc nuw i8 %103 to i1
  br i1 %104, label %..loopexit87_crit_edge.2, label %.lr.ph.2, !llvm.loop !13

..loopexit87_crit_edge.2:                         ; preds = %.lr.ph.2
  %105 = trunc nsw i64 %indvars.iv.next.2 to i32
  store i32 %105, ptr @size, align 4, !tbaa !5
  br label %.loopexit87.2

.loopexit87.2:                                    ; preds = %..loopexit87_crit_edge.2, %87, %.loopexit87.1
  %.lcssa101.2 = phi i32 [ %.lcssa101.1, %.loopexit87.1 ], [ %105, %..loopexit87_crit_edge.2 ], [ %.lcssa101.1, %87 ]
  %106 = load i8, ptr getelementptr inbounds (i8, ptr @vis, i64 3), align 1, !tbaa !9, !range !11, !noundef !12
  %107 = trunc nuw i8 %106 to i1
  br i1 %107, label %127, label %108

108:                                              ; preds = %.loopexit87.2
  store i8 1, ptr getelementptr inbounds (i8, ptr @vis, i64 3), align 1, !tbaa !9
  %.07897.3 = load i32, ptr getelementptr inbounds (i8, ptr @row, i64 12), align 4, !tbaa !5
  %109 = sext i32 %.07897.3 to i64
  %110 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !9, !range !11, !noundef !12
  %112 = trunc nuw i8 %111 to i1
  br i1 %112, label %127, label %.lr.ph.preheader.3

.lr.ph.preheader.3:                               ; preds = %108
  %113 = sext i32 %.lcssa101.2 to i64
  br label %.lr.ph.3

.lr.ph.3:                                         ; preds = %.lr.ph.3, %.lr.ph.preheader.3
  %indvars.iv.3 = phi i64 [ %113, %.lr.ph.preheader.3 ], [ %indvars.iv.next.3, %.lr.ph.3 ]
  %114 = phi ptr [ %110, %.lr.ph.preheader.3 ], [ %123, %.lr.ph.3 ]
  %115 = phi i64 [ %109, %.lr.ph.preheader.3 ], [ %122, %.lr.ph.3 ]
  %.07898.3 = phi i32 [ %.07897.3, %.lr.ph.preheader.3 ], [ %118, %.lr.ph.3 ]
  store i8 1, ptr %114, align 1, !tbaa !9
  %116 = shl i32 %.07898.3, 4
  %117 = getelementptr inbounds [4 x i32], ptr @row, i64 0, i64 %115
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = or i32 %116, %118
  %120 = or i32 %119, 256
  %indvars.iv.next.3 = add nsw i64 %indvars.iv.3, 1
  %121 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv.3
  store i32 %120, ptr %121, align 4, !tbaa !5
  %122 = sext i32 %118 to i64
  %123 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !9, !range !11, !noundef !12
  %125 = trunc nuw i8 %124 to i1
  br i1 %125, label %..loopexit87_crit_edge.3, label %.lr.ph.3, !llvm.loop !13

..loopexit87_crit_edge.3:                         ; preds = %.lr.ph.3
  %126 = trunc nsw i64 %indvars.iv.next.3 to i32
  store i32 %126, ptr @size, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %.loopexit87.2, %108, %..loopexit87_crit_edge.3
  %size.promoted109 = phi i32 [ %126, %..loopexit87_crit_edge.3 ], [ %.lcssa101.2, %108 ], [ %.lcssa101.2, %.loopexit87.2 ]
  store i32 1, ptr @vis, align 16
  %.076105 = load i32, ptr @col, align 16, !tbaa !5
  %128 = sext i32 %.076105 to i64
  %129 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !9, !range !11, !noundef !12
  %131 = trunc nuw i8 %130 to i1
  br i1 %131, label %.loopexit86.thread, label %.lr.ph107.preheader

.lr.ph107.preheader:                              ; preds = %127
  %132 = sext i32 %size.promoted109 to i64
  br label %.lr.ph107

.lr.ph107:                                        ; preds = %.lr.ph107.preheader, %.lr.ph107
  %indvars.iv142 = phi i64 [ %132, %.lr.ph107.preheader ], [ %indvars.iv.next143, %.lr.ph107 ]
  %133 = phi ptr [ %129, %.lr.ph107.preheader ], [ %142, %.lr.ph107 ]
  %134 = phi i64 [ %128, %.lr.ph107.preheader ], [ %141, %.lr.ph107 ]
  %.076106 = phi i32 [ %.076105, %.lr.ph107.preheader ], [ %137, %.lr.ph107 ]
  store i8 1, ptr %133, align 1, !tbaa !9
  %135 = shl i32 %.076106, 4
  %136 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %134
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = or i32 %135, %137
  %139 = or i32 %138, 512
  %indvars.iv.next143 = add nsw i64 %indvars.iv142, 1
  %140 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv142
  store i32 %139, ptr %140, align 4, !tbaa !5
  %141 = sext i32 %137 to i64
  %142 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !9, !range !11, !noundef !12
  %144 = trunc nuw i8 %143 to i1
  br i1 %144, label %.loopexit86, label %.lr.ph107, !llvm.loop !15

.loopexit86:                                      ; preds = %.lr.ph107
  %145 = trunc nsw i64 %indvars.iv.next143 to i32
  store i32 %145, ptr @size, align 4, !tbaa !5
  %.pre168 = load i8, ptr getelementptr inbounds (i8, ptr @vis, i64 1), align 1, !tbaa !9, !range !11
  %146 = trunc nuw i8 %.pre168 to i1
  br i1 %146, label %.loopexit86.1, label %.loopexit86.thread

.loopexit86.thread:                               ; preds = %127, %.loopexit86
  %.lcssa108111179 = phi i32 [ %145, %.loopexit86 ], [ %size.promoted109, %127 ]
  store i8 1, ptr getelementptr inbounds (i8, ptr @vis, i64 1), align 1, !tbaa !9
  %.076105.1 = load i32, ptr getelementptr inbounds (i8, ptr @col, i64 4), align 4, !tbaa !5
  %147 = sext i32 %.076105.1 to i64
  %148 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %147
  %149 = load i8, ptr %148, align 1, !tbaa !9, !range !11, !noundef !12
  %150 = trunc nuw i8 %149 to i1
  br i1 %150, label %.loopexit86.1, label %.lr.ph107.preheader.1

.lr.ph107.preheader.1:                            ; preds = %.loopexit86.thread
  %151 = sext i32 %.lcssa108111179 to i64
  br label %.lr.ph107.1

.lr.ph107.1:                                      ; preds = %.lr.ph107.1, %.lr.ph107.preheader.1
  %indvars.iv142.1 = phi i64 [ %151, %.lr.ph107.preheader.1 ], [ %indvars.iv.next143.1, %.lr.ph107.1 ]
  %152 = phi ptr [ %148, %.lr.ph107.preheader.1 ], [ %161, %.lr.ph107.1 ]
  %153 = phi i64 [ %147, %.lr.ph107.preheader.1 ], [ %160, %.lr.ph107.1 ]
  %.076106.1 = phi i32 [ %.076105.1, %.lr.ph107.preheader.1 ], [ %156, %.lr.ph107.1 ]
  store i8 1, ptr %152, align 1, !tbaa !9
  %154 = shl i32 %.076106.1, 4
  %155 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %153
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = or i32 %154, %156
  %158 = or i32 %157, 512
  %indvars.iv.next143.1 = add nsw i64 %indvars.iv142.1, 1
  %159 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv142.1
  store i32 %158, ptr %159, align 4, !tbaa !5
  %160 = sext i32 %156 to i64
  %161 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %160
  %162 = load i8, ptr %161, align 1, !tbaa !9, !range !11, !noundef !12
  %163 = trunc nuw i8 %162 to i1
  br i1 %163, label %..loopexit86_crit_edge.1, label %.lr.ph107.1, !llvm.loop !15

..loopexit86_crit_edge.1:                         ; preds = %.lr.ph107.1
  %164 = trunc nsw i64 %indvars.iv.next143.1 to i32
  store i32 %164, ptr @size, align 4, !tbaa !5
  br label %.loopexit86.1

.loopexit86.1:                                    ; preds = %..loopexit86_crit_edge.1, %.loopexit86.thread, %.loopexit86
  %.lcssa108111.1 = phi i32 [ %145, %.loopexit86 ], [ %164, %..loopexit86_crit_edge.1 ], [ %.lcssa108111179, %.loopexit86.thread ]
  %165 = load i8, ptr getelementptr inbounds (i8, ptr @vis, i64 2), align 2, !tbaa !9, !range !11, !noundef !12
  %166 = trunc nuw i8 %165 to i1
  br i1 %166, label %.loopexit86.2, label %167

167:                                              ; preds = %.loopexit86.1
  store i8 1, ptr getelementptr inbounds (i8, ptr @vis, i64 2), align 2, !tbaa !9
  %.076105.2 = load i32, ptr getelementptr inbounds (i8, ptr @col, i64 8), align 8, !tbaa !5
  %168 = sext i32 %.076105.2 to i64
  %169 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %168
  %170 = load i8, ptr %169, align 1, !tbaa !9, !range !11, !noundef !12
  %171 = trunc nuw i8 %170 to i1
  br i1 %171, label %.loopexit86.2, label %.lr.ph107.preheader.2

.lr.ph107.preheader.2:                            ; preds = %167
  %172 = sext i32 %.lcssa108111.1 to i64
  br label %.lr.ph107.2

.lr.ph107.2:                                      ; preds = %.lr.ph107.2, %.lr.ph107.preheader.2
  %indvars.iv142.2 = phi i64 [ %172, %.lr.ph107.preheader.2 ], [ %indvars.iv.next143.2, %.lr.ph107.2 ]
  %173 = phi ptr [ %169, %.lr.ph107.preheader.2 ], [ %182, %.lr.ph107.2 ]
  %174 = phi i64 [ %168, %.lr.ph107.preheader.2 ], [ %181, %.lr.ph107.2 ]
  %.076106.2 = phi i32 [ %.076105.2, %.lr.ph107.preheader.2 ], [ %177, %.lr.ph107.2 ]
  store i8 1, ptr %173, align 1, !tbaa !9
  %175 = shl i32 %.076106.2, 4
  %176 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %174
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = or i32 %175, %177
  %179 = or i32 %178, 512
  %indvars.iv.next143.2 = add nsw i64 %indvars.iv142.2, 1
  %180 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv142.2
  store i32 %179, ptr %180, align 4, !tbaa !5
  %181 = sext i32 %177 to i64
  %182 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %181
  %183 = load i8, ptr %182, align 1, !tbaa !9, !range !11, !noundef !12
  %184 = trunc nuw i8 %183 to i1
  br i1 %184, label %..loopexit86_crit_edge.2, label %.lr.ph107.2, !llvm.loop !15

..loopexit86_crit_edge.2:                         ; preds = %.lr.ph107.2
  %185 = trunc nsw i64 %indvars.iv.next143.2 to i32
  store i32 %185, ptr @size, align 4, !tbaa !5
  br label %.loopexit86.2

.loopexit86.2:                                    ; preds = %..loopexit86_crit_edge.2, %167, %.loopexit86.1
  %.lcssa108111.2 = phi i32 [ %.lcssa108111.1, %.loopexit86.1 ], [ %185, %..loopexit86_crit_edge.2 ], [ %.lcssa108111.1, %167 ]
  %186 = load i8, ptr getelementptr inbounds (i8, ptr @vis, i64 3), align 1, !tbaa !9, !range !11, !noundef !12
  %187 = trunc nuw i8 %186 to i1
  %.pre169 = load i32, ptr getelementptr inbounds (i8, ptr @col, i64 12), align 4, !tbaa !5
  br i1 %187, label %.loopexit86.2..loopexit86.3_crit_edge, label %188

.loopexit86.2..loopexit86.3_crit_edge:            ; preds = %.loopexit86.2
  %.pre175 = sext i32 %.pre169 to i64
  br label %.loopexit86.3

188:                                              ; preds = %.loopexit86.2
  store i8 1, ptr getelementptr inbounds (i8, ptr @vis, i64 3), align 1, !tbaa !9
  %189 = sext i32 %.pre169 to i64
  %190 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %189
  %191 = load i8, ptr %190, align 1, !tbaa !9, !range !11, !noundef !12
  %192 = trunc nuw i8 %191 to i1
  br i1 %192, label %.loopexit86.3, label %.lr.ph107.preheader.3

.lr.ph107.preheader.3:                            ; preds = %188
  %193 = sext i32 %.lcssa108111.2 to i64
  br label %.lr.ph107.3

.lr.ph107.3:                                      ; preds = %.lr.ph107.3, %.lr.ph107.preheader.3
  %indvars.iv142.3 = phi i64 [ %193, %.lr.ph107.preheader.3 ], [ %indvars.iv.next143.3, %.lr.ph107.3 ]
  %194 = phi ptr [ %190, %.lr.ph107.preheader.3 ], [ %203, %.lr.ph107.3 ]
  %195 = phi i64 [ %189, %.lr.ph107.preheader.3 ], [ %202, %.lr.ph107.3 ]
  %.076106.3 = phi i32 [ %.pre169, %.lr.ph107.preheader.3 ], [ %198, %.lr.ph107.3 ]
  store i8 1, ptr %194, align 1, !tbaa !9
  %196 = shl i32 %.076106.3, 4
  %197 = getelementptr inbounds [4 x i32], ptr @col, i64 0, i64 %195
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = or i32 %196, %198
  %200 = or i32 %199, 512
  %indvars.iv.next143.3 = add nsw i64 %indvars.iv142.3, 1
  %201 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv142.3
  store i32 %200, ptr %201, align 4, !tbaa !5
  %202 = sext i32 %198 to i64
  %203 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %202
  %204 = load i8, ptr %203, align 1, !tbaa !9, !range !11, !noundef !12
  %205 = trunc nuw i8 %204 to i1
  br i1 %205, label %..loopexit86_crit_edge.3, label %.lr.ph107.3, !llvm.loop !15

..loopexit86_crit_edge.3:                         ; preds = %.lr.ph107.3
  %206 = trunc nsw i64 %indvars.iv.next143.3 to i32
  store i32 %206, ptr @size, align 4, !tbaa !5
  br label %.loopexit86.3

.loopexit86.3:                                    ; preds = %.loopexit86.2..loopexit86.3_crit_edge, %..loopexit86_crit_edge.3, %188
  %.pre-phi = phi i64 [ %.pre175, %.loopexit86.2..loopexit86.3_crit_edge ], [ %189, %..loopexit86_crit_edge.3 ], [ %189, %188 ]
  %size.promoted120 = phi i32 [ %.lcssa108111.2, %.loopexit86.2..loopexit86.3_crit_edge ], [ %206, %..loopexit86_crit_edge.3 ], [ %.lcssa108111.2, %188 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @vis, i8 0, i64 16, i1 false)
  %207 = load i32, ptr @row, align 16, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = load i32, ptr @col, align 16, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %208, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  store i32 %212, ptr @seq, align 16, !tbaa !5
  %213 = load i32, ptr getelementptr inbounds (i8, ptr @col, i64 4), align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %208, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  store i32 %216, ptr getelementptr inbounds (i8, ptr @seq, i64 4), align 4, !tbaa !5
  %217 = load i32, ptr getelementptr inbounds (i8, ptr @col, i64 8), align 8, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %208, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !5
  store i32 %220, ptr getelementptr inbounds (i8, ptr @seq, i64 8), align 8, !tbaa !5
  %221 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %208, i64 %.pre-phi
  %222 = load i32, ptr %221, align 4, !tbaa !5
  store i32 %222, ptr getelementptr inbounds (i8, ptr @seq, i64 12), align 4, !tbaa !5
  %223 = load i32, ptr getelementptr inbounds (i8, ptr @row, i64 4), align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %224, i64 %210
  %226 = load i32, ptr %225, align 4, !tbaa !5
  store i32 %226, ptr getelementptr inbounds (i8, ptr @seq, i64 16), align 16, !tbaa !5
  %227 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %224, i64 %214
  %228 = load i32, ptr %227, align 4, !tbaa !5
  store i32 %228, ptr getelementptr inbounds (i8, ptr @seq, i64 20), align 4, !tbaa !5
  %229 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %224, i64 %218
  %230 = load i32, ptr %229, align 4, !tbaa !5
  store i32 %230, ptr getelementptr inbounds (i8, ptr @seq, i64 24), align 8, !tbaa !5
  %231 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %224, i64 %.pre-phi
  %232 = load i32, ptr %231, align 4, !tbaa !5
  store i32 %232, ptr getelementptr inbounds (i8, ptr @seq, i64 28), align 4, !tbaa !5
  %233 = load i32, ptr getelementptr inbounds (i8, ptr @row, i64 8), align 8, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %234, i64 %210
  %236 = load i32, ptr %235, align 4, !tbaa !5
  store i32 %236, ptr getelementptr inbounds (i8, ptr @seq, i64 32), align 16, !tbaa !5
  %237 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %234, i64 %214
  %238 = load i32, ptr %237, align 4, !tbaa !5
  store i32 %238, ptr getelementptr inbounds (i8, ptr @seq, i64 36), align 4, !tbaa !5
  %239 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %234, i64 %218
  %240 = load i32, ptr %239, align 4, !tbaa !5
  store i32 %240, ptr getelementptr inbounds (i8, ptr @seq, i64 40), align 8, !tbaa !5
  %241 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %234, i64 %.pre-phi
  %242 = load i32, ptr %241, align 4, !tbaa !5
  store i32 %242, ptr getelementptr inbounds (i8, ptr @seq, i64 44), align 4, !tbaa !5
  %243 = load i32, ptr getelementptr inbounds (i8, ptr @row, i64 12), align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %244, i64 %210
  %246 = load i32, ptr %245, align 4, !tbaa !5
  store i32 %246, ptr getelementptr inbounds (i8, ptr @seq, i64 48), align 16, !tbaa !5
  %247 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %244, i64 %214
  %248 = load i32, ptr %247, align 4, !tbaa !5
  store i32 %248, ptr getelementptr inbounds (i8, ptr @seq, i64 52), align 4, !tbaa !5
  %249 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %244, i64 %218
  %250 = load i32, ptr %249, align 4, !tbaa !5
  store i32 %250, ptr getelementptr inbounds (i8, ptr @seq, i64 56), align 8, !tbaa !5
  %251 = getelementptr inbounds [4 x [4 x i32]], ptr @mat, i64 0, i64 %244, i64 %.pre-phi
  %252 = load i32, ptr %251, align 4, !tbaa !5
  store i32 %252, ptr getelementptr inbounds (i8, ptr @seq, i64 60), align 4, !tbaa !5
  br label %256

253:                                              ; preds = %.loopexit85
  %254 = load i32, ptr @ans, align 4, !tbaa !5
  %255 = icmp sgt i32 %254, %280
  br i1 %255, label %281, label %284

256:                                              ; preds = %.loopexit86.3, %.loopexit85
  %indvars.iv154 = phi i64 [ 0, %.loopexit86.3 ], [ %indvars.iv.next155, %.loopexit85 ]
  %.lcssa119123124 = phi i32 [ %size.promoted120, %.loopexit86.3 ], [ %280, %.loopexit85 ]
  %257 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %indvars.iv154
  %258 = load i8, ptr %257, align 1, !tbaa !9, !range !11, !noundef !12
  %259 = trunc nuw i8 %258 to i1
  br i1 %259, label %.loopexit85, label %260

260:                                              ; preds = %256
  store i8 1, ptr %257, align 1, !tbaa !9
  %261 = getelementptr inbounds [16 x i32], ptr @seq, i64 0, i64 %indvars.iv154
  %.073116 = load i32, ptr %261, align 4, !tbaa !5
  %262 = sext i32 %.073116 to i64
  %263 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %262
  %264 = load i8, ptr %263, align 1, !tbaa !9, !range !11, !noundef !12
  %265 = trunc nuw i8 %264 to i1
  br i1 %265, label %.loopexit85, label %.lr.ph118.preheader

.lr.ph118.preheader:                              ; preds = %260
  %266 = sext i32 %.lcssa119123124 to i64
  br label %.lr.ph118

.lr.ph118:                                        ; preds = %.lr.ph118.preheader, %.lr.ph118
  %indvars.iv151 = phi i64 [ %266, %.lr.ph118.preheader ], [ %indvars.iv.next152, %.lr.ph118 ]
  %267 = phi ptr [ %263, %.lr.ph118.preheader ], [ %276, %.lr.ph118 ]
  %268 = phi i64 [ %262, %.lr.ph118.preheader ], [ %275, %.lr.ph118 ]
  %.073117 = phi i32 [ %.073116, %.lr.ph118.preheader ], [ %271, %.lr.ph118 ]
  store i8 1, ptr %267, align 1, !tbaa !9
  %269 = shl i32 %.073117, 4
  %270 = getelementptr inbounds [16 x i32], ptr @seq, i64 0, i64 %268
  %271 = load i32, ptr %270, align 4, !tbaa !5
  %272 = or i32 %269, %271
  %273 = or i32 %272, 768
  %indvars.iv.next152 = add nsw i64 %indvars.iv151, 1
  %274 = getelementptr inbounds [32 x i32], ptr @tmp, i64 0, i64 %indvars.iv151
  store i32 %273, ptr %274, align 4, !tbaa !5
  %275 = sext i32 %271 to i64
  %276 = getelementptr inbounds [16 x i8], ptr @vis, i64 0, i64 %275
  %277 = load i8, ptr %276, align 1, !tbaa !9, !range !11, !noundef !12
  %278 = trunc nuw i8 %277 to i1
  br i1 %278, label %..loopexit85_crit_edge, label %.lr.ph118, !llvm.loop !16

..loopexit85_crit_edge:                           ; preds = %.lr.ph118
  %279 = trunc nsw i64 %indvars.iv.next152 to i32
  store i32 %279, ptr @size, align 4, !tbaa !5
  br label %.loopexit85

.loopexit85:                                      ; preds = %260, %..loopexit85_crit_edge, %256
  %280 = phi i32 [ %.lcssa119123124, %256 ], [ %279, %..loopexit85_crit_edge ], [ %.lcssa119123124, %260 ]
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next155, 16
  br i1 %exitcond.not, label %253, label %256, !llvm.loop !17

281:                                              ; preds = %253
  store i32 %280, ptr @ans, align 4, !tbaa !5
  %282 = sext i32 %280 to i64
  %283 = shl nsw i64 %282, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @out, ptr nonnull align 16 @tmp, i64 %283, i1 false)
  br label %284

284:                                              ; preds = %253, %281
  %285 = tail call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef nonnull @col, ptr noundef nonnull getelementptr inbounds (i8, ptr @col, i64 16))
  br i1 %285, label %48, label %286, !llvm.loop !18

286:                                              ; preds = %284
  %287 = tail call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef nonnull @row, ptr noundef nonnull getelementptr inbounds (i8, ptr @row, i64 16))
  br i1 %287, label %.preheader89, label %288, !llvm.loop !19

288:                                              ; preds = %286
  %289 = load i32, ptr @ans, align 4, !tbaa !5
  %290 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %289)
  %291 = load i32, ptr @ans, align 4, !tbaa !5
  %292 = icmp sgt i32 %291, 0
  br i1 %292, label %.lr.ph127.preheader, label %._crit_edge

.lr.ph127.preheader:                              ; preds = %288
  %wide.trip.count = zext nneg i32 %291 to i64
  br label %.lr.ph127

293:                                              ; preds = %.lr.ph127
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %exitcond160.not = icmp eq i64 %indvars.iv.next158, %wide.trip.count
  br i1 %exitcond160.not, label %.lr.ph129.preheader, label %.lr.ph127, !llvm.loop !20

.lr.ph127:                                        ; preds = %.lr.ph127.preheader, %293
  %indvars.iv157 = phi i64 [ 0, %.lr.ph127.preheader ], [ %indvars.iv.next158, %293 ]
  %294 = getelementptr inbounds [32 x i32], ptr @out, i64 0, i64 %indvars.iv157
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %.mask = and i32 %295, -256
  %296 = icmp eq i32 %.mask, 768
  br i1 %296, label %.loopexit, label %293

.loopexit:                                        ; preds = %.lr.ph127
  %297 = getelementptr inbounds [32 x i32], ptr @out, i64 0, i64 %indvars.iv157
  %298 = getelementptr inbounds i32, ptr @out, i64 %wide.trip.count
  tail call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull %297, ptr noundef nonnull %298)
  %.pre174 = load i32, ptr @ans, align 4, !tbaa !5
  %299 = icmp sgt i32 %.pre174, 0
  br i1 %299, label %.lr.ph129.preheader, label %._crit_edge

.lr.ph129.preheader:                              ; preds = %293, %.loopexit
  br label %.lr.ph129

._crit_edge:                                      ; preds = %324, %288, %.loopexit
  ret i32 0

.lr.ph129:                                        ; preds = %.lr.ph129.preheader, %324
  %indvars.iv161 = phi i64 [ %indvars.iv.next162, %324 ], [ 0, %.lr.ph129.preheader ]
  %300 = getelementptr inbounds [32 x i32], ptr @out, i64 0, i64 %indvars.iv161
  %301 = load i32, ptr %300, align 4, !tbaa !5
  %302 = ashr i32 %301, 8
  %303 = lshr i32 %301, 4
  %304 = and i32 %303, 15
  %305 = and i32 %301, 15
  switch i32 %302, label %314 [
    i32 1, label %306
    i32 2, label %310
  ]

306:                                              ; preds = %.lr.ph129
  %307 = add nuw nsw i32 %304, 97
  %308 = add nuw nsw i32 %305, 97
  %309 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %307, i32 noundef %308)
  br label %324

310:                                              ; preds = %.lr.ph129
  %311 = add nuw nsw i32 %304, 1
  %312 = add nuw nsw i32 %305, 1
  %313 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %311, i32 noundef %312)
  br label %324

314:                                              ; preds = %.lr.ph129
  %315 = lshr i32 %304, 2
  %316 = add nuw nsw i32 %315, 97
  %317 = and i32 %303, 3
  %318 = add nuw nsw i32 %317, 1
  %319 = lshr i32 %305, 2
  %320 = add nuw nsw i32 %319, 97
  %321 = and i32 %301, 3
  %322 = add nuw nsw i32 %321, 1
  %323 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %316, i32 noundef %318, i32 noundef %320, i32 noundef %322)
  br label %324

324:                                              ; preds = %310, %314, %306
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %325 = load i32, ptr @ans, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = icmp slt i64 %indvars.iv.next162, %326
  br i1 %327, label %.lr.ph129, label %._crit_edge, !llvm.loop !21
}

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

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

!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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


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