; LLVM IR from eyangch/competitive-programming :: Codeforces/1029 (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"

%"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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@og = external dso_local global [200000 x i64], align 16
@a = external dso_local global [11 x [200000 x %"struct.std::pair"]], 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 i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %22 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %23 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %25
  %27 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %26, ptr noundef null)
  %28 = 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)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %30

30:                                               ; preds = %86, %0
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  %36 = load i64, ptr %2, align 8, !tbaa !8
  %37 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %36
  %38 = getelementptr inbounds %"struct.std::pair", ptr %37, i32 0, i32 0
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %38)
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %40
  %42 = getelementptr inbounds %"struct.std::pair", ptr %41, i32 0, i32 0
  %43 = load i64, ptr %42, align 16, !tbaa !11
  %44 = load i64, ptr %2, align 8, !tbaa !8
  %45 = getelementptr inbounds [200000 x i64], ptr @og, i64 0, i64 %44
  store i64 %43, ptr %45, align 8, !tbaa !8
  %46 = load i64, ptr @K, align 8, !tbaa !8
  %47 = load i64, ptr %2, align 8, !tbaa !8
  %48 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %47
  %49 = getelementptr inbounds %"struct.std::pair", ptr %48, i32 0, i32 0
  %50 = load i64, ptr %49, align 16, !tbaa !11
  %51 = srem i64 %50, %46
  store i64 %51, ptr %49, align 16, !tbaa !11
  %52 = load i64, ptr %2, align 8, !tbaa !8
  %53 = load i64, ptr %2, align 8, !tbaa !8
  %54 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %53
  %55 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 1
  store i64 %52, ptr %55, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 1, ptr %4, align 8, !tbaa !8
  br label %56

56:                                               ; preds = %82, %35
  %57 = load i64, ptr %4, align 8, !tbaa !8
  %58 = icmp slt i64 %57, 11
  br i1 %58, label %60, label %59

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

60:                                               ; preds = %56
  %61 = load i64, ptr %4, align 8, !tbaa !8
  %62 = sub nsw i64 %61, 1
  %63 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %62
  %64 = load i64, ptr %2, align 8, !tbaa !8
  %65 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %63, i64 0, i64 %64
  %66 = getelementptr inbounds %"struct.std::pair", ptr %65, i32 0, i32 0
  %67 = load i64, ptr %66, align 16, !tbaa !11
  %68 = mul nsw i64 %67, 10
  %69 = load i64, ptr @K, align 8, !tbaa !8
  %70 = srem i64 %68, %69
  %71 = load i64, ptr %4, align 8, !tbaa !8
  %72 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %71
  %73 = load i64, ptr %2, align 8, !tbaa !8
  %74 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %72, i64 0, i64 %73
  %75 = getelementptr inbounds %"struct.std::pair", ptr %74, i32 0, i32 0
  store i64 %70, ptr %75, align 16, !tbaa !11
  %76 = load i64, ptr %2, align 8, !tbaa !8
  %77 = load i64, ptr %4, align 8, !tbaa !8
  %78 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %77
  %79 = load i64, ptr %2, align 8, !tbaa !8
  %80 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %78, i64 0, i64 %79
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 1
  store i64 %76, ptr %81, align 8, !tbaa !13
  br label %82

82:                                               ; preds = %60
  %83 = load i64, ptr %4, align 8, !tbaa !8
  %84 = add nsw i64 %83, 1
  store i64 %84, ptr %4, align 8, !tbaa !8
  br label %56, !llvm.loop !14

85:                                               ; preds = %59
  br label %86

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

89:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %90

90:                                               ; preds = %103, %89
  %91 = load i64, ptr %5, align 8, !tbaa !8
  %92 = icmp slt i64 %91, 11
  br i1 %92, label %94, label %93

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

94:                                               ; preds = %90
  %95 = load i64, ptr %5, align 8, !tbaa !8
  %96 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %95
  %97 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %96, i64 0, i64 0
  %98 = load i64, ptr %5, align 8, !tbaa !8
  %99 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %98
  %100 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %99, i64 0, i64 0
  %101 = load i64, ptr @N, align 8, !tbaa !8
  %102 = getelementptr inbounds %"struct.std::pair", ptr %100, i64 %101
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef %97, ptr noundef %102)
  br label %103

103:                                              ; preds = %94
  %104 = load i64, ptr %5, align 8, !tbaa !8
  %105 = add nsw i64 %104, 1
  store i64 %105, ptr %5, align 8, !tbaa !8
  br label %90, !llvm.loop !17

106:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 -1, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %107

