; LLVM IR from kazunetakahashi/atcoder :: 2017/1115_ARC074 (F)

; 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::__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] }
%"class.std::basic_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }

@H = external dso_local global i32, align 4
@W = external dso_local global i32, align 4
@_Z1aB5cxx11 = external dso_local global [110 x %"class.std::__cxx11::basic_string"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8add_edgeiix(i32 noundef, i32 noundef, i64 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 uwtable
declare dso_local noundef i64 @_Z8max_flowii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @H)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @W)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %26, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @H, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %29

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %23
  %25 = call 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) %24)
  br label %26

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !9

29:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 300, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 301, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %97, %29
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = load i32, ptr @H, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %100

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

36:                                               ; preds = %93, %35
  %37 = load i32, ptr %11, align 4, !tbaa !5
  %38 = load i32, ptr @W, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %96

41:                                               ; preds = %36
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %43
  %45 = load i32, ptr %11, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %44, i64 noundef %46)
  %48 = load i8, ptr %47, align 1, !tbaa !11
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 %49, 83
  br i1 %50, label %51, label %66

51:                                               ; preds = %41
  %52 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %52, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %53, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr %9, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %55
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %56, i64 noundef %58)
  store i8 111, ptr %59, align 1, !tbaa !11
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = load i32, ptr %9, align 4, !tbaa !5
  call void @_Z8add_edgeiix(i32 noundef %60, i32 noundef %61, i64 noundef 1000000007)
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = load i32, ptr @H, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  call void @_Z8add_edgeiix(i32 noundef %62, i32 noundef %65, i64 noundef 1000000007)
  br label %92

66:                                               ; preds = %41
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %68
  %70 = load i32, ptr %11, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %69, i64 noundef %71)
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = sext i8 %73 to i32
  %75 = icmp eq i32 %74, 84
  br i1 %75, label %76, label %91

76:                                               ; preds = %66
  %77 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %77, ptr %7, align 4, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %78, ptr %8, align 4, !tbaa !5
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %80
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %81, i64 noundef %83)
  store i8 111, ptr %84, align 1, !tbaa !11
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z8add_edgeiix(i32 noundef %85, i32 noundef %86, i64 noundef 1000000007)
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = load i32, ptr @H, align 4, !tbaa !5
  %89 = add nsw i32 %87, %88
  %90 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z8add_edgeiix(i32 noundef %89, i32 noundef %90, i64 noundef 1000000007)
  br label %91

91:                                               ; preds = %76, %66
  br label %92

92:                                               ; preds = %91, %51
  br label %93

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

96:                                               ; preds = %40
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !5
  br label %30, !llvm.loop !13

100:                                              ; preds = %34
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = icmp eq i32 %101, %102
  br i1 %103, label %108, label %104

104:                                              ; preds = %100
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = icmp eq i32 %105, %106
  br i1 %107, label %108, label %111

108:                                              ; preds = %104, %100
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  br label %156

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

112:                                              ; preds = %147, %111
  %113 = load i32, ptr %12, align 4, !tbaa !5
  %114 = load i32, ptr @H, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %150

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

118:                                              ; preds = %143, %117
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = load i32, ptr @W, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %146

123:                                              ; preds = %118
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %125
  %127 = load i32, ptr %13, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %126, i64 noundef %128)
  %130 = load i8, ptr %129, align 1, !tbaa !11
  %131 = sext i8 %130 to i32
  %132 = icmp eq i32 %131, 111
  br i1 %132, label %133, label %142

133:                                              ; preds = %123
  %134 = load i32, ptr %12, align 4, !tbaa !5
  %135 = load i32, ptr %13, align 4, !tbaa !5
  %136 = load i32, ptr @H, align 4, !tbaa !5
  %137 = add nsw i32 %135, %136
  call void @_Z8add_edgeiix(i32 noundef %134, i32 noundef %137, i64 noundef 1)
  %138 = load i32, ptr %13, align 4, !tbaa !5
  %139 = load i32, ptr @H, align 4, !tbaa !5
  %140 = add nsw i32 %138, %139
  %141 = load i32, ptr %12, align 4, !tbaa !5
  call void @_Z8add_edgeiix(i32 noundef %140, i32 noundef %141, i64 noundef 1)
  br label %142

142:                                              ; preds = %133, %123
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %13, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %13, align 4, !tbaa !5
  br label %118, !llvm.loop !14

146:                                              ; preds = %122
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %12, align 4, !tbaa !5
  br label %112, !llvm.loop !15

150:                                              ; preds = %116
  %151 = load i32, ptr %3, align 4, !tbaa !5
  %152 = load i32, ptr %4, align 4, !tbaa !5
  %153 = call noundef i64 @_Z8max_flowii(i32 noundef %151, i32 noundef %152)
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %153)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %10, align 4
  br label %156

156:                                              ; preds = %150, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %157 = load i32, ptr %10, align 4
  switch i32 %157, label %160 [
    i32 0, label %158
    i32 1, label %158
  ]

158:                                              ; preds = %156, %156
  %159 = load i32, ptr %1, align 4
  ret i32 %159

160:                                              ; preds = %156
  unreachable
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; 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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 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 = { 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 = { "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 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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::__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] }
%"class.std::basic_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }

@H = external dso_local global i32, align 4
@W = external dso_local global i32, align 4
@_Z1aB5cxx11 = external dso_local global [110 x %"class.std::__cxx11::basic_string"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8add_edgeiix(i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z8max_flowii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @H)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @W)
  %3 = load i32, ptr @H, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge77.thread

.preheader61:                                     ; preds = %.lr.ph
  %5 = icmp sgt i32 %10, 0
  %6 = load i32, ptr @W, align 4
  %7 = icmp sgt i32 %6, 0
  %or.cond115 = select i1 %5, i1 %7, i1 false
  br i1 %or.cond115, label %.preheader60, label %._crit_edge77.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %indvars.iv
  %9 = tail call 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) %8)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @H, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = icmp slt i64 %indvars.iv.next, %11
  br i1 %12, label %.lr.ph, label %.preheader61, !llvm.loop !9

.preheader60:                                     ; preds = %.preheader61, %._crit_edge
  %13 = phi i32 [ %23, %._crit_edge ], [ %10, %.preheader61 ]
  %14 = phi i32 [ %24, %._crit_edge ], [ %6, %.preheader61 ]
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %._crit_edge ], [ 0, %.preheader61 ]
  %.04775 = phi i32 [ %.1.lcssa, %._crit_edge ], [ undef, %.preheader61 ]
  %.04874 = phi i32 [ %.149.lcssa, %._crit_edge ], [ undef, %.preheader61 ]
  %.05173 = phi i32 [ %.152.lcssa, %._crit_edge ], [ undef, %.preheader61 ]
  %.05472 = phi i32 [ %.155.lcssa, %._crit_edge ], [ undef, %.preheader61 ]
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph68, label %._crit_edge

.lr.ph68:                                         ; preds = %.preheader60
  %16 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %indvars.iv96
  %17 = trunc nuw nsw i64 %indvars.iv96 to i32
  br label %27

._crit_edge77:                                    ; preds = %._crit_edge
  %18 = icmp eq i32 %.155.lcssa, %.149.lcssa
  %19 = icmp eq i32 %.152.lcssa, %.1.lcssa
  %or.cond = select i1 %18, i1 true, i1 %19
  br i1 %or.cond, label %._crit_edge77.thread, label %.preheader59

.preheader59:                                     ; preds = %._crit_edge77
  %20 = icmp sgt i32 %23, 0
  %21 = load i32, ptr @W, align 4
  %22 = icmp sgt i32 %21, 0
  %or.cond117 = select i1 %20, i1 %22, i1 false
  br i1 %or.cond117, label %.preheader, label %._crit_edge89

._crit_edge.loopexit:                             ; preds = %44
  %.pre = load i32, ptr @H, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader60
  %23 = phi i32 [ %13, %.preheader60 ], [ %.pre, %._crit_edge.loopexit ]
  %24 = phi i32 [ %14, %.preheader60 ], [ %45, %._crit_edge.loopexit ]
  %.155.lcssa = phi i32 [ %.05472, %.preheader60 ], [ %.256, %._crit_edge.loopexit ]
  %.152.lcssa = phi i32 [ %.05173, %.preheader60 ], [ %.253, %._crit_edge.loopexit ]
  %.149.lcssa = phi i32 [ %.04874, %.preheader60 ], [ %.250, %._crit_edge.loopexit ]
  %.1.lcssa = phi i32 [ %.04775, %.preheader60 ], [ %.2, %._crit_edge.loopexit ]
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %25 = sext i32 %23 to i64
  %26 = icmp slt i64 %indvars.iv.next97, %25
  br i1 %26, label %.preheader60, label %._crit_edge77, !llvm.loop !11

27:                                               ; preds = %.lr.ph68, %44
  %indvars.iv93 = phi i64 [ 0, %.lr.ph68 ], [ %indvars.iv.next94, %44 ]
  %.166 = phi i32 [ %.04775, %.lr.ph68 ], [ %.2, %44 ]
  %.14965 = phi i32 [ %.04874, %.lr.ph68 ], [ %.250, %44 ]
  %.15264 = phi i32 [ %.05173, %.lr.ph68 ], [ %.253, %44 ]
  %.15563 = phi i32 [ %.05472, %.lr.ph68 ], [ %.256, %44 ]
  %28 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %16, i64 noundef %indvars.iv93)
  %29 = load i8, ptr %28, align 1, !tbaa !13
  %30 = icmp eq i8 %29, 83
  %31 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %16, i64 noundef %indvars.iv93)
  br i1 %30, label %32, label %36

32:                                               ; preds = %27
  store i8 111, ptr %31, align 1, !tbaa !13
  tail call void @_Z8add_edgeiix(i32 noundef 300, i32 noundef %17, i64 noundef 1000000007)
  %33 = load i32, ptr @H, align 4, !tbaa !5
  %34 = trunc nuw nsw i64 %indvars.iv93 to i32
  %35 = add nsw i32 %33, %34
  tail call void @_Z8add_edgeiix(i32 noundef 300, i32 noundef %35, i64 noundef 1000000007)
  br label %44

36:                                               ; preds = %27
  %37 = load i8, ptr %31, align 1, !tbaa !13
  %38 = icmp eq i8 %37, 84
  br i1 %38, label %39, label %44

39:                                               ; preds = %36
  %40 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %16, i64 noundef %indvars.iv93)
  store i8 111, ptr %40, align 1, !tbaa !13
  tail call void @_Z8add_edgeiix(i32 noundef %17, i32 noundef 301, i64 noundef 1000000007)
  %41 = load i32, ptr @H, align 4, !tbaa !5
  %42 = trunc nuw nsw i64 %indvars.iv93 to i32
  %43 = add nsw i32 %41, %42
  tail call void @_Z8add_edgeiix(i32 noundef %43, i32 noundef 301, i64 noundef 1000000007)
  br label %44

44:                                               ; preds = %32, %39, %36
  %.256 = phi i32 [ %17, %32 ], [ %.15563, %39 ], [ %.15563, %36 ]
  %.253 = phi i32 [ %34, %32 ], [ %.15264, %39 ], [ %.15264, %36 ]
  %.250 = phi i32 [ %.14965, %32 ], [ %17, %39 ], [ %.14965, %36 ]
  %.2 = phi i32 [ %.166, %32 ], [ %42, %39 ], [ %.166, %36 ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %45 = load i32, ptr @W, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next94, %46
  br i1 %47, label %27, label %._crit_edge.loopexit, !llvm.loop !14

._crit_edge77.thread:                             ; preds = %0, %.preheader61, %._crit_edge77
  %48 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %74

.preheader:                                       ; preds = %.preheader59, %._crit_edge87
  %49 = phi i32 [ %56, %._crit_edge87 ], [ %23, %.preheader59 ]
  %50 = phi i32 [ %57, %._crit_edge87 ], [ %21, %.preheader59 ]
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %._crit_edge87 ], [ 0, %.preheader59 ]
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph86, label %._crit_edge87

.lr.ph86:                                         ; preds = %.preheader
  %52 = getelementptr inbounds [110 x %"class.std::__cxx11::basic_string"], ptr @_Z1aB5cxx11, i64 0, i64 %indvars.iv102
  %53 = trunc nuw nsw i64 %indvars.iv102 to i32
  br label %60

._crit_edge89:                                    ; preds = %._crit_edge87, %.preheader59
  %54 = tail call noundef i64 @_Z8max_flowii(i32 noundef 300, i32 noundef 301)
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %54)
  br label %74

._crit_edge87.loopexit:                           ; preds = %70
  %.pre105 = load i32, ptr @H, align 4, !tbaa !5
  br label %._crit_edge87

._crit_edge87:                                    ; preds = %._crit_edge87.loopexit, %.preheader
  %56 = phi i32 [ %.pre105, %._crit_edge87.loopexit ], [ %49, %.preheader ]
  %57 = phi i32 [ %71, %._crit_edge87.loopexit ], [ %50, %.preheader ]
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %58 = sext i32 %56 to i64
  %59 = icmp slt i64 %indvars.iv.next103, %58
  br i1 %59, label %.preheader, label %._crit_edge89, !llvm.loop !15

60:                                               ; preds = %.lr.ph86, %70
  %indvars.iv99 = phi i64 [ 0, %.lr.ph86 ], [ %indvars.iv.next100, %70 ]
  %61 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %52, i64 noundef %indvars.iv99)
  %62 = load i8, ptr %61, align 1, !tbaa !13
  %63 = icmp eq i8 %62, 111
  br i1 %63, label %64, label %70

64:                                               ; preds = %60
  %65 = load i32, ptr @H, align 4, !tbaa !5
  %66 = trunc nuw nsw i64 %indvars.iv99 to i32
  %67 = add nsw i32 %65, %66
  tail call void @_Z8add_edgeiix(i32 noundef %53, i32 noundef %67, i64 noundef 1)
  %68 = load i32, ptr @H, align 4, !tbaa !5
  %69 = add nsw i32 %68, %66
  tail call void @_Z8add_edgeiix(i32 noundef %69, i32 noundef %53, i64 noundef 1)
  br label %70

70:                                               ; preds = %60, %64
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %71 = load i32, ptr @W, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next100, %72
  br i1 %73, label %60, label %._crit_edge87.loopexit, !llvm.loop !16

74:                                               ; preds = %._crit_edge89, %._crit_edge77.thread
  %.sink = phi ptr [ %55, %._crit_edge89 ], [ %48, %._crit_edge77.thread ]
  %75 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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 #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 #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 #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 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 = { 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 #2 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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" }

!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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !12}
!16 = distinct !{!16, !10}


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