; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/LONG/JULY15/MAXDIFFW/A.ll (Z6solve2v)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@g = external dso_local global [51 x [51 x i32]], align 16
@vi = external dso_local global [51 x [51 x i32]], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6solve2v() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = call i64 @time(ptr noundef null) #6
  %21 = trunc i64 %20 to i32
  call void @srand(i32 noundef %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 -1, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %140, %0
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %136, %27
  %29 = load i32, ptr %8, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %139

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %34 = call i32 @rand() #6
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = srem i32 %34, %35
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %9, align 4, !tbaa !5
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = icmp eq i32 %38, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %33
  store i32 7, ptr %7, align 4
  br label %133

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

43:                                               ; preds = %121, %42
  %44 = load i32, ptr %11, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %124

48:                                               ; preds = %43
  %49 = load i32, ptr %11, align 4, !tbaa !5
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = icmp eq i32 %49, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %48
  br label %121

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %117, %53
  %55 = load i32, ptr %12, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %120

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %60 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %60, ptr %13, align 4, !tbaa !5
  %61 = load i32, ptr %13, align 4, !tbaa !5
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = icmp eq i32 %61, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %59
  store i32 13, ptr %7, align 4
  br label %114

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

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

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

71:                                               ; preds = %66
  %72 = load i32, ptr %14, align 4, !tbaa !5
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = icmp eq i32 %72, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %71
  br label %110

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %78
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [51 x i32], ptr %79, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %85
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [51 x i32], ptr %86, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sub nsw i32 %83, %90
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %93
  %95 = load i32, ptr %13, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [51 x i32], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %91, %98
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %101
  %103 = load i32, ptr %14, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [51 x i32], ptr %102, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sub nsw i32 %99, %106
  store i32 %107, ptr %15, align 4, !tbaa !5
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %109 = load i32, ptr %108, align 4, !tbaa !5
  store i32 %109, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %110

110:                                              ; preds = %76, %75
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %14, align 4, !tbaa !5
  br label %66, !llvm.loop !9

113:                                              ; preds = %70
  store i32 0, ptr %7, align 4
  br label %114

114:                                              ; preds = %113, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %115 = load i32, ptr %7, align 4
  switch i32 %115, label %291 [
    i32 0, label %116
    i32 13, label %117
  ]

116:                                              ; preds = %114
  br label %117

117:                                              ; preds = %116, %114
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %12, align 4, !tbaa !5
  br label %54, !llvm.loop !11

120:                                              ; preds = %58
  br label %121

121:                                              ; preds = %120, %52
  %122 = load i32, ptr %11, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %11, align 4, !tbaa !5
  br label %43, !llvm.loop !12

124:                                              ; preds = %47
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = load i32, ptr %1, align 4, !tbaa !5
  %127 = icmp sgt i32 %125, %126
  br i1 %127, label %128, label %132

128:                                              ; preds = %124
  %129 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %129, ptr %1, align 4, !tbaa !5
  %130 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %130, ptr %2, align 4, !tbaa !5
  %131 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %131, ptr %3, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %128, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  store i32 0, ptr %7, align 4
  br label %133

133:                                              ; preds = %132, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %134 = load i32, ptr %7, align 4
  switch i32 %134, label %291 [
    i32 0, label %135
    i32 7, label %136
  ]

135:                                              ; preds = %133
  br label %136

136:                                              ; preds = %135, %133
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %8, align 4, !tbaa !5
  br label %28, !llvm.loop !13

139:                                              ; preds = %32
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %6, align 4, !tbaa !5
  br label %22, !llvm.loop !14

143:                                              ; preds = %26
  %144 = load i32, ptr %2, align 4, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %144)
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef @.str)
  %147 = load i32, ptr %3, align 4, !tbaa !5
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %146, i32 noundef %147)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %150 = load i32, ptr %2, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %151
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [51 x i32], ptr %152, i64 0, i64 %154
  store i32 1, ptr %155, align 4, !tbaa !5
  %156 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5)
  %157 = icmp ne i32 %156, -1
  br i1 %157, label %158, label %166

158:                                              ; preds = %143
  %159 = load i32, ptr %4, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %160
  %162 = load i32, ptr %5, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [51 x i32], ptr %161, i64 0, i64 %163
  store i32 1, ptr %164, align 4, !tbaa !5
  %165 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %165, ptr %2, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %158, %143
  br label %167

167:                                              ; preds = %289, %166
  br label %168

168:                                              ; preds = %167
  store i32 -1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 -1000000, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %255, %168
  %170 = load i32, ptr %17, align 4, !tbaa !5
  %171 = load i32, ptr @n, align 4, !tbaa !5
  %172 = icmp sle i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  store i32 19, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %258

174:                                              ; preds = %169
  %175 = load i32, ptr %17, align 4, !tbaa !5
  %176 = load i32, ptr %2, align 4, !tbaa !5
  %177 = icmp eq i32 %175, %176
  br i1 %177, label %178, label %179

178:                                              ; preds = %174
  br label %255

179:                                              ; preds = %174
  %180 = load i32, ptr %2, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %181
  %183 = load i32, ptr %17, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [51 x i32], ptr %182, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = icmp eq i32 %186, 0
  br i1 %187, label %188, label %254

188:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %227, %188
  %190 = load i32, ptr %19, align 4, !tbaa !5
  %191 = load i32, ptr @n, align 4, !tbaa !5
  %192 = icmp sle i32 %190, %191
  br i1 %192, label %194, label %193

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

194:                                              ; preds = %189
  %195 = load i32, ptr %19, align 4, !tbaa !5
  %196 = load i32, ptr %17, align 4, !tbaa !5
  %197 = icmp eq i32 %195, %196
  br i1 %197, label %198, label %199

198:                                              ; preds = %194
  br label %227

199:                                              ; preds = %194
  %200 = load i32, ptr %17, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %201
  %203 = load i32, ptr %19, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [51 x i32], ptr %202, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = icmp eq i32 %206, 0
  br i1 %207, label %208, label %226

208:                                              ; preds = %199
  %209 = load i32, ptr %17, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %210
  %212 = load i32, ptr %19, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [51 x i32], ptr %211, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = load i32, ptr %18, align 4, !tbaa !5
  %217 = icmp sgt i32 %215, %216
  br i1 %217, label %218, label %226

218:                                              ; preds = %208
  %219 = load i32, ptr %17, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %220
  %222 = load i32, ptr %19, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [51 x i32], ptr %221, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  store i32 %225, ptr %18, align 4, !tbaa !5
  br label %226

226:                                              ; preds = %218, %208, %199
  br label %227

227:                                              ; preds = %226, %198
  %228 = load i32, ptr %19, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %19, align 4, !tbaa !5
  br label %189, !llvm.loop !15

230:                                              ; preds = %193
  %231 = load i32, ptr %2, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %232
  %234 = load i32, ptr %17, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [51 x i32], ptr %233, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = load i32, ptr %18, align 4, !tbaa !5
  %239 = sub nsw i32 %237, %238
  %240 = load i32, ptr %16, align 4, !tbaa !5
  %241 = icmp sgt i32 %239, %240
  br i1 %241, label %242, label %253

242:                                              ; preds = %230
  %243 = load i32, ptr %2, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %244
  %246 = load i32, ptr %17, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [51 x i32], ptr %245, i64 0, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = load i32, ptr %18, align 4, !tbaa !5
  %251 = sub nsw i32 %249, %250
  store i32 %251, ptr %16, align 4, !tbaa !5
  %252 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %252, ptr %3, align 4, !tbaa !5
  br label %253

253:                                              ; preds = %242, %230
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %254

254:                                              ; preds = %253, %179
  br label %255

255:                                              ; preds = %254, %178
  %256 = load i32, ptr %17, align 4, !tbaa !5
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %17, align 4, !tbaa !5
  br label %169, !llvm.loop !16

258:                                              ; preds = %173
  %259 = load i32, ptr %3, align 4, !tbaa !5
  %260 = icmp eq i32 %259, -1
  br i1 %260, label %261, label %262

261:                                              ; preds = %258
  store i32 18, ptr %7, align 4
  br label %287

262:                                              ; preds = %258
  %263 = load i32, ptr %2, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %264
  %266 = load i32, ptr %3, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [51 x i32], ptr %265, i64 0, i64 %267
  store i32 1, ptr %268, align 4, !tbaa !5
  %269 = load i32, ptr %2, align 4, !tbaa !5
  %270 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %269)
  %271 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %270, ptr noundef @.str)
  %272 = load i32, ptr %3, align 4, !tbaa !5
  %273 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %271, i32 noundef %272)
  %274 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %273, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %275 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5)
  %276 = icmp ne i32 %275, -1
  br i1 %276, label %277, label %285

