; LLVM IR from eyangch/competitive-programming :: Codeforces/1528 (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::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 }
%"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" }
%"struct.std::pair" = type { i64, i64 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@D = external dso_local global [600 x [600 x i64]], align 16
@G = external dso_local global [600 x %"class.std::vector"], align 16
@mn = external dso_local global [600 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dijx(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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

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

26:                                               ; preds = %37, %0
  %27 = load i64, ptr %2, align 8, !tbaa !8
  %28 = load i64, ptr @M, align 8, !tbaa !8
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %40

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %35 = load i64, ptr %3, align 8, !tbaa !8
  %36 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %35
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %37

37:                                               ; preds = %31
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %2, align 8, !tbaa !8
  br label %26, !llvm.loop !11

40:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %41

41:                                               ; preds = %90, %40
  %42 = load i64, ptr %7, align 8, !tbaa !8
  %43 = load i64, ptr @N, align 8, !tbaa !8
  %44 = icmp slt i64 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %93

46:                                               ; preds = %41
  %47 = load i64, ptr %7, align 8, !tbaa !8
  %48 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %47
  %49 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #6
  %50 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %49, ptr %50, align 8
  %51 = load i64, ptr %7, align 8, !tbaa !8
  %52 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %51
  %53 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #6
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %53, ptr %54, align 8
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8
  %57 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %56, ptr %58)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 1000000000000000, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %59

59:                                               ; preds = %86, %46
  %60 = load i64, ptr %12, align 8, !tbaa !8
  %61 = load i64, ptr %7, align 8, !tbaa !8
  %62 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %61
  %63 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #6
  %64 = icmp slt i64 %60, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %59
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %89

66:                                               ; preds = %59
  %67 = load i64, ptr %7, align 8, !tbaa !8
  %68 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %67
  %69 = load i64, ptr %12, align 8, !tbaa !8
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %69) #6
  %71 = getelementptr inbounds %"struct.std::pair", ptr %70, i32 0, i32 1
  %72 = load i64, ptr %71, align 8, !tbaa !13
  %73 = load i64, ptr %11, align 8, !tbaa !8
  %74 = icmp slt i64 %72, %73
  br i1 %74, label %75, label %85

75:                                               ; preds = %66
  %76 = load i64, ptr %7, align 8, !tbaa !8
  %77 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %76
  %78 = load i64, ptr %12, align 8, !tbaa !8
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef %78) #6
  %80 = getelementptr inbounds %"struct.std::pair", ptr %79, i32 0, i32 1
  %81 = load i64, ptr %80, align 8, !tbaa !13
  store i64 %81, ptr %11, align 8, !tbaa !8
  %82 = load i64, ptr %12, align 8, !tbaa !8
  %83 = load i64, ptr %7, align 8, !tbaa !8
  %84 = getelementptr inbounds [600 x i64], ptr @mn, i64 0, i64 %83
  store i64 %82, ptr %84, align 8, !tbaa !8
  br label %85

85:                                               ; preds = %75, %66
  br label %86

86:                                               ; preds = %85
  %87 = load i64, ptr %12, align 8, !tbaa !8
  %88 = add nsw i64 %87, 1
  store i64 %88, ptr %12, align 8, !tbaa !8
  br label %59, !llvm.loop !15

89:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %7, align 8, !tbaa !8
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %7, align 8, !tbaa !8
  br label %41, !llvm.loop !16

93:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %94

94:                                               ; preds = %114, %93
  %95 = load i64, ptr %13, align 8, !tbaa !8
  %96 = load i64, ptr @N, align 8, !tbaa !8
  %97 = icmp slt i64 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %117

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %100

100:                                              ; preds = %110, %99
  %101 = load i64, ptr %14, align 8, !tbaa !8
  %102 = load i64, ptr @N, align 8, !tbaa !8
  %103 = icmp slt i64 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %113

105:                                              ; preds = %100
  %106 = load i64, ptr %13, align 8, !tbaa !8
  %107 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %106
  %108 = load i64, ptr %14, align 8, !tbaa !8
  %109 = getelementptr inbounds [600 x i64], ptr %107, i64 0, i64 %108
  store i64 1000000000000000, ptr %109, align 8, !tbaa !8
  br label %110

110:                                              ; preds = %105
  %111 = load i64, ptr %14, align 8, !tbaa !8
  %112 = add nsw i64 %111, 1
  store i64 %112, ptr %14, align 8, !tbaa !8
  br label %100, !llvm.loop !17

113:                                              ; preds = %104
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %13, align 8, !tbaa !8
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %13, align 8, !tbaa !8
  br label %94, !llvm.loop !18

117:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !8
  br label %118

118:                                              ; preds = %125, %117
  %119 = load i64, ptr %15, align 8, !tbaa !8
  %120 = load i64, ptr @N, align 8, !tbaa !8
  %121 = icmp slt i64 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %128

123:                                              ; preds = %118
  %124 = load i64, ptr %15, align 8, !tbaa !8
  call void @_Z3dijx(i64 noundef %124)
  br label %125

125:                                              ; preds = %123
  %126 = load i64, ptr %15, align 8, !tbaa !8
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %15, align 8, !tbaa !8
  br label %118, !llvm.loop !19

128:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !8
  br label %129

129:                                              ; preds = %153, %128
  %130 = load i64, ptr %16, align 8, !tbaa !8
  %131 = load i64, ptr @N, align 8, !tbaa !8
  %132 = icmp slt i64 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 20, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %156

134:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !8
  br label %135

135:                                              ; preds = %148, %134
  %136 = load i64, ptr %17, align 8, !tbaa !8
  %137 = load i64, ptr @N, align 8, !tbaa !8
  %138 = icmp slt i64 %136, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %135
  store i32 23, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %151

140:                                              ; preds = %135
  %141 = load i64, ptr %16, align 8, !tbaa !8
  %142 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %141
  %143 = load i64, ptr %17, align 8, !tbaa !8
  %144 = getelementptr inbounds [600 x i64], ptr %142, i64 0, i64 %143
  %145 = load i64, ptr %144, align 8, !tbaa !8
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %145)
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %146, i8 noundef signext 32)
  br label %148

148:                                              ; preds = %140
  %149 = load i64, ptr %17, align 8, !tbaa !8
  %150 = add nsw i64 %149, 1
  store i64 %150, ptr %17, align 8, !tbaa !8
  br label %135, !llvm.loop !20

151:                                              ; preds = %139
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  br label %153

153:                                              ; preds = %151
  %154 = load i64, ptr %16, align 8, !tbaa !8
  %155 = add nsw i64 %154, 1
  store i64 %155, ptr %16, align 8, !tbaa !8
  br label %129, !llvm.loop !21

156:                                              ; preds = %133
  %157 = load i32, ptr %1, align 4
  ret i32 %157
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__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)) #2 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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.mustprogress"}
!13 = !{!14, !9, i64 8}
!14 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !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::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 }
%"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" }
%"struct.std::pair" = type { i64, i64 }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@D = external dso_local local_unnamed_addr global [600 x [600 x i64]], align 16
@G = external dso_local global [600 x %"class.std::vector"], align 16
@mn = external dso_local local_unnamed_addr global [600 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dijx(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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::pair", align 8
  %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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = 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) @N)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %13 = load i64, ptr @M, align 8, !tbaa !8
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %.preheader45

.preheader45:                                     ; preds = %.lr.ph, %0
  %15 = load i64, ptr @N, align 8, !tbaa !8
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %.lr.ph51, label %._crit_edge62

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03946 = phi i64 [ %22, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %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) %2)
  %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) %3)
  %20 = load i64, ptr %1, align 8, !tbaa !8
  %21 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  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)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %22 = add nuw nsw i64 %.03946, 1
  %23 = load i64, ptr @M, align 8, !tbaa !8
  %24 = icmp slt i64 %22, %23
  br i1 %24, label %.lr.ph, label %.preheader45, !llvm.loop !11

.preheader44:                                     ; preds = %._crit_edge
  %25 = icmp sgt i64 %39, 0
  br i1 %25, label %.preheader43.us.preheader, label %._crit_edge62

.preheader43.us.preheader:                        ; preds = %.preheader44
  %min.iters.check = icmp ult i64 %39, 4
  %n.vec = and i64 %39, 9223372036854775804
  %cmp.n = icmp eq i64 %39, %n.vec
  br label %.preheader43.us

.preheader43.us:                                  ; preds = %.preheader43.us.preheader, %._crit_edge54.us
  %.03655.us = phi i64 [ %31, %._crit_edge54.us ], [ 0, %.preheader43.us.preheader ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader43.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader43.us ]
  %26 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %.03655.us, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %26, align 16, !tbaa !8
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %27, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge54.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader43.us
  %.03552.us.ph = phi i64 [ 0, %.preheader43.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.03552.us = phi i64 [ %30, %scalar.ph ], [ %.03552.us.ph, %scalar.ph.preheader ]
  %29 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %.03655.us, i64 %.03552.us
  store i64 1000000000000000, ptr %29, align 8, !tbaa !8
  %30 = add nuw nsw i64 %.03552.us, 1
  %exitcond.not = icmp eq i64 %30, %39
  br i1 %exitcond.not, label %._crit_edge54.us, label %scalar.ph, !llvm.loop !16

._crit_edge54.us:                                 ; preds = %scalar.ph, %middle.block
  %31 = add nuw nsw i64 %.03655.us, 1
  %exitcond64.not = icmp eq i64 %31, %39
  br i1 %exitcond64.not, label %.preheader42, label %.preheader43.us, !llvm.loop !17

.lr.ph51:                                         ; preds = %.preheader45, %._crit_edge
  %.04050 = phi i64 [ %38, %._crit_edge ], [ 0, %.preheader45 ]
  %32 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %.04050
  %33 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  %34 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %33, ptr %34)
  %35 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  %36 = icmp sgt i64 %35, 0
  br i1 %36, label %.lr.ph49, label %._crit_edge

.lr.ph49:                                         ; preds = %.lr.ph51
  %37 = getelementptr inbounds [600 x i64], ptr @mn, i64 0, i64 %.04050
  br label %41

._crit_edge:                                      ; preds = %50, %.lr.ph51
  %38 = add nuw nsw i64 %.04050, 1
  %39 = load i64, ptr @N, align 8, !tbaa !8
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %.lr.ph51, label %.preheader44, !llvm.loop !18

41:                                               ; preds = %.lr.ph49, %50
  %.03748 = phi i64 [ 0, %.lr.ph49 ], [ %51, %50 ]
  %.03847 = phi i64 [ 1000000000000000, %.lr.ph49 ], [ %.1, %50 ]
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %.03748) #6
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !19
  %45 = icmp slt i64 %44, %.03847
  br i1 %45, label %46, label %50

46:                                               ; preds = %41
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %.03748) #6
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load i64, ptr %48, align 8, !tbaa !19
  store i64 %.03748, ptr %37, align 8, !tbaa !8
  br label %50

50:                                               ; preds = %41, %46
  %.1 = phi i64 [ %49, %46 ], [ %.03847, %41 ]
  %51 = add nuw nsw i64 %.03748, 1
  %52 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  %53 = icmp slt i64 %51, %52
  br i1 %53, label %41, label %._crit_edge, !llvm.loop !21

.preheader42:                                     ; preds = %._crit_edge54.us
  br i1 %25, label %.lr.ph57, label %.preheader41

.preheader41:                                     ; preds = %.lr.ph57, %.preheader42
  %54 = phi i64 [ %39, %.preheader42 ], [ %57, %.lr.ph57 ]
  %55 = icmp sgt i64 %54, 0
  br i1 %55, label %.preheader, label %._crit_edge62

.lr.ph57:                                         ; preds = %.preheader42, %.lr.ph57
  %.03456 = phi i64 [ %56, %.lr.ph57 ], [ 0, %.preheader42 ]
  call void @_Z3dijx(i64 noundef %.03456)
  %56 = add nuw nsw i64 %.03456, 1
  %57 = load i64, ptr @N, align 8, !tbaa !8
  %58 = icmp slt i64 %56, %57
  br i1 %58, label %.lr.ph57, label %.preheader41, !llvm.loop !22

.preheader:                                       ; preds = %.preheader41, %._crit_edge60
  %59 = phi i64 [ %63, %._crit_edge60 ], [ %54, %.preheader41 ]
  %.03361 = phi i64 [ %62, %._crit_edge60 ], [ 0, %.preheader41 ]
  %60 = icmp sgt i64 %59, 0
  br i1 %60, label %.lr.ph59, label %._crit_edge60

._crit_edge62:                                    ; preds = %._crit_edge60, %.preheader44, %.preheader45, %.preheader41
  ret i32 0

._crit_edge60:                                    ; preds = %.lr.ph59, %.preheader
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %62 = add nuw nsw i64 %.03361, 1
  %63 = load i64, ptr @N, align 8, !tbaa !8
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %.preheader, label %._crit_edge62, !llvm.loop !23

.lr.ph59:                                         ; preds = %.preheader, %.lr.ph59
  %.058 = phi i64 [ %69, %.lr.ph59 ], [ 0, %.preheader ]
  %65 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %.03361, i64 %.058
  %66 = load i64, ptr %65, align 8, !tbaa !8
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %66)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %67, i8 noundef signext 32)
  %69 = add nuw nsw i64 %.058, 1
  %70 = load i64, ptr @N, align 8, !tbaa !8
  %71 = icmp slt i64 %69, %70
  br i1 %71, label %.lr.ph59, label %._crit_edge60, !llvm.loop !24
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__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 #2 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{!20, !9, i64 8}
!20 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}


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