; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2015-16/Feb 2016/Silver (16 Feb S3)

; 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_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }

@best = external dso_local global [101 x [101 x i8]], align 16
@temp = external dso_local global [101 x [101 x i8]], align 16
@ans = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::basic_ifstream", align 8
  %3 = alloca %"class.std::basic_ofstream", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 520, ptr %2) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %2, ptr noundef @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr %3) #7
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %3, ptr noundef @.str.1, i32 noundef 16)
          to label %23 unwind label %36

23:                                               ; preds = %0
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) @x)
          to label %25 unwind label %40

25:                                               ; preds = %23
  %26 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) @y)
          to label %27 unwind label %40

27:                                               ; preds = %25
  %28 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) @k)
          to label %29 unwind label %40

29:                                               ; preds = %27
  %30 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) @m)
          to label %31 unwind label %40

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

32:                                               ; preds = %60, %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = icmp slt i32 %33, 101
  br i1 %34, label %44, label %35

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

36:                                               ; preds = %0
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %4, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %5, align 4
  br label %275

40:                                               ; preds = %269, %29, %27, %25, %23
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %4, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %5, align 4
  br label %274

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

45:                                               ; preds = %56, %44
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 101
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %45
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [101 x [101 x i8]], ptr @best, i64 0, i64 %51
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [101 x i8], ptr %52, i64 0, i64 %54
  store i8 0, ptr %55, align 1, !tbaa !9
  br label %56

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

59:                                               ; preds = %48
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %6, align 4, !tbaa !5
  br label %32, !llvm.loop !13

63:                                               ; preds = %35
  store i8 1, ptr @best, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %225, %63
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = load i32, ptr @k, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

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

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

70:                                               ; preds = %90, %69
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = icmp slt i32 %71, 101
  br i1 %72, label %74, label %73

73:                                               ; preds = %70
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %93

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

75:                                               ; preds = %86, %74
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = icmp slt i32 %76, 101
  br i1 %77, label %79, label %78

78:                                               ; preds = %75
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %89

79:                                               ; preds = %75
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %81
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [101 x i8], ptr %82, i64 0, i64 %84
  store i8 0, ptr %85, align 1, !tbaa !9
  br label %86

86:                                               ; preds = %79
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %11, align 4, !tbaa !5
  br label %75, !llvm.loop !14

89:                                               ; preds = %78
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %10, align 4, !tbaa !5
  br label %70, !llvm.loop !15

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

94:                                               ; preds = %188, %93
  %95 = load i32, ptr %12, align 4, !tbaa !5
  %96 = load i32, ptr @x, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  %98 = icmp slt i32 %95, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %94
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %191

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

101:                                              ; preds = %184, %100
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = load i32, ptr @y, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  %105 = icmp slt i32 %102, %104
  br i1 %105, label %107, label %106

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

107:                                              ; preds = %101
  %108 = load i32, ptr %12, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [101 x [101 x i8]], ptr @best, i64 0, i64 %109
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [101 x i8], ptr %110, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !9, !range !16, !noundef !17
  %115 = trunc i8 %114 to i1
  br i1 %115, label %116, label %183

116:                                              ; preds = %107
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %118
  %120 = load i32, ptr %13, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [101 x i8], ptr %119, i64 0, i64 %121
  store i8 1, ptr %122, align 1, !tbaa !9
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %124
  %126 = load i32, ptr @y, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [101 x i8], ptr %125, i64 0, i64 %127
  store i8 1, ptr %128, align 1, !tbaa !9
  %129 = load i32, ptr @x, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %130
  %132 = load i32, ptr %13, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [101 x i8], ptr %131, i64 0, i64 %133
  store i8 1, ptr %134, align 1, !tbaa !9
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %136
  %138 = getelementptr inbounds [101 x i8], ptr %137, i64 0, i64 0
  store i8 1, ptr %138, align 1, !tbaa !9
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [101 x i8], ptr @temp, i64 0, i64 %140
  store i8 1, ptr %141, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %142 = load i32, ptr @y, align 4, !tbaa !5
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = sub nsw i32 %142, %143
  store i32 %144, ptr %15, align 4, !tbaa !5
  %145 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %146 unwind label %174