107:                                              ; preds = %201, %106
  %108 = load i64, ptr %8, align 8, !tbaa !8
  %109 = load i64, ptr @N, align 8, !tbaa !8
  %110 = icmp slt i64 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %204

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %113 = load i64, ptr %8, align 8, !tbaa !8
  %114 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %113
  %115 = getelementptr inbounds %"struct.std::pair", ptr %114, i32 0, i32 1
  %116 = load i64, ptr %115, align 8, !tbaa !13
  store i64 %116, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %117 = load i64, ptr %8, align 8, !tbaa !8
  %118 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %117
  %119 = getelementptr inbounds %"struct.std::pair", ptr %118, i32 0, i32 0
  %120 = load i64, ptr %119, align 16, !tbaa !11
  store i64 %120, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  %121 = load i64, ptr %9, align 8, !tbaa !8
  %122 = getelementptr inbounds [200000 x i64], ptr @og, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !8
  call void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %12, i64 noundef %123)
  %124 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  store i64 %124, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %125 = load i64, ptr %11, align 8, !tbaa !8
  %126 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %125
  %127 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %126, i64 0, i64 0
  %128 = load i64, ptr %11, align 8, !tbaa !8
  %129 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %128
  %130 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %129, i64 0, i64 0
  %131 = load i64, ptr @N, align 8, !tbaa !8
  %132 = getelementptr inbounds %"struct.std::pair", ptr %130, i64 %131
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %133 = load i64, ptr @K, align 8, !tbaa !8
  %134 = load i64, ptr %10, align 8, !tbaa !8
  %135 = sub nsw i64 %133, %134
  %136 = load i64, ptr @K, align 8, !tbaa !8
  %137 = srem i64 %135, %136
  store i64 %137, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 2147483647, ptr %16, align 4, !tbaa !18
  call void @_ZNSt4pairIxxEC2IxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %138 = call noundef ptr @_ZSt11upper_boundIPSt4pairIxxES1_ET_S3_S3_RKT0_(ptr noundef %127, ptr noundef %132, ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  store ptr %138, ptr %13, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %139 = load i64, ptr %11, align 8, !tbaa !8
  %140 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %139
  %141 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %140, i64 0, i64 0
  %142 = load i64, ptr %11, align 8, !tbaa !8
  %143 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %142
  %144 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr %143, i64 0, i64 0
  %145 = load i64, ptr @N, align 8, !tbaa !8
  %146 = getelementptr inbounds %"struct.std::pair", ptr %144, i64 %145
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %147 = load i64, ptr @K, align 8, !tbaa !8
  %148 = load i64, ptr %10, align 8, !tbaa !8
  %149 = sub nsw i64 %147, %148
  %150 = load i64, ptr @K, align 8, !tbaa !8
  %151 = srem i64 %149, %150
  store i64 %151, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !18
  call void @_ZNSt4pairIxxEC2IxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %152 = call noundef ptr @_ZSt11lower_boundIPSt4pairIxxES1_ET_S3_S3_RKT0_(ptr noundef %141, ptr noundef %146, ptr noundef nonnull align 8 dereferenceable(16) %18)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  store ptr %152, ptr %17, align 8, !tbaa !20
  %153 = load ptr, ptr %13, align 8, !tbaa !20
  %154 = load ptr, ptr %17, align 8, !tbaa !20
  %155 = ptrtoint ptr %153 to i64
  %156 = ptrtoint ptr %154 to i64
  %157 = sub i64 %155, %156
  %158 = sdiv exact i64 %157, 16
  %159 = icmp slt i64 %158, 0
  br i1 %159, label %160, label %161

160:                                              ; preds = %112
  store i32 13, ptr %3, align 4
  br label %198

161:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store i64 0, ptr %21, align 8, !tbaa !8
  br label %162

162:                                              ; preds = %173, %161
  %163 = load i64, ptr %21, align 8, !tbaa !8
  %164 = load i64, ptr %11, align 8, !tbaa !8
  %165 = icmp slt i64 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %176

167:                                              ; preds = %162
  %168 = load i64, ptr %10, align 8, !tbaa !8
  %169 = mul nsw i64 %168, 10
  store i64 %169, ptr %10, align 8, !tbaa !8
  %170 = load i64, ptr @K, align 8, !tbaa !8
  %171 = load i64, ptr %10, align 8, !tbaa !8
  %172 = srem i64 %171, %170
  store i64 %172, ptr %10, align 8, !tbaa !8
  br label %173

173:                                              ; preds = %167
  %174 = load i64, ptr %21, align 8, !tbaa !8
  %175 = add nsw i64 %174, 1
  store i64 %175, ptr %21, align 8, !tbaa !8
  br label %162, !llvm.loop !22

176:                                              ; preds = %166
  %177 = load i64, ptr %10, align 8, !tbaa !8
  %178 = load i64, ptr %8, align 8, !tbaa !8
  %179 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %178
  %180 = getelementptr inbounds %"struct.std::pair", ptr %179, i32 0, i32 0
  %181 = load i64, ptr %180, align 16, !tbaa !11
  %182 = add nsw i64 %177, %181
  %183 = load i64, ptr @K, align 8, !tbaa !8
  %184 = srem i64 %182, %183
  %185 = icmp eq i64 %184, 0
  br i1 %185, label %186, label %189

186:                                              ; preds = %176
  %187 = load i64, ptr %6, align 8, !tbaa !8
  %188 = add nsw i64 %187, -1
  store i64 %188, ptr %6, align 8, !tbaa !8
  br label %189

189:                                              ; preds = %186, %176
  %190 = load ptr, ptr %13, align 8, !tbaa !20
  %191 = load ptr, ptr %17, align 8, !tbaa !20
  %192 = ptrtoint ptr %190 to i64
  %193 = ptrtoint ptr %191 to i64
  %194 = sub i64 %192, %193
  %195 = sdiv exact i64 %194, 16
  %196 = load i64, ptr %6, align 8, !tbaa !8
  %197 = add nsw i64 %196, %195
  store i64 %197, ptr %6, align 8, !tbaa !8
  store i32 0, ptr %3, align 4
  br label %198

198:                                              ; preds = %189, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %199 = load i32, ptr %3, align 4
  switch i32 %199, label %209 [
    i32 0, label %200
    i32 13, label %201
  ]

200:                                              ; preds = %198
  br label %201

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

204:                                              ; preds = %111
  %205 = load i64, ptr %6, align 8, !tbaa !8
  %206 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %205)
  %207 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %206, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %208 = load i32, ptr %1, align 4
  ret i32 %208

209:                                              ; preds = %198
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 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: 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 dso_local void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11upper_boundIPSt4pairIxxES1_ET_S3_S3_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPSt4pairIxxES1_ET_S3_S3_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) #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

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

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 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 = { 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, !9, i64 0}
!12 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!13 = !{!12, !9, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !10, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"any pointer", !10, i64 0}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}


; 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" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@og = external dso_local local_unnamed_addr global [200000 x i64], align 16
@a = external dso_local global [11 x [200000 x %"struct.std::pair"]], 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 %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %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) @K)
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %.preheader54

.preheader54:                                     ; preds = %.lr.ph, %0
  %18 = phi i64 [ %16, %0 ], [ %90, %.lr.ph ]
  %19 = getelementptr inbounds %"struct.std::pair", ptr @a, i64 %18
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull @a, ptr noundef nonnull %19)
  %20 = load i64, ptr @N, align 8, !tbaa !8
  %21 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 3200000), i64 %20
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 3200000), ptr noundef nonnull %21)
  %22 = load i64, ptr @N, align 8, !tbaa !8
  %23 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 6400000), i64 %22
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 6400000), ptr noundef nonnull %23)
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 9600000), i64 %24
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 9600000), ptr noundef nonnull %25)
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 12800000), i64 %26
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 12800000), ptr noundef nonnull %27)
  %28 = load i64, ptr @N, align 8, !tbaa !8
  %29 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 16000000), i64 %28
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 16000000), ptr noundef nonnull %29)
  %30 = load i64, ptr @N, align 8, !tbaa !8
  %31 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 19200000), i64 %30
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 19200000), ptr noundef nonnull %31)
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 22400000), i64 %32
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 22400000), ptr noundef nonnull %33)
  %34 = load i64, ptr @N, align 8, !tbaa !8
  %35 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 25600000), i64 %34
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 25600000), ptr noundef nonnull %35)
  %36 = load i64, ptr @N, align 8, !tbaa !8
  %37 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 28800000), i64 %36
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 28800000), ptr noundef nonnull %37)
  %38 = load i64, ptr @N, align 8, !tbaa !8
  %39 = getelementptr inbounds %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 32000000), i64 %38
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 32000000), ptr noundef nonnull %39)
  %40 = load i64, ptr @N, align 8, !tbaa !8
  %41 = icmp sgt i64 %40, 0
  br i1 %41, label %.lr.ph63, label %._crit_edge64

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.04656 = phi i64 [ %89, %.lr.ph ], [ 0, %0 ]
  %42 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %.04656
  %43 = 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) %42)
  %44 = load i64, ptr %42, align 16, !tbaa !11
  %45 = getelementptr inbounds [200000 x i64], ptr @og, i64 0, i64 %.04656
  store i64 %44, ptr %45, align 8, !tbaa !8
  %46 = load i64, ptr @K, align 8, !tbaa !8
  %47 = srem i64 %44, %46
  store i64 %47, ptr %42, align 16, !tbaa !11
  %48 = getelementptr inbounds i8, ptr %42, i64 8
  store i64 %.04656, ptr %48, align 8, !tbaa !13
  %49 = mul nsw i64 %47, 10
  %50 = srem i64 %49, %46
  %51 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 1, i64 %.04656
  store i64 %50, ptr %51, align 16, !tbaa !11
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  store i64 %.04656, ptr %52, align 8, !tbaa !13
  %53 = mul nsw i64 %50, 10
  %54 = srem i64 %53, %46
  %55 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 2, i64 %.04656
  store i64 %54, ptr %55, align 16, !tbaa !11
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  store i64 %.04656, ptr %56, align 8, !tbaa !13
  %57 = mul nsw i64 %54, 10
  %58 = srem i64 %57, %46
  %59 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 3, i64 %.04656
  store i64 %58, ptr %59, align 16, !tbaa !11
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  store i64 %.04656, ptr %60, align 8, !tbaa !13
  %61 = mul nsw i64 %58, 10
  %62 = srem i64 %61, %46
  %63 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 4, i64 %.04656
  store i64 %62, ptr %63, align 16, !tbaa !11
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  store i64 %.04656, ptr %64, align 8, !tbaa !13
  %65 = mul nsw i64 %62, 10
  %66 = srem i64 %65, %46
  %67 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 5, i64 %.04656
  store i64 %66, ptr %67, align 16, !tbaa !11
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  store i64 %.04656, ptr %68, align 8, !tbaa !13
  %69 = mul nsw i64 %66, 10
  %70 = srem i64 %69, %46
  %71 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 6, i64 %.04656
  store i64 %70, ptr %71, align 16, !tbaa !11
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  store i64 %.04656, ptr %72, align 8, !tbaa !13
  %73 = mul nsw i64 %70, 10
  %74 = srem i64 %73, %46
  %75 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 7, i64 %.04656
  store i64 %74, ptr %75, align 16, !tbaa !11
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  store i64 %.04656, ptr %76, align 8, !tbaa !13
  %77 = mul nsw i64 %74, 10
  %78 = srem i64 %77, %46
  %79 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 8, i64 %.04656
  store i64 %78, ptr %79, align 16, !tbaa !11
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  store i64 %.04656, ptr %80, align 8, !tbaa !13
  %81 = mul nsw i64 %78, 10
  %82 = srem i64 %81, %46
  %83 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 9, i64 %.04656
  store i64 %82, ptr %83, align 16, !tbaa !11
  %84 = getelementptr inbounds i8, ptr %83, i64 8
  store i64 %.04656, ptr %84, align 8, !tbaa !13
  %85 = mul nsw i64 %82, 10
  %86 = srem i64 %85, %46
  %87 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 10, i64 %.04656
  store i64 %86, ptr %87, align 16, !tbaa !11
  %88 = getelementptr inbounds i8, ptr %87, i64 8
  store i64 %.04656, ptr %88, align 8, !tbaa !13
  %89 = add nuw nsw i64 %.04656, 1
  %90 = load i64, ptr @N, align 8, !tbaa !8
  %91 = icmp slt i64 %89, %90
  br i1 %91, label %.lr.ph, label %.preheader54, !llvm.loop !14

._crit_edge64:                                    ; preds = %137, %.preheader54
  %.051.lcssa = phi i64 [ 0, %.preheader54 ], [ %.2, %137 ]
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.051.lcssa)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph63:                                         ; preds = %.preheader54, %137
  %.04962 = phi i64 [ %138, %137 ], [ 0, %.preheader54 ]
  %.05161 = phi i64 [ %.2, %137 ], [ 0, %.preheader54 ]
  %94 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @a, i64 0, i64 %.04962
  %95 = getelementptr inbounds i8, ptr %94, i64 8
  %96 = load i64, ptr %95, align 8, !tbaa !13
  %97 = load i64, ptr %94, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  %98 = getelementptr inbounds [200000 x i64], ptr @og, i64 0, i64 %96
  %99 = load i64, ptr %98, align 8, !tbaa !8
  call void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %1, i64 noundef %99)
  %100 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  %101 = getelementptr inbounds [11 x [200000 x %"struct.std::pair"]], ptr @a, i64 0, i64 %100
  %102 = load i64, ptr @N, align 8, !tbaa !8
  %103 = getelementptr inbounds %"struct.std::pair", ptr %101, i64 %102
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %104 = load i64, ptr @K, align 8, !tbaa !8
  %105 = sub nsw i64 %104, %97
  %106 = srem i64 %105, %104
  store i64 %106, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 2147483647, ptr %4, align 4, !tbaa !16
  call void @_ZNSt4pairIxxEC2IxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %107 = call noundef ptr @_ZSt11upper_boundIPSt4pairIxxES1_ET_S3_S3_RKT0_(ptr noundef nonnull %101, ptr noundef nonnull %103, ptr noundef nonnull align 8 dereferenceable(16) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  %108 = load i64, ptr @N, align 8, !tbaa !8
  %109 = getelementptr inbounds %"struct.std::pair", ptr %101, i64 %108
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %110 = load i64, ptr @K, align 8, !tbaa !8
  %111 = sub nsw i64 %110, %97
  %112 = srem i64 %111, %110
  store i64 %112, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !16
  call void @_ZNSt4pairIxxEC2IxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %113 = call noundef ptr @_ZSt11lower_boundIPSt4pairIxxES1_ET_S3_S3_RKT0_(ptr noundef nonnull %101, ptr noundef nonnull %109, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  %114 = ptrtoint ptr %107 to i64
  %115 = ptrtoint ptr %113 to i64
  %116 = sub i64 %114, %115
  %117 = ashr exact i64 %116, 4
  %118 = icmp slt i64 %117, 0
  br i1 %118, label %137, label %.preheader

.preheader:                                       ; preds = %.lr.ph63
  %119 = icmp sgt i64 %100, 0
  %.pre = load i64, ptr @K, align 8, !tbaa !8
  br i1 %119, label %.lr.ph60.preheader, label %._crit_edge

.lr.ph60.preheader:                               ; preds = %.preheader
  %xtraiter = and i64 %100, 3
  %120 = icmp ult i64 %100, 4
  br i1 %120, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph60.preheader.new

.lr.ph60.preheader.new:                           ; preds = %.lr.ph60.preheader
  %unroll_iter = and i64 %100, 9223372036854775804
  br label %.lr.ph60

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph60, %.lr.ph60.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph60.preheader ], [ %136, %.lr.ph60 ]
  %.04758.unr = phi i64 [ %97, %.lr.ph60.preheader ], [ %136, %.lr.ph60 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph60.epil

.lr.ph60.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph60.epil
  %.04758.epil = phi i64 [ %122, %.lr.ph60.epil ], [ %.04758.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph60.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %121 = mul nsw i64 %.04758.epil, 10
  %122 = srem i64 %121, %.pre
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph60.epil, !llvm.loop !18

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph60.epil, %.preheader
  %.047.lcssa = phi i64 [ %97, %.preheader ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %122, %.lr.ph60.epil ]
  %123 = load i64, ptr %94, align 16, !tbaa !11
  %124 = add nsw i64 %123, %.047.lcssa
  %125 = srem i64 %124, %.pre
  %126 = icmp eq i64 %125, 0
  %127 = sext i1 %126 to i64
  %spec.select = add i64 %117, %.05161
  %128 = add i64 %spec.select, %127
  br label %137

.lr.ph60:                                         ; preds = %.lr.ph60, %.lr.ph60.preheader.new
  %.04758 = phi i64 [ %97, %.lr.ph60.preheader.new ], [ %136, %.lr.ph60 ]
  %niter = phi i64 [ 0, %.lr.ph60.preheader.new ], [ %niter.next.3, %.lr.ph60 ]
  %129 = mul nsw i64 %.04758, 10
  %130 = srem i64 %129, %.pre
  %131 = mul nsw i64 %130, 10
  %132 = srem i64 %131, %.pre
  %133 = mul nsw i64 %132, 10
  %134 = srem i64 %133, %.pre
  %135 = mul nsw i64 %134, 10
  %136 = srem i64 %135, %.pre
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph60, !llvm.loop !20

137:                                              ; preds = %.lr.ph63, %._crit_edge
  %.2 = phi i64 [ %128, %._crit_edge ], [ %.05161, %.lr.ph63 ]
  %138 = add nuw nsw i64 %.04962, 1
  %139 = load i64, ptr @N, align 8, !tbaa !8
  %140 = icmp slt i64 %138, %139
  br i1 %140, label %.lr.ph63, label %._crit_edge64, !llvm.loop !21
}

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

; 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

; 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 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 dso_local void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) local_unnamed_addr #5

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPSt4pairIxxES1_ET_S3_S3_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 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 = { 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, !9, i64 0}
!12 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!13 = !{!12, !9, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !10, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}


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