; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/Morgan Stanley/Morgan Stanley 2016/Problem E (E)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@ma = external dso_local global [501 x [501 x i32]], align 16
@a = external dso_local global [501 x [501 x i32]], align 16
@b = external dso_local global [501 x [501 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::set", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %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
  store i32 0, ptr %1, align 4
  %22 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %23 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %25
  %27 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %26, ptr noundef null)
  %28 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %29 = getelementptr i8, ptr %28, i64 -24
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %30
  %32 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %31, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #7
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %35

35:                                               ; preds = %100, %0
  %36 = load i32, ptr %5, align 4, !tbaa !8
  %37 = load i32, ptr %2, align 4, !tbaa !8
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  %41 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %42 unwind label %54

42:                                               ; preds = %40
  %43 = invoke { ptr, i8 } @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE6insertERKS5_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %44 unwind label %54

44:                                               ; preds = %42
  %45 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 0
  %46 = extractvalue { ptr, i8 } %43, 0
  store ptr %46, ptr %45, align 8
  %47 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 1
  %48 = extractvalue { ptr, i8 } %43, 1
  store i8 %48, ptr %47, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %49

49:                                               ; preds = %92, %44
  %50 = load i32, ptr %11, align 4, !tbaa !8
  %51 = load i32, ptr %3, align 4, !tbaa !8
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %58, label %53

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

54:                                               ; preds = %42, %40
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %8, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %9, align 4
  br label %103

58:                                               ; preds = %49
  %59 = load i32, ptr %11, align 4, !tbaa !8
  %60 = sext i32 %59 to i64
  %61 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %60)
          to label %62 unwind label %95

62:                                               ; preds = %58
  %63 = load i8, ptr %61, align 1, !tbaa !11
  %64 = sext i8 %63 to i32
  %65 = icmp eq i32 %64, 49
  %66 = zext i1 %65 to i32
  %67 = load i32, ptr %5, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [501 x [501 x i32]], ptr @ma, i64 0, i64 %68
  %70 = load i32, ptr %11, align 4, !tbaa !8
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [501 x i32], ptr %69, i64 0, i64 %71
  store i32 %66, ptr %72, align 4, !tbaa !8
  %73 = load i32, ptr %5, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [501 x [501 x i32]], ptr @ma, i64 0, i64 %74
  %76 = load i32, ptr %11, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [501 x i32], ptr %75, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !8
  %80 = load i32, ptr %11, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %81
  %83 = load i32, ptr %5, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [501 x i32], ptr %82, i64 0, i64 %84
  store i32 %79, ptr %85, align 4, !tbaa !8
  %86 = load i32, ptr %5, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %87
  %89 = load i32, ptr %11, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [501 x i32], ptr %88, i64 0, i64 %90
  store i32 %79, ptr %91, align 4, !tbaa !8
  br label %92

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

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

99:                                               ; preds = %53
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br label %100

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

103:                                              ; preds = %95, %54
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %293

104:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %105

105:                                              ; preds = %189, %104
  %106 = load i32, ptr %13, align 4, !tbaa !8
  %107 = load i32, ptr %2, align 4, !tbaa !8
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %192

110:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %111 = load i32, ptr %13, align 4, !tbaa !8
  store i32 %111, ptr %14, align 4, !tbaa !8
  br label %112

112:                                              ; preds = %136, %110
  %113 = load i32, ptr %14, align 4, !tbaa !8
  %114 = load i32, ptr %2, align 4, !tbaa !8
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 11, ptr %6, align 4
  br label %139

117:                                              ; preds = %112
  %118 = load i32, ptr %14, align 4, !tbaa !8
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %119
  %121 = load i32, ptr %13, align 4, !tbaa !8
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [501 x i32], ptr %120, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !8
  %125 = icmp eq i32 %124, 1
  br i1 %125, label %126, label %135

126:                                              ; preds = %117
  %127 = load i32, ptr %14, align 4, !tbaa !8
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %128
  %130 = load i32, ptr %13, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %131
  call void @_ZSt4swapIiLm501EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 4 dereferenceable(2004) %129, ptr noundef nonnull align 4 dereferenceable(2004) %132) #7
  %133 = load i32, ptr %12, align 4, !tbaa !8
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %12, align 4, !tbaa !8
  store i32 11, ptr %6, align 4
  br label %139

135:                                              ; preds = %117
  br label %136

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

139:                                              ; preds = %126, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %140

140:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %141 = load i32, ptr %13, align 4, !tbaa !8
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %15, align 4, !tbaa !8
  br label %143

143:                                              ; preds = %185, %140
  %144 = load i32, ptr %15, align 4, !tbaa !8
  %145 = load i32, ptr %2, align 4, !tbaa !8
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %148, label %147

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

148:                                              ; preds = %143
  %149 = load i32, ptr %15, align 4, !tbaa !8
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %150
  %152 = load i32, ptr %13, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [501 x i32], ptr %151, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !8
  %156 = icmp eq i32 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %148
  br label %185

158:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %159 = load i32, ptr %13, align 4, !tbaa !8
  store i32 %159, ptr %16, align 4, !tbaa !8
  br label %160

160:                                              ; preds = %181, %158
  %161 = load i32, ptr %16, align 4, !tbaa !8
  %162 = load i32, ptr %3, align 4, !tbaa !8
  %163 = icmp slt i32 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %184

165:                                              ; preds = %160
  %166 = load i32, ptr %13, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %167
  %169 = load i32, ptr %16, align 4, !tbaa !8
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [501 x i32], ptr %168, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !8
  %173 = load i32, ptr %15, align 4, !tbaa !8
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %174
  %176 = load i32, ptr %16, align 4, !tbaa !8
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [501 x i32], ptr %175, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !8
  %180 = sub nsw i32 %179, %172
  store i32 %180, ptr %178, align 4, !tbaa !8
  br label %181

181:                                              ; preds = %165
  %182 = load i32, ptr %16, align 4, !tbaa !8
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %16, align 4, !tbaa !8
  br label %160, !llvm.loop !16

184:                                              ; preds = %164
  br label %185

185:                                              ; preds = %184, %157
  %186 = load i32, ptr %15, align 4, !tbaa !8
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %15, align 4, !tbaa !8
  br label %143, !llvm.loop !17

188:                                              ; preds = %147
  br label %189

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

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

193:                                              ; preds = %277, %192
  %194 = load i32, ptr %18, align 4, !tbaa !8
  %195 = load i32, ptr %3, align 4, !tbaa !8
  %196 = icmp slt i32 %194, %195
  br i1 %196, label %198, label %197

197:                                              ; preds = %193
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %280

198:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %199 = load i32, ptr %18, align 4, !tbaa !8
  store i32 %199, ptr %19, align 4, !tbaa !8
  br label %200

200:                                              ; preds = %224, %198
  %201 = load i32, ptr %19, align 4, !tbaa !8
  %202 = load i32, ptr %3, align 4, !tbaa !8
  %203 = icmp slt i32 %201, %202
  br i1 %203, label %205, label %204

204:                                              ; preds = %200
  store i32 23, ptr %6, align 4
  br label %227

205:                                              ; preds = %200
  %206 = load i32, ptr %19, align 4, !tbaa !8
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %207
  %209 = load i32, ptr %18, align 4, !tbaa !8
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [501 x i32], ptr %208, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !8
  %213 = icmp eq i32 %212, 1
  br i1 %213, label %214, label %223

214:                                              ; preds = %205
  %215 = load i32, ptr %19, align 4, !tbaa !8
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %216
  %218 = load i32, ptr %18, align 4, !tbaa !8
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %219
  call void @_ZSt4swapIiLm501EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 4 dereferenceable(2004) %217, ptr noundef nonnull align 4 dereferenceable(2004) %220) #7
  %221 = load i32, ptr %17, align 4, !tbaa !8
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %17, align 4, !tbaa !8
  store i32 23, ptr %6, align 4
  br label %227

