; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2015-16/Open 2016/Bronze (16 Open B2)

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

@grids = external dso_local global [10 x [10 x [10 x i8]]], align 16
@des = external dso_local global [10 x [10 x i8]], align 16
@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 520, ptr %2) #6
  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) #6
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %3, ptr noundef @.str.1, i32 noundef 16)
          to label %18 unwind label %28

18:                                               ; preds = %0
  %19 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) @N)
          to label %20 unwind label %32

20:                                               ; preds = %18
  %21 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) @K)
          to label %22 unwind label %32

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

23:                                               ; preds = %59, %22
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = load i32, ptr @N, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %36, label %27

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

28:                                               ; preds = %0
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %4, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %5, align 4
  br label %206

32:                                               ; preds = %20, %18
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %4, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %5, align 4
  br label %205

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

37:                                               ; preds = %51, %36
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = load i32, ptr @N, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [10 x [10 x i8]], ptr @des, i64 0, i64 %44
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [10 x i8], ptr %45, i64 0, i64 %47
  %49 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 1 dereferenceable(1) %48)
          to label %50 unwind label %54

50:                                               ; preds = %42
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %8, align 4, !tbaa !5
  br label %37, !llvm.loop !9

54:                                               ; preds = %42
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %4, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %205

58:                                               ; preds = %41
  br label %59

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

62:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %63

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

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

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

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

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

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

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

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

80:                                               ; preds = %75
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [10 x [10 x [10 x i8]]], ptr @grids, i64 0, i64 %82
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [10 x [10 x i8]], ptr %83, i64 0, i64 %85
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [10 x i8], ptr %86, i64 0, i64 %88
  %90 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 1 dereferenceable(1) %89)
          to label %91 unwind label %95

91:                                               ; preds = %80
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %11, align 4, !tbaa !5
  br label %75, !llvm.loop !12

95:                                               ; preds = %80
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %4, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %205

99:                                               ; preds = %79
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %10, align 4, !tbaa !5
  br label %69, !llvm.loop !13

103:                                              ; preds = %73
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %9, align 4, !tbaa !5
  br label %63, !llvm.loop !14

107:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 -7, ptr %12, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %195, %107
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = icmp slt i32 %109, 8
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  store i32 17, ptr %7, align 4
  br label %198

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 -7, ptr %13, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %189, %112
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = icmp slt i32 %114, 8
  br i1 %115, label %117, label %116

116:                                              ; preds = %113
  store i32 20, ptr %7, align 4
  br label %192

117:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 -7, ptr %14, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %183, %117
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = icmp slt i32 %119, 8
  br i1 %120, label %122, label %121

121:                                              ; preds = %118
  store i32 23, ptr %7, align 4
  br label %186

122:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 -7, ptr %15, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %177, %122
  %124 = load i32, ptr %15, align 4, !tbaa !5
  %125 = icmp slt i32 %124, 8
  br i1 %125, label %127, label %126

126:                                              ; preds = %123
  store i32 26, ptr %7, align 4
  br label %180

127:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %171, %127
  %129 = load i32, ptr %16, align 4, !tbaa !5
  %130 = load i32, ptr @K, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 29, ptr %7, align 4
  br label %174

133:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %134 = load i32, ptr %16, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %17, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %165, %133
  %137 = load i32, ptr %17, align 4, !tbaa !5
  %138 = load i32, ptr @K, align 4, !tbaa !5
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  store i32 32, ptr %7, align 4
  br label %168

141:                                              ; preds = %136
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = load i32, ptr %15, align 4, !tbaa !5
  %146 = load i32, ptr %16, align 4, !tbaa !5
  %147 = load i32, ptr %17, align 4, !tbaa !5
  %148 = call noundef zeroext i1 @_Z4testiiiiii(i32 noundef %142, i32 noundef %143, i32 noundef %144, i32 noundef %145, i32 noundef %146, i32 noundef %147)
  br i1 %148, label %149, label %164

149:                                              ; preds = %141
  %150 = load i32, ptr %16, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %151)
          to label %153 unwind label %160

153:                                              ; preds = %149
  %154 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @.str.2)
          to label %155 unwind label %160

155:                                              ; preds = %153
  %156 = load i32, ptr %17, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  %158 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %154, i32 noundef %157)
          to label %159 unwind label %160

159:                                              ; preds = %155
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %168

160:                                              ; preds = %155, %153, %149
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %4, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %205

164:                                              ; preds = %141
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %17, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %17, align 4, !tbaa !5
  br label %136, !llvm.loop !15

168:                                              ; preds = %159, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  %169 = load i32, ptr %7, align 4
  switch i32 %169, label %174 [
    i32 32, label %170
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %16, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %16, align 4, !tbaa !5
  br label %128, !llvm.loop !16

174:                                              ; preds = %168, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %175 = load i32, ptr %7, align 4
  switch i32 %175, label %180 [
    i32 29, label %176
  ]

176:                                              ; preds = %174
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %15, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %15, align 4, !tbaa !5
  br label %123, !llvm.loop !17

180:                                              ; preds = %174, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %181 = load i32, ptr %7, align 4
  switch i32 %181, label %186 [
    i32 26, label %182
  ]

182:                                              ; preds = %180
  br label %183

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

186:                                              ; preds = %180, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %187 = load i32, ptr %7, align 4
  switch i32 %187, label %192 [
    i32 23, label %188
  ]

188:                                              ; preds = %186
  br label %189

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

192:                                              ; preds = %186, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %193 = load i32, ptr %7, align 4
  switch i32 %193, label %198 [
    i32 20, label %194
  ]

194:                                              ; preds = %192
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %12, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %12, align 4, !tbaa !5
  br label %108, !llvm.loop !20

198:                                              ; preds = %192, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %199 = load i32, ptr %7, align 4
  switch i32 %199, label %201 [
    i32 17, label %200
  ]

200:                                              ; preds = %198
  store i32 0, ptr %7, align 4
  br label %201

201:                                              ; preds = %200, %198
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #6
  %202 = load i32, ptr %7, align 4
  switch i32 %202, label %212 [
    i32 0, label %203
    i32 1, label %203
  ]

203:                                              ; preds = %201, %201
  %204 = load i32, ptr %1, align 4
  ret i32 %204

205:                                              ; preds = %160, %95, %54, %32
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #6
  br label %206

206:                                              ; preds = %205, %28
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #6
  br label %207

207:                                              ; preds = %206
  %208 = load ptr, ptr %4, align 8
  %209 = load i32, ptr %5, align 4
  %210 = insertvalue { ptr, i32 } poison, ptr %208, 0
  %211 = insertvalue { ptr, i32 } %210, i32 %209, 1
  resume { ptr, i32 } %211

212:                                              ; preds = %201
  unreachable
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #3 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 #3 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)) #4

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #4

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

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

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

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

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

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

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


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

%"class.std::basic_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 }

@grids = external dso_local global [10 x [10 x [10 x i8]]], align 16
@des = external dso_local global [10 x [10 x i8]], align 16
@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::basic_ifstream", align 8
  %2 = alloca %"class.std::basic_ofstream", align 8
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %1) #6
  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) #6
  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 %3 unwind label %15

3:                                                ; preds = %0
  %4 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @N)
          to label %5 unwind label %17

5:                                                ; preds = %3
  %6 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) @K)
          to label %.preheader88 unwind label %17

.preheader88:                                     ; preds = %5
  %7 = load i32, ptr @N, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader87, label %.preheader86

.preheader87:                                     ; preds = %.preheader88, %._crit_edge
  %9 = phi i32 [ %19, %._crit_edge ], [ %7, %.preheader88 ]
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %._crit_edge ], [ 0, %.preheader88 ]
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.preheader87.._crit_edge_crit_edge

.preheader87.._crit_edge_crit_edge:               ; preds = %.preheader87
  %.pre137 = sext i32 %9 to i64
  br label %._crit_edge

.preheader86:                                     ; preds = %._crit_edge, %.preheader88
  %11 = phi i32 [ %7, %.preheader88 ], [ %19, %._crit_edge ]
  %12 = load i32, ptr @K, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.preheader85.lr.ph, label %.split.us

.preheader85.lr.ph:                               ; preds = %.preheader86
  %14 = icmp sgt i32 %11, 0
  br i1 %14, label %.preheader85, label %.preheader82.preheader

15:                                               ; preds = %0
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %108

17:                                               ; preds = %5, %3
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %107

._crit_edge:                                      ; preds = %23, %.preheader87.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre137, %.preheader87.._crit_edge_crit_edge ], [ %25, %23 ]
  %19 = phi i32 [ %9, %.preheader87.._crit_edge_crit_edge ], [ %24, %23 ]
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %20 = icmp slt i64 %indvars.iv.next123, %.pre-phi
  br i1 %20, label %.preheader87, label %.preheader86, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader87, %23
  %indvars.iv = phi i64 [ %indvars.iv.next, %23 ], [ 0, %.preheader87 ]
  %21 = getelementptr inbounds [10 x [10 x i8]], ptr @des, i64 0, i64 %indvars.iv122, i64 %indvars.iv
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %23 unwind label %27

23:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr @N, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv.next, %25
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !12

27:                                               ; preds = %.lr.ph
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %107

.preheader85:                                     ; preds = %.preheader85.lr.ph, %._crit_edge96
  %29 = phi i32 [ %39, %._crit_edge96 ], [ %12, %.preheader85.lr.ph ]
  %30 = phi i32 [ %40, %._crit_edge96 ], [ %11, %.preheader85.lr.ph ]
  %31 = phi i32 [ %41, %._crit_edge96 ], [ %11, %.preheader85.lr.ph ]
  %32 = phi i32 [ %42, %._crit_edge96 ], [ %11, %.preheader85.lr.ph ]
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %._crit_edge96 ], [ 0, %.preheader85.lr.ph ]
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.preheader84.lr.ph, label %._crit_edge96

.preheader84.lr.ph:                               ; preds = %.preheader85
  %34 = icmp sgt i32 %31, 0
  br i1 %34, label %.preheader84, label %._crit_edge96

.preheader83:                                     ; preds = %._crit_edge96
  %35 = icmp sgt i32 %39, 0
  br i1 %35, label %.preheader82.preheader, label %.split.us

.preheader82.preheader:                           ; preds = %.preheader85.lr.ph, %.preheader83
  %.ph184 = phi i32 [ %12, %.preheader85.lr.ph ], [ %39, %.preheader83 ]
  br label %.preheader82

.preheader84:                                     ; preds = %.preheader84.lr.ph, %._crit_edge94
  %36 = phi i32 [ %45, %._crit_edge94 ], [ %30, %.preheader84.lr.ph ]
  %37 = phi i32 [ %45, %._crit_edge94 ], [ %31, %.preheader84.lr.ph ]
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %._crit_edge94 ], [ 0, %.preheader84.lr.ph ]
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph93, label %.preheader84.._crit_edge94_crit_edge

.preheader84.._crit_edge94_crit_edge:             ; preds = %.preheader84
  %.pre138 = sext i32 %36 to i64
  br label %._crit_edge94

._crit_edge96.loopexit:                           ; preds = %._crit_edge94
  %.pre = load i32, ptr @K, align 4, !tbaa !5
  br label %._crit_edge96

._crit_edge96:                                    ; preds = %.preheader84.lr.ph, %._crit_edge96.loopexit, %.preheader85
  %39 = phi i32 [ %.pre, %._crit_edge96.loopexit ], [ %29, %.preheader85 ], [ %29, %.preheader84.lr.ph ]
  %40 = phi i32 [ %45, %._crit_edge96.loopexit ], [ %30, %.preheader85 ], [ %30, %.preheader84.lr.ph ]
  %41 = phi i32 [ %45, %._crit_edge96.loopexit ], [ %31, %.preheader85 ], [ %31, %.preheader84.lr.ph ]
  %42 = phi i32 [ %45, %._crit_edge96.loopexit ], [ %32, %.preheader85 ], [ %31, %.preheader84.lr.ph ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %43 = sext i32 %39 to i64
  %44 = icmp slt i64 %indvars.iv.next132, %43
  br i1 %44, label %.preheader85, label %.preheader83, !llvm.loop !13

._crit_edge94:                                    ; preds = %49, %.preheader84.._crit_edge94_crit_edge
  %.pre-phi139 = phi i64 [ %.pre138, %.preheader84.._crit_edge94_crit_edge ], [ %51, %49 ]
  %45 = phi i32 [ %36, %.preheader84.._crit_edge94_crit_edge ], [ %50, %49 ]
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %46 = icmp slt i64 %indvars.iv.next129, %.pre-phi139
  br i1 %46, label %.preheader84, label %._crit_edge96.loopexit, !llvm.loop !14

.lr.ph93:                                         ; preds = %.preheader84, %49
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %49 ], [ 0, %.preheader84 ]
  %47 = getelementptr inbounds [10 x [10 x [10 x i8]]], ptr @grids, i64 0, i64 %indvars.iv131, i64 %indvars.iv128, i64 %indvars.iv125
  %48 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 1 dereferenceable(1) %47)
          to label %49 unwind label %53

49:                                               ; preds = %.lr.ph93
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv.next126, %51
  br i1 %52, label %.lr.ph93, label %._crit_edge94, !llvm.loop !15

53:                                               ; preds = %.lr.ph93
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %107

.preheader82:                                     ; preds = %.preheader82.preheader, %.critedge80
  %55 = phi i32 [ %101, %.critedge80 ], [ %.ph184, %.preheader82.preheader ]
  %56 = phi i32 [ %102, %.critedge80 ], [ %.ph184, %.preheader82.preheader ]
  %57 = phi i32 [ %103, %.critedge80 ], [ %.ph184, %.preheader82.preheader ]
  %58 = phi i32 [ %104, %.critedge80 ], [ %.ph184, %.preheader82.preheader ]
  %59 = phi i32 [ %105, %.critedge80 ], [ %.ph184, %.preheader82.preheader ]
  %.053110 = phi i32 [ %106, %.critedge80 ], [ -7, %.preheader82.preheader ]
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.preheader81, label %.critedge80

.preheader81:                                     ; preds = %.preheader82, %.critedge78
  %61 = phi i32 [ %96, %.critedge78 ], [ %55, %.preheader82 ]
  %62 = phi i32 [ %97, %.critedge78 ], [ %56, %.preheader82 ]
  %63 = phi i32 [ %98, %.critedge78 ], [ %57, %.preheader82 ]
  %64 = phi i32 [ %99, %.critedge78 ], [ %58, %.preheader82 ]
  %.052108 = phi i32 [ %100, %.critedge78 ], [ -7, %.preheader82 ]
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %.preheader, label %.critedge78

.preheader:                                       ; preds = %.preheader81, %.critedge76
  %66 = phi i32 [ %92, %.critedge76 ], [ %61, %.preheader81 ]
  %67 = phi i32 [ %93, %.critedge76 ], [ %62, %.preheader81 ]
  %68 = phi i32 [ %94, %.critedge76 ], [ %63, %.preheader81 ]
  %.051106 = phi i32 [ %95, %.critedge76 ], [ -7, %.preheader81 ]
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.critedge.preheader, label %.critedge76

.critedge.preheader:                              ; preds = %.preheader, %.critedge74
  %70 = phi i32 [ %89, %.critedge74 ], [ %66, %.preheader ]
  %71 = phi i32 [ %90, %.critedge74 ], [ %67, %.preheader ]
  %.050105 = phi i32 [ %91, %.critedge74 ], [ -7, %.preheader ]
  %.not70102 = icmp sgt i32 %71, 0
  br i1 %.not70102, label %.lr.ph104, label %.critedge74

.critedge.loopexit:                               ; preds = %86, %.lr.ph104
  %72 = phi i32 [ %73, %.lr.ph104 ], [ %88, %86 ]
  %.not70 = icmp slt i32 %75, %72
  br i1 %.not70, label %.lr.ph104, label %.critedge74, !llvm.loop !16

.lr.ph104:                                        ; preds = %.critedge.preheader, %.critedge.loopexit
  %73 = phi i32 [ %72, %.critedge.loopexit ], [ %70, %.critedge.preheader ]
  %74 = phi i32 [ %72, %.critedge.loopexit ], [ %71, %.critedge.preheader ]
  %.049103 = phi i32 [ %75, %.critedge.loopexit ], [ 0, %.critedge.preheader ]
  %75 = add nuw nsw i32 %.049103, 1
  %.not98 = icmp slt i32 %75, %74
  br i1 %.not98, label %.lr.ph101, label %.critedge.loopexit

.lr.ph101:                                        ; preds = %.lr.ph104, %86
  %.099 = phi i32 [ %87, %86 ], [ %75, %.lr.ph104 ]
  %76 = call noundef zeroext i1 @_Z4testiiiiii(i32 noundef %.053110, i32 noundef %.052108, i32 noundef %.051106, i32 noundef %.050105, i32 noundef %.049103, i32 noundef %.099)
  br i1 %76, label %77, label %86

77:                                               ; preds = %.lr.ph101
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef %75)
          to label %79 unwind label %84

79:                                               ; preds = %77
  %80 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %78, ptr noundef nonnull @.str.2)
          to label %81 unwind label %84

81:                                               ; preds = %79
  %82 = add nuw nsw i32 %.099, 1
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %80, i32 noundef %82)
          to label %.split.us unwind label %84

84:                                               ; preds = %81, %79, %77
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %107

86:                                               ; preds = %.lr.ph101
  %87 = add nuw nsw i32 %.099, 1
  %88 = load i32, ptr @K, align 4, !tbaa !5
  %.not = icmp slt i32 %87, %88
  br i1 %.not, label %.lr.ph101, label %.critedge.loopexit, !llvm.loop !17

.critedge74:                                      ; preds = %.critedge.loopexit, %.critedge.preheader
  %89 = phi i32 [ %70, %.critedge.preheader ], [ %72, %.critedge.loopexit ]
  %90 = phi i32 [ %71, %.critedge.preheader ], [ %72, %.critedge.loopexit ]
  %91 = add nsw i32 %.050105, 1
  %exitcond = icmp eq i32 %91, 8
  br i1 %exitcond, label %.critedge76, label %.critedge.preheader, !llvm.loop !18

.critedge76:                                      ; preds = %.critedge74, %.preheader
  %92 = phi i32 [ %66, %.preheader ], [ %89, %.critedge74 ]
  %93 = phi i32 [ %67, %.preheader ], [ %90, %.critedge74 ]
  %94 = phi i32 [ %68, %.preheader ], [ %90, %.critedge74 ]
  %95 = add nsw i32 %.051106, 1
  %exitcond134 = icmp eq i32 %95, 8
  br i1 %exitcond134, label %.critedge78, label %.preheader, !llvm.loop !19

.critedge78:                                      ; preds = %.critedge76, %.preheader81
  %96 = phi i32 [ %61, %.preheader81 ], [ %92, %.critedge76 ]
  %97 = phi i32 [ %62, %.preheader81 ], [ %93, %.critedge76 ]
  %98 = phi i32 [ %63, %.preheader81 ], [ %94, %.critedge76 ]
  %99 = phi i32 [ %64, %.preheader81 ], [ %94, %.critedge76 ]
  %100 = add nsw i32 %.052108, 1
  %exitcond135 = icmp eq i32 %100, 8
  br i1 %exitcond135, label %.critedge80, label %.preheader81, !llvm.loop !20

.critedge80:                                      ; preds = %.critedge78, %.preheader82
  %101 = phi i32 [ %55, %.preheader82 ], [ %96, %.critedge78 ]
  %102 = phi i32 [ %56, %.preheader82 ], [ %97, %.critedge78 ]
  %103 = phi i32 [ %57, %.preheader82 ], [ %98, %.critedge78 ]
  %104 = phi i32 [ %58, %.preheader82 ], [ %99, %.critedge78 ]
  %105 = phi i32 [ %59, %.preheader82 ], [ %99, %.critedge78 ]
  %106 = add nsw i32 %.053110, 1
  %exitcond136.not = icmp eq i32 %106, 8
  br i1 %exitcond136.not, label %.split.us, label %.preheader82, !llvm.loop !21

.split.us:                                        ; preds = %.critedge80, %.preheader86, %.preheader83, %81
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #6
  ret i32 0

107:                                              ; preds = %84, %53, %27, %17
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %54, %53 ], [ %85, %84 ], [ %18, %17 ]
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  br label %108

108:                                              ; preds = %107, %15
  %.pn.pn = phi { ptr, i32 } [ %.pn, %107 ], [ %16, %15 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #3 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 #3 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 #4

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

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

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

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

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

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

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

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


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