; LLVM IR from eyangch/competitive-programming :: Codeforces/1203 (f2)

; 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"

%"struct.std::pair" = type { i64, i64 }
%"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.anon = type { i8 }

@N = external dso_local global i64, align 8
@R = external dso_local global i64, align 8
@nP = external dso_local global i64, align 8
@nN = external dso_local global i64, align 8
@ps = external dso_local global [100 x %"struct.std::pair"], align 16
@ne = external dso_local global [100 x %"struct.std::pair"], align 16
@dp = external dso_local global [101 x [101 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 norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %class.anon, align 1
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %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) @R)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %26

26:                                               ; preds = %49, %0
  %27 = load i64, ptr %2, align 8, !tbaa !8
  %28 = load i64, ptr @N, 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) #7
  br label %52

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %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 = load i64, ptr %4, align 8, !tbaa !8
  %35 = icmp sge i64 %34, 0
  br i1 %35, label %36, label %42

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %37 = load i64, ptr @nP, align 8, !tbaa !8
  %38 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ps, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  %40 = load i64, ptr @nP, align 8, !tbaa !8
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr @nP, align 8, !tbaa !8
  br label %48

42:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  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) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %43 = load i64, ptr @nN, align 8, !tbaa !8
  %44 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ne, i64 0, i64 %43
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #7
  %46 = load i64, ptr @nN, align 8, !tbaa !8
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr @nN, align 8, !tbaa !8
  br label %48

48:                                               ; preds = %42, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %49

49:                                               ; preds = %48
  %50 = load i64, ptr %2, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %2, align 8, !tbaa !8
  br label %26, !llvm.loop !11

52:                                               ; preds = %30
  %53 = load i64, ptr @nP, align 8, !tbaa !8
  %54 = getelementptr inbounds %"struct.std::pair", ptr @ps, i64 %53
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef @ps, ptr noundef %54)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %55

55:                                               ; preds = %77, %52
  %56 = load i64, ptr %8, align 8, !tbaa !8
  %57 = load i64, ptr @nP, align 8, !tbaa !8
  %58 = icmp slt i64 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %80

60:                                               ; preds = %55
  %61 = load i64, ptr @R, align 8, !tbaa !8
  %62 = load i64, ptr %8, align 8, !tbaa !8
  %63 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ps, i64 0, i64 %62
  %64 = getelementptr inbounds %"struct.std::pair", ptr %63, i32 0, i32 0
  %65 = load i64, ptr %64, align 16, !tbaa !13
  %66 = icmp sge i64 %61, %65
  br i1 %66, label %67, label %76

67:                                               ; preds = %60
  %68 = load i64, ptr %8, align 8, !tbaa !8
  %69 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ps, i64 0, i64 %68
  %70 = getelementptr inbounds %"struct.std::pair", ptr %69, i32 0, i32 1
  %71 = load i64, ptr %70, align 8, !tbaa !15
  %72 = load i64, ptr @R, align 8, !tbaa !8
  %73 = add nsw i64 %72, %71
  store i64 %73, ptr @R, align 8, !tbaa !8
  %74 = load i64, ptr %7, align 8, !tbaa !8
  %75 = add nsw i64 %74, 1
  store i64 %75, ptr %7, align 8, !tbaa !8
  br label %76

76:                                               ; preds = %67, %60
  br label %77

77:                                               ; preds = %76
  %78 = load i64, ptr %8, align 8, !tbaa !8
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %8, align 8, !tbaa !8
  br label %55, !llvm.loop !16

80:                                               ; preds = %59
  %81 = load i64, ptr @nN, align 8, !tbaa !8
  %82 = getelementptr inbounds %"struct.std::pair", ptr @ne, i64 %81
  call void @"_ZSt4sortIPSt4pairIxxEZ4mainE3$_0EvT_S4_T0_"(ptr noundef @ne, ptr noundef %82)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %83

83:                                               ; preds = %103, %80
  %84 = load i64, ptr %10, align 8, !tbaa !8
  %85 = load i64, ptr @nN, align 8, !tbaa !8
  %86 = icmp sle i64 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %106

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %89

89:                                               ; preds = %99, %88
  %90 = load i64, ptr %12, align 8, !tbaa !8
  %91 = load i64, ptr @nN, align 8, !tbaa !8
  %92 = icmp sle i64 %90, %91
  br i1 %92, label %94, label %93

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

94:                                               ; preds = %89
  %95 = load i64, ptr %10, align 8, !tbaa !8
  %96 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %95
  %97 = load i64, ptr %12, align 8, !tbaa !8
  %98 = getelementptr inbounds [101 x i64], ptr %96, i64 0, i64 %97
  store i64 -1, ptr %98, align 8, !tbaa !8
  br label %99

99:                                               ; preds = %94
  %100 = load i64, ptr %12, align 8, !tbaa !8
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %12, align 8, !tbaa !8
  br label %89, !llvm.loop !17

102:                                              ; preds = %93
  br label %103

103:                                              ; preds = %102
  %104 = load i64, ptr %10, align 8, !tbaa !8
  %105 = add nsw i64 %104, 1
  store i64 %105, ptr %10, align 8, !tbaa !8
  br label %83, !llvm.loop !18

106:                                              ; preds = %87
  %107 = load i64, ptr @R, align 8, !tbaa !8
  store i64 %107, ptr @dp, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 1, ptr %13, align 8, !tbaa !8
  br label %108

108:                                              ; preds = %181, %106
  %109 = load i64, ptr %13, align 8, !tbaa !8
  %110 = load i64, ptr @nN, align 8, !tbaa !8
  %111 = icmp sle i64 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %184

113:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %114

114:                                              ; preds = %177, %113
  %115 = load i64, ptr %14, align 8, !tbaa !8
  %116 = load i64, ptr %13, align 8, !tbaa !8
  %117 = icmp sle i64 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %180

119:                                              ; preds = %114
  %120 = load i64, ptr %13, align 8, !tbaa !8
  %121 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %120
  %122 = load i64, ptr %14, align 8, !tbaa !8
  %123 = getelementptr inbounds [101 x i64], ptr %121, i64 0, i64 %122
  %124 = load i64, ptr %13, align 8, !tbaa !8
  %125 = sub nsw i64 %124, 1
  %126 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %125
  %127 = load i64, ptr %14, align 8, !tbaa !8
  %128 = getelementptr inbounds [101 x i64], ptr %126, i64 0, i64 %127
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef nonnull align 8 dereferenceable(8) %128)
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = load i64, ptr %13, align 8, !tbaa !8
  %132 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %131
  %133 = load i64, ptr %14, align 8, !tbaa !8
  %134 = getelementptr inbounds [101 x i64], ptr %132, i64 0, i64 %133
  store i64 %130, ptr %134, align 8, !tbaa !8
  %135 = load i64, ptr %14, align 8, !tbaa !8
  %136 = icmp sgt i64 %135, 0
  br i1 %136, label %137, label %176

137:                                              ; preds = %119
  %138 = load i64, ptr %13, align 8, !tbaa !8
  %139 = sub nsw i64 %138, 1
  %140 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ne, i64 0, i64 %139
  %141 = getelementptr inbounds %"struct.std::pair", ptr %140, i32 0, i32 0
  %142 = load i64, ptr %141, align 16, !tbaa !13
  %143 = load i64, ptr %13, align 8, !tbaa !8
  %144 = sub nsw i64 %143, 1
  %145 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %144
  %146 = load i64, ptr %14, align 8, !tbaa !8
  %147 = sub nsw i64 %146, 1
  %148 = getelementptr inbounds [101 x i64], ptr %145, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = icmp sle i64 %142, %149
  br i1 %150, label %151, label %175

151:                                              ; preds = %137
  %152 = load i64, ptr %13, align 8, !tbaa !8
  %153 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %152
  %154 = load i64, ptr %14, align 8, !tbaa !8
  %155 = getelementptr inbounds [101 x i64], ptr %153, i64 0, i64 %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %156 = load i64, ptr %13, align 8, !tbaa !8
  %157 = sub nsw i64 %156, 1
  %158 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %157
  %159 = load i64, ptr %14, align 8, !tbaa !8
  %160 = sub nsw i64 %159, 1
  %161 = getelementptr inbounds [101 x i64], ptr %158, i64 0, i64 %160
  %162 = load i64, ptr %161, align 8, !tbaa !8
  %163 = load i64, ptr %13, align 8, !tbaa !8
  %164 = sub nsw i64 %163, 1
  %165 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ne, i64 0, i64 %164
  %166 = getelementptr inbounds %"struct.std::pair", ptr %165, i32 0, i32 1
  %167 = load i64, ptr %166, align 8, !tbaa !15
  %168 = add nsw i64 %162, %167
  store i64 %168, ptr %15, align 8, !tbaa !8
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %170 = load i64, ptr %169, align 8, !tbaa !8
  %171 = load i64, ptr %13, align 8, !tbaa !8
  %172 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %171
  %173 = load i64, ptr %14, align 8, !tbaa !8
  %174 = getelementptr inbounds [101 x i64], ptr %172, i64 0, i64 %173
  store i64 %170, ptr %174, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %175

175:                                              ; preds = %151, %137
  br label %176

176:                                              ; preds = %175, %119
  br label %177

177:                                              ; preds = %176
  %178 = load i64, ptr %14, align 8, !tbaa !8
  %179 = add nsw i64 %178, 1
  store i64 %179, ptr %14, align 8, !tbaa !8
  br label %114, !llvm.loop !19

180:                                              ; preds = %118
  br label %181

181:                                              ; preds = %180
  %182 = load i64, ptr %13, align 8, !tbaa !8
  %183 = add nsw i64 %182, 1
  store i64 %183, ptr %13, align 8, !tbaa !8
  br label %108, !llvm.loop !20

184:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !8
  br label %185

185:                                              ; preds = %201, %184
  %186 = load i64, ptr %17, align 8, !tbaa !8
  %187 = load i64, ptr @nN, align 8, !tbaa !8
  %188 = icmp sle i64 %186, %187
  br i1 %188, label %190, label %189

189:                                              ; preds = %185
  store i32 20, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %204

190:                                              ; preds = %185
  %191 = load i64, ptr @nN, align 8, !tbaa !8
  %192 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %191
  %193 = load i64, ptr %17, align 8, !tbaa !8
  %194 = getelementptr inbounds [101 x i64], ptr %192, i64 0, i64 %193
  %195 = load i64, ptr %194, align 8, !tbaa !8
  %196 = icmp sge i64 %195, 0
  br i1 %196, label %197, label %200

197:                                              ; preds = %190
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %199 = load i64, ptr %198, align 8, !tbaa !8
  store i64 %199, ptr %16, align 8, !tbaa !8
  br label %200

200:                                              ; preds = %197, %190
  br label %201

201:                                              ; preds = %200
  %202 = load i64, ptr %17, align 8, !tbaa !8
  %203 = add nsw i64 %202, 1
  store i64 %203, ptr %17, align 8, !tbaa !8
  br label %185, !llvm.loop !21

204:                                              ; preds = %189
  %205 = load i64, ptr %16, align 8, !tbaa !8
  %206 = load i64, ptr %7, align 8, !tbaa !8
  %207 = add nsw i64 %205, %206
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %207)
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %208, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  %210 = load i32, ptr %1, align 4
  ret i32 %210
}

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPSt4pairIxxEZ4mainE3$_0EvT_S4_T0_"(ptr noundef, ptr noundef) #5

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

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

attributes #0 = { 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 #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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.mustprogress"}
!13 = !{!14, !9, i64 0}
!14 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!15 = !{!14, !9, i64 8}
!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"

%"struct.std::pair" = type { i64, i64 }
%"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" }

@N = external dso_local global i64, align 8
@R = external dso_local global i64, align 8
@nP = external dso_local local_unnamed_addr global i64, align 8
@nN = external dso_local local_unnamed_addr global i64, align 8
@ps = external dso_local global [100 x %"struct.std::pair"], align 16
@ne = external dso_local global [100 x %"struct.std::pair"], align 16
@dp = external dso_local global [101 x [101 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = 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)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @R)
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %35, %0
  %18 = load i64, ptr @nP, align 8, !tbaa !8
  %19 = getelementptr inbounds %"struct.std::pair", ptr @ps, i64 %18
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull @ps, ptr noundef nonnull %19)
  %20 = load i64, ptr @nP, align 8, !tbaa !8
  %21 = icmp sgt i64 %20, 0
  br i1 %21, label %.lr.ph58.preheader, label %._crit_edge59

.lr.ph58.preheader:                               ; preds = %._crit_edge
  %R.promoted = load i64, ptr @R, align 8, !tbaa !8
  %xtraiter = and i64 %20, 1
  %22 = icmp eq i64 %20, 1
  br i1 %22, label %._crit_edge59.loopexit.unr-lcssa, label %.lr.ph58.preheader.new

.lr.ph58.preheader.new:                           ; preds = %.lr.ph58.preheader
  %unroll_iter = and i64 %20, 9223372036854775806
  br label %.lr.ph58

.lr.ph:                                           ; preds = %0, %35
  %.04254 = phi i64 [ %38, %35 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %23 = 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)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %25 = load i64, ptr %2, align 8, !tbaa !8
  %26 = icmp sgt i64 %25, -1
  br i1 %26, label %27, label %31

27:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %28 = load i64, ptr @nP, align 8, !tbaa !8
  %29 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ps, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(16) %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  br label %35

31:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  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) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %32 = load i64, ptr @nN, align 8, !tbaa !8
  %33 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ne, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  br label %35

35:                                               ; preds = %31, %27
  %nN.sink87 = phi ptr [ @nN, %31 ], [ @nP, %27 ]
  %36 = load i64, ptr %nN.sink87, align 8, !tbaa !8
  %37 = add nsw i64 %36, 1
  store i64 %37, ptr %nN.sink87, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %38 = add nuw nsw i64 %.04254, 1
  %39 = load i64, ptr @N, align 8, !tbaa !8
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge59.loopexit.unr-lcssa:                 ; preds = %73, %.lr.ph58.preheader
  %.1.lcssa.ph = phi i64 [ poison, %.lr.ph58.preheader ], [ %.1.1, %73 ]
  %.04056.unr = phi i64 [ 0, %.lr.ph58.preheader ], [ %75, %73 ]
  %.04155.unr = phi i64 [ 0, %.lr.ph58.preheader ], [ %.1.1, %73 ]
  %.unr = phi i64 [ %R.promoted, %.lr.ph58.preheader ], [ %74, %73 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge59, label %.lr.ph58.epil

.lr.ph58.epil:                                    ; preds = %._crit_edge59.loopexit.unr-lcssa
  %41 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ps, i64 0, i64 %.04056.unr
  %42 = load i64, ptr %41, align 16, !tbaa !13
  %.not52.epil = icmp slt i64 %.unr, %42
  br i1 %.not52.epil, label %._crit_edge59, label %43

43:                                               ; preds = %.lr.ph58.epil
  %44 = getelementptr inbounds i8, ptr %41, i64 8
  %45 = load i64, ptr %44, align 8, !tbaa !15
  %46 = add nsw i64 %45, %.unr
  store i64 %46, ptr @R, align 8, !tbaa !8
  %47 = add nsw i64 %.04155.unr, 1
  br label %._crit_edge59

._crit_edge59:                                    ; preds = %._crit_edge59.loopexit.unr-lcssa, %43, %.lr.ph58.epil, %._crit_edge
  %.041.lcssa = phi i64 [ 0, %._crit_edge ], [ %.1.lcssa.ph, %._crit_edge59.loopexit.unr-lcssa ], [ %47, %43 ], [ %.04155.unr, %.lr.ph58.epil ]
  %48 = load i64, ptr @nN, align 8, !tbaa !8
  %49 = getelementptr inbounds %"struct.std::pair", ptr @ne, i64 %48
  call void @"_ZSt4sortIPSt4pairIxxEZ4mainE3$_0EvT_S4_T0_"(ptr noundef nonnull @ne, ptr noundef nonnull %49)
  %50 = load i64, ptr @nN, align 8, !tbaa !8
  %.not64 = icmp slt i64 %50, 0
  br i1 %.not64, label %._crit_edge70.thread, label %.preheader53.preheader

._crit_edge70.thread:                             ; preds = %._crit_edge59
  %51 = load i64, ptr @R, align 8, !tbaa !8
  store i64 %51, ptr @dp, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  br label %._crit_edge75

.preheader53.preheader:                           ; preds = %._crit_edge59
  %52 = shl i64 %50, 3
  %53 = add i64 %52, 8
  %54 = add nuw i64 %50, 1
  %xtraiter91 = and i64 %54, 7
  %55 = icmp ult i64 %50, 7
  br i1 %55, label %._crit_edge66.unr-lcssa, label %.preheader53.preheader.new

.preheader53.preheader.new:                       ; preds = %.preheader53.preheader
  %unroll_iter93 = and i64 %54, -8
  br label %.preheader53

.lr.ph58:                                         ; preds = %73, %.lr.ph58.preheader.new
  %.04056 = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %75, %73 ]
  %.04155 = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %.1.1, %73 ]
  %56 = phi i64 [ %R.promoted, %.lr.ph58.preheader.new ], [ %74, %73 ]
  %niter = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %niter.next.1, %73 ]
  %57 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ps, i64 0, i64 %.04056
  %58 = load i64, ptr %57, align 16, !tbaa !13
  %.not52 = icmp slt i64 %56, %58
  br i1 %.not52, label %.lr.ph58.1, label %59

59:                                               ; preds = %.lr.ph58
  %60 = getelementptr inbounds i8, ptr %57, i64 8
  %61 = load i64, ptr %60, align 8, !tbaa !15
  %62 = add nsw i64 %61, %56
  store i64 %62, ptr @R, align 8, !tbaa !8
  %63 = add nsw i64 %.04155, 1
  br label %.lr.ph58.1

.lr.ph58.1:                                       ; preds = %.lr.ph58, %59
  %64 = phi i64 [ %62, %59 ], [ %56, %.lr.ph58 ]
  %.1 = phi i64 [ %63, %59 ], [ %.04155, %.lr.ph58 ]
  %65 = or disjoint i64 %.04056, 1
  %66 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ps, i64 0, i64 %65
  %67 = load i64, ptr %66, align 16, !tbaa !13
  %.not52.1 = icmp slt i64 %64, %67
  br i1 %.not52.1, label %73, label %68

68:                                               ; preds = %.lr.ph58.1
  %69 = getelementptr inbounds i8, ptr %66, i64 8
  %70 = load i64, ptr %69, align 8, !tbaa !15
  %71 = add nsw i64 %70, %64
  store i64 %71, ptr @R, align 8, !tbaa !8
  %72 = add nsw i64 %.1, 1
  br label %73

73:                                               ; preds = %68, %.lr.ph58.1
  %74 = phi i64 [ %71, %68 ], [ %64, %.lr.ph58.1 ]
  %.1.1 = phi i64 [ %72, %68 ], [ %.1, %.lr.ph58.1 ]
  %75 = add nuw nsw i64 %.04056, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge59.loopexit.unr-lcssa, label %.lr.ph58, !llvm.loop !16

.preheader53:                                     ; preds = %.preheader53, %.preheader53.preheader.new
  %.03965 = phi i64 [ 0, %.preheader53.preheader.new ], [ %84, %.preheader53 ]
  %niter94 = phi i64 [ 0, %.preheader53.preheader.new ], [ %niter94.next.7, %.preheader53 ]
  %76 = mul nuw nsw i64 %.03965, 808
  %scevgep = getelementptr i8, ptr @dp, i64 %76
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 -1, i64 %53, i1 false), !tbaa !8
  %77 = mul nuw i64 %.03965, 808
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 808), i64 %77
  call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 -1, i64 %53, i1 false), !tbaa !8
  %78 = mul nuw i64 %.03965, 808
  %gep99 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 1616), i64 %78
  call void @llvm.memset.p0.i64(ptr align 16 %gep99, i8 -1, i64 %53, i1 false), !tbaa !8
  %79 = mul nuw i64 %.03965, 808
  %gep100 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 2424), i64 %79
  call void @llvm.memset.p0.i64(ptr align 8 %gep100, i8 -1, i64 %53, i1 false), !tbaa !8
  %80 = mul nuw i64 %.03965, 808
  %gep101 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 3232), i64 %80
  call void @llvm.memset.p0.i64(ptr align 16 %gep101, i8 -1, i64 %53, i1 false), !tbaa !8
  %81 = mul nuw i64 %.03965, 808
  %gep102 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 4040), i64 %81
  call void @llvm.memset.p0.i64(ptr align 8 %gep102, i8 -1, i64 %53, i1 false), !tbaa !8
  %82 = mul nuw i64 %.03965, 808
  %gep103 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 4848), i64 %82
  call void @llvm.memset.p0.i64(ptr align 16 %gep103, i8 -1, i64 %53, i1 false), !tbaa !8
  %83 = mul nuw i64 %.03965, 808
  %gep104 = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 5656), i64 %83
  call void @llvm.memset.p0.i64(ptr align 8 %gep104, i8 -1, i64 %53, i1 false), !tbaa !8
  %84 = add nuw i64 %.03965, 8
  %niter94.next.7 = add i64 %niter94, 8
  %niter94.ncmp.7 = icmp eq i64 %niter94.next.7, %unroll_iter93
  br i1 %niter94.ncmp.7, label %._crit_edge66.unr-lcssa, label %.preheader53, !llvm.loop !17

._crit_edge66.unr-lcssa:                          ; preds = %.preheader53, %.preheader53.preheader
  %.03965.unr = phi i64 [ 0, %.preheader53.preheader ], [ %84, %.preheader53 ]
  %lcmp.mod92.not = icmp eq i64 %xtraiter91, 0
  br i1 %lcmp.mod92.not, label %._crit_edge66, label %.preheader53.epil

.preheader53.epil:                                ; preds = %._crit_edge66.unr-lcssa, %.preheader53.epil
  %.03965.epil = phi i64 [ %86, %.preheader53.epil ], [ %.03965.unr, %._crit_edge66.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader53.epil ], [ 0, %._crit_edge66.unr-lcssa ]
  %85 = mul nuw nsw i64 %.03965.epil, 808
  %scevgep.epil = getelementptr i8, ptr @dp, i64 %85
  call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 -1, i64 %53, i1 false), !tbaa !8
  %86 = add nuw i64 %.03965.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter91
  br i1 %epil.iter.cmp.not, label %._crit_edge66, label %.preheader53.epil, !llvm.loop !18

._crit_edge66:                                    ; preds = %.preheader53.epil, %._crit_edge66.unr-lcssa
  %87 = load i64, ptr @R, align 8, !tbaa !8
  store i64 %87, ptr @dp, align 16, !tbaa !8
  %.not4668 = icmp eq i64 %50, 0
  br i1 %.not4668, label %._crit_edge70, label %.peel.next

.peel.next:                                       ; preds = %._crit_edge66, %.loopexit
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit ], [ 2, %._crit_edge66 ]
  %.03769 = phi i64 [ %96, %.loopexit ], [ 1, %._crit_edge66 ]
  %88 = add nsw i64 %.03769, -1
  %89 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @ne, i64 0, i64 %88
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %.03769, i64 0
  %92 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %88, i64 0
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef nonnull align 8 dereferenceable(8) %92)
  %94 = load i64, ptr %93, align 8, !tbaa !8
  store i64 %94, ptr %91, align 8, !tbaa !8
  br label %98

._crit_edge70:                                    ; preds = %.loopexit, %._crit_edge66
  %95 = phi i64 [ %50, %._crit_edge66 ], [ %97, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  store i64 0, ptr %7, align 8, !tbaa !8
  %.not4771 = icmp slt i64 %95, 0
  br i1 %.not4771, label %._crit_edge75, label %.lr.ph74

.loopexit:                                        ; preds = %112
  %96 = add nuw nsw i64 %.03769, 1
  %97 = load i64, ptr @nN, align 8, !tbaa !8
  %.not46.not = icmp slt i64 %.03769, %97
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  br i1 %.not46.not, label %.peel.next, label %._crit_edge70, !llvm.loop !20

98:                                               ; preds = %112, %.peel.next
  %.067 = phi i64 [ 1, %.peel.next ], [ %113, %112 ]
  %99 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %.03769, i64 %.067
  %100 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %88, i64 %.067
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull align 8 dereferenceable(8) %100)
  %102 = load i64, ptr %101, align 8, !tbaa !8
  store i64 %102, ptr %99, align 8, !tbaa !8
  %103 = load i64, ptr %89, align 16, !tbaa !13
  %104 = add nsw i64 %.067, -1
  %105 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %88, i64 %104
  %106 = load i64, ptr %105, align 8, !tbaa !8
  %.not50 = icmp sgt i64 %103, %106
  br i1 %.not50, label %112, label %107

107:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %108 = load i64, ptr %90, align 8, !tbaa !15
  %109 = add nsw i64 %108, %106
  store i64 %109, ptr %5, align 8, !tbaa !8
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %111 = load i64, ptr %110, align 8, !tbaa !8
  store i64 %111, ptr %99, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %112

112:                                              ; preds = %107, %98
  %113 = add nuw i64 %.067, 1
  %exitcond77.not = icmp eq i64 %113, %indvars.iv
  br i1 %exitcond77.not, label %.loopexit, label %98, !llvm.loop !21

._crit_edge75:                                    ; preds = %126, %._crit_edge70.thread, %._crit_edge70
  %114 = phi i64 [ 0, %._crit_edge70 ], [ 0, %._crit_edge70.thread ], [ %127, %126 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  %115 = add nsw i64 %114, %.041.lcssa
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %115)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %116, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  ret i32 0

.lr.ph74:                                         ; preds = %._crit_edge70, %126
  %118 = phi i64 [ %127, %126 ], [ 0, %._crit_edge70 ]
  %119 = phi i64 [ %128, %126 ], [ %95, %._crit_edge70 ]
  %storemerge72 = phi i64 [ %130, %126 ], [ 0, %._crit_edge70 ]
  %120 = getelementptr inbounds [101 x [101 x i64]], ptr @dp, i64 0, i64 %119, i64 %storemerge72
  %121 = load i64, ptr %120, align 8, !tbaa !8
  %122 = icmp sgt i64 %121, -1
  br i1 %122, label %123, label %126

123:                                              ; preds = %.lr.ph74
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %125 = load i64, ptr %124, align 8, !tbaa !8
  store i64 %125, ptr %6, align 8, !tbaa !8
  %.pre = load i64, ptr %7, align 8, !tbaa !8
  %.pre82 = load i64, ptr @nN, align 8, !tbaa !8
  br label %126

126:                                              ; preds = %.lr.ph74, %123
  %127 = phi i64 [ %118, %.lr.ph74 ], [ %125, %123 ]
  %128 = phi i64 [ %119, %.lr.ph74 ], [ %.pre82, %123 ]
  %129 = phi i64 [ %storemerge72, %.lr.ph74 ], [ %.pre, %123 ]
  %130 = add nsw i64 %129, 1
  store i64 %130, ptr %7, align 8, !tbaa !8
  %.not47.not = icmp slt i64 %129, %128
  br i1 %.not47.not, label %.lr.ph74, label %._crit_edge75, !llvm.loop !23
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPSt4pairIxxEZ4mainE3$_0EvT_S4_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

attributes #0 = { 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 #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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: write) }
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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 0}
!14 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!15 = !{!14, !9, i64 8}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12, !22}
!22 = !{!"llvm.loop.peeled.count", i32 1}
!23 = distinct !{!23, !12}


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