277:                                              ; preds = %262
  %278 = load i32, ptr %4, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %279
  %281 = load i32, ptr %5, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [51 x i32], ptr %280, i64 0, i64 %282
  store i32 1, ptr %283, align 4, !tbaa !5
  %284 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %284, ptr %2, align 4, !tbaa !5
  br label %286

285:                                              ; preds = %262
  store i32 18, ptr %7, align 4
  br label %287

286:                                              ; preds = %277
  store i32 0, ptr %7, align 4
  br label %287

287:                                              ; preds = %286, %285, %261
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %288 = load i32, ptr %7, align 4
  switch i32 %288, label %291 [
    i32 0, label %289
    i32 18, label %290
  ]

289:                                              ; preds = %287
  br label %167, !llvm.loop !17

290:                                              ; preds = %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void

291:                                              ; preds = %287, %133, %114
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local local_unnamed_addr global [51 x [51 x i32]], align 16
@vi = external dso_local local_unnamed_addr global [51 x [51 x i32]], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6solve2v() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i64 @time(ptr noundef null) #8
  %6 = trunc i64 %5 to i32
  tail call void @srand(i32 noundef %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not131 = icmp slt i32 %7, 1
  br i1 %.not131, label %._crit_edge136, label %.preheader111

.preheader111:                                    ; preds = %0, %._crit_edge128
  %8 = phi i32 [ %18, %._crit_edge128 ], [ %7, %0 ]
  %indvars.iv164 = phi i64 [ %indvars.iv.next165, %._crit_edge128 ], [ 1, %0 ]
  %.070135 = phi i32 [ %.171.lcssa, %._crit_edge128 ], [ 0, %0 ]
  %.075134 = phi i32 [ %.176.lcssa, %._crit_edge128 ], [ -1, %0 ]
  %.082132 = phi i32 [ %.183.lcssa, %._crit_edge128 ], [ 0, %0 ]
  %.not97122 = icmp slt i32 %8, 1
  br i1 %.not97122, label %._crit_edge128, label %.lr.ph127

.lr.ph127:                                        ; preds = %.preheader111
  %9 = trunc nuw nsw i64 %indvars.iv164 to i32
  br label %20

._crit_edge136:                                   ; preds = %._crit_edge128, %0
  %.082.lcssa = phi i32 [ 0, %0 ], [ %.183.lcssa, %._crit_edge128 ]
  %.075.lcssa = phi i32 [ -1, %0 ], [ %.176.lcssa, %._crit_edge128 ]
  %10 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.075.lcssa)
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @.str)
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef %.082.lcssa)
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %14 = sext i32 %.075.lcssa to i64
  %15 = sext i32 %.082.lcssa to i64
  %16 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %14, i64 %15
  store i32 1, ptr %16, align 4, !tbaa !5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %.not93 = icmp eq i32 %17, -1
  br i1 %.not93, label %83, label %77

._crit_edge128:                                   ; preds = %74, %.preheader111
  %18 = phi i32 [ %8, %.preheader111 ], [ %75, %74 ]
  %.183.lcssa = phi i32 [ %.082132, %.preheader111 ], [ %.385, %74 ]
  %.176.lcssa = phi i32 [ %.075134, %.preheader111 ], [ %.378, %74 ]
  %.171.lcssa = phi i32 [ %.070135, %.preheader111 ], [ %.3, %74 ]
  %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
  %19 = sext i32 %18 to i64
  %.not.not = icmp slt i64 %indvars.iv164, %19
  br i1 %.not.not, label %.preheader111, label %._crit_edge136, !llvm.loop !9

20:                                               ; preds = %.lr.ph127, %74
  %.171126 = phi i32 [ %.070135, %.lr.ph127 ], [ %.3, %74 ]
  %.176125 = phi i32 [ %.075134, %.lr.ph127 ], [ %.378, %74 ]
  %.079124 = phi i32 [ 1, %.lr.ph127 ], [ %76, %74 ]
  %.183123 = phi i32 [ %.082132, %.lr.ph127 ], [ %.385, %74 ]
  %21 = call i32 @rand() #8
  %22 = load i32, ptr @n, align 4
  %23 = srem i32 %21, %22
  %24 = add nsw i32 %23, 1
  %25 = zext i32 %24 to i64
  %26 = icmp eq i64 %indvars.iv164, %25
  br i1 %26, label %74, label %27

27:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  %.not98118 = icmp slt i32 %22, 1
  br i1 %.not98118, label %._crit_edge, label %.lr.ph121

.lr.ph121:                                        ; preds = %27
  %28 = sext i32 %24 to i64
  %29 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %indvars.iv164, i64 %28
  br label %33

._crit_edge:                                      ; preds = %.loopexit110, %27
  %30 = phi i32 [ %22, %27 ], [ %72, %.loopexit110 ]
  %31 = phi i32 [ 0, %27 ], [ %71, %.loopexit110 ]
  %32 = icmp sgt i32 %31, %.171126
  %.284 = select i1 %32, i32 %24, i32 %.183123
  %.277 = select i1 %32, i32 %9, i32 %.176125
  %.272 = call i32 @llvm.smax.i32(i32 %31, i32 %.171126)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %74

33:                                               ; preds = %.lr.ph121, %.loopexit110
  %34 = phi i32 [ 0, %.lr.ph121 ], [ %71, %.loopexit110 ]
  %35 = phi i32 [ %22, %.lr.ph121 ], [ %72, %.loopexit110 ]
  %indvars.iv161 = phi i64 [ 1, %.lr.ph121 ], [ %indvars.iv.next162, %.loopexit110 ]
  %36 = icmp eq i64 %indvars.iv161, %25
  %.not99114 = icmp slt i32 %35, 1
  %or.cond = or i1 %36, %.not99114
  br i1 %or.cond, label %.loopexit110, label %.lr.ph117

.lr.ph117:                                        ; preds = %33
  %37 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %28, i64 %indvars.iv161
  br label %38

38:                                               ; preds = %.lr.ph117, %.loopexit
  %39 = phi i32 [ %34, %.lr.ph117 ], [ %67, %.loopexit ]
  %40 = phi i32 [ %35, %.lr.ph117 ], [ %68, %.loopexit ]
  %41 = phi i32 [ %35, %.lr.ph117 ], [ %69, %.loopexit ]
  %indvars.iv158 = phi i64 [ 1, %.lr.ph117 ], [ %indvars.iv.next159, %.loopexit ]
  %42 = icmp eq i64 %indvars.iv158, %indvars.iv161
  %.not100112 = icmp slt i32 %41, 1
  %or.cond155 = or i1 %42, %.not100112
  br i1 %or.cond155, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %38
  %43 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %indvars.iv161, i64 %indvars.iv158
  br label %44

44:                                               ; preds = %.lr.ph, %61
  %45 = phi i32 [ %39, %.lr.ph ], [ %62, %61 ]
  %46 = phi i32 [ %40, %.lr.ph ], [ %63, %61 ]
  %47 = phi i32 [ %41, %.lr.ph ], [ %64, %61 ]
  %48 = phi i32 [ %41, %.lr.ph ], [ %65, %61 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %61 ]
  %49 = icmp eq i64 %indvars.iv, %indvars.iv158
  br i1 %49, label %61, label %50

50:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %51 = load i32, ptr %29, align 4, !tbaa !5
  %52 = load i32, ptr %37, align 4, !tbaa !5
  %53 = load i32, ptr %43, align 4, !tbaa !5
  %54 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %indvars.iv158, i64 %indvars.iv
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add i32 %51, %53
  %57 = add i32 %52, %55
  %58 = sub i32 %56, %57
  store i32 %58, ptr %4, align 4, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %60 = load i32, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %.pre = load i32, ptr @n, align 4
  br label %61

61:                                               ; preds = %44, %50
  %62 = phi i32 [ %45, %44 ], [ %60, %50 ]
  %63 = phi i32 [ %46, %44 ], [ %.pre, %50 ]
  %64 = phi i32 [ %47, %44 ], [ %.pre, %50 ]
  %65 = phi i32 [ %48, %44 ], [ %.pre, %50 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %66 = sext i32 %65 to i64
  %.not100.not = icmp slt i64 %indvars.iv, %66
  br i1 %.not100.not, label %44, label %.loopexit, !llvm.loop !12

.loopexit:                                        ; preds = %61, %38
  %67 = phi i32 [ %39, %38 ], [ %62, %61 ]
  %68 = phi i32 [ %40, %38 ], [ %63, %61 ]
  %69 = phi i32 [ %41, %38 ], [ %64, %61 ]
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %70 = sext i32 %69 to i64
  %.not99.not = icmp slt i64 %indvars.iv158, %70
  br i1 %.not99.not, label %38, label %.loopexit110, !llvm.loop !13

.loopexit110:                                     ; preds = %.loopexit, %33
  %71 = phi i32 [ %34, %33 ], [ %67, %.loopexit ]
  %72 = phi i32 [ %35, %33 ], [ %68, %.loopexit ]
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %73 = sext i32 %72 to i64
  %.not98.not = icmp slt i64 %indvars.iv161, %73
  br i1 %.not98.not, label %33, label %._crit_edge, !llvm.loop !14

74:                                               ; preds = %20, %._crit_edge
  %75 = phi i32 [ %30, %._crit_edge ], [ %22, %20 ]
  %.385 = phi i32 [ %.284, %._crit_edge ], [ %.183123, %20 ]
  %.378 = phi i32 [ %.277, %._crit_edge ], [ %.176125, %20 ]
  %.3 = phi i32 [ %.272, %._crit_edge ], [ %.171126, %20 ]
  %76 = add nuw nsw i32 %.079124, 1
  %.not97.not = icmp slt i32 %.079124, %75
  br i1 %.not97.not, label %20, label %._crit_edge128, !llvm.loop !15

77:                                               ; preds = %._crit_edge136
  %78 = load i32, ptr %1, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %79, i64 %81
  store i32 1, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %77, %._crit_edge136
  %.4 = phi i32 [ %80, %77 ], [ %.075.lcssa, %._crit_edge136 ]
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %.not94146190 = icmp slt i32 %84, 1
  br i1 %.not94146190, label %._crit_edge152.split.thread, label %.lr.ph151

.lr.ph151:                                        ; preds = %83, %138
  %85 = phi i32 [ %144, %138 ], [ %84, %83 ]
  %.5191 = phi i32 [ %141, %138 ], [ %.4, %83 ]
  %86 = sext i32 %.5191 to i64
  %87 = add nuw i32 %85, 1
  %88 = zext i32 %.5191 to i64
  %wide.trip.count173 = zext i32 %87 to i64
  %89 = zext nneg i32 %85 to i64
  %xtraiter = and i64 %89, 1
  %90 = icmp eq i32 %87, 2
  %unroll_iter = and i64 %89, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %92

._crit_edge152.split:                             ; preds = %128
  %91 = icmp eq i32 %.688, -1
  br i1 %91, label %._crit_edge152.split.thread, label %129

92:                                               ; preds = %.lr.ph151, %128
  %indvars.iv170 = phi i64 [ 1, %.lr.ph151 ], [ %indvars.iv.next171, %128 ]
  %.067148 = phi i32 [ -1000000, %.lr.ph151 ], [ %.2, %128 ]
  %.486147 = phi i32 [ -1, %.lr.ph151 ], [ %.688, %128 ]
  %93 = icmp eq i64 %indvars.iv170, %88
  br i1 %93, label %128, label %94

94:                                               ; preds = %92
  %95 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %86, i64 %indvars.iv170
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = icmp eq i32 %96, 0
  br i1 %97, label %.preheader.preheader, label %128

.preheader.preheader:                             ; preds = %94
  br i1 %90, label %._crit_edge144.unr-lcssa, label %.preheader

._crit_edge144.unr-lcssa:                         ; preds = %127, %.preheader.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.preheader.preheader ], [ %.1.1, %127 ]
  %indvars.iv167.unr = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next168.1, %127 ]
  %.065141.unr = phi i32 [ 0, %.preheader.preheader ], [ %.1.1, %127 ]
  br i1 %lcmp.mod.not, label %._crit_edge144, label %.preheader.epil

.preheader.epil:                                  ; preds = %._crit_edge144.unr-lcssa
  %98 = icmp eq i64 %indvars.iv167.unr, %indvars.iv170
  br i1 %98, label %._crit_edge144, label %99

99:                                               ; preds = %.preheader.epil
  %100 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %indvars.iv170, i64 %indvars.iv167.unr
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %._crit_edge144

103:                                              ; preds = %99
  %104 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %indvars.iv170, i64 %indvars.iv167.unr
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %spec.select102.epil = call i32 @llvm.smax.i32(i32 %105, i32 %.065141.unr)
  br label %._crit_edge144