146:                                              ; preds = %116
  %147 = load i32, ptr %145, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  store i32 %147, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %148 = load i32, ptr @x, align 4, !tbaa !5
  %149 = load i32, ptr %12, align 4, !tbaa !5
  %150 = sub nsw i32 %148, %149
  store i32 %150, ptr %17, align 4, !tbaa !5
  %151 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %152 unwind label %178

152:                                              ; preds = %146
  %153 = load i32, ptr %151, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  store i32 %153, ptr %16, align 4, !tbaa !5
  %154 = load i32, ptr %12, align 4, !tbaa !5
  %155 = load i32, ptr %16, align 4, !tbaa !5
  %156 = add nsw i32 %154, %155
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %157
  %159 = load i32, ptr %13, align 4, !tbaa !5
  %160 = load i32, ptr %16, align 4, !tbaa !5
  %161 = sub nsw i32 %159, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [101 x i8], ptr %158, i64 0, i64 %162
  store i8 1, ptr %163, align 1, !tbaa !9
  %164 = load i32, ptr %12, align 4, !tbaa !5
  %165 = load i32, ptr %14, align 4, !tbaa !5
  %166 = sub nsw i32 %164, %165
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %167
  %169 = load i32, ptr %13, align 4, !tbaa !5
  %170 = load i32, ptr %14, align 4, !tbaa !5
  %171 = add nsw i32 %169, %170
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [101 x i8], ptr %168, i64 0, i64 %172
  store i8 1, ptr %173, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %183

174:                                              ; preds = %116
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %4, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %182

178:                                              ; preds = %146
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %4, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %182

182:                                              ; preds = %178, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %274

183:                                              ; preds = %152, %107
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %13, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %13, align 4, !tbaa !5
  br label %101, !llvm.loop !18

187:                                              ; preds = %106
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %12, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %12, align 4, !tbaa !5
  br label %94, !llvm.loop !19

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

192:                                              ; preds = %221, %191
  %193 = load i32, ptr %18, align 4, !tbaa !5
  %194 = icmp slt i32 %193, 101
  br i1 %194, label %196, label %195

195:                                              ; preds = %192
  store i32 23, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %224

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

197:                                              ; preds = %217, %196
  %198 = load i32, ptr %19, align 4, !tbaa !5
  %199 = icmp slt i32 %198, 101
  br i1 %199, label %201, label %200

200:                                              ; preds = %197
  store i32 26, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %220

201:                                              ; preds = %197
  %202 = load i32, ptr %18, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %203
  %205 = load i32, ptr %19, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [101 x i8], ptr %204, i64 0, i64 %206
  %208 = load i8, ptr %207, align 1, !tbaa !9, !range !16, !noundef !17
  %209 = trunc i8 %208 to i1
  %210 = load i32, ptr %18, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [101 x [101 x i8]], ptr @best, i64 0, i64 %211
  %213 = load i32, ptr %19, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [101 x i8], ptr %212, i64 0, i64 %214
  %216 = zext i1 %209 to i8
  store i8 %216, ptr %215, align 1, !tbaa !9
  br label %217

217:                                              ; preds = %201
  %218 = load i32, ptr %19, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %19, align 4, !tbaa !5
  br label %197, !llvm.loop !20

220:                                              ; preds = %200
  br label %221

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

224:                                              ; preds = %195
  br label %225

225:                                              ; preds = %224
  %226 = load i32, ptr %9, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %9, align 4, !tbaa !5
  br label %64, !llvm.loop !22

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

229:                                              ; preds = %266, %228
  %230 = load i32, ptr %20, align 4, !tbaa !5
  %231 = icmp slt i32 %230, 101
  br i1 %231, label %233, label %232

232:                                              ; preds = %229
  store i32 29, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %269

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

234:                                              ; preds = %262, %233
  %235 = load i32, ptr %21, align 4, !tbaa !5
  %236 = icmp slt i32 %235, 101
  br i1 %236, label %238, label %237

237:                                              ; preds = %234
  store i32 32, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %265