223:                                              ; preds = %205
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %19, align 4, !tbaa !8
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %19, align 4, !tbaa !8
  br label %200, !llvm.loop !19

227:                                              ; preds = %214, %204
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %228

228:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %229 = load i32, ptr %18, align 4, !tbaa !8
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %20, align 4, !tbaa !8
  br label %231

231:                                              ; preds = %273, %228
  %232 = load i32, ptr %20, align 4, !tbaa !8
  %233 = load i32, ptr %3, align 4, !tbaa !8
  %234 = icmp slt i32 %232, %233
  br i1 %234, label %236, label %235

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

236:                                              ; preds = %231
  %237 = load i32, ptr %20, align 4, !tbaa !8
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %238
  %240 = load i32, ptr %18, align 4, !tbaa !8
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [501 x i32], ptr %239, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !8
  %244 = icmp eq i32 %243, 0
  br i1 %244, label %245, label %246

245:                                              ; preds = %236
  br label %273

246:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %247 = load i32, ptr %18, align 4, !tbaa !8
  store i32 %247, ptr %21, align 4, !tbaa !8
  br label %248

248:                                              ; preds = %269, %246
  %249 = load i32, ptr %21, align 4, !tbaa !8
  %250 = load i32, ptr %2, align 4, !tbaa !8
  %251 = icmp slt i32 %249, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %248
  store i32 29, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %272

253:                                              ; preds = %248
  %254 = load i32, ptr %18, align 4, !tbaa !8
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %255
  %257 = load i32, ptr %21, align 4, !tbaa !8
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [501 x i32], ptr %256, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !8
  %261 = load i32, ptr %20, align 4, !tbaa !8
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %262
  %264 = load i32, ptr %21, align 4, !tbaa !8
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [501 x i32], ptr %263, i64 0, i64 %265
  %267 = load i32, ptr %266, align 4, !tbaa !8
  %268 = sub nsw i32 %267, %260
  store i32 %268, ptr %266, align 4, !tbaa !8
  br label %269

269:                                              ; preds = %253
  %270 = load i32, ptr %21, align 4, !tbaa !8
  %271 = add nsw i32 %270, 1
  store i32 %271, ptr %21, align 4, !tbaa !8
  br label %248, !llvm.loop !20

272:                                              ; preds = %252
  br label %273

273:                                              ; preds = %272, %245
  %274 = load i32, ptr %20, align 4, !tbaa !8
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %20, align 4, !tbaa !8
  br label %231, !llvm.loop !21

276:                                              ; preds = %235
  br label %277

277:                                              ; preds = %276
  %278 = load i32, ptr %18, align 4, !tbaa !8
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %18, align 4, !tbaa !8
  br label %193, !llvm.loop !22

280:                                              ; preds = %197
  %281 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %282 unwind label %289

282:                                              ; preds = %280
  %283 = load i32, ptr %281, align 4, !tbaa !8
  %284 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %283)
          to label %285 unwind label %289

285:                                              ; preds = %282
  %286 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %284, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %287 unwind label %289

287:                                              ; preds = %285
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %288 = load i32, ptr %1, align 4
  ret i32 %288

289:                                              ; preds = %285, %282, %280
  %290 = landingpad { ptr, i32 }
          cleanup
  %291 = extractvalue { ptr, i32 } %290, 0
  store ptr %291, ptr %8, align 8
  %292 = extractvalue { ptr, i32 } %290, 1
  store i32 %292, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %293

293:                                              ; preds = %289, %103
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %294

294:                                              ; preds = %293
  %295 = load ptr, ptr %8, align 8
  %296 = load i32, ptr %9, align 4
  %297 = insertvalue { ptr, i32 } poison, ptr %295, 0
  %298 = insertvalue { ptr, i32 } %297, i32 %296, 1
  resume { ptr, i32 } %298
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #3

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

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

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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE6insertERKS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@ma = external dso_local local_unnamed_addr global [501 x [501 x i32]], align 16
@a = external dso_local global [501 x [501 x i32]], align 16
@b = external dso_local global [501 x [501 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::set", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %15
  %17 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #8
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  %20 = load i32, ptr %1, align 4, !tbaa !8
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph84, label %._crit_edge85.thread

._crit_edge85.thread:                             ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %._crit_edge93

._crit_edge85:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 0, ptr %5, align 4, !tbaa !8
  %22 = icmp sgt i32 %28, 0
  br i1 %22, label %.preheader75, label %._crit_edge93

.lr.ph84:                                         ; preds = %0, %._crit_edge
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %._crit_edge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %24 unwind label %31

24:                                               ; preds = %.lr.ph84
  %25 = invoke { ptr, i8 } @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE6insertERKS5_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %.preheader77 unwind label %31

.preheader77:                                     ; preds = %24
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader77
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %28 = load i32, ptr %1, align 4, !tbaa !8
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next110, %29
  br i1 %30, label %.lr.ph84, label %._crit_edge85, !llvm.loop !11

31:                                               ; preds = %24, %.lr.ph84
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  br label %141

.lr.ph:                                           ; preds = %.preheader77, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader77 ]
  %33 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv)
  %34 = load i8, ptr %33, align 1, !tbaa !13
  %35 = icmp eq i8 %34, 49
  %36 = zext i1 %35 to i32
  %37 = getelementptr inbounds [501 x [501 x i32]], ptr @ma, i64 0, i64 %indvars.iv109, i64 %indvars.iv
  store i32 %36, ptr %37, align 4, !tbaa !8
  %38 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv, i64 %indvars.iv109
  store i32 %36, ptr %38, align 4, !tbaa !8
  %39 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv109, i64 %indvars.iv
  store i32 %36, ptr %39, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next, %41
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.loopexit74:                                      ; preds = %..loopexit73_crit_edge.us, %.lr.ph91, %.loopexit76
  %43 = sext i32 %62 to i64
  %44 = icmp slt i64 %indvars.iv.next113, %43
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  br i1 %44, label %.preheader75, label %._crit_edge93, !llvm.loop !15

.preheader75:                                     ; preds = %._crit_edge85, %.loopexit74
  %45 = phi i32 [ %62, %.loopexit74 ], [ %28, %._crit_edge85 ]
  %46 = phi i32 [ %63, %.loopexit74 ], [ 0, %._crit_edge85 ]
  %indvars.iv120 = phi i64 [ %indvars.iv.next121, %.loopexit74 ], [ 1, %._crit_edge85 ]
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %.loopexit74 ], [ 0, %._crit_edge85 ]
  %47 = mul nuw nsw i64 %indvars.iv112, 2008
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 2004), i64 %47
  %48 = xor i64 %indvars.iv112, -1
  %scevgep153 = getelementptr i8, ptr @a, i64 %47
  %49 = or disjoint i64 %47, 4
  %scevgep154 = getelementptr i8, ptr @a, i64 %49
  %sext = sext i32 %45 to i64
  br label %54

._crit_edge93:                                    ; preds = %.loopexit74, %._crit_edge85.thread, %._crit_edge85
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 0, ptr %6, align 4, !tbaa !8
  %50 = load i32, ptr %2, align 4, !tbaa !8
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.preheader70, label %._crit_edge102

52:                                               ; preds = %54
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %53 = icmp slt i64 %indvars.iv.next115, %sext
  br i1 %53, label %54, label %.loopexit76, !llvm.loop !16

54:                                               ; preds = %.preheader75, %52
  %indvars.iv114 = phi i64 [ %indvars.iv112, %.preheader75 ], [ %indvars.iv.next115, %52 ]
  %55 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv114, i64 %indvars.iv112
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %52

58:                                               ; preds = %54
  %59 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv114
  %60 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv112
  call void @_ZSt4swapIiLm501EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 4 dereferenceable(2004) %59, ptr noundef nonnull align 4 dereferenceable(2004) %60) #8
  %61 = add nsw i32 %46, 1
  store i32 %61, ptr %5, align 4, !tbaa !8
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  %.pre144 = sext i32 %.pre to i64
  br label %.loopexit76

.loopexit76:                                      ; preds = %52, %58
  %.pre-phi = phi i64 [ %.pre144, %58 ], [ %sext, %52 ]
  %62 = phi i32 [ %.pre, %58 ], [ %45, %52 ]
  %63 = phi i32 [ %61, %58 ], [ %46, %52 ]
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %64 = icmp slt i64 %indvars.iv.next113, %.pre-phi
  br i1 %64, label %.lr.ph91, label %.loopexit74

.lr.ph91:                                         ; preds = %.loopexit76
  %65 = load i32, ptr %2, align 4
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv112, %66
  %.fr = freeze i1 %67
  br i1 %.fr, label %.lr.ph91.split.us.preheader, label %.loopexit74

.lr.ph91.split.us.preheader:                      ; preds = %.lr.ph91
  %wide.trip.count = zext i32 %62 to i64
  %reass.sub = sub nsw i64 %wide.trip.count, %indvars.iv112
  %68 = mul i64 %reass.sub, 2004
  %smax = call i64 @llvm.smax.i64(i64 %indvars.iv120, i64 %66)
  %69 = add nsw i64 %smax, %48
  %70 = shl nsw i64 %69, 2
  %gep196 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 -2000), i64 %47
  %71 = getelementptr i8, ptr %gep196, i64 %68
  %scevgep152 = getelementptr i8, ptr %71, i64 %70
  %scevgep155 = getelementptr i8, ptr %scevgep154, i64 %70
  %smax156 = call i64 @llvm.smax.i64(i64 %indvars.iv120, i64 %66)
  %72 = sub nsw i64 %smax156, %indvars.iv112
  %min.iters.check = icmp ult i64 %72, 8
  %bound0 = icmp ult ptr %gep, %scevgep155
  %bound1 = icmp ult ptr %scevgep153, %scevgep152
  %found.conflict = and i1 %bound0, %bound1
  %n.vec = and i64 %72, -8
  %ind.end = add i64 %indvars.iv112, %n.vec
  %cmp.n = icmp eq i64 %72, %n.vec
  br label %.lr.ph91.split.us

.lr.ph91.split.us:                                ; preds = %.lr.ph91.split.us.preheader, %..loopexit73_crit_edge.us
  %indvars.iv122 = phi i64 [ %indvars.iv120, %.lr.ph91.split.us.preheader ], [ %indvars.iv.next123, %..loopexit73_crit_edge.us ]
  %73 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv122, i64 %indvars.iv112
  %74 = load i32, ptr %73, align 4, !tbaa !8
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %..loopexit73_crit_edge.us, label %.preheader72.us.preheader

.preheader72.us.preheader:                        ; preds = %.lr.ph91.split.us
  %brmerge = select i1 %min.iters.check, i1 true, i1 %found.conflict
  br i1 %brmerge, label %.preheader72.us.preheader192, label %vector.body

vector.body:                                      ; preds = %.preheader72.us.preheader, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader72.us.preheader ]
  %offset.idx = add i64 %indvars.iv112, %index
  %76 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv112, i64 %offset.idx
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %wide.load = load <4 x i32>, ptr %76, align 4, !tbaa !8, !alias.scope !17
  %wide.load157 = load <4 x i32>, ptr %77, align 4, !tbaa !8, !alias.scope !17
  %78 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv122, i64 %offset.idx
  %79 = getelementptr inbounds i8, ptr %78, i64 16
  %wide.load158 = load <4 x i32>, ptr %78, align 4, !tbaa !8, !alias.scope !20, !noalias !17
  %wide.load159 = load <4 x i32>, ptr %79, align 4, !tbaa !8, !alias.scope !20, !noalias !17
  %80 = sub nsw <4 x i32> %wide.load158, %wide.load
  %81 = sub nsw <4 x i32> %wide.load159, %wide.load157
  store <4 x i32> %80, ptr %78, align 4, !tbaa !8, !alias.scope !20, !noalias !17
  store <4 x i32> %81, ptr %79, align 4, !tbaa !8, !alias.scope !20, !noalias !17
  %index.next = add nuw i64 %index, 8
  %82 = icmp eq i64 %index.next, %n.vec
  br i1 %82, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %..loopexit73_crit_edge.us, label %.preheader72.us.preheader192

.preheader72.us.preheader192:                     ; preds = %.preheader72.us.preheader, %middle.block
  %indvars.iv117.ph = phi i64 [ %indvars.iv112, %.preheader72.us.preheader ], [ %ind.end, %middle.block ]
  br label %.preheader72.us

.preheader72.us:                                  ; preds = %.preheader72.us.preheader192, %.preheader72.us
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %.preheader72.us ], [ %indvars.iv117.ph, %.preheader72.us.preheader192 ]
  %83 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv112, i64 %indvars.iv117
  %84 = load i32, ptr %83, align 4, !tbaa !8
  %85 = getelementptr inbounds [501 x [501 x i32]], ptr @a, i64 0, i64 %indvars.iv122, i64 %indvars.iv117
  %86 = load i32, ptr %85, align 4, !tbaa !8
  %87 = sub nsw i32 %86, %84
  store i32 %87, ptr %85, align 4, !tbaa !8
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %88 = icmp slt i64 %indvars.iv.next118, %66
  br i1 %88, label %.preheader72.us, label %..loopexit73_crit_edge.us, !llvm.loop !25

..loopexit73_crit_edge.us:                        ; preds = %.preheader72.us, %middle.block, %.lr.ph91.split.us
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit74, label %.lr.ph91.split.us, !llvm.loop !26

.loopexit69:                                      ; preds = %..loopexit_crit_edge.us, %.lr.ph99, %.loopexit71
  %89 = sext i32 %109 to i64
  %90 = icmp slt i64 %indvars.iv.next127, %89
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  br i1 %90, label %.preheader70, label %._crit_edge102, !llvm.loop !27

.preheader70:                                     ; preds = %._crit_edge93, %.loopexit69
  %91 = phi i32 [ %109, %.loopexit69 ], [ %50, %._crit_edge93 ]
  %92 = phi i32 [ %110, %.loopexit69 ], [ 0, %._crit_edge93 ]
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %.loopexit69 ], [ 1, %._crit_edge93 ]
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %.loopexit69 ], [ 0, %._crit_edge93 ]
  %93 = mul nuw nsw i64 %indvars.iv126, 2008
  %gep197 = getelementptr i8, ptr getelementptr (i8, ptr @b, i64 2004), i64 %93
  %94 = xor i64 %indvars.iv126, -1
  %scevgep165 = getelementptr i8, ptr @b, i64 %93
  %95 = or disjoint i64 %93, 4
  %scevgep166 = getelementptr i8, ptr @b, i64 %95
  %sext130 = sext i32 %91 to i64
  br label %101

._crit_edge102:                                   ; preds = %.loopexit69, %._crit_edge93
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %97)
          to label %136 unwind label %139

99:                                               ; preds = %101
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %100 = icmp slt i64 %indvars.iv.next129, %sext130
  br i1 %100, label %101, label %.loopexit71, !llvm.loop !28

101:                                              ; preds = %.preheader70, %99
  %indvars.iv128 = phi i64 [ %indvars.iv126, %.preheader70 ], [ %indvars.iv.next129, %99 ]
  %102 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv128, i64 %indvars.iv126
  %103 = load i32, ptr %102, align 4, !tbaa !8
  %104 = icmp eq i32 %103, 1
  br i1 %104, label %105, label %99

105:                                              ; preds = %101
  %106 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv128
  %107 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv126
  call void @_ZSt4swapIiLm501EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 4 dereferenceable(2004) %106, ptr noundef nonnull align 4 dereferenceable(2004) %107) #8
  %108 = add nsw i32 %92, 1
  store i32 %108, ptr %6, align 4, !tbaa !8
  %.pre143 = load i32, ptr %2, align 4, !tbaa !8
  %.pre145 = sext i32 %.pre143 to i64
  br label %.loopexit71

.loopexit71:                                      ; preds = %99, %105
  %.pre-phi146 = phi i64 [ %.pre145, %105 ], [ %sext130, %99 ]
  %109 = phi i32 [ %.pre143, %105 ], [ %91, %99 ]
  %110 = phi i32 [ %108, %105 ], [ %92, %99 ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %111 = icmp slt i64 %indvars.iv.next127, %.pre-phi146
  br i1 %111, label %.lr.ph99, label %.loopexit69

.lr.ph99:                                         ; preds = %.loopexit71
  %112 = load i32, ptr %1, align 4
  %113 = sext i32 %112 to i64
  %114 = icmp slt i64 %indvars.iv126, %113
  %.fr100 = freeze i1 %114
  br i1 %.fr100, label %.lr.ph99.split.us.preheader, label %.loopexit69

.lr.ph99.split.us.preheader:                      ; preds = %.lr.ph99
  %wide.trip.count140 = zext i32 %109 to i64
  %reass.sub189 = sub nsw i64 %wide.trip.count140, %indvars.iv126
  %115 = mul i64 %reass.sub189, 2004
  %smax163 = call i64 @llvm.smax.i64(i64 %indvars.iv135, i64 %113)
  %116 = add nsw i64 %smax163, %94
  %117 = shl nsw i64 %116, 2
  %gep198 = getelementptr i8, ptr getelementptr (i8, ptr @b, i64 -2000), i64 %93
  %118 = getelementptr i8, ptr %gep198, i64 %115
  %scevgep164 = getelementptr i8, ptr %118, i64 %117
  %scevgep167 = getelementptr i8, ptr %scevgep166, i64 %117
  %smax171 = call i64 @llvm.smax.i64(i64 %indvars.iv135, i64 %113)
  %119 = sub nsw i64 %smax171, %indvars.iv126
  %min.iters.check174 = icmp ult i64 %119, 8
  %bound0168 = icmp ult ptr %gep197, %scevgep167
  %bound1169 = icmp ult ptr %scevgep165, %scevgep164
  %found.conflict170 = and i1 %bound0168, %bound1169
  %n.vec177 = and i64 %119, -8
  %ind.end178 = add i64 %indvars.iv126, %n.vec177
  %cmp.n188 = icmp eq i64 %119, %n.vec177
  br label %.lr.ph99.split.us

.lr.ph99.split.us:                                ; preds = %.lr.ph99.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv137 = phi i64 [ %indvars.iv135, %.lr.ph99.split.us.preheader ], [ %indvars.iv.next138, %..loopexit_crit_edge.us ]
  %120 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv137, i64 %indvars.iv126
  %121 = load i32, ptr %120, align 4, !tbaa !8
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %..loopexit_crit_edge.us, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.lr.ph99.split.us
  %brmerge199 = select i1 %min.iters.check174, i1 true, i1 %found.conflict170
  br i1 %brmerge199, label %.preheader.us.preheader190, label %vector.body180

vector.body180:                                   ; preds = %.preheader.us.preheader, %vector.body180
  %index181 = phi i64 [ %index.next187, %vector.body180 ], [ 0, %.preheader.us.preheader ]
  %offset.idx182 = add i64 %indvars.iv126, %index181
  %123 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv126, i64 %offset.idx182
  %124 = getelementptr inbounds i8, ptr %123, i64 16
  %wide.load183 = load <4 x i32>, ptr %123, align 4, !tbaa !8, !alias.scope !29
  %wide.load184 = load <4 x i32>, ptr %124, align 4, !tbaa !8, !alias.scope !29
  %125 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv137, i64 %offset.idx182
  %126 = getelementptr inbounds i8, ptr %125, i64 16
  %wide.load185 = load <4 x i32>, ptr %125, align 4, !tbaa !8, !alias.scope !32, !noalias !29
  %wide.load186 = load <4 x i32>, ptr %126, align 4, !tbaa !8, !alias.scope !32, !noalias !29
  %127 = sub nsw <4 x i32> %wide.load185, %wide.load183
  %128 = sub nsw <4 x i32> %wide.load186, %wide.load184
  store <4 x i32> %127, ptr %125, align 4, !tbaa !8, !alias.scope !32, !noalias !29
  store <4 x i32> %128, ptr %126, align 4, !tbaa !8, !alias.scope !32, !noalias !29
  %index.next187 = add nuw i64 %index181, 8
  %129 = icmp eq i64 %index.next187, %n.vec177
  br i1 %129, label %middle.block172, label %vector.body180, !llvm.loop !34

middle.block172:                                  ; preds = %vector.body180
  br i1 %cmp.n188, label %..loopexit_crit_edge.us, label %.preheader.us.preheader190

.preheader.us.preheader190:                       ; preds = %.preheader.us.preheader, %middle.block172
  %indvars.iv132.ph = phi i64 [ %indvars.iv126, %.preheader.us.preheader ], [ %ind.end178, %middle.block172 ]
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader190, %.preheader.us
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %.preheader.us ], [ %indvars.iv132.ph, %.preheader.us.preheader190 ]
  %130 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv126, i64 %indvars.iv132
  %131 = load i32, ptr %130, align 4, !tbaa !8
  %132 = getelementptr inbounds [501 x [501 x i32]], ptr @b, i64 0, i64 %indvars.iv137, i64 %indvars.iv132
  %133 = load i32, ptr %132, align 4, !tbaa !8
  %134 = sub nsw i32 %133, %131
  store i32 %134, ptr %132, align 4, !tbaa !8
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %135 = icmp slt i64 %indvars.iv.next133, %113
  br i1 %135, label %.preheader.us, label %..loopexit_crit_edge.us, !llvm.loop !35

..loopexit_crit_edge.us:                          ; preds = %.preheader.us, %middle.block172, %.lr.ph99.split.us
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %exitcond141.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count140
  br i1 %exitcond141.not, label %.loopexit69, label %.lr.ph99.split.us, !llvm.loop !36

136:                                              ; preds = %._crit_edge102
  %137 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %138 unwind label %139

138:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

139:                                              ; preds = %136, %._crit_edge102
  %140 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %141

141:                                              ; preds = %139, %31
  %.pn = phi { ptr, i32 } [ %32, %31 ], [ %140, %139 ]
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #3

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

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

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 nounwind uwtable
declare dso_local void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE6insertERKS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18}
!18 = distinct !{!18, !19}
!19 = distinct !{!19, !"LVerDomain"}
!20 = !{!21}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !12, !23, !24}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !12, !23}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = !{!30}
!30 = distinct !{!30, !31}
!31 = distinct !{!31, !"LVerDomain"}
!32 = !{!33}
!33 = distinct !{!33, !31}
!34 = distinct !{!34, !12, !23, !24}
!35 = distinct !{!35, !12, !23}
!36 = distinct !{!36, !12}


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