; LLVM IR from duc0/ContestNeko :: CPPProjects (KMin)

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

%"struct.std::pair" = type { i32, i32 }
%"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 }

@nRow = external dso_local global i32, align 4
@nCol = external dso_local global i32, align 4
@nCar = external dso_local global i32, align 4
@board = external dso_local global [2020 x [2020 x i8]], align 16
@carPos = external dso_local global [2020 x %"struct.std::pair"], align 16
@f = external dso_local global [2020 x [2020 x i32]], align 16
@ret = external dso_local global [2020 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #0

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

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

; Function Attrs: 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)) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z9recalcRowi(i32 noundef) #4

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %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 %"struct.std::pair", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %19 = load ptr, ptr @stdin, align 8, !tbaa !5
  %20 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %19)
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @nRow, ptr noundef @nCol, ptr noundef @nCar)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %33, %0
  %23 = load i32, ptr %2, align 4, !tbaa !9
  %24 = load i32, ptr @nRow, align 4, !tbaa !9
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %36

27:                                               ; preds = %22
  %28 = load i32, ptr %2, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [2020 x [2020 x i8]], ptr @board, i64 0, i64 %29
  %31 = getelementptr inbounds [2020 x i8], ptr %30, i64 0, i64 0
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %31)
  br label %33

33:                                               ; preds = %27
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !9
  br label %22, !llvm.loop !11

36:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %57, %36
  %38 = load i32, ptr %3, align 4, !tbaa !9
  %39 = load i32, ptr @nCar, align 4, !tbaa !9
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %60

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.6, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %44 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %44, ptr %6, align 4
  %45 = load i32, ptr %3, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [2020 x %"struct.std::pair"], ptr @carPos, i64 0, i64 %46
  %48 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  %49 = load i32, ptr %4, align 4, !tbaa !9
  %50 = sub nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [2020 x [2020 x i8]], ptr @board, i64 0, i64 %51
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = sub nsw i32 %53, 1
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [2020 x i8], ptr %52, i64 0, i64 %55
  store i8 88, ptr %56, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %57

57:                                               ; preds = %42
  %58 = load i32, ptr %3, align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !9
  br label %37, !llvm.loop !14

60:                                               ; preds = %41
  %61 = load i32, ptr @nCar, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %62
  store i32 0, ptr %63, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 16321600, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %140, %60
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = load i32, ptr @nRow, align 4, !tbaa !9
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %143

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %136, %69
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = load i32, ptr @nCol, align 4, !tbaa !9
  %73 = icmp sle i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %139

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #9
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [2020 x [2020 x i8]], ptr @board, i64 0, i64 %78
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = sub nsw i32 %80, 1
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [2020 x i8], ptr %79, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !13
  store i8 %84, ptr %10, align 1, !tbaa !13
  %85 = load i8, ptr %10, align 1, !tbaa !13
  %86 = sext i8 %85 to i32
  %87 = icmp eq i32 %86, 46
  br i1 %87, label %88, label %135

88:                                               ; preds = %75
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = sub nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %91
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [2020 x i32], ptr %92, i64 0, i64 %94
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %97
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [2020 x i32], ptr %98, i64 0, i64 %101
  %103 = load i32, ptr %7, align 4, !tbaa !9
  %104 = sub nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %105
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [2020 x i32], ptr %106, i64 0, i64 %109
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %102, ptr noundef nonnull align 4 dereferenceable(4) %110)
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %95, ptr noundef nonnull align 4 dereferenceable(4) %111)
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  %115 = load i32, ptr %7, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %116
  %118 = load i32, ptr %9, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2020 x i32], ptr %117, i64 0, i64 %119
  store i32 %114, ptr %120, align 4, !tbaa !9
  %121 = load i32, ptr @nCar, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %122
  %124 = load i32, ptr %7, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %125
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [2020 x i32], ptr %126, i64 0, i64 %128
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %123, ptr noundef nonnull align 4 dereferenceable(4) %129)
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = load i32, ptr @nCar, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %133
  store i32 %131, ptr %134, align 4, !tbaa !9
  br label %135

135:                                              ; preds = %88, %75
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #9
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %9, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %9, align 4, !tbaa !9
  br label %70, !llvm.loop !15

139:                                              ; preds = %74
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %7, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %7, align 4, !tbaa !9
  br label %64, !llvm.loop !16

143:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %151, %143
  %145 = load i32, ptr %11, align 4, !tbaa !9
  %146 = load i32, ptr @nRow, align 4, !tbaa !9
  %147 = icmp sle i32 %145, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %144
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %154

149:                                              ; preds = %144
  %150 = load i32, ptr %11, align 4, !tbaa !9
  call void @_Z9recalcRowi(i32 noundef %150)
  br label %151

151:                                              ; preds = %149
  %152 = load i32, ptr %11, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %11, align 4, !tbaa !9
  br label %144, !llvm.loop !17

154:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %155 = load i32, ptr @nCar, align 4, !tbaa !9
  %156 = sub nsw i32 %155, 1
  store i32 %156, ptr %12, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %213, %154
  %158 = load i32, ptr %12, align 4, !tbaa !9
  %159 = icmp sge i32 %158, 1
  br i1 %159, label %161, label %160

160:                                              ; preds = %157
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %216

161:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %162 = load i32, ptr %12, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [2020 x %"struct.std::pair"], ptr @carPos, i64 0, i64 %164
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %165, i64 8, i1 false)
  %166 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %167 = load i32, ptr %166, align 4, !tbaa !18
  %168 = sub nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [2020 x [2020 x i8]], ptr @board, i64 0, i64 %169
  %171 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !20
  %173 = sub nsw i32 %172, 1
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [2020 x i8], ptr %170, i64 0, i64 %174
  store i8 46, ptr %175, align 1, !tbaa !13
  %176 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %177 = load i32, ptr %176, align 4, !tbaa !18
  call void @_Z9recalcRowi(i32 noundef %177)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 1, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @nRow, ptr noundef nonnull align 4 dereferenceable(4) @nCol)
  %179 = load i32, ptr %178, align 4, !tbaa !9
  store i32 %179, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %180

180:                                              ; preds = %202, %161
  %181 = load i32, ptr %14, align 4, !tbaa !9
  %182 = load i32, ptr %15, align 4, !tbaa !9
  %183 = icmp sle i32 %181, %182
  br i1 %183, label %184, label %203

184:                                              ; preds = %180
  %185 = load i32, ptr %14, align 4, !tbaa !9
  %186 = load i32, ptr %15, align 4, !tbaa !9
  %187 = add nsw i32 %185, %186
  %188 = sdiv i32 %187, 2
  store i32 %188, ptr %16, align 4, !tbaa !9
  %189 = load i32, ptr %16, align 4, !tbaa !9
  %190 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %191 = load i32, ptr %190, align 4, !tbaa !18
  %192 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %193 = load i32, ptr %192, align 4, !tbaa !20
  %194 = call noundef zeroext i1 @_Z2okiii(i32 noundef %189, i32 noundef %191, i32 noundef %193)
  br i1 %194, label %195, label %199

195:                                              ; preds = %184
  %196 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %196, ptr %17, align 4, !tbaa !9
  %197 = load i32, ptr %16, align 4, !tbaa !9
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %14, align 4, !tbaa !9
  br label %202

199:                                              ; preds = %184
  %200 = load i32, ptr %16, align 4, !tbaa !9
  %201 = sub nsw i32 %200, 1
  store i32 %201, ptr %15, align 4, !tbaa !9
  br label %202

202:                                              ; preds = %199, %195
  br label %180, !llvm.loop !21

203:                                              ; preds = %180
  %204 = load i32, ptr %12, align 4, !tbaa !9
  %205 = add nsw i32 %204, 1
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %206
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %207, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %209 = load i32, ptr %208, align 4, !tbaa !9
  %210 = load i32, ptr %12, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %211
  store i32 %209, ptr %212, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %213

213:                                              ; preds = %203
  %214 = load i32, ptr %12, align 4, !tbaa !9
  %215 = add nsw i32 %214, -1
  store i32 %215, ptr %12, align 4, !tbaa !9
  br label %157, !llvm.loop !22

216:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 1, ptr %18, align 4, !tbaa !9
  br label %217

217:                                              ; preds = %229, %216
  %218 = load i32, ptr %18, align 4, !tbaa !9
  %219 = load i32, ptr @nCar, align 4, !tbaa !9
  %220 = icmp sle i32 %218, %219
  br i1 %220, label %222, label %221

221:                                              ; preds = %217
  store i32 22, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %232

222:                                              ; preds = %217
  %223 = load i32, ptr %18, align 4, !tbaa !9
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !9
  %227 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %226)
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %227, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %229

229:                                              ; preds = %222
  %230 = load i32, ptr %18, align 4, !tbaa !9
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %18, align 4, !tbaa !9
  br label %217, !llvm.loop !23

232:                                              ; preds = %221
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 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)) #8

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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 #9 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!20 = !{!19, !10, i64 4}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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

%"struct.std::pair" = type { i32, i32 }
%"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 }

@nRow = external dso_local global i32, align 4
@nCol = external dso_local global i32, align 4
@nCar = external dso_local global i32, align 4
@board = external dso_local global [2020 x [2020 x i8]], align 16
@carPos = external dso_local global [2020 x %"struct.std::pair"], align 16
@f = external dso_local global [2020 x [2020 x i32]], align 16
@ret = external dso_local global [2020 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; 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 #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z9recalcRowi(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i32, align 4
  %5 = load ptr, ptr @stdin, align 8, !tbaa !5
  %6 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %5)
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @nRow, ptr noundef nonnull @nCol, ptr noundef nonnull @nCar)
  %8 = load i32, ptr @nRow, align 4, !tbaa !9
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.preheader62

.preheader62:                                     ; preds = %.lr.ph, %0
  %10 = phi i32 [ %8, %0 ], [ %14, %.lr.ph ]
  %11 = load i32, ptr @nCar, align 4, !tbaa !9
  %.not64 = icmp slt i32 %11, 1
  br i1 %.not64, label %.preheader62.._crit_edge_crit_edge, label %.lr.ph66

.preheader62.._crit_edge_crit_edge:               ; preds = %.preheader62
  %.pre114 = sext i32 %11 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [2020 x [2020 x i8]], ptr @board, i64 0, i64 %indvars.iv
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %12)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @nRow, align 4, !tbaa !9
  %15 = sext i32 %14 to i64
  %16 = icmp slt i64 %indvars.iv.next, %15
  br i1 %16, label %.lr.ph, label %.preheader62, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %.lr.ph66
  %.pre = load i32, ptr @nRow, align 4, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader62.._crit_edge_crit_edge, %._crit_edge.loopexit
  %.pre-phi = phi i64 [ %.pre114, %.preheader62.._crit_edge_crit_edge ], [ %33, %._crit_edge.loopexit ]
  %17 = phi i32 [ %10, %.preheader62.._crit_edge_crit_edge ], [ %.pre, %._crit_edge.loopexit ]
  %.lcssa = phi i32 [ %11, %.preheader62.._crit_edge_crit_edge ], [ %32, %._crit_edge.loopexit ]
  %18 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %.pre-phi
  store i32 0, ptr %18, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16321600) @f, i8 0, i64 16321600, i1 false)
  %.not5571 = icmp slt i32 %17, 1
  br i1 %.not5571, label %._crit_edge76, label %.preheader61.lr.ph

.preheader61.lr.ph:                               ; preds = %._crit_edge
  %19 = load i32, ptr @nCol, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 1
  br i1 %20, label %.lr.ph75.preheader, label %.preheader61

.lr.ph66:                                         ; preds = %.preheader62, %.lr.ph66
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %.lr.ph66 ], [ 1, %.preheader62 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %22 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %22, ptr %3, align 8
  %23 = getelementptr inbounds [2020 x %"struct.std::pair"], ptr @carPos, i64 0, i64 %indvars.iv95
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  %25 = load i32, ptr %1, align 4, !tbaa !9
  %26 = add nsw i32 %25, -1
  %27 = sext i32 %26 to i64
  %28 = load i32, ptr %2, align 4, !tbaa !9
  %29 = add nsw i32 %28, -1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2020 x [2020 x i8]], ptr @board, i64 0, i64 %27, i64 %30
  store i8 88, ptr %31, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %32 = load i32, ptr @nCar, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %.not.not = icmp slt i64 %indvars.iv95, %33
  br i1 %.not.not, label %.lr.ph66, label %._crit_edge.loopexit, !llvm.loop !14

.preheader61:                                     ; preds = %.preheader61.lr.ph, %._crit_edge70
  %34 = phi i32 [ %39, %._crit_edge70 ], [ %.lcssa, %.preheader61.lr.ph ]
  %35 = phi i32 [ %40, %._crit_edge70 ], [ %17, %.preheader61.lr.ph ]
  %36 = phi i32 [ %41, %._crit_edge70 ], [ %19, %.preheader61.lr.ph ]
  %37 = phi i32 [ %42, %._crit_edge70 ], [ %19, %.preheader61.lr.ph ]
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %._crit_edge70 ], [ 1, %.preheader61.lr.ph ]
  %.not5967 = icmp slt i32 %37, 1
  br i1 %.not5967, label %._crit_edge70, label %.lr.ph69

.lr.ph69:                                         ; preds = %.preheader61
  %38 = add nsw i64 %indvars.iv101, -1
  br label %44

.preheader60:                                     ; preds = %._crit_edge70
  %.not5673 = icmp slt i32 %40, 1
  br i1 %.not5673, label %._crit_edge76, label %.lr.ph75.preheader

.lr.ph75.preheader:                               ; preds = %.preheader61.lr.ph, %.preheader60
  br label %.lr.ph75

._crit_edge70.loopexit:                           ; preds = %68
  %.pre111 = load i32, ptr @nRow, align 4, !tbaa !9
  br label %._crit_edge70

._crit_edge70:                                    ; preds = %._crit_edge70.loopexit, %.preheader61
  %39 = phi i32 [ %69, %._crit_edge70.loopexit ], [ %34, %.preheader61 ]
  %40 = phi i32 [ %.pre111, %._crit_edge70.loopexit ], [ %35, %.preheader61 ]
  %41 = phi i32 [ %70, %._crit_edge70.loopexit ], [ %36, %.preheader61 ]
  %42 = phi i32 [ %70, %._crit_edge70.loopexit ], [ %37, %.preheader61 ]
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %43 = sext i32 %40 to i64
  %.not55.not = icmp slt i64 %indvars.iv101, %43
  br i1 %.not55.not, label %.preheader61, label %.preheader60, !llvm.loop !15

44:                                               ; preds = %.lr.ph69, %68
  %45 = phi i32 [ %34, %.lr.ph69 ], [ %69, %68 ]
  %46 = phi i32 [ %36, %.lr.ph69 ], [ %70, %68 ]
  %indvars.iv98 = phi i64 [ 1, %.lr.ph69 ], [ %indvars.iv.next99, %68 ]
  %47 = add nsw i64 %indvars.iv98, -1
  %48 = getelementptr inbounds [2020 x [2020 x i8]], ptr @board, i64 0, i64 %38, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !13
  %50 = icmp eq i8 %49, 46
  br i1 %50, label %51, label %68

51:                                               ; preds = %44
  %52 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %38, i64 %indvars.iv98
  %53 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %indvars.iv101, i64 %47
  %54 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %38, i64 %47
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(4) %54)
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %52, ptr noundef nonnull align 4 dereferenceable(4) %55)
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  %59 = getelementptr inbounds [2020 x [2020 x i32]], ptr @f, i64 0, i64 %indvars.iv101, i64 %indvars.iv98
  store i32 %58, ptr %59, align 4, !tbaa !9
  %60 = load i32, ptr @nCar, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %61
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %62, ptr noundef nonnull align 4 dereferenceable(4) %59)
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = load i32, ptr @nCar, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %66
  store i32 %64, ptr %67, align 4, !tbaa !9
  %.pre110 = load i32, ptr @nCol, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %51, %44
  %69 = phi i32 [ %65, %51 ], [ %45, %44 ]
  %70 = phi i32 [ %.pre110, %51 ], [ %46, %44 ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %71 = sext i32 %70 to i64
  %.not59.not = icmp slt i64 %indvars.iv98, %71
  br i1 %.not59.not, label %44, label %._crit_edge70.loopexit, !llvm.loop !17

._crit_edge76.loopexit:                           ; preds = %.lr.ph75
  %.pre112 = load i32, ptr @nCar, align 4, !tbaa !9
  br label %._crit_edge76

._crit_edge76:                                    ; preds = %._crit_edge, %._crit_edge76.loopexit, %.preheader60
  %72 = phi i32 [ %.pre112, %._crit_edge76.loopexit ], [ %39, %.preheader60 ], [ %.lcssa, %._crit_edge ]
  %73 = icmp sgt i32 %72, 1
  br i1 %73, label %.lr.ph87.preheader, label %.preheader

.lr.ph87.preheader:                               ; preds = %._crit_edge76
  %74 = zext nneg i32 %72 to i64
  br label %.lr.ph87

.lr.ph75:                                         ; preds = %.lr.ph75.preheader, %.lr.ph75
  %.05174 = phi i32 [ %75, %.lr.ph75 ], [ 1, %.lr.ph75.preheader ]
  call void @_Z9recalcRowi(i32 noundef %.05174)
  %75 = add nuw nsw i32 %.05174, 1
  %76 = load i32, ptr @nRow, align 4, !tbaa !9
  %.not56.not = icmp slt i32 %.05174, %76
  br i1 %.not56.not, label %.lr.ph75, label %._crit_edge76.loopexit, !llvm.loop !18

.preheader.loopexit:                              ; preds = %._crit_edge82
  %.pre113 = load i32, ptr @nCar, align 4, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %._crit_edge76
  %77 = phi i32 [ %.pre113, %.preheader.loopexit ], [ %72, %._crit_edge76 ]
  %.not5788 = icmp slt i32 %77, 1
  br i1 %.not5788, label %._crit_edge91, label %.lr.ph90

.lr.ph87:                                         ; preds = %.lr.ph87.preheader, %._crit_edge82
  %indvars.iv104 = phi i64 [ %74, %.lr.ph87.preheader ], [ %indvars.iv.next105, %._crit_edge82 ]
  %indvars.iv.next105 = add nsw i64 %indvars.iv104, -1
  %78 = getelementptr inbounds [2020 x %"struct.std::pair"], ptr @carPos, i64 0, i64 %indvars.iv104
  %.sroa.0.0.copyload = load i32, ptr %78, align 8
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %78, i64 4
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4
  %79 = add nsw i32 %.sroa.0.0.copyload, -1
  %80 = sext i32 %79 to i64
  %81 = add nsw i32 %.sroa.6.0.copyload, -1
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [2020 x [2020 x i8]], ptr @board, i64 0, i64 %80, i64 %82
  store i8 46, ptr %83, align 1, !tbaa !13
  call void @_Z9recalcRowi(i32 noundef %.sroa.0.0.copyload)
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @nRow, ptr noundef nonnull align 4 dereferenceable(4) @nCol)
  %85 = load i32, ptr %84, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  store i32 0, ptr %4, align 4, !tbaa !9
  %.not5877 = icmp slt i32 %85, 1
  br i1 %.not5877, label %._crit_edge82, label %.lr.ph81

.lr.ph81:                                         ; preds = %.lr.ph87, %93
  %.04579 = phi i32 [ %.1, %93 ], [ %85, %.lr.ph87 ]
  %.04678 = phi i32 [ %.147, %93 ], [ 1, %.lr.ph87 ]
  %86 = add nuw nsw i32 %.04579, %.04678
  %87 = lshr i32 %86, 1
  %88 = call noundef zeroext i1 @_Z2okiii(i32 noundef %87, i32 noundef %.sroa.0.0.copyload, i32 noundef %.sroa.6.0.copyload)
  br i1 %88, label %89, label %91

89:                                               ; preds = %.lr.ph81
  store i32 %87, ptr %4, align 4, !tbaa !9
  %90 = add nuw nsw i32 %87, 1
  br label %93

91:                                               ; preds = %.lr.ph81
  %92 = add nsw i32 %87, -1
  br label %93

93:                                               ; preds = %91, %89
  %.147 = phi i32 [ %90, %89 ], [ %.04678, %91 ]
  %.1 = phi i32 [ %.04579, %89 ], [ %92, %91 ]
  %.not58 = icmp sgt i32 %.147, %.1
  br i1 %.not58, label %._crit_edge82, label %.lr.ph81, !llvm.loop !19

._crit_edge82:                                    ; preds = %93, %.lr.ph87
  %94 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %indvars.iv104
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %indvars.iv.next105
  store i32 %96, ptr %97, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  %98 = icmp sgt i64 %indvars.iv104, 2
  br i1 %98, label %.lr.ph87, label %.preheader.loopexit, !llvm.loop !20

._crit_edge91:                                    ; preds = %.lr.ph90, %.preheader
  ret i32 0

.lr.ph90:                                         ; preds = %.preheader, %.lr.ph90
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %.lr.ph90 ], [ 1, %.preheader ]
  %99 = getelementptr inbounds [2020 x i32], ptr @ret, i64 0, i64 %indvars.iv107
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %100)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %103 = load i32, ptr @nCar, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %.not57.not = icmp slt i64 %indvars.iv107, %104
  br i1 %.not57.not, label %.lr.ph90, label %._crit_edge91, !llvm.loop !21
}

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

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

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

; 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 #1 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)) #8

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


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