238:                                              ; preds = %234
  %239 = load i32, ptr %20, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [101 x [101 x i8]], ptr @best, i64 0, i64 %240
  %242 = load i32, ptr %21, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [101 x i8], ptr %241, i64 0, i64 %243
  %245 = load i8, ptr %244, align 1, !tbaa !9, !range !16, !noundef !17
  %246 = trunc i8 %245 to i1
  br i1 %246, label %247, label %261

247:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %248 = load i32, ptr %20, align 4, !tbaa !5
  %249 = load i32, ptr %21, align 4, !tbaa !5
  %250 = add nsw i32 %248, %249
  %251 = load i32, ptr @m, align 4, !tbaa !5
  %252 = sub nsw i32 %250, %251
  %253 = call i32 @llvm.abs.i32(i32 %252, i1 true)
  store i32 %253, ptr %22, align 4, !tbaa !5
  %254 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %255 unwind label %257

255:                                              ; preds = %247
  %256 = load i32, ptr %254, align 4, !tbaa !5
  store i32 %256, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %261

257:                                              ; preds = %247
  %258 = landingpad { ptr, i32 }
          cleanup
  %259 = extractvalue { ptr, i32 } %258, 0
  store ptr %259, ptr %4, align 8
  %260 = extractvalue { ptr, i32 } %258, 1
  store i32 %260, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %274

261:                                              ; preds = %255, %238
  br label %262

262:                                              ; preds = %261
  %263 = load i32, ptr %21, align 4, !tbaa !5
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %21, align 4, !tbaa !5
  br label %234, !llvm.loop !23

265:                                              ; preds = %237
  br label %266

266:                                              ; preds = %265
  %267 = load i32, ptr %20, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %20, align 4, !tbaa !5
  br label %229, !llvm.loop !24

269:                                              ; preds = %232
  %270 = load i32, ptr @ans, align 4, !tbaa !5
  %271 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %270)
          to label %272 unwind label %40

272:                                              ; preds = %269
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #7
  %273 = load i32, ptr %1, align 4
  ret i32 %273

274:                                              ; preds = %257, %182, %40
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #7
  br label %275

275:                                              ; preds = %274, %36
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #7
  br label %276

276:                                              ; preds = %275
  %277 = load ptr, ptr %4, align 8
  %278 = load i32, ptr %5, align 4
  %279 = insertvalue { ptr, i32 } poison, ptr %277, 0
  %280 = insertvalue { ptr, i32 } %279, i32 %278, 1
  resume { ptr, i32 } %280
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), 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) #1

; 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)) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #6 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !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"

%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }

@best = external dso_local local_unnamed_addr global [101 x [101 x i8]], align 16
@temp = external dso_local local_unnamed_addr global [101 x [101 x i8]], align 16
@ans = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::basic_ifstream", align 8
  %2 = alloca %"class.std::basic_ofstream", align 8
  %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
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %1) #9
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %1, ptr noundef nonnull @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #9
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.1, i32 noundef 16)
          to label %8 unwind label %18

8:                                                ; preds = %0
  %9 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @x)
          to label %10 unwind label %20

10:                                               ; preds = %8
  %11 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @y)
          to label %12 unwind label %20

12:                                               ; preds = %10
  %13 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) @k)
          to label %14 unwind label %20

14:                                               ; preds = %12
  %15 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @m)
          to label %.preheader54.preheader unwind label %20

.preheader54.preheader:                           ; preds = %14
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10201) @best, i8 0, i64 10201, i1 false), !tbaa !5
  store i8 1, ptr @best, align 16, !tbaa !5
  %16 = load i32, ptr @k, align 4, !tbaa !9
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader53.preheader, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge65, %.preheader54.preheader
  br label %.preheader

.preheader53.preheader:                           ; preds = %.preheader54.preheader
  %.pre = load i32, ptr @x, align 4, !tbaa !9
  br label %.preheader53

18:                                               ; preds = %0
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %105

20:                                               ; preds = %87, %14, %12, %10, %8
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #9
  br label %105

.preheader53:                                     ; preds = %.preheader53.preheader, %._crit_edge65
  %22 = phi i32 [ %28, %._crit_edge65 ], [ %16, %.preheader53.preheader ]
  %23 = phi i32 [ %29, %._crit_edge65 ], [ %.pre, %.preheader53.preheader ]
  %24 = phi i32 [ %30, %._crit_edge65 ], [ %.pre, %.preheader53.preheader ]
  %25 = phi i32 [ %31, %._crit_edge65 ], [ %.pre, %.preheader53.preheader ]
  %.04368 = phi i32 [ %32, %._crit_edge65 ], [ 0, %.preheader53.preheader ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10201) @temp, i8 0, i64 10201, i1 false), !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 0, ptr %3, align 4, !tbaa !9
  %.not62 = icmp slt i32 %25, 0
  br i1 %.not62, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %.preheader53
  %26 = load i32, ptr @y, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %._crit_edge65, label %.lr.ph64.split

._crit_edge65.loopexit:                           ; preds = %._crit_edge
  %.pre86 = load i32, ptr @k, align 4, !tbaa !9
  br label %._crit_edge65

._crit_edge65:                                    ; preds = %.lr.ph64, %._crit_edge65.loopexit, %.preheader53
  %28 = phi i32 [ %.pre86, %._crit_edge65.loopexit ], [ %22, %.preheader53 ], [ %22, %.lr.ph64 ]
  %29 = phi i32 [ %39, %._crit_edge65.loopexit ], [ %23, %.preheader53 ], [ %23, %.lr.ph64 ]
  %30 = phi i32 [ %40, %._crit_edge65.loopexit ], [ %24, %.preheader53 ], [ %23, %.lr.ph64 ]
  %31 = phi i32 [ %40, %._crit_edge65.loopexit ], [ %25, %.preheader53 ], [ %23, %.lr.ph64 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(10201) @best, ptr noundef nonnull align 16 dereferenceable(10201) @temp, i64 10201, i1 false), !tbaa !5
  %32 = add nuw nsw i32 %.04368, 1
  %33 = icmp slt i32 %32, %28
  br i1 %33, label %.preheader53, label %.preheader.preheader, !llvm.loop !11

.lr.ph64.split:                                   ; preds = %.lr.ph64, %._crit_edge
  %34 = phi i32 [ %39, %._crit_edge ], [ %23, %.lr.ph64 ]
  %35 = phi i32 [ %40, %._crit_edge ], [ %24, %.lr.ph64 ]
  %36 = phi i32 [ %42, %._crit_edge ], [ %26, %.lr.ph64 ]
  %37 = phi i32 [ %44, %._crit_edge ], [ 0, %.lr.ph64 ]
  %38 = phi i32 [ %43, %._crit_edge ], [ %26, %.lr.ph64 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  store i32 0, ptr %4, align 4, !tbaa !9
  %.not4960 = icmp slt i32 %38, 0
  br i1 %.not4960, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %82
  %.pre85 = load i32, ptr @x, align 4, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph64.split
  %39 = phi i32 [ %.pre85, %._crit_edge.loopexit ], [ %34, %.lr.ph64.split ]
  %40 = phi i32 [ %.pre85, %._crit_edge.loopexit ], [ %35, %.lr.ph64.split ]
  %41 = phi i32 [ %85, %._crit_edge.loopexit ], [ %37, %.lr.ph64.split ]
  %42 = phi i32 [ %83, %._crit_edge.loopexit ], [ %36, %.lr.ph64.split ]
  %43 = phi i32 [ %83, %._crit_edge.loopexit ], [ %38, %.lr.ph64.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  %44 = add nsw i32 %41, 1
  store i32 %44, ptr %3, align 4, !tbaa !9
  %.not.not = icmp slt i32 %41, %40
  br i1 %.not.not, label %.lr.ph64.split, label %._crit_edge65.loopexit, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph64.split, %82
  %45 = phi i32 [ %83, %82 ], [ %36, %.lr.ph64.split ]
  %46 = phi i32 [ %85, %82 ], [ %37, %.lr.ph64.split ]
  %47 = phi i32 [ %83, %82 ], [ %38, %.lr.ph64.split ]
  %storemerge4861 = phi i32 [ %86, %82 ], [ 0, %.lr.ph64.split ]
  %48 = sext i32 %46 to i64
  %49 = sext i32 %storemerge4861 to i64
  %50 = getelementptr inbounds [101 x [101 x i8]], ptr @best, i64 0, i64 %48, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !5, !range !15, !noundef !16
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %53, label %82

53:                                               ; preds = %.lr.ph
  %54 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %48, i64 %49
  store i8 1, ptr %54, align 1, !tbaa !5
  %55 = sext i32 %47 to i64
  %56 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %48, i64 %55
  store i8 1, ptr %56, align 1, !tbaa !5
  %57 = load i32, ptr @x, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %58, i64 %49
  store i8 1, ptr %59, align 1, !tbaa !5
  %60 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %48
  store i8 1, ptr %60, align 1, !tbaa !5
  %61 = getelementptr inbounds [101 x i8], ptr @temp, i64 0, i64 %49
  store i8 1, ptr %61, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %62 = sub nsw i32 %47, %storemerge4861
  store i32 %62, ptr %5, align 4, !tbaa !9
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %64 = load i32, ptr %63, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  %65 = load i32, ptr @x, align 4, !tbaa !9
  %66 = load i32, ptr %3, align 4, !tbaa !9
  %67 = sub nsw i32 %65, %66
  store i32 %67, ptr %6, align 4, !tbaa !9
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %69 = load i32, ptr %68, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  %70 = load i32, ptr %3, align 4, !tbaa !9
  %71 = add nsw i32 %70, %69
  %72 = sext i32 %71 to i64
  %73 = load i32, ptr %4, align 4, !tbaa !9
  %74 = sub nsw i32 %73, %69
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %72, i64 %75
  store i8 1, ptr %76, align 1, !tbaa !5
  %77 = sub nsw i32 %70, %64
  %78 = sext i32 %77 to i64
  %79 = add nsw i32 %73, %64
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [101 x [101 x i8]], ptr @temp, i64 0, i64 %78, i64 %80
  store i8 1, ptr %81, align 1, !tbaa !5
  %.pre84 = load i32, ptr @y, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %.lr.ph, %53
  %83 = phi i32 [ %45, %.lr.ph ], [ %.pre84, %53 ]
  %84 = phi i32 [ %storemerge4861, %.lr.ph ], [ %73, %53 ]
  %85 = phi i32 [ %46, %.lr.ph ], [ %70, %53 ]
  %86 = add nsw i32 %84, 1
  store i32 %86, ptr %4, align 4, !tbaa !9
  %.not49.not = icmp slt i32 %84, %83
  br i1 %.not49.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !17

.preheader:                                       ; preds = %.preheader.preheader, %90
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %90 ], [ 0, %.preheader.preheader ]
  br label %91

87:                                               ; preds = %90
  %88 = load i32, ptr @ans, align 4, !tbaa !9
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef %88)
          to label %104 unwind label %20

90:                                               ; preds = %103
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next81, 101
  br i1 %exitcond83.not, label %87, label %.preheader, !llvm.loop !18

91:                                               ; preds = %.preheader, %103
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %103 ]
  %92 = getelementptr inbounds [101 x [101 x i8]], ptr @best, i64 0, i64 %indvars.iv80, i64 %indvars.iv
  %93 = load i8, ptr %92, align 1, !tbaa !5, !range !15, !noundef !16
  %94 = trunc nuw i8 %93 to i1
  br i1 %94, label %95, label %103

95:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  %96 = add nuw nsw i64 %indvars.iv, %indvars.iv80
  %97 = load i32, ptr @m, align 4, !tbaa !9
  %98 = trunc nuw nsw i64 %96 to i32
  %99 = sub i32 %98, %97
  %100 = call i32 @llvm.abs.i32(i32 %99, i1 true)
  store i32 %100, ptr %7, align 4, !tbaa !9
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %102 = load i32, ptr %101, align 4, !tbaa !9
  store i32 %102, ptr @ans, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  br label %103

103:                                              ; preds = %91, %95
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next, 101
  br i1 %exitcond79.not, label %90, label %91, !llvm.loop !19

104:                                              ; preds = %87
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #9
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #9
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #9
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #9
  ret i32 0

105:                                              ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #9
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #9
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), 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) #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

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 nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #6 align 2

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

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

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass