; LLVM IR from VastoLorde95/Competitive-Programming :: HackerEarth/IndiaHacks/Finals/Problem E (E)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::allocator<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::allocator<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::allocator<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::allocator<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::pair" = type { %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@_Z1vB5cxx11 = external dso_local global %"class.std::vector", align 8
@dp = external dso_local global [10000 x [7 x i64]], align 16
@MOD = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %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 i64, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %22 = getelementptr i8, ptr %21, i64 -24
  %23 = load i64, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %23
  %25 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %24, ptr noundef null)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %28

28:                                               ; preds = %40, %0
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = load i32, ptr @q, align 4, !tbaa !8
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %57

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  %34 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %35 unwind label %43

35:                                               ; preds = %33
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %37 unwind label %43

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #7
  invoke void @_ZSt9make_pairIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind writable sret(%"struct.std::pair") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %38 unwind label %47

38:                                               ; preds = %37
  invoke void @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EE9push_backEOS7_(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, ptr noundef nonnull align 8 dereferenceable(64) %7)
          to label %39 unwind label %51

39:                                               ; preds = %38
  call void @_ZNSt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %7) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %2, align 4, !tbaa !8
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %2, align 4, !tbaa !8
  br label %28, !llvm.loop !11

43:                                               ; preds = %35, %33
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %5, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %6, align 4
  br label %56

47:                                               ; preds = %37
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %5, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %6, align 4
  br label %55

51:                                               ; preds = %38
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %5, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %6, align 4
  call void @_ZNSt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %7) #7
  br label %55

55:                                               ; preds = %51, %47
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #7
  br label %56

56:                                               ; preds = %55, %43
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %150

57:                                               ; preds = %32
  store i64 1, ptr getelementptr inbounds ([10000 x [7 x i64]], ptr @dp, i64 0, i64 1), align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %122, %57
  %59 = load i32, ptr %8, align 4, !tbaa !8
  %60 = load i32, ptr @n, align 4, !tbaa !8
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

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

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

64:                                               ; preds = %118, %63
  %65 = load i32, ptr %10, align 4, !tbaa !8
  %66 = icmp slt i32 %65, 6
  br i1 %66, label %68, label %67

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

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

69:                                               ; preds = %114, %68
  %70 = load i32, ptr %11, align 4, !tbaa !8
  %71 = load i32, ptr @q, align 4, !tbaa !8
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %74, label %73

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

74:                                               ; preds = %69
  %75 = load i32, ptr %11, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %76) #7
  %78 = getelementptr inbounds %"struct.std::pair", ptr %77, i32 0, i32 1
  %79 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %78, i64 noundef 0)
  %80 = load i8, ptr %79, align 1, !tbaa !15
  %81 = sext i8 %80 to i32
  %82 = sub nsw i32 %81, 97
  %83 = load i32, ptr %10, align 4, !tbaa !8
  %84 = icmp eq i32 %82, %83
  br i1 %84, label %85, label %113

85:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %86 = load i32, ptr %11, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %87) #7
  %89 = getelementptr inbounds %"struct.std::pair", ptr %88, i32 0, i32 0
  %90 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %89, i64 noundef 0)
  %91 = load i8, ptr %90, align 1, !tbaa !15
  %92 = sext i8 %91 to i32
  %93 = sub nsw i32 %92, 97
  store i32 %93, ptr %12, align 4, !tbaa !8
  %94 = load i64, ptr @MOD, align 8, !tbaa !13
  %95 = load i32, ptr %8, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %96
  %98 = load i32, ptr %10, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [7 x i64], ptr %97, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !13
  %102 = load i32, ptr %8, align 4, !tbaa !8
  %103 = add nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %104
  %106 = load i32, ptr %12, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [7 x i64], ptr %105, i64 0, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !13
  %110 = add nsw i64 %109, %101
  store i64 %110, ptr %108, align 8, !tbaa !13
  %111 = load i64, ptr %108, align 8, !tbaa !13
  %112 = srem i64 %111, %94
  store i64 %112, ptr %108, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %113

113:                                              ; preds = %85, %74
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %11, align 4, !tbaa !8
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %11, align 4, !tbaa !8
  br label %69, !llvm.loop !16

117:                                              ; preds = %73
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %10, align 4, !tbaa !8
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %10, align 4, !tbaa !8
  br label %64, !llvm.loop !17

121:                                              ; preds = %67
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %8, align 4, !tbaa !8
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %8, align 4, !tbaa !8
  br label %58, !llvm.loop !18

125:                                              ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !8
  br label %126

126:                                              ; preds = %142, %125
  %127 = load i32, ptr %14, align 4, !tbaa !8
  %128 = icmp slt i32 %127, 6
  br i1 %128, label %130, label %129

129:                                              ; preds = %126
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %145

130:                                              ; preds = %126
  %131 = load i64, ptr %13, align 8, !tbaa !13
  %132 = load i32, ptr @n, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %133
  %135 = load i32, ptr %14, align 4, !tbaa !8
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [7 x i64], ptr %134, i64 0, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !13
  %139 = add nsw i64 %131, %138
  %140 = load i64, ptr @MOD, align 8, !tbaa !13
  %141 = srem i64 %139, %140
  store i64 %141, ptr %13, align 8, !tbaa !13
  br label %142

142:                                              ; preds = %130
  %143 = load i32, ptr %14, align 4, !tbaa !8
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %14, align 4, !tbaa !8
  br label %126, !llvm.loop !19

145:                                              ; preds = %129
  %146 = load i64, ptr %13, align 8, !tbaa !13
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %146)
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %149 = load i32, ptr %1, align 4
  ret i32 %149

150:                                              ; preds = %56
  %151 = load ptr, ptr %5, align 8
  %152 = load i32, ptr %6, align 4
  %153 = insertvalue { ptr, i32 } poison, ptr %151, 0
  %154 = insertvalue { ptr, i32 } %153, i32 %152, 1
  resume { ptr, i32 } %154
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #6 align 2

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::allocator<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::allocator<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::allocator<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::allocator<std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::pair" = type { %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@_Z1vB5cxx11 = external dso_local global %"class.std::vector", align 8
@dp = external dso_local local_unnamed_addr global [10000 x [7 x i64]], align 16
@MOD = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = 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) @n)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @q)
  %17 = load i32, ptr @q, align 4, !tbaa !8
  %.not34 = icmp slt i32 %17, 1
  br i1 %.not34, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %27, %0
  %18 = phi i32 [ %17, %0 ], [ %29, %27 ]
  store i64 1, ptr getelementptr inbounds (i8, ptr @dp, i64 56), align 8, !tbaa !11
  %19 = load i32, ptr @n, align 4, !tbaa !8
  %20 = icmp sgt i32 %19, 1
  %21 = icmp sgt i32 %18, 0
  %or.cond = and i1 %20, %21
  br i1 %or.cond, label %.preheader33, label %.preheader

.lr.ph:                                           ; preds = %0, %27
  %.02935 = phi i32 [ %28, %27 ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %23 unwind label %30

23:                                               ; preds = %.lr.ph
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %25 unwind label %30

25:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #7
  invoke void @_ZSt9make_pairIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %26 unwind label %32

26:                                               ; preds = %25
  invoke void @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EE9push_backEOS7_(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, ptr noundef nonnull align 8 dereferenceable(64) %3)
          to label %27 unwind label %34

27:                                               ; preds = %26
  call void @_ZNSt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %3) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  %28 = add nuw nsw i32 %.02935, 1
  %29 = load i32, ptr @q, align 4, !tbaa !8
  %.not.not = icmp slt i32 %.02935, %29
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

30:                                               ; preds = %23, %.lr.ph
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %37

32:                                               ; preds = %25
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %36

34:                                               ; preds = %26
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %3) #7
  br label %36

36:                                               ; preds = %34, %32
  %.pn = phi { ptr, i32 } [ %35, %34 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  br label %37

37:                                               ; preds = %36, %30
  %.pn.pn = phi { ptr, i32 } [ %.pn, %36 ], [ %31, %30 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn.pn

.preheader33:                                     ; preds = %._crit_edge, %.split.us
  %38 = phi i32 [ %69, %.split.us ], [ %19, %._crit_edge ]
  %39 = phi i32 [ %70, %.split.us ], [ %18, %._crit_edge ]
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.split.us ], [ 1, %._crit_edge ]
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph37, label %.split.us

.preheader:                                       ; preds = %.split.us, %._crit_edge
  %.lcssa = phi i32 [ %19, %._crit_edge ], [ %69, %.split.us ]
  %41 = sext i32 %.lcssa to i64
  %42 = load i64, ptr @MOD, align 8, !tbaa !11
  %43 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %41, i64 0
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = srem i64 %44, %42
  %46 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %41, i64 1
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = add nsw i64 %47, %45
  %49 = srem i64 %48, %42
  %50 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %41, i64 2
  %51 = load i64, ptr %50, align 8, !tbaa !11
  %52 = add nsw i64 %51, %49
  %53 = srem i64 %52, %42
  %54 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %41, i64 3
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = add nsw i64 %55, %53
  %57 = srem i64 %56, %42
  %58 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %41, i64 4
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = add nsw i64 %59, %57
  %61 = srem i64 %60, %42
  %62 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %41, i64 5
  %63 = load i64, ptr %62, align 8, !tbaa !11
  %64 = add nsw i64 %63, %61
  %65 = srem i64 %64, %42
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %65)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph37:                                         ; preds = %.preheader33
  %68 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv51, i64 0
  br label %209

.split.us:                                        ; preds = %.preheader33, %._crit_edge38.5
  %69 = phi i32 [ %.pre, %._crit_edge38.5 ], [ %38, %.preheader33 ]
  %70 = phi i32 [ %208, %._crit_edge38.5 ], [ %39, %.preheader33 ]
  %71 = sext i32 %69 to i64
  %72 = icmp slt i64 %indvars.iv.next52, %71
  br i1 %72, label %.preheader33, label %.preheader, !llvm.loop !15

._crit_edge38:                                    ; preds = %230
  %73 = icmp sgt i32 %231, 0
  br i1 %73, label %.lr.ph37.1, label %._crit_edge38.5

.lr.ph37.1:                                       ; preds = %._crit_edge38
  %74 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv51, i64 1
  br label %75

75:                                               ; preds = %96, %.lr.ph37.1
  %indvars.iv.1 = phi i64 [ 0, %.lr.ph37.1 ], [ %indvars.iv.next.1, %96 ]
  %76 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.1) #7
  %77 = getelementptr inbounds i8, ptr %76, i64 32
  %78 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %77, i64 noundef 0)
  %79 = load i8, ptr %78, align 1, !tbaa !17
  %80 = sext i8 %79 to i64
  %81 = add nsw i64 %80, 4294967199
  %82 = and i64 %81, 4294967295
  %83 = icmp eq i64 %82, 1
  br i1 %83, label %84, label %96

84:                                               ; preds = %75
  %85 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.1) #7
  %86 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %85, i64 noundef 0)
  %87 = load i8, ptr %86, align 1, !tbaa !17
  %88 = sext i8 %87 to i64
  %89 = add nsw i64 %88, -97
  %90 = load i64, ptr @MOD, align 8, !tbaa !11
  %91 = load i64, ptr %74, align 8, !tbaa !11
  %92 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next52, i64 %89
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = add nsw i64 %93, %91
  %95 = srem i64 %94, %90
  store i64 %95, ptr %92, align 8, !tbaa !11
  br label %96

96:                                               ; preds = %84, %75
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %97 = load i32, ptr @q, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = icmp slt i64 %indvars.iv.next.1, %98
  br i1 %99, label %75, label %._crit_edge38.1, !llvm.loop !18

._crit_edge38.1:                                  ; preds = %96
  %100 = icmp sgt i32 %97, 0
  br i1 %100, label %.lr.ph37.2, label %._crit_edge38.5

.lr.ph37.2:                                       ; preds = %._crit_edge38.1
  %101 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv51, i64 2
  br label %102

102:                                              ; preds = %123, %.lr.ph37.2
  %indvars.iv.2 = phi i64 [ 0, %.lr.ph37.2 ], [ %indvars.iv.next.2, %123 ]
  %103 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.2) #7
  %104 = getelementptr inbounds i8, ptr %103, i64 32
  %105 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %104, i64 noundef 0)
  %106 = load i8, ptr %105, align 1, !tbaa !17
  %107 = sext i8 %106 to i64
  %108 = add nsw i64 %107, 4294967199
  %109 = and i64 %108, 4294967295
  %110 = icmp eq i64 %109, 2
  br i1 %110, label %111, label %123

111:                                              ; preds = %102
  %112 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.2) #7
  %113 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %112, i64 noundef 0)
  %114 = load i8, ptr %113, align 1, !tbaa !17
  %115 = sext i8 %114 to i64
  %116 = add nsw i64 %115, -97
  %117 = load i64, ptr @MOD, align 8, !tbaa !11
  %118 = load i64, ptr %101, align 8, !tbaa !11
  %119 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next52, i64 %116
  %120 = load i64, ptr %119, align 8, !tbaa !11
  %121 = add nsw i64 %120, %118
  %122 = srem i64 %121, %117
  store i64 %122, ptr %119, align 8, !tbaa !11
  br label %123

123:                                              ; preds = %111, %102
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %124 = load i32, ptr @q, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = icmp slt i64 %indvars.iv.next.2, %125
  br i1 %126, label %102, label %._crit_edge38.2, !llvm.loop !18

._crit_edge38.2:                                  ; preds = %123
  %127 = icmp sgt i32 %124, 0
  br i1 %127, label %.lr.ph37.3, label %._crit_edge38.5

.lr.ph37.3:                                       ; preds = %._crit_edge38.2
  %128 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv51, i64 3
  br label %129

129:                                              ; preds = %150, %.lr.ph37.3
  %indvars.iv.3 = phi i64 [ 0, %.lr.ph37.3 ], [ %indvars.iv.next.3, %150 ]
  %130 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.3) #7
  %131 = getelementptr inbounds i8, ptr %130, i64 32
  %132 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %131, i64 noundef 0)
  %133 = load i8, ptr %132, align 1, !tbaa !17
  %134 = sext i8 %133 to i64
  %135 = add nsw i64 %134, 4294967199
  %136 = and i64 %135, 4294967295
  %137 = icmp eq i64 %136, 3
  br i1 %137, label %138, label %150

138:                                              ; preds = %129
  %139 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.3) #7
  %140 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %139, i64 noundef 0)
  %141 = load i8, ptr %140, align 1, !tbaa !17
  %142 = sext i8 %141 to i64
  %143 = add nsw i64 %142, -97
  %144 = load i64, ptr @MOD, align 8, !tbaa !11
  %145 = load i64, ptr %128, align 8, !tbaa !11
  %146 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next52, i64 %143
  %147 = load i64, ptr %146, align 8, !tbaa !11
  %148 = add nsw i64 %147, %145
  %149 = srem i64 %148, %144
  store i64 %149, ptr %146, align 8, !tbaa !11
  br label %150

150:                                              ; preds = %138, %129
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %151 = load i32, ptr @q, align 4, !tbaa !8
  %152 = sext i32 %151 to i64
  %153 = icmp slt i64 %indvars.iv.next.3, %152
  br i1 %153, label %129, label %._crit_edge38.3, !llvm.loop !18

._crit_edge38.3:                                  ; preds = %150
  %154 = icmp sgt i32 %151, 0
  br i1 %154, label %.lr.ph37.4, label %._crit_edge38.5

.lr.ph37.4:                                       ; preds = %._crit_edge38.3
  %155 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv51, i64 4
  br label %156

156:                                              ; preds = %177, %.lr.ph37.4
  %indvars.iv.4 = phi i64 [ 0, %.lr.ph37.4 ], [ %indvars.iv.next.4, %177 ]
  %157 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.4) #7
  %158 = getelementptr inbounds i8, ptr %157, i64 32
  %159 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %158, i64 noundef 0)
  %160 = load i8, ptr %159, align 1, !tbaa !17
  %161 = sext i8 %160 to i64
  %162 = add nsw i64 %161, 4294967199
  %163 = and i64 %162, 4294967295
  %164 = icmp eq i64 %163, 4
  br i1 %164, label %165, label %177

165:                                              ; preds = %156
  %166 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.4) #7
  %167 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %166, i64 noundef 0)
  %168 = load i8, ptr %167, align 1, !tbaa !17
  %169 = sext i8 %168 to i64
  %170 = add nsw i64 %169, -97
  %171 = load i64, ptr @MOD, align 8, !tbaa !11
  %172 = load i64, ptr %155, align 8, !tbaa !11
  %173 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next52, i64 %170
  %174 = load i64, ptr %173, align 8, !tbaa !11
  %175 = add nsw i64 %174, %172
  %176 = srem i64 %175, %171
  store i64 %176, ptr %173, align 8, !tbaa !11
  br label %177

177:                                              ; preds = %165, %156
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
  %178 = load i32, ptr @q, align 4, !tbaa !8
  %179 = sext i32 %178 to i64
  %180 = icmp slt i64 %indvars.iv.next.4, %179
  br i1 %180, label %156, label %._crit_edge38.4, !llvm.loop !18

._crit_edge38.4:                                  ; preds = %177
  %181 = icmp sgt i32 %178, 0
  br i1 %181, label %.lr.ph37.5, label %._crit_edge38.5

.lr.ph37.5:                                       ; preds = %._crit_edge38.4
  %182 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv51, i64 5
  br label %183

183:                                              ; preds = %204, %.lr.ph37.5
  %indvars.iv.5 = phi i64 [ 0, %.lr.ph37.5 ], [ %indvars.iv.next.5, %204 ]
  %184 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.5) #7
  %185 = getelementptr inbounds i8, ptr %184, i64 32
  %186 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %185, i64 noundef 0)
  %187 = load i8, ptr %186, align 1, !tbaa !17
  %188 = sext i8 %187 to i64
  %189 = add nsw i64 %188, 4294967199
  %190 = and i64 %189, 4294967295
  %191 = icmp eq i64 %190, 5
  br i1 %191, label %192, label %204

192:                                              ; preds = %183
  %193 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv.5) #7
  %194 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %193, i64 noundef 0)
  %195 = load i8, ptr %194, align 1, !tbaa !17
  %196 = sext i8 %195 to i64
  %197 = add nsw i64 %196, -97
  %198 = load i64, ptr @MOD, align 8, !tbaa !11
  %199 = load i64, ptr %182, align 8, !tbaa !11
  %200 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next52, i64 %197
  %201 = load i64, ptr %200, align 8, !tbaa !11
  %202 = add nsw i64 %201, %199
  %203 = srem i64 %202, %198
  store i64 %203, ptr %200, align 8, !tbaa !11
  br label %204

204:                                              ; preds = %192, %183
  %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
  %205 = load i32, ptr @q, align 4, !tbaa !8
  %206 = sext i32 %205 to i64
  %207 = icmp slt i64 %indvars.iv.next.5, %206
  br i1 %207, label %183, label %._crit_edge38.5, !llvm.loop !18

._crit_edge38.5:                                  ; preds = %204, %._crit_edge38, %._crit_edge38.1, %._crit_edge38.2, %._crit_edge38.3, %._crit_edge38.4
  %208 = phi i32 [ %178, %._crit_edge38.4 ], [ %151, %._crit_edge38.3 ], [ %124, %._crit_edge38.2 ], [ %97, %._crit_edge38.1 ], [ %231, %._crit_edge38 ], [ %205, %204 ]
  %.pre = load i32, ptr @n, align 4, !tbaa !8
  br label %.split.us

209:                                              ; preds = %.lr.ph37, %230
  %indvars.iv = phi i64 [ 0, %.lr.ph37 ], [ %indvars.iv.next, %230 ]
  %210 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv) #7
  %211 = getelementptr inbounds i8, ptr %210, i64 32
  %212 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %211, i64 noundef 0)
  %213 = load i8, ptr %212, align 1, !tbaa !17
  %214 = sext i8 %213 to i64
  %215 = add nsw i64 %214, 4294967199
  %216 = and i64 %215, 4294967295
  %217 = icmp eq i64 %216, 0
  br i1 %217, label %218, label %230

218:                                              ; preds = %209
  %219 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESaIS7_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z1vB5cxx11, i64 noundef %indvars.iv) #7
  %220 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %219, i64 noundef 0)
  %221 = load i8, ptr %220, align 1, !tbaa !17
  %222 = sext i8 %221 to i64
  %223 = add nsw i64 %222, -97
  %224 = load i64, ptr @MOD, align 8, !tbaa !11
  %225 = load i64, ptr %68, align 8, !tbaa !11
  %226 = getelementptr inbounds [10000 x [7 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next52, i64 %223
  %227 = load i64, ptr %226, align 8, !tbaa !11
  %228 = add nsw i64 %227, %225
  %229 = srem i64 %228, %224
  store i64 %229, ptr %226, align 8, !tbaa !11
  br label %230

230:                                              ; preds = %209, %218
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %231 = load i32, ptr @q, align 4, !tbaa !8
  %232 = sext i32 %231 to i64
  %233 = icmp slt i64 %indvars.iv.next, %232
  br i1 %233, label %209, label %._crit_edge38, !llvm.loop !18
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #6 align 2

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

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

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

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

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


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