; LLVM IR from eyangch/competitive-programming :: Codeforces/1623 (d)

; 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_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::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@MOD = external dso_local global i64, align 8
@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@R = external dso_local global i64, align 8
@C = external dso_local global i64, align 8
@Rd = external dso_local global i64, align 8
@Cd = external dso_local global i64, align 8
@P = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %25 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %27
  %29 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %28, ptr noundef null)
  %30 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %32

32:                                               ; preds = %199, %0
  %33 = load i64, ptr @T, align 8, !tbaa !8
  %34 = add nsw i64 %33, -1
  store i64 %34, ptr @T, align 8, !tbaa !8
  %35 = icmp ne i64 %33, 0
  br i1 %35, label %36, label %205

36:                                               ; preds = %32
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(8) @R)
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(8) @C)
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(8) @Rd)
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(8) @Cd)
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 8 dereferenceable(8) @P)
  %44 = load i64, ptr @R, align 8, !tbaa !8
  %45 = add nsw i64 %44, -1
  store i64 %45, ptr @R, align 8, !tbaa !8
  %46 = load i64, ptr @C, align 8, !tbaa !8
  %47 = add nsw i64 %46, -1
  store i64 %47, ptr @C, align 8, !tbaa !8
  %48 = load i64, ptr @Rd, align 8, !tbaa !8
  %49 = add nsw i64 %48, -1
  store i64 %49, ptr @Rd, align 8, !tbaa !8
  %50 = load i64, ptr @Cd, align 8, !tbaa !8
  %51 = add nsw i64 %50, -1
  store i64 %51, ptr @Cd, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %52 = load i64, ptr @P, align 8, !tbaa !8
  %53 = sub nsw i64 100, %52
  %54 = call noundef i64 @_Z3invx(i64 noundef 100)
  %55 = mul nsw i64 %53, %54
  %56 = load i64, ptr @MOD, align 8, !tbaa !8
  %57 = srem i64 %55, %56
  store i64 %57, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #8
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  store i64 1, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store i64 1, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %58 = load i64, ptr @R, align 8, !tbaa !8
  store i64 %58, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %59 = load i64, ptr @C, align 8, !tbaa !8
  store i64 %59, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #8
  store i8 0, ptr %8, align 1, !tbaa !11
  br label %60

60:                                               ; preds = %124, %36
  br label %61

61:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #8
  store i8 0, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #8
  store i8 0, ptr %10, align 1, !tbaa !11
  %62 = load i64, ptr %6, align 8, !tbaa !8
  %63 = load i64, ptr %4, align 8, !tbaa !8
  %64 = add nsw i64 %62, %63
  %65 = icmp slt i64 %64, 0
  br i1 %65, label %72, label %66

66:                                               ; preds = %61
  %67 = load i64, ptr %6, align 8, !tbaa !8
  %68 = load i64, ptr %4, align 8, !tbaa !8
  %69 = add nsw i64 %67, %68
  %70 = load i64, ptr @N, align 8, !tbaa !8
  %71 = icmp sge i64 %69, %70
  br i1 %71, label %72, label %75

72:                                               ; preds = %66, %61
  %73 = load i64, ptr %4, align 8, !tbaa !8
  %74 = sub nsw i64 0, %73
  store i64 %74, ptr %4, align 8, !tbaa !8
  store i8 1, ptr %9, align 1, !tbaa !11
  br label %75

75:                                               ; preds = %72, %66
  %76 = load i64, ptr %7, align 8, !tbaa !8
  %77 = load i64, ptr %5, align 8, !tbaa !8
  %78 = add nsw i64 %76, %77
  %79 = icmp slt i64 %78, 0
  br i1 %79, label %86, label %80

80:                                               ; preds = %75
  %81 = load i64, ptr %7, align 8, !tbaa !8
  %82 = load i64, ptr %5, align 8, !tbaa !8
  %83 = add nsw i64 %81, %82
  %84 = load i64, ptr @M, align 8, !tbaa !8
  %85 = icmp sge i64 %83, %84
  br i1 %85, label %86, label %89

86:                                               ; preds = %80, %75
  %87 = load i64, ptr %5, align 8, !tbaa !8
  %88 = sub nsw i64 0, %87
  store i64 %88, ptr %5, align 8, !tbaa !8
  store i8 1, ptr %10, align 1, !tbaa !11
  br label %89

89:                                               ; preds = %86, %80
  %90 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %91 = trunc i8 %90 to i1
  br i1 %91, label %92, label %113

92:                                               ; preds = %89
  %93 = load i64, ptr @R, align 8, !tbaa !8
  %94 = load i64, ptr %6, align 8, !tbaa !8
  %95 = icmp eq i64 %93, %94
  br i1 %95, label %96, label %113

96:                                               ; preds = %92
  %97 = load i64, ptr @C, align 8, !tbaa !8
  %98 = load i64, ptr %7, align 8, !tbaa !8
  %99 = icmp eq i64 %97, %98
  br i1 %99, label %100, label %113

100:                                              ; preds = %96
  %101 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %102 = trunc i8 %101 to i1
  br i1 %102, label %106, label %103

103:                                              ; preds = %100
  %104 = load i64, ptr %4, align 8, !tbaa !8
  %105 = icmp eq i64 %104, 1
  br i1 %105, label %106, label %113

106:                                              ; preds = %103, %100
  %107 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %108 = trunc i8 %107 to i1
  br i1 %108, label %112, label %109

109:                                              ; preds = %106
  %110 = load i64, ptr %5, align 8, !tbaa !8
  %111 = icmp eq i64 %110, 1
  br i1 %111, label %112, label %113

112:                                              ; preds = %109, %106
  store i32 5, ptr %11, align 4
  br label %122

113:                                              ; preds = %109, %103, %96, %92, %89
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %114 unwind label %125

114:                                              ; preds = %113
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %115 unwind label %125

115:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  %116 = load i64, ptr %4, align 8, !tbaa !8
  %117 = load i64, ptr %6, align 8, !tbaa !8
  %118 = add nsw i64 %117, %116
  store i64 %118, ptr %6, align 8, !tbaa !8
  %119 = load i64, ptr %5, align 8, !tbaa !8
  %120 = load i64, ptr %7, align 8, !tbaa !8
  %121 = add nsw i64 %120, %119
  store i64 %121, ptr %7, align 8, !tbaa !8
  store i8 1, ptr %8, align 1, !tbaa !11
  store i32 0, ptr %11, align 4
  br label %122

122:                                              ; preds = %115, %112
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  %123 = load i32, ptr %11, align 4
  switch i32 %123, label %212 [
    i32 0, label %124
    i32 5, label %129
  ]

124:                                              ; preds = %122
  br label %60, !llvm.loop !15

125:                                              ; preds = %114, %113
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %13, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  br label %204

129:                                              ; preds = %122
  %130 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  %132 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %133 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %132, ptr %133, align 8
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8
  %136 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %135, ptr %137)
          to label %138 unwind label %148

138:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store i64 1, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  store i64 0, ptr %18, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store ptr %3, ptr %19, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %139 = load ptr, ptr %19, align 8, !tbaa !17
  %140 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %139) #8
  %141 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %140, ptr %141, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %142 = load ptr, ptr %19, align 8, !tbaa !17
  %143 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %142) #8
  %144 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %143, ptr %144, align 8
  br label %145

145:                                              ; preds = %181, %138
  %146 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  br i1 %146, label %152, label %147

147:                                              ; preds = %145
  store i32 6, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %183

148:                                              ; preds = %129
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %13, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %14, align 4
  br label %204

152:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #8
  %153 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %153, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %154 = getelementptr inbounds %"struct.std::pair", ptr %22, i32 0, i32 0
  %155 = load i64, ptr %154, align 8, !tbaa !19
  store i64 %155, ptr %23, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %156 = getelementptr inbounds %"struct.std::pair", ptr %22, i32 0, i32 1
  %157 = load i64, ptr %156, align 8, !tbaa !21
  store i64 %157, ptr %24, align 8, !tbaa !8
  %158 = load i64, ptr %18, align 8, !tbaa !8
  %159 = add nsw i64 %158, 1
  %160 = load i64, ptr @MOD, align 8, !tbaa !8
  %161 = srem i64 %159, %160
  store i64 %161, ptr %18, align 8, !tbaa !8
  %162 = load i64, ptr %23, align 8, !tbaa !8
  %163 = load i64, ptr @Rd, align 8, !tbaa !8
  %164 = icmp eq i64 %162, %163
  br i1 %164, label %169, label %165

165:                                              ; preds = %152
  %166 = load i64, ptr %24, align 8, !tbaa !8
  %167 = load i64, ptr @Cd, align 8, !tbaa !8
  %168 = icmp eq i64 %166, %167
  br i1 %168, label %169, label %180

169:                                              ; preds = %165, %152
  %170 = load i64, ptr %17, align 8, !tbaa !8
  %171 = load i64, ptr %2, align 8, !tbaa !8
  %172 = mul nsw i64 %170, %171
  %173 = load i64, ptr @MOD, align 8, !tbaa !8
  %174 = srem i64 %172, %173
  store i64 %174, ptr %17, align 8, !tbaa !8
  %175 = load i64, ptr %18, align 8, !tbaa !8
  %176 = load i64, ptr %2, align 8, !tbaa !8
  %177 = mul nsw i64 %175, %176
  %178 = load i64, ptr @MOD, align 8, !tbaa !8
  %179 = srem i64 %177, %178
  store i64 %179, ptr %18, align 8, !tbaa !8
  br label %180

180:                                              ; preds = %169, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #8
  br label %181

181:                                              ; preds = %180
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  br label %145

183:                                              ; preds = %147
  %184 = load i64, ptr %17, align 8, !tbaa !8
  %185 = sub nsw i64 1, %184
  %186 = load i64, ptr @MOD, align 8, !tbaa !8
  %187 = add nsw i64 %185, %186
  %188 = load i64, ptr @MOD, align 8, !tbaa !8
  %189 = srem i64 %187, %188
  store i64 %189, ptr %17, align 8, !tbaa !8
  %190 = load i64, ptr %18, align 8, !tbaa !8
  %191 = load i64, ptr %17, align 8, !tbaa !8
  %192 = call noundef i64 @_Z3invx(i64 noundef %191)
  %193 = mul nsw i64 %190, %192
  %194 = load i64, ptr @MOD, align 8, !tbaa !8
  %195 = srem i64 %193, %194
  %196 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %195)
          to label %197 unwind label %200

197:                                              ; preds = %183
  %198 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %196, i8 noundef signext 10)
          to label %199 unwind label %200

199:                                              ; preds = %197
  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 1, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %32, !llvm.loop !22

200:                                              ; preds = %197, %183
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %13, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %204

204:                                              ; preds = %200, %148, %125
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %207

205:                                              ; preds = %32
  %206 = load i32, ptr %1, align 4
  ret i32 %206

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

212:                                              ; preds = %122
  unreachable
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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

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

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

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

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


; 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_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::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@R = external dso_local global i64, align 8
@C = external dso_local global i64, align 8
@Rd = external dso_local global i64, align 8
@Cd = external dso_local global i64, align 8
@P = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %14 = load i64, ptr @T, align 8, !tbaa !8
  %15 = add nsw i64 %14, -1
  store i64 %15, ptr @T, align 8, !tbaa !8
  %.not68 = icmp eq i64 %14, 0
  br i1 %.not68, label %._crit_edge71, label %.lr.ph70.preheader

.lr.ph70.preheader:                               ; preds = %0, %108
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) @R)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) @C)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) @Rd)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) @Cd)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @P)
  %23 = load i64, ptr @R, align 8, !tbaa !8
  %24 = add nsw i64 %23, -1
  store i64 %24, ptr @R, align 8, !tbaa !8
  %25 = load i64, ptr @C, align 8, !tbaa !8
  %26 = add nsw i64 %25, -1
  store i64 %26, ptr @C, align 8, !tbaa !8
  %27 = load i64, ptr @Rd, align 8, !tbaa !8
  %28 = add nsw i64 %27, -1
  store i64 %28, ptr @Rd, align 8, !tbaa !8
  %29 = load i64, ptr @Cd, align 8, !tbaa !8
  %30 = add nsw i64 %29, -1
  store i64 %30, ptr @Cd, align 8, !tbaa !8
  %31 = load i64, ptr @P, align 8, !tbaa !8
  %32 = sub nsw i64 100, %31
  %33 = call noundef i64 @_Z3invx(i64 noundef 100)
  %34 = mul nsw i64 %32, %33
  %35 = load i64, ptr @MOD, align 8, !tbaa !8
  %36 = srem i64 %34, %35
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %37 = load i64, ptr @R, align 8
  store i64 %37, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %38 = load i64, ptr @C, align 8, !tbaa !8
  store i64 %38, ptr %3, align 8, !tbaa !8
  %39 = load i64, ptr @N, align 8
  %40 = load i64, ptr @M, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %.peel.next unwind label %.loopexit.split-lp

.peel.next:                                       ; preds = %.lr.ph70.preheader
  %41 = icmp slt i64 %38, -1
  %42 = add nsw i64 %38, 1
  %.not49.peel = icmp sge i64 %42, %40
  %or.cond52.not.peel = select i1 %41, i1 true, i1 %.not49.peel
  %spec.select57.peel = select i1 %or.cond52.not.peel, i64 -1, i64 1
  %43 = icmp slt i64 %37, -1
  %44 = add nsw i64 %37, 1
  %.not48.peel = icmp sge i64 %44, %39
  %or.cond51.not.peel = select i1 %43, i1 true, i1 %.not48.peel
  %spec.select55.peel = select i1 %or.cond51.not.peel, i64 -1, i64 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = add nsw i64 %45, %spec.select55.peel
  store i64 %46, ptr %2, align 8, !tbaa !8
  %47 = load i64, ptr %3, align 8, !tbaa !8
  %48 = add nsw i64 %47, %spec.select57.peel
  br label %49

49:                                               ; preds = %67, %.peel.next
  %50 = phi i64 [ %46, %.peel.next ], [ %69, %67 ]
  %storemerge = phi i64 [ %48, %.peel.next ], [ %71, %67 ]
  %.033 = phi i64 [ %spec.select57.peel, %.peel.next ], [ %spec.select57, %67 ]
  %.0 = phi i64 [ %spec.select55.peel, %.peel.next ], [ %spec.select55, %67 ]
  store i64 %storemerge, ptr %3, align 8, !tbaa !8
  %51 = add nsw i64 %50, %.0
  %52 = icmp slt i64 %51, 0
  %53 = load i64, ptr @N, align 8
  %.not48 = icmp sge i64 %51, %53
  %or.cond51.not = select i1 %52, i1 true, i1 %.not48
  %54 = sub nsw i64 0, %.0
  %spec.select55 = select i1 %or.cond51.not, i64 %54, i64 %.0
  %55 = add nsw i64 %storemerge, %.033
  %56 = icmp slt i64 %55, 0
  %57 = load i64, ptr @M, align 8
  %.not49 = icmp sge i64 %55, %57
  %or.cond52.not = select i1 %56, i1 true, i1 %.not49
  %58 = sub nsw i64 0, %.033
  %spec.select57 = select i1 %or.cond52.not, i64 %58, i64 %.033
  %59 = load i64, ptr @R, align 8
  %60 = icmp eq i64 %59, %50
  br i1 %60, label %61, label %66

61:                                               ; preds = %49
  %62 = load i64, ptr @C, align 8, !tbaa !8
  %63 = icmp eq i64 %62, %storemerge
  %64 = icmp eq i64 %spec.select55, 1
  %or.cond = select i1 %or.cond51.not, i1 true, i1 %64
  %or.cond53 = select i1 %63, i1 %or.cond, i1 false
  %65 = icmp eq i64 %spec.select57, 1
  %or.cond3 = select i1 %or.cond52.not, i1 true, i1 %65
  %or.cond54 = select i1 %or.cond53, i1 %or.cond3, i1 false
  br i1 %or.cond54, label %.loopexit, label %66

66:                                               ; preds = %61, %49
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %67 unwind label %.loopexit74

67:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %68 = load i64, ptr %2, align 8, !tbaa !8
  %69 = add nsw i64 %68, %spec.select55
  store i64 %69, ptr %2, align 8, !tbaa !8
  %70 = load i64, ptr %3, align 8, !tbaa !8
  %71 = add nsw i64 %70, %spec.select57
  br label %49, !llvm.loop !11

.loopexit74:                                      ; preds = %66
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %72

.loopexit.split-lp:                               ; preds = %.lr.ph70.preheader
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %72

72:                                               ; preds = %.loopexit.split-lp, %.loopexit74
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit74 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %113

.loopexit:                                        ; preds = %61
  %73 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %74 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %73, ptr %74)
          to label %75 unwind label %87

75:                                               ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %76 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %76, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %77 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %77, ptr %6, align 8
  %78 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %78, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %103, %75
  %.041.lcssa = phi i64 [ 1, %75 ], [ %.142, %103 ]
  %.039.lcssa = phi i64 [ 0, %75 ], [ %.140, %103 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %79 = load i64, ptr @MOD, align 8, !tbaa !8
  %reass.sub72 = sub i64 %79, %.041.lcssa
  %80 = add i64 %reass.sub72, 1
  %81 = srem i64 %80, %79
  %82 = call noundef i64 @_Z3invx(i64 noundef %81)
  %83 = mul nsw i64 %82, %.039.lcssa
  %84 = load i64, ptr @MOD, align 8, !tbaa !8
  %85 = srem i64 %83, %84
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %85)
          to label %106 unwind label %111

87:                                               ; preds = %.loopexit
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %113

.lr.ph:                                           ; preds = %75, %103
  %.03966 = phi i64 [ %.140, %103 ], [ 0, %75 ]
  %.04165 = phi i64 [ %.142, %103 ], [ 1, %75 ]
  %89 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %.sroa.0.0.copyload = load i64, ptr %89, align 8
  %90 = add nsw i64 %.03966, 1
  %91 = load i64, ptr @MOD, align 8, !tbaa !8
  %92 = srem i64 %90, %91
  %93 = load i64, ptr @Rd, align 8, !tbaa !8
  %94 = icmp eq i64 %.sroa.0.0.copyload, %93
  br i1 %94, label %98, label %95

95:                                               ; preds = %.lr.ph
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %89, i64 8
  %.sroa.4.0.copyload = load i64, ptr %.sroa.4.0..sroa_idx, align 8
  %96 = load i64, ptr @Cd, align 8, !tbaa !8
  %97 = icmp eq i64 %.sroa.4.0.copyload, %96
  br i1 %97, label %98, label %103

98:                                               ; preds = %95, %.lr.ph
  %99 = mul nsw i64 %.04165, %36
  %100 = srem i64 %99, %91
  %101 = mul nsw i64 %92, %36
  %102 = srem i64 %101, %91
  br label %103

103:                                              ; preds = %98, %95
  %.142 = phi i64 [ %100, %98 ], [ %.04165, %95 ]
  %.140 = phi i64 [ %102, %98 ], [ %92, %95 ]
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %105 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %105, label %.lr.ph, label %._crit_edge

106:                                              ; preds = %._crit_edge
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %86, i8 noundef signext 10)
          to label %108 unwind label %111

108:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %109 = load i64, ptr @T, align 8, !tbaa !8
  %110 = add nsw i64 %109, -1
  store i64 %110, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %109, 0
  br i1 %.not, label %._crit_edge71, label %.lr.ph70.preheader, !llvm.loop !13

111:                                              ; preds = %106, %._crit_edge
  %112 = landingpad { ptr, i32 }
          cleanup
  br label %113

113:                                              ; preds = %111, %87, %72
  %.pn = phi { ptr, i32 } [ %112, %111 ], [ %88, %87 ], [ %lpad.phi, %72 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn

._crit_edge71:                                    ; preds = %108, %0
  ret i32 0
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(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 @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; 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 #4 align 2

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass