; LLVM IR from tangjz/acm-icpc :: codeforces/gym/100827K.ll (Z5solvev)

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

@n = external dso_local global i32, align 4
@mat = external dso_local global [5 x [5 x i32]], align 16
@rmsk = external dso_local global [5 x i32], align 16
@rlim = external dso_local global [2 x [5 x i32]], align 16
@rpre = external dso_local global [5 x [7 x i32]], align 16
@cmsk = external dso_local global [5 x i32], align 16
@clim = external dso_local global [2 x [5 x i32]], align 16
@cpre = external dso_local global [5 x [7 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3buf = external hidden global [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3buf_0 = external hidden global [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %35, %0
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  br label %38

20:                                               ; preds = %15
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [5 x [7 x i32]], ptr @cpre, i64 0, i64 %22
  %24 = getelementptr inbounds [7 x i32], ptr %23, i64 0, i64 0
  store i32 0, ptr %24, align 4, !tbaa !5
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [5 x [7 x i32]], ptr @rpre, i64 0, i64 %26
  %28 = getelementptr inbounds [7 x i32], ptr %27, i64 0, i64 0
  store i32 0, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [5 x i32], ptr @cmsk, i64 0, i64 %30
  store i32 0, ptr %31, align 4, !tbaa !5
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [5 x i32], ptr @rmsk, i64 0, i64 %33
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %20
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %1, align 4, !tbaa !5
  br label %15, !llvm.loop !9

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

39:                                               ; preds = %61, %38
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %64

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %57, %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %60

50:                                               ; preds = %45
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [5 x [5 x i32]], ptr @mat, i64 0, i64 %52
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [5 x i32], ptr %53, i64 0, i64 %55
  store i32 0, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %50
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %4, align 4, !tbaa !5
  br label %45, !llvm.loop !11

60:                                               ; preds = %49
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %39, !llvm.loop !12

64:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  store i8 0, ptr %5, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 -1, ptr %6, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %221, %64
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %224

70:                                               ; preds = %65
  %71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @_ZZ5solvevE3buf)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %99, %70
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = add nsw i32 %74, 2
  %76 = icmp slt i32 %73, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %72
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %102

78:                                               ; preds = %72
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !15
  %83 = sext i8 %82 to i32
  %84 = icmp eq i32 %83, 45
  br i1 %84, label %85, label %86

85:                                               ; preds = %78
  br label %93

86:                                               ; preds = %78
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !15
  %91 = sext i8 %90 to i32
  %92 = sub nsw i32 %91, 48
  br label %93

93:                                               ; preds = %86, %85
  %94 = phi i32 [ 0, %85 ], [ %92, %86 ]
  %95 = trunc i32 %94 to i8
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %97
  store i8 %95, ptr %98, align 1, !tbaa !15
  br label %99

99:                                               ; preds = %93
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %7, align 4, !tbaa !5
  br label %72, !llvm.loop !16

102:                                              ; preds = %77
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = icmp eq i32 %103, -1
  br i1 %104, label %109, label %105

105:                                              ; preds = %102
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = icmp eq i32 %106, %107
  br i1 %108, label %109, label %136

109:                                              ; preds = %105, %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = load i32, ptr @n, align 4, !tbaa !5
  %112 = icmp eq i32 %110, %111
  %113 = zext i1 %112 to i32
  store i32 %113, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %132, %109
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %135

119:                                              ; preds = %114
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !15
  %125 = sext i8 %124 to i32
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [2 x [5 x i32]], ptr @clim, i64 0, i64 %127
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [5 x i32], ptr %128, i64 0, i64 %130
  store i32 %125, ptr %131, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %119
  %133 = load i32, ptr %9, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %9, align 4, !tbaa !5
  br label %114, !llvm.loop !17

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

136:                                              ; preds = %105
  %137 = load i8, ptr @_ZZ5solvevE3buf, align 1, !tbaa !15
  %138 = sext i8 %137 to i32
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [5 x i32], ptr @rlim, i64 0, i64 %140
  store i32 %138, ptr %141, align 4, !tbaa !5
  %142 = load i32, ptr @n, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %144
  %146 = load i8, ptr %145, align 1, !tbaa !15
  %147 = sext i8 %146 to i32
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds ([2 x [5 x i32]], ptr @rlim, i64 0, i64 1), i64 0, i64 %149
  store i32 %147, ptr %150, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %217, %136
  %152 = load i32, ptr %10, align 4, !tbaa !5
  %153 = load i32, ptr @n, align 4, !tbaa !5
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %220

156:                                              ; preds = %151
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %159
  %161 = load i8, ptr %160, align 1, !tbaa !15
  %162 = sext i8 %161 to i32
  %163 = sub nsw i32 %162, 1
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [5 x [5 x i32]], ptr @mat, i64 0, i64 %165
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [5 x i32], ptr %166, i64 0, i64 %168
  store i32 %163, ptr %169, align 4, !tbaa !5
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [5 x [5 x i32]], ptr @mat, i64 0, i64 %171
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [5 x i32], ptr %172, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = icmp eq i32 %176, -1
  br i1 %177, label %178, label %179

178:                                              ; preds = %156
  br label %217

179:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [5 x [5 x i32]], ptr @mat, i64 0, i64 %181
  %183 = load i32, ptr %10, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [5 x i32], ptr %182, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = shl i32 1, %186
  store i32 %187, ptr %11, align 4, !tbaa !5
  %188 = load i32, ptr %6, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [5 x i32], ptr @rmsk, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = load i32, ptr %10, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [5 x i32], ptr @cmsk, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = or i32 %191, %195
  %197 = load i32, ptr %11, align 4, !tbaa !5
  %198 = and i32 %196, %197
  %199 = load i8, ptr %5, align 1, !tbaa !13, !range !18, !noundef !19
  %200 = trunc i8 %199 to i1
  %201 = zext i1 %200 to i32
  %202 = or i32 %201, %198
  %203 = icmp ne i32 %202, 0
  %204 = zext i1 %203 to i8
  store i8 %204, ptr %5, align 1, !tbaa !13
  %205 = load i32, ptr %11, align 4, !tbaa !5
  %206 = load i32, ptr %6, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [5 x i32], ptr @rmsk, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = or i32 %209, %205
  store i32 %210, ptr %208, align 4, !tbaa !5
  %211 = load i32, ptr %11, align 4, !tbaa !5
  %212 = load i32, ptr %10, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [5 x i32], ptr @cmsk, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = or i32 %215, %211
  store i32 %216, ptr %214, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %217

217:                                              ; preds = %179, %178
  %218 = load i32, ptr %10, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %10, align 4, !tbaa !5
  br label %151, !llvm.loop !20

220:                                              ; preds = %155
  br label %221

221:                                              ; preds = %220, %135
  %222 = load i32, ptr %6, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %6, align 4, !tbaa !5
  br label %65, !llvm.loop !21

224:                                              ; preds = %69
  %225 = load i8, ptr %5, align 1, !tbaa !13, !range !18, !noundef !19
  %226 = trunc i8 %225 to i1
  br i1 %226, label %229, label %227

227:                                              ; preds = %224
  %228 = call noundef zeroext i1 @_Z3dfsii(i32 noundef 0, i32 noundef 0)
  br i1 %228, label %231, label %229

229:                                              ; preds = %227, %224
  %230 = call i32 @puts(ptr noundef @.str.2)
  br label %268

231:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %232

232:                                              ; preds = %264, %231
  %233 = load i32, ptr %12, align 4, !tbaa !5
  %234 = load i32, ptr @n, align 4, !tbaa !5
  %235 = icmp slt i32 %233, %234
  br i1 %235, label %237, label %236

236:                                              ; preds = %232
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %267

237:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %256, %237
  %239 = load i32, ptr %13, align 4, !tbaa !5
  %240 = load i32, ptr @n, align 4, !tbaa !5
  %241 = icmp slt i32 %239, %240
  br i1 %241, label %243, label %242

242:                                              ; preds = %238
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %259

243:                                              ; preds = %238
  %244 = load i32, ptr %12, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [5 x [5 x i32]], ptr @mat, i64 0, i64 %245
  %247 = load i32, ptr %13, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [5 x i32], ptr %246, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !5
  %251 = add nsw i32 49, %250
  %252 = trunc i32 %251 to i8
  %253 = load i32, ptr %13, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [7 x i8], ptr @_ZZ5solvevE3buf_0, i64 0, i64 %254
  store i8 %252, ptr %255, align 1, !tbaa !15
  br label %256

256:                                              ; preds = %243
  %257 = load i32, ptr %13, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %13, align 4, !tbaa !5
  br label %238, !llvm.loop !22

259:                                              ; preds = %242
  %260 = load i32, ptr @n, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [7 x i8], ptr @_ZZ5solvevE3buf_0, i64 0, i64 %261
  store i8 0, ptr %262, align 1, !tbaa !15
  %263 = call i32 @puts(ptr noundef @_ZZ5solvevE3buf_0)
  br label %264

264:                                              ; preds = %259
  %265 = load i32, ptr %12, align 4, !tbaa !5
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %12, align 4, !tbaa !5
  br label %232, !llvm.loop !23

267:                                              ; preds = %236
  br label %268

268:                                              ; preds = %267, %229
  %269 = call i32 @puts(ptr noundef @.str.3)
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  ret void
}

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

declare i32 @puts(ptr noundef) #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{i8 0, i8 2}
!19 = !{}
!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"

@n = external dso_local global i32, align 4
@mat = external dso_local local_unnamed_addr global [5 x [5 x i32]], align 16
@rmsk = external dso_local local_unnamed_addr global [5 x i32], align 16
@rlim = external dso_local local_unnamed_addr global [2 x [5 x i32]], align 16
@rpre = external dso_local local_unnamed_addr global [5 x [7 x i32]], align 16
@cmsk = external dso_local local_unnamed_addr global [5 x i32], align 16
@clim = external dso_local local_unnamed_addr global [2 x [5 x i32]], align 16
@cpre = external dso_local local_unnamed_addr global [5 x [7 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3buf = external hidden global [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3buf_0 = external hidden global [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph.preheader, label %.preheader70

.lr.ph.preheader:                                 ; preds = %0
  %4 = zext nneg i32 %2 to i64
  %5 = shl nuw nsw i64 %4, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @cmsk, i8 0, i64 %5, i1 false), !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @rmsk, i8 0, i64 %5, i1 false), !tbaa !5
  %xtraiter = and i64 %4, 1
  %6 = icmp eq i32 %2, 1
  br i1 %6, label %.preheader72.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %4, 2147483646
  br label %.lr.ph

.preheader72.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader72, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader72.unr-lcssa
  %7 = getelementptr inbounds [5 x [7 x i32]], ptr @cpre, i64 0, i64 %indvars.iv.unr
  store i32 0, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds [5 x [7 x i32]], ptr @rpre, i64 0, i64 %indvars.iv.unr
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %.preheader72

.preheader72:                                     ; preds = %.preheader72.unr-lcssa, %.lr.ph.epil
  br i1 %3, label %.preheader71.us.preheader, label %.preheader70

.preheader71.us.preheader:                        ; preds = %.preheader72
  %9 = zext nneg i32 %2 to i64
  %10 = shl nuw nsw i64 %9, 2
  %xtraiter170 = and i64 %4, 7
  %11 = icmp ult i32 %2, 8
  br i1 %11, label %.preheader70.loopexit.unr-lcssa, label %.preheader71.us.preheader.new

.preheader71.us.preheader.new:                    ; preds = %.preheader71.us.preheader
  %unroll_iter172 = and i64 %4, 2147483640
  br label %.preheader71.us

.preheader71.us:                                  ; preds = %.preheader71.us, %.preheader71.us.preheader.new
  %indvar = phi i64 [ 0, %.preheader71.us.preheader.new ], [ %indvar.next.7, %.preheader71.us ]
  %niter173 = phi i64 [ 0, %.preheader71.us.preheader.new ], [ %niter173.next.7, %.preheader71.us ]
  %12 = mul nuw nsw i64 %indvar, 20
  %scevgep = getelementptr i8, ptr @mat, i64 %12
  tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %10, i1 false), !tbaa !5
  %13 = mul nuw i64 %indvar, 20
  %14 = or disjoint i64 %13, 20
  %scevgep.1 = getelementptr i8, ptr @mat, i64 %14
  tail call void @llvm.memset.p0.i64(ptr align 4 %scevgep.1, i8 0, i64 %10, i1 false), !tbaa !5
  %15 = mul nuw i64 %indvar, 20
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @mat, i64 40), i64 %15
  tail call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %10, i1 false), !tbaa !5
  %16 = mul nuw i64 %indvar, 20
  %gep174 = getelementptr i8, ptr getelementptr (i8, ptr @mat, i64 60), i64 %16
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep174, i8 0, i64 %10, i1 false), !tbaa !5
  %17 = mul nuw i64 %indvar, 20
  %gep175 = getelementptr i8, ptr getelementptr (i8, ptr @mat, i64 80), i64 %17
  tail call void @llvm.memset.p0.i64(ptr align 16 %gep175, i8 0, i64 %10, i1 false), !tbaa !5
  %18 = mul nuw i64 %indvar, 20
  %gep176 = getelementptr i8, ptr getelementptr (i8, ptr @mat, i64 100), i64 %18
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep176, i8 0, i64 %10, i1 false), !tbaa !5
  %19 = mul nuw i64 %indvar, 20
  %gep177 = getelementptr i8, ptr getelementptr (i8, ptr @mat, i64 120), i64 %19
  tail call void @llvm.memset.p0.i64(ptr align 8 %gep177, i8 0, i64 %10, i1 false), !tbaa !5
  %20 = mul nuw i64 %indvar, 20
  %gep178 = getelementptr i8, ptr getelementptr (i8, ptr @mat, i64 140), i64 %20
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep178, i8 0, i64 %10, i1 false), !tbaa !5
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter173.next.7 = add i64 %niter173, 8
  %niter173.ncmp.7 = icmp eq i64 %niter173.next.7, %unroll_iter172
  br i1 %niter173.ncmp.7, label %.preheader70.loopexit.unr-lcssa, label %.preheader71.us, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %21 = getelementptr inbounds [5 x [7 x i32]], ptr @cpre, i64 0, i64 %indvars.iv
  store i32 0, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds [5 x [7 x i32]], ptr @rpre, i64 0, i64 %indvars.iv
  store i32 0, ptr %22, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %23 = getelementptr inbounds [5 x [7 x i32]], ptr @cpre, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds [5 x [7 x i32]], ptr @rpre, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %24, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader72.unr-lcssa, label %.lr.ph, !llvm.loop !11

.preheader70.loopexit.unr-lcssa:                  ; preds = %.preheader71.us, %.preheader71.us.preheader
  %indvar.unr = phi i64 [ 0, %.preheader71.us.preheader ], [ %indvar.next.7, %.preheader71.us ]
  %lcmp.mod171.not = icmp eq i64 %xtraiter170, 0
  br i1 %lcmp.mod171.not, label %.preheader70, label %.preheader71.us.epil

.preheader71.us.epil:                             ; preds = %.preheader70.loopexit.unr-lcssa, %.preheader71.us.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader71.us.epil ], [ %indvar.unr, %.preheader70.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader71.us.epil ], [ 0, %.preheader70.loopexit.unr-lcssa ]
  %25 = mul nuw nsw i64 %indvar.epil, 20
  %scevgep.epil = getelementptr i8, ptr @mat, i64 %25
  tail call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %10, i1 false), !tbaa !5
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter170
  br i1 %epil.iter.cmp.not, label %.preheader70, label %.preheader71.us.epil, !llvm.loop !12

.preheader70:                                     ; preds = %.preheader70.loopexit.unr-lcssa, %.preheader71.us.epil, %0, %.preheader72
  %.not88 = icmp slt i32 %2, -1
  br i1 %.not88, label %._crit_edge92.thread, label %.lr.ph91

._crit_edge92:                                    ; preds = %.loopexit68
  %26 = trunc nuw i8 %.3 to i1
  br i1 %26, label %104, label %._crit_edge92.thread

.lr.ph91:                                         ; preds = %.preheader70, %.loopexit68
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %.loopexit68 ], [ -1, %.preheader70 ]
  %.06189 = phi i8 [ %.3, %.loopexit68 ], [ 0, %.preheader70 ]
  %27 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @_ZZ5solvevE3buf)
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, -2
  br i1 %29, label %iter.check, label %._crit_edge

iter.check:                                       ; preds = %.lr.ph91
  %30 = add i32 %28, 2
  %wide.trip.count110 = zext i32 %30 to i64
  %min.iters.check137 = icmp ult i32 %30, 8
  br i1 %min.iters.check137, label %.lr.ph79.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check139 = icmp ult i32 %30, 32
  br i1 %min.iters.check139, label %vec.epilog.ph, label %vector.ph140

vector.ph140:                                     ; preds = %vector.main.loop.iter.check
  %n.vec142 = and i64 %wide.trip.count110, 4294967264
  br label %vector.body143

vector.body143:                                   ; preds = %vector.body143, %vector.ph140
  %index144 = phi i64 [ 0, %vector.ph140 ], [ %index.next147, %vector.body143 ]
  %31 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %index144
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %wide.load145 = load <16 x i8>, ptr %31, align 1, !tbaa !14
  %wide.load146 = load <16 x i8>, ptr %32, align 1, !tbaa !14
  %33 = icmp eq <16 x i8> %wide.load145, <i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45>
  %34 = icmp eq <16 x i8> %wide.load146, <i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45>
  %35 = add <16 x i8> %wide.load145, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48>
  %36 = add <16 x i8> %wide.load146, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48>
  %37 = select <16 x i1> %33, <16 x i8> zeroinitializer, <16 x i8> %35
  %38 = select <16 x i1> %34, <16 x i8> zeroinitializer, <16 x i8> %36
  store <16 x i8> %37, ptr %31, align 1, !tbaa !14
  store <16 x i8> %38, ptr %32, align 1, !tbaa !14
  %index.next147 = add nuw i64 %index144, 32
  %39 = icmp eq i64 %index.next147, %n.vec142
  br i1 %39, label %middle.block135, label %vector.body143, !llvm.loop !15

middle.block135:                                  ; preds = %vector.body143
  %cmp.n148 = icmp eq i64 %n.vec142, %wide.trip.count110
  br i1 %cmp.n148, label %._crit_edge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block135
  %n.vec.remaining = and i64 %wide.trip.count110, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph79.preheader, label %vec.epilog.ph

.lr.ph79.preheader:                               ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv107.ph = phi i64 [ 0, %iter.check ], [ %n.vec142, %vec.epilog.iter.check ], [ %n.vec150, %vec.epilog.middle.block ]
  br label %.lr.ph79

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec142, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec150 = and i64 %wide.trip.count110, 4294967288
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index152 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next154, %vec.epilog.vector.body ]
  %40 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %index152
  %wide.load153 = load <8 x i8>, ptr %40, align 1, !tbaa !14
  %41 = icmp eq <8 x i8> %wide.load153, <i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45, i8 45>
  %42 = add <8 x i8> %wide.load153, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48>
  %43 = select <8 x i1> %41, <8 x i8> zeroinitializer, <8 x i8> %42
  store <8 x i8> %43, ptr %40, align 1, !tbaa !14
  %index.next154 = add nuw i64 %index152, 8
  %44 = icmp eq i64 %index.next154, %n.vec150
  br i1 %44, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !18

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n155 = icmp eq i64 %n.vec150, %wide.trip.count110
  br i1 %cmp.n155, label %._crit_edge, label %.lr.ph79.preheader

._crit_edge:                                      ; preds = %.lr.ph79, %middle.block135, %vec.epilog.middle.block, %.lr.ph91
  %45 = icmp eq i64 %indvars.iv121, -1
  %46 = trunc nsw i64 %indvars.iv121 to i32
  %47 = icmp eq i32 %28, %46
  %or.cond = or i1 %45, %47
  br i1 %or.cond, label %.preheader67, label %66

.preheader67:                                     ; preds = %._crit_edge
  %48 = icmp sgt i32 %28, 0
  br i1 %48, label %.lr.ph87, label %.loopexit68

.lr.ph87:                                         ; preds = %.preheader67
  %49 = zext i1 %47 to i64
  %wide.trip.count119 = zext nneg i32 %28 to i64
  %min.iters.check = icmp ult i32 %28, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph87
  %indvars.iv116.ph = phi i64 [ 0, %.lr.ph87 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph87
  %n.vec = and i64 %wide.trip.count119, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %50 = or disjoint i64 %index, 1
  %51 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %50
  %52 = getelementptr inbounds i8, ptr %51, i64 4
  %wide.load = load <4 x i8>, ptr %51, align 1, !tbaa !14
  %wide.load134 = load <4 x i8>, ptr %52, align 1, !tbaa !14
  %53 = sext <4 x i8> %wide.load to <4 x i32>
  %54 = sext <4 x i8> %wide.load134 to <4 x i32>
  %55 = getelementptr inbounds [2 x [5 x i32]], ptr @clim, i64 0, i64 %49, i64 %index
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  store <4 x i32> %53, ptr %55, align 4, !tbaa !5
  store <4 x i32> %54, ptr %56, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count119
  br i1 %cmp.n, label %.loopexit68, label %scalar.ph.preheader

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %.lr.ph79
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %.lr.ph79 ], [ %indvars.iv107.ph, %.lr.ph79.preheader ]
  %58 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv107
  %59 = load i8, ptr %58, align 1, !tbaa !14
  %60 = icmp eq i8 %59, 45
  %61 = add i8 %59, -48
  %spec.select = select i1 %60, i8 0, i8 %61
  store i8 %spec.select, ptr %58, align 1, !tbaa !14
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond111 = icmp eq i64 %indvars.iv.next108, %wide.trip.count110
  br i1 %exitcond111, label %._crit_edge, label %.lr.ph79, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %scalar.ph ], [ %indvars.iv116.ph, %scalar.ph.preheader ]
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %62 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv.next117
  %63 = load i8, ptr %62, align 1, !tbaa !14
  %64 = sext i8 %63 to i32
  %65 = getelementptr inbounds [2 x [5 x i32]], ptr @clim, i64 0, i64 %49, i64 %indvars.iv116
  store i32 %64, ptr %65, align 4, !tbaa !5
  %exitcond120.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count119
  br i1 %exitcond120.not, label %.loopexit68, label %scalar.ph, !llvm.loop !21

66:                                               ; preds = %._crit_edge
  %67 = load i8, ptr @_ZZ5solvevE3buf, align 1, !tbaa !14
  %68 = sext i8 %67 to i32
  %69 = getelementptr inbounds [5 x i32], ptr @rlim, i64 0, i64 %indvars.iv121
  store i32 %68, ptr %69, align 4, !tbaa !5
  %70 = add nsw i32 %28, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !14
  %74 = sext i8 %73 to i32
  %75 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @rlim, i64 20), i64 0, i64 %indvars.iv121
  store i32 %74, ptr %75, align 4, !tbaa !5
  %76 = icmp sgt i32 %28, 0
  br i1 %76, label %.lr.ph84, label %.loopexit68

.lr.ph84:                                         ; preds = %66
  %77 = getelementptr inbounds [5 x i32], ptr @rmsk, i64 0, i64 %indvars.iv121
  %wide.trip.count114 = zext nneg i32 %28 to i64
  br label %78

78:                                               ; preds = %.lr.ph84, %99
  %indvars.iv112 = phi i64 [ 0, %.lr.ph84 ], [ %indvars.iv.next113, %99 ]
  %.181 = phi i8 [ %.06189, %.lr.ph84 ], [ %.2, %99 ]
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %79 = getelementptr inbounds [9 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv.next113
  %80 = load i8, ptr %79, align 1, !tbaa !14
  %81 = sext i8 %80 to i32
  %82 = add nsw i32 %81, -1
  %83 = getelementptr inbounds [5 x [5 x i32]], ptr @mat, i64 0, i64 %indvars.iv121, i64 %indvars.iv112
  store i32 %82, ptr %83, align 4, !tbaa !5
  %84 = icmp eq i8 %80, 0
  br i1 %84, label %99, label %85

85:                                               ; preds = %78
  %86 = shl nuw i32 1, %82
  %87 = load i32, ptr %77, align 4, !tbaa !5
  %88 = getelementptr inbounds [5 x i32], ptr @cmsk, i64 0, i64 %indvars.iv112
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = or i32 %89, %87
  %91 = and i32 %90, %86
  %92 = and i8 %.181, 1
  %93 = zext nneg i8 %92 to i32
  %94 = or i32 %91, %93
  %95 = icmp ne i32 %94, 0
  %96 = zext i1 %95 to i8
  %97 = or i32 %87, %86
  store i32 %97, ptr %77, align 4, !tbaa !5
  %98 = or i32 %89, %86
  store i32 %98, ptr %88, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %78, %85
  %.2 = phi i8 [ %.181, %78 ], [ %96, %85 ]
  %exitcond115.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count114
  br i1 %exitcond115.not, label %.loopexit68, label %78, !llvm.loop !22

.loopexit68:                                      ; preds = %99, %scalar.ph, %middle.block, %66, %.preheader67
  %.3 = phi i8 [ %.06189, %.preheader67 ], [ %.06189, %66 ], [ %.06189, %middle.block ], [ %.06189, %scalar.ph ], [ %.2, %99 ]
  %indvars.iv.next122 = add nsw i64 %indvars.iv121, 1
  %100 = sext i32 %28 to i64
  %.not.not = icmp slt i64 %indvars.iv121, %100
  br i1 %.not.not, label %.lr.ph91, label %._crit_edge92, !llvm.loop !23

._crit_edge92.thread:                             ; preds = %.preheader70, %._crit_edge92
  %101 = tail call noundef zeroext i1 @_Z3dfsii(i32 noundef 0, i32 noundef 0)
  br i1 %101, label %.preheader66, label %104

.preheader66:                                     ; preds = %._crit_edge92.thread
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %.preheader, label %.loopexit

104:                                              ; preds = %._crit_edge92.thread, %._crit_edge92
  %105 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.loopexit

.preheader:                                       ; preds = %.preheader66, %._crit_edge96
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %._crit_edge96 ], [ 0, %.preheader66 ]
  %106 = phi i32 [ %120, %._crit_edge96 ], [ %102, %.preheader66 ]
  %107 = icmp sgt i32 %106, 0
  br i1 %107, label %.lr.ph95, label %._crit_edge96

.lr.ph95:                                         ; preds = %.preheader
  %wide.trip.count126 = zext nneg i32 %106 to i64
  %min.iters.check158 = icmp ult i32 %106, 8
  br i1 %min.iters.check158, label %scalar.ph157.preheader, label %vector.ph159

scalar.ph157.preheader:                           ; preds = %middle.block156, %.lr.ph95
  %indvars.iv123.ph = phi i64 [ 0, %.lr.ph95 ], [ %n.vec161, %middle.block156 ]
  br label %scalar.ph157

vector.ph159:                                     ; preds = %.lr.ph95
  %n.vec161 = and i64 %wide.trip.count126, 2147483640
  br label %vector.body163

vector.body163:                                   ; preds = %vector.body163, %vector.ph159
  %index164 = phi i64 [ 0, %vector.ph159 ], [ %index.next167, %vector.body163 ]
  %108 = getelementptr inbounds [5 x [5 x i32]], ptr @mat, i64 0, i64 %indvars.iv128, i64 %index164
  %109 = getelementptr inbounds i8, ptr %108, i64 16
  %wide.load165 = load <4 x i32>, ptr %108, align 4, !tbaa !5
  %wide.load166 = load <4 x i32>, ptr %109, align 4, !tbaa !5
  %110 = trunc <4 x i32> %wide.load165 to <4 x i8>
  %111 = trunc <4 x i32> %wide.load166 to <4 x i8>
  %112 = add <4 x i8> %110, <i8 49, i8 49, i8 49, i8 49>
  %113 = add <4 x i8> %111, <i8 49, i8 49, i8 49, i8 49>
  %114 = getelementptr inbounds [7 x i8], ptr @_ZZ5solvevE3buf_0, i64 0, i64 %index164
  %115 = getelementptr inbounds i8, ptr %114, i64 4
  store <4 x i8> %112, ptr %114, align 1, !tbaa !14
  store <4 x i8> %113, ptr %115, align 1, !tbaa !14
  %index.next167 = add nuw i64 %index164, 8
  %116 = icmp eq i64 %index.next167, %n.vec161
  br i1 %116, label %middle.block156, label %vector.body163, !llvm.loop !24

middle.block156:                                  ; preds = %vector.body163
  %cmp.n168 = icmp eq i64 %n.vec161, %wide.trip.count126
  br i1 %cmp.n168, label %._crit_edge96, label %scalar.ph157.preheader

._crit_edge96:                                    ; preds = %scalar.ph157, %middle.block156, %.preheader
  %117 = sext i32 %106 to i64
  %118 = getelementptr inbounds [7 x i8], ptr @_ZZ5solvevE3buf_0, i64 0, i64 %117
  store i8 0, ptr %118, align 1, !tbaa !14
  %119 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @_ZZ5solvevE3buf_0)
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = icmp slt i64 %indvars.iv.next129, %121
  br i1 %122, label %.preheader, label %.loopexit, !llvm.loop !25

scalar.ph157:                                     ; preds = %scalar.ph157.preheader, %scalar.ph157
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %scalar.ph157 ], [ %indvars.iv123.ph, %scalar.ph157.preheader ]
  %123 = getelementptr inbounds [5 x [5 x i32]], ptr @mat, i64 0, i64 %indvars.iv128, i64 %indvars.iv123
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = trunc i32 %124 to i8
  %126 = add i8 %125, 49
  %127 = getelementptr inbounds [7 x i8], ptr @_ZZ5solvevE3buf_0, i64 0, i64 %indvars.iv123
  store i8 %126, ptr %127, align 1, !tbaa !14
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
  br i1 %exitcond127.not, label %._crit_edge96, label %scalar.ph157, !llvm.loop !26

.loopexit:                                        ; preds = %._crit_edge96, %.preheader66, %104
  %128 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  ret void
}

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !16, !17}
!19 = distinct !{!19, !10, !16, !17}
!20 = distinct !{!20, !10, !17, !16}
!21 = distinct !{!21, !10, !17, !16}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10, !16, !17}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10, !17, !16}


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