._crit_edge144:                                   ; preds = %.preheader.epil, %99, %103, %._crit_edge144.unr-lcssa
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %._crit_edge144.unr-lcssa ], [ %.065141.unr, %.preheader.epil ], [ %.065141.unr, %99 ], [ %spec.select102.epil, %103 ]
  %106 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %86, i64 %indvars.iv170
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sub nsw i32 %107, %.1.lcssa
  %109 = icmp sgt i32 %108, %.067148
  %110 = trunc nuw nsw i64 %indvars.iv170 to i32
  %spec.select = select i1 %109, i32 %110, i32 %.486147
  %spec.select101 = call i32 @llvm.smax.i32(i32 %108, i32 %.067148)
  br label %128

.preheader:                                       ; preds = %.preheader.preheader, %127
  %indvars.iv167 = phi i64 [ %indvars.iv.next168.1, %127 ], [ 1, %.preheader.preheader ]
  %.065141 = phi i32 [ %.1.1, %127 ], [ 0, %.preheader.preheader ]
  %niter = phi i64 [ %niter.next.1, %127 ], [ 0, %.preheader.preheader ]
  %111 = icmp eq i64 %indvars.iv167, %indvars.iv170
  br i1 %111, label %.preheader.1, label %112

112:                                              ; preds = %.preheader
  %113 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %indvars.iv170, i64 %indvars.iv167
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %.preheader.1

116:                                              ; preds = %112
  %117 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %indvars.iv170, i64 %indvars.iv167
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %spec.select102 = call i32 @llvm.smax.i32(i32 %118, i32 %.065141)
  br label %.preheader.1

.preheader.1:                                     ; preds = %116, %112, %.preheader
  %.1 = phi i32 [ %.065141, %.preheader ], [ %.065141, %112 ], [ %spec.select102, %116 ]
  %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
  %119 = icmp eq i64 %indvars.iv.next168, %indvars.iv170
  br i1 %119, label %127, label %120

120:                                              ; preds = %.preheader.1
  %121 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %indvars.iv170, i64 %indvars.iv.next168
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = icmp eq i32 %122, 0
  br i1 %123, label %124, label %127

124:                                              ; preds = %120
  %125 = getelementptr inbounds [51 x [51 x i32]], ptr @g, i64 0, i64 %indvars.iv170, i64 %indvars.iv.next168
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %spec.select102.1 = call i32 @llvm.smax.i32(i32 %126, i32 %.1)
  br label %127

127:                                              ; preds = %124, %120, %.preheader.1
  %.1.1 = phi i32 [ %.1, %.preheader.1 ], [ %.1, %120 ], [ %spec.select102.1, %124 ]
  %indvars.iv.next168.1 = add nuw nsw i64 %indvars.iv167, 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 %._crit_edge144.unr-lcssa, label %.preheader, !llvm.loop !16

128:                                              ; preds = %94, %._crit_edge144, %92
  %.688 = phi i32 [ %.486147, %92 ], [ %spec.select, %._crit_edge144 ], [ %.486147, %94 ]
  %.2 = phi i32 [ %.067148, %92 ], [ %spec.select101, %._crit_edge144 ], [ %.067148, %94 ]
  %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
  %exitcond174.not = icmp eq i64 %indvars.iv.next171, %wide.trip.count173
  br i1 %exitcond174.not, label %._crit_edge152.split, label %92, !llvm.loop !17

129:                                              ; preds = %._crit_edge152.split
  %130 = sext i32 %.5191 to i64
  %131 = sext i32 %.688 to i64
  %132 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %130, i64 %131
  store i32 1, ptr %132, align 4, !tbaa !5
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.5191)
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef nonnull @.str)
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %134, i32 noundef %.688)
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %135, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %137 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %.not95 = icmp eq i32 %137, -1
  br i1 %.not95, label %._crit_edge152.split.thread, label %138

138:                                              ; preds = %129
  %139 = load i32, ptr %1, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = load i32, ptr %2, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [51 x [51 x i32]], ptr @vi, i64 0, i64 %140, i64 %142
  store i32 1, ptr %143, align 4, !tbaa !5
  %144 = load i32, ptr @n, align 4, !tbaa !5
  %.not94146 = icmp slt i32 %144, 1
  br i1 %.not94146, label %._crit_edge152.split.thread, label %.lr.ph151

._crit_edge152.split.thread:                      ; preds = %129, %._crit_edge152.split, %138, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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