; LLVM IR from Izaron/ACM-ICPC :: Russian Olympiad in Informatics/Final Stage 2016 (fisher)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_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::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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.3", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.5" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.5" = type { i32 }
%"struct.std::_Head_base.6" = type { i32 }
%"class.std::set" = type { %"class.std::_Rb_tree.7" }
%"class.std::_Rb_tree.7" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i64, align 8
@pos = external dso_local global i64, align 8
@allFish = external dso_local global i64, align 8
@prodFish = external dso_local global i64, align 8
@navar = external dso_local global i64, align 8
@linksSize = external dso_local global i32, align 4
@linksVal = external dso_local global [320005 x i64], align 16
@linksMn = external dso_local global [320005 x i64], align 16
@xs = external dso_local global [320005 x i32], align 16
@as = external dso_local global [320005 x i32], align 16
@ys = external dso_local global [320005 x i32], align 16
@bs = external dso_local global [320005 x i32], align 16
@cs = external dso_local global [320005 x i32], align 16
@links = external dso_local global %"class.std::map", align 8
@tree = external dso_local global [1280020 x i64], align 16
@treeAns = external dso_local global [1280020 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z6getAnsv() #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::tuple", align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::set", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::tuple", align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %28 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %29 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %31
  %33 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %32, ptr noundef null)
  call void @llvm.memset.p0.i64(ptr align 16 @linksVal, i8 0, i64 2560040, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @linksMn, i8 0, i64 2560040, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @tree, i8 0, i64 10240160, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @treeAns, i8 0, i64 10240160, i1 false)
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @p)
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #8
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %35

35:                                               ; preds = %54, %0
  %36 = load i32, ptr %3, align 4, !tbaa !8
  %37 = load i32, ptr @n, align 4, !tbaa !8
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %66

40:                                               ; preds = %35
  %41 = load i32, ptr %3, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [320005 x i32], ptr @xs, i64 0, i64 %42
  %44 = load i32, ptr %3, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [320005 x i32], ptr @as, i64 0, i64 %45
  %47 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %43, ptr noundef %46)
          to label %48 unwind label %57

48:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #8
  %49 = load i32, ptr %3, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [320005 x i32], ptr @xs, i64 0, i64 %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 1, ptr %7, align 4, !tbaa !8
  invoke void @_ZSt10make_tupleIJRiiS0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %6, ptr noundef nonnull align 4 dereferenceable(4) %51, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %52 unwind label %61

52:                                               ; preds = %48
  invoke void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %53 unwind label %61

53:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #8
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %3, align 4, !tbaa !8
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !8
  br label %35, !llvm.loop !11

57:                                               ; preds = %40
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %4, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %5, align 4
  br label %65

61:                                               ; preds = %52, %48
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %4, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #8
  br label %65

65:                                               ; preds = %61, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %302

66:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #8
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %67

67:                                               ; preds = %101, %66
  %68 = load i32, ptr %9, align 4, !tbaa !8
  %69 = load i32, ptr @m, align 4, !tbaa !8
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %117

72:                                               ; preds = %67
  %73 = load i32, ptr %9, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [320005 x i32], ptr @ys, i64 0, i64 %74
  %76 = load i32, ptr %9, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [320005 x i32], ptr @bs, i64 0, i64 %77
  %79 = load i32, ptr %9, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %80
  %82 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %75, ptr noundef %78, ptr noundef %81)
          to label %83 unwind label %104

83:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #8
  %84 = load i32, ptr %9, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [320005 x i32], ptr @ys, i64 0, i64 %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 2, ptr %11, align 4, !tbaa !8
  invoke void @_ZSt10make_tupleIJRiiS0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %10, ptr noundef nonnull align 4 dereferenceable(4) %86, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %87 unwind label %108

87:                                               ; preds = %83
  invoke void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %88 unwind label %108

88:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %89 = load i32, ptr %9, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !8
  %93 = sub nsw i32 0, %92
  %94 = sext i32 %93 to i64
  store i64 %94, ptr %12, align 8, !tbaa !13
  %95 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertEOx(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %96 unwind label %112

96:                                               ; preds = %88
  %97 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 0
  %98 = extractvalue { ptr, i8 } %95, 0
  store ptr %98, ptr %97, align 8
  %99 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 1
  %100 = extractvalue { ptr, i8 } %95, 1
  store i8 %100, ptr %99, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %101

101:                                              ; preds = %96
  %102 = load i32, ptr %9, align 4, !tbaa !8
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %9, align 4, !tbaa !8
  br label %67, !llvm.loop !15

104:                                              ; preds = %72
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %4, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %5, align 4
  br label %116

108:                                              ; preds = %87, %83
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %4, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #8
  br label %116

112:                                              ; preds = %88
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %4, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %116

116:                                              ; preds = %112, %108, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %301

117:                                              ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store ptr %8, ptr %14, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %118 = load ptr, ptr %14, align 8, !tbaa !16
  %119 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %118) #8
  %120 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %121 = load ptr, ptr %14, align 8, !tbaa !16
  %122 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %121) #8
  %123 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %122, ptr %123, align 8
  br label %124

124:                                              ; preds = %142, %117
  %125 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  br i1 %125, label %127, label %126

126:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %148

127:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  %129 = load i64, ptr %128, align 8, !tbaa !13
  store i64 %129, ptr %17, align 8, !tbaa !13
  %130 = load i64, ptr %17, align 8, !tbaa !13
  %131 = sub nsw i64 0, %130
  %132 = load i32, ptr @linksSize, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [320005 x i64], ptr @linksMn, i64 0, i64 %133
  store i64 %131, ptr %134, align 8, !tbaa !13
  %135 = load i32, ptr @linksSize, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %136 = load i64, ptr %17, align 8, !tbaa !13
  %137 = sub nsw i64 0, %136
  store i64 %137, ptr %18, align 8, !tbaa !13
  %138 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @links, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %139 unwind label %144

139:                                              ; preds = %127
  store i32 %135, ptr %138, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  %140 = load i32, ptr @linksSize, align 4, !tbaa !8
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr @linksSize, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %142

142:                                              ; preds = %139
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  br label %124

144:                                              ; preds = %127
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %4, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %301

148:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !8
  br label %149

149:                                              ; preds = %166, %148
  %150 = load i32, ptr %19, align 4, !tbaa !8
  %151 = load i32, ptr @m, align 4, !tbaa !8
  %152 = icmp slt i32 %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %173

154:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %155 = load i32, ptr %19, align 4, !tbaa !8
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !8
  %159 = sext i32 %158 to i64
  store i64 %159, ptr %20, align 8, !tbaa !13
  %160 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @links, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %161 unwind label %169

161:                                              ; preds = %154
  %162 = load i32, ptr %160, align 4, !tbaa !8
  %163 = load i32, ptr %19, align 4, !tbaa !8
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %164
  store i32 %162, ptr %165, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %166

166:                                              ; preds = %161
  %167 = load i32, ptr %19, align 4, !tbaa !8
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %19, align 4, !tbaa !8
  br label %149, !llvm.loop !18

169:                                              ; preds = %154
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %4, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %301

173:                                              ; preds = %153
  %174 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %175 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %174, ptr %175, align 8
  %176 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %177 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %176, ptr %177, align 8
  %178 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8
  %180 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %179, ptr %181)
          to label %182 unwind label %189

182:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  store i64 0, ptr %23, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !8
  br label %183

183:                                              ; preds = %283, %182
  %184 = load i32, ptr %24, align 4, !tbaa !8
  %185 = sext i32 %184 to i64
  %186 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %187 = icmp ult i64 %185, %186
  br i1 %187, label %193, label %188

188:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %291

189:                                              ; preds = %173
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %4, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %5, align 4
  br label %301

193:                                              ; preds = %183
  %194 = load i32, ptr %24, align 4, !tbaa !8
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %195) #8
  %197 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %196) #8
  %198 = load i32, ptr %197, align 4, !tbaa !8
  %199 = sext i32 %198 to i64
  store i64 %199, ptr @pos, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %200 = load i32, ptr %24, align 4, !tbaa !8
  %201 = sext i32 %200 to i64
  %202 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %201) #8
  %203 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %202) #8
  %204 = load i32, ptr %203, align 4, !tbaa !8
  store i32 %204, ptr %25, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %205 = load i32, ptr %24, align 4, !tbaa !8
  %206 = sext i32 %205 to i64
  %207 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %206) #8
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %207) #8
  %209 = load i32, ptr %208, align 4, !tbaa !8
  store i32 %209, ptr %26, align 4, !tbaa !8
  %210 = load i32, ptr %25, align 4, !tbaa !8
  %211 = icmp eq i32 %210, 1
  br i1 %211, label %212, label %220

212:                                              ; preds = %193
  %213 = load i32, ptr %26, align 4, !tbaa !8
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [320005 x i32], ptr @as, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !8
  %217 = sext i32 %216 to i64
  %218 = load i64, ptr @allFish, align 8, !tbaa !13
  %219 = add nsw i64 %218, %217
  store i64 %219, ptr @allFish, align 8, !tbaa !13
  br label %277

220:                                              ; preds = %193
  %221 = load i32, ptr %26, align 4, !tbaa !8
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [320005 x i32], ptr @bs, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !8
  %225 = sext i32 %224 to i64
  %226 = load i64, ptr @prodFish, align 8, !tbaa !13
  %227 = add nsw i64 %226, %225
  store i64 %227, ptr @prodFish, align 8, !tbaa !13
  %228 = load i32, ptr %26, align 4, !tbaa !8
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [320005 x i32], ptr @bs, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !8
  %232 = sext i32 %231 to i64
  %233 = load i32, ptr %26, align 4, !tbaa !8
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !8
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [320005 x i64], ptr @linksMn, i64 0, i64 %237
  %239 = load i64, ptr %238, align 8, !tbaa !13
  %240 = mul nsw i64 %232, %239
  %241 = load i64, ptr @navar, align 8, !tbaa !13
  %242 = add nsw i64 %241, %240
  store i64 %242, ptr @navar, align 8, !tbaa !13
  %243 = load i32, ptr %26, align 4, !tbaa !8
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [320005 x i32], ptr @bs, i64 0, i64 %244
  %246 = load i32, ptr %245, align 4, !tbaa !8
  %247 = sext i32 %246 to i64
  %248 = load i32, ptr %26, align 4, !tbaa !8
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !8
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [320005 x i64], ptr @linksVal, i64 0, i64 %252
  %254 = load i64, ptr %253, align 8, !tbaa !13
  %255 = add nsw i64 %254, %247
  store i64 %255, ptr %253, align 8, !tbaa !13
  %256 = load i32, ptr %26, align 4, !tbaa !8
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %257
  %259 = load i32, ptr %258, align 4, !tbaa !8
  %260 = load i32, ptr %26, align 4, !tbaa !8
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [320005 x i32], ptr @bs, i64 0, i64 %261
  %263 = load i32, ptr %262, align 4, !tbaa !8
  %264 = sext i32 %263 to i64
  %265 = load i32, ptr %26, align 4, !tbaa !8
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %266
  %268 = load i32, ptr %267, align 4, !tbaa !8
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [320005 x i64], ptr @linksMn, i64 0, i64 %269
  %271 = load i64, ptr %270, align 8, !tbaa !13
  invoke void @_Z3addiiiixx(i32 noundef 1, i32 noundef 0, i32 noundef 320004, i32 noundef %259, i64 noundef %264, i64 noundef %271)
          to label %272 unwind label %273

272:                                              ; preds = %220
  br label %277

273:                                              ; preds = %220
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %4, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %5, align 4
  br label %290

277:                                              ; preds = %272, %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %278 = invoke noundef i64 @_Z6getAnsv()
          to label %279 unwind label %286

279:                                              ; preds = %277
  store i64 %278, ptr %27, align 8, !tbaa !13
  %280 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %27)
          to label %281 unwind label %286

281:                                              ; preds = %279
  %282 = load i64, ptr %280, align 8, !tbaa !13
  store i64 %282, ptr %23, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %283

283:                                              ; preds = %281
  %284 = load i32, ptr %24, align 4, !tbaa !8
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr %24, align 4, !tbaa !8
  br label %183, !llvm.loop !19

286:                                              ; preds = %279, %277
  %287 = landingpad { ptr, i32 }
          cleanup
  %288 = extractvalue { ptr, i32 } %287, 0
  store ptr %288, ptr %4, align 8
  %289 = extractvalue { ptr, i32 } %287, 1
  store i32 %289, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %290

290:                                              ; preds = %286, %273
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %300

291:                                              ; preds = %188
  %292 = load i64, ptr %23, align 8, !tbaa !13
  %293 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %292)
          to label %294 unwind label %296

294:                                              ; preds = %291
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #8
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #8
  %295 = load i32, ptr %1, align 4
  ret i32 %295

296:                                              ; preds = %291
  %297 = landingpad { ptr, i32 }
          cleanup
  %298 = extractvalue { ptr, i32 } %297, 0
  store ptr %298, ptr %4, align 8
  %299 = extractvalue { ptr, i32 } %297, 1
  store i32 %299, ptr %5, align 4
  br label %300

300:                                              ; preds = %296, %290
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %301

301:                                              ; preds = %300, %189, %169, %144, %116
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #8
  br label %302

302:                                              ; preds = %301, %65
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #8
  br label %303

303:                                              ; preds = %302
  %304 = load ptr, ptr %4, align 8
  %305 = load i32, ptr %5, align 4
  %306 = insertvalue { ptr, i32 } poison, ptr %304, 0
  %307 = insertvalue { ptr, i32 } %306, i32 %305, 1
  resume { ptr, i32 } %307
}

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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt10make_tupleIJRiiS0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #6

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

; 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { 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 #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 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !10, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_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::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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.3", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.5" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.5" = type { i32 }
%"struct.std::_Head_base.6" = type { i32 }
%"class.std::set" = type { %"class.std::_Rb_tree.7" }
%"class.std::_Rb_tree.7" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i64, align 8
@pos = external dso_local local_unnamed_addr global i64, align 8
@allFish = external dso_local local_unnamed_addr global i64, align 8
@prodFish = external dso_local local_unnamed_addr global i64, align 8
@navar = external dso_local local_unnamed_addr global i64, align 8
@linksSize = external dso_local local_unnamed_addr global i32, align 4
@linksVal = external dso_local local_unnamed_addr global [320005 x i64], align 16
@linksMn = external dso_local local_unnamed_addr global [320005 x i64], align 16
@xs = external dso_local global [320005 x i32], align 16
@as = external dso_local global [320005 x i32], align 16
@ys = external dso_local global [320005 x i32], align 16
@bs = external dso_local global [320005 x i32], align 16
@cs = external dso_local global [320005 x i32], align 16
@links = external dso_local global %"class.std::map", align 8
@tree = external dso_local local_unnamed_addr global [1280020 x i64], align 16
@treeAns = external dso_local local_unnamed_addr global [1280020 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::tuple", align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::set", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::tuple", align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2560040) @linksVal, i8 0, i64 2560040, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2560040) @linksMn, i8 0, i64 2560040, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10240160) @tree, i8 0, i64 10240160, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10240160) @treeAns, i8 0, i64 10240160, i1 false)
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @p)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #9
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  store i32 0, ptr %2, align 4, !tbaa !8
  %23 = load i32, ptr @n, align 4, !tbaa !8
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %34, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #9
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  store i32 0, ptr %6, align 4, !tbaa !8
  %25 = load i32, ptr @m, align 4, !tbaa !8
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph48, label %._crit_edge49

.lr.ph:                                           ; preds = %0, %34
  %storemerge45 = phi i32 [ %36, %34 ], [ 0, %0 ]
  %27 = sext i32 %storemerge45 to i64
  %28 = getelementptr inbounds [320005 x i32], ptr @xs, i64 0, i64 %27
  %29 = getelementptr inbounds [320005 x i32], ptr @as, i64 0, i64 %27
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %28, ptr noundef nonnull %29)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #9
  %31 = load i32, ptr %2, align 4, !tbaa !8
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [320005 x i32], ptr @xs, i64 0, i64 %32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  store i32 1, ptr %4, align 4, !tbaa !8
  call void @_ZSt10make_tupleIJRiiS0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %3, ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %2)
  invoke void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(12) %3)
          to label %34 unwind label %39

34:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #9
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !8
  %37 = load i32, ptr @n, align 4, !tbaa !8
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !11

39:                                               ; preds = %.lr.ph
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  br label %156

._crit_edge49:                                    ; preds = %60, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %41 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #9
  store ptr %41, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  %42 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #9
  store ptr %42, ptr %11, align 8
  %43 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  br i1 %43, label %.lr.ph51, label %._crit_edge52

.lr.ph48:                                         ; preds = %._crit_edge, %60
  %storemerge3746 = phi i32 [ %62, %60 ], [ 0, %._crit_edge ]
  %44 = sext i32 %storemerge3746 to i64
  %45 = getelementptr inbounds [320005 x i32], ptr @ys, i64 0, i64 %44
  %46 = getelementptr inbounds [320005 x i32], ptr @bs, i64 0, i64 %44
  %47 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %44
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %45, ptr noundef nonnull %46, ptr noundef nonnull %47)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #9
  %49 = load i32, ptr %6, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [320005 x i32], ptr @ys, i64 0, i64 %50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  store i32 2, ptr %8, align 4, !tbaa !8
  call void @_ZSt10make_tupleIJRiiS0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %7, ptr noundef nonnull align 4 dereferenceable(4) %51, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %6)
  invoke void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %52 unwind label %65

52:                                               ; preds = %.lr.ph48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %53 = load i32, ptr %6, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = sub nsw i32 0, %56
  %58 = sext i32 %57 to i64
  store i64 %58, ptr %9, align 8, !tbaa !13
  %59 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertEOx(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %60 unwind label %67

60:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  %61 = load i32, ptr %6, align 4, !tbaa !8
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %6, align 4, !tbaa !8
  %63 = load i32, ptr @m, align 4, !tbaa !8
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %.lr.ph48, label %._crit_edge49, !llvm.loop !15

65:                                               ; preds = %.lr.ph48
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #9
  br label %69

67:                                               ; preds = %52
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %69

69:                                               ; preds = %67, %65
  %.pn40 = phi { ptr, i32 } [ %68, %67 ], [ %66, %65 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  br label %155

._crit_edge52:                                    ; preds = %79, %._crit_edge49
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  %70 = load i32, ptr @m, align 4, !tbaa !8
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph55, label %._crit_edge56

.lr.ph51:                                         ; preds = %._crit_edge49, %79
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  %73 = load i64, ptr %72, align 8, !tbaa !13
  %74 = sub nsw i64 0, %73
  %75 = load i32, ptr @linksSize, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [320005 x i64], ptr @linksMn, i64 0, i64 %76
  store i64 %74, ptr %77, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  store i64 %74, ptr %12, align 8, !tbaa !13
  %78 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @links, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %79 unwind label %84

79:                                               ; preds = %.lr.ph51
  store i32 %75, ptr %78, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  %80 = load i32, ptr @linksSize, align 4, !tbaa !8
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr @linksSize, align 4, !tbaa !8
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  %83 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  br i1 %83, label %.lr.ph51, label %._crit_edge52

84:                                               ; preds = %.lr.ph51
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br label %155

._crit_edge56:                                    ; preds = %92, %._crit_edge52
  %86 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %87 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %86, ptr %87)
          to label %99 unwind label %103

.lr.ph55:                                         ; preds = %._crit_edge52, %92
  %indvars.iv = phi i64 [ %indvars.iv.next, %92 ], [ 0, %._crit_edge52 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %88 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %indvars.iv
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  store i64 %90, ptr %13, align 8, !tbaa !13
  %91 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @links, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %92 unwind label %97

92:                                               ; preds = %.lr.ph55
  %93 = load i32, ptr %91, align 4, !tbaa !8
  store i32 %93, ptr %88, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %94 = load i32, ptr @m, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next, %95
  br i1 %96, label %.lr.ph55, label %._crit_edge56, !llvm.loop !16

97:                                               ; preds = %.lr.ph55
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  br label %155

99:                                               ; preds = %._crit_edge56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #9
  store i64 0, ptr %14, align 8, !tbaa !13
  %100 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %.not = icmp eq i64 %100, 0
  br i1 %.not, label %._crit_edge60, label %.lr.ph59

._crit_edge60.loopexit:                           ; preds = %144
  %.pre = load i64, ptr %14, align 8, !tbaa !13
  br label %._crit_edge60

._crit_edge60:                                    ; preds = %._crit_edge60.loopexit, %99
  %101 = phi i64 [ %.pre, %._crit_edge60.loopexit ], [ 0, %99 ]
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %101)
          to label %151 unwind label %152

103:                                              ; preds = %._crit_edge56
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %155

.lr.ph59:                                         ; preds = %99, %144
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %144 ], [ 0, %99 ]
  %105 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv62) #9
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %105) #9
  %107 = load i32, ptr %106, align 4, !tbaa !8
  %108 = sext i32 %107 to i64
  store i64 %108, ptr @pos, align 8, !tbaa !13
  %109 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv62) #9
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %109) #9
  %111 = load i32, ptr %110, align 4, !tbaa !8
  %112 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv62) #9
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %112) #9
  %114 = load i32, ptr %113, align 4, !tbaa !8
  %115 = icmp eq i32 %111, 1
  %116 = sext i32 %114 to i64
  br i1 %115, label %117, label %123

117:                                              ; preds = %.lr.ph59
  %118 = getelementptr inbounds [320005 x i32], ptr @as, i64 0, i64 %116
  %119 = load i32, ptr %118, align 4, !tbaa !8
  %120 = sext i32 %119 to i64
  %121 = load i64, ptr @allFish, align 8, !tbaa !13
  %122 = add nsw i64 %121, %120
  store i64 %122, ptr @allFish, align 8, !tbaa !13
  br label %142

123:                                              ; preds = %.lr.ph59
  %124 = getelementptr inbounds [320005 x i32], ptr @bs, i64 0, i64 %116
  %125 = load i32, ptr %124, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = load i64, ptr @prodFish, align 8, !tbaa !13
  %128 = add nsw i64 %127, %126
  store i64 %128, ptr @prodFish, align 8, !tbaa !13
  %129 = getelementptr inbounds [320005 x i32], ptr @cs, i64 0, i64 %116
  %130 = load i32, ptr %129, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [320005 x i64], ptr @linksMn, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !13
  %134 = mul nsw i64 %133, %126
  %135 = load i64, ptr @navar, align 8, !tbaa !13
  %136 = add nsw i64 %135, %134
  store i64 %136, ptr @navar, align 8, !tbaa !13
  %137 = getelementptr inbounds [320005 x i64], ptr @linksVal, i64 0, i64 %131
  %138 = load i64, ptr %137, align 8, !tbaa !13
  %139 = add nsw i64 %138, %126
  store i64 %139, ptr %137, align 8, !tbaa !13
  invoke void @_Z3addiiiixx(i32 noundef 1, i32 noundef 0, i32 noundef 320004, i32 noundef %130, i64 noundef %126, i64 noundef %133)
          to label %142 unwind label %140

140:                                              ; preds = %123
  %141 = landingpad { ptr, i32 }
          cleanup
  br label %154

142:                                              ; preds = %123, %117
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #9
  %143 = invoke noundef i64 @_Z6getAnsv()
          to label %144 unwind label %149

144:                                              ; preds = %142
  store i64 %143, ptr %15, align 8, !tbaa !13
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %146 = load i64, ptr %145, align 8, !tbaa !13
  store i64 %146, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %147 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %148 = icmp ugt i64 %147, %indvars.iv.next63
  br i1 %148, label %.lr.ph59, label %._crit_edge60.loopexit, !llvm.loop !17

149:                                              ; preds = %142
  %150 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  br label %154

151:                                              ; preds = %._crit_edge60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #9
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #9
  ret i32 0

152:                                              ; preds = %._crit_edge60
  %153 = landingpad { ptr, i32 }
          cleanup
  br label %154

154:                                              ; preds = %140, %149, %152
  %.pn.pn = phi { ptr, i32 } [ %153, %152 ], [ %150, %149 ], [ %141, %140 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  br label %155

155:                                              ; preds = %154, %103, %97, %84, %69
  %.pn40.pn = phi { ptr, i32 } [ %.pn40, %69 ], [ %85, %84 ], [ %98, %97 ], [ %.pn.pn, %154 ], [ %104, %103 ]
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #9
  br label %156

156:                                              ; preds = %155, %39
  %.pn43 = phi { ptr, i32 } [ %40, %39 ], [ %.pn40.pn, %155 ]
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn43
}

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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt10make_tupleIJRiiS0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #7

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

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

; 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 nounwind willreturn memory(argmem: write) }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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 #9 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass