; LLVM IR from eyangch/competitive-programming :: USACOcontests/platinum/2022.01 (minimizing_haybales)

; 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.segt = type { i64, [500000 x i64], [500000 x i64], [500000 x i64], [500000 x 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 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

@S = external dso_local global %struct.segt, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@sA = external dso_local global [100000 x i64], align 16
@C = external dso_local global [100000 x i64], align 16
@cc = external dso_local global [100000 x i64], align 16
@L = external dso_local global [100000 x i64], align 16
@R = external dso_local global [100000 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %class.anon, align 1
  %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 %"class.std::priority_queue", align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca %"struct.std::pair", align 8
  store i32 0, ptr %1, align 4
  %22 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %23 = getelementptr i8, ptr %22, i64 -24
  %24 = load i64, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %24
  %26 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %25, ptr noundef null)
  %27 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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)
  %30 = load i64, ptr @N, align 8, !tbaa !8
  %31 = sub nsw i64 %30, 1
  call void @_ZN4segt4initExxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef 0, i64 noundef %31, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %32

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

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

37:                                               ; preds = %32
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %39 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %39)
  br label %41

41:                                               ; preds = %37
  %42 = load i64, ptr %2, align 8, !tbaa !8
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %2, align 8, !tbaa !8
  br label %32, !llvm.loop !11

44:                                               ; preds = %36
  %45 = load i64, ptr @N, align 8, !tbaa !8
  %46 = getelementptr inbounds i64, ptr @A, i64 %45
  %47 = call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef @A, ptr noundef %46, ptr noundef @sA)
  %48 = load i64, ptr @N, align 8, !tbaa !8
  %49 = getelementptr inbounds i64, ptr @sA, i64 %48
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @sA, ptr noundef %49)
  %50 = load i64, ptr @N, align 8, !tbaa !8
  %51 = getelementptr inbounds i64, ptr @C, i64 %50
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @C, ptr noundef %51, i32 noundef 0)
  %52 = load i64, ptr @N, align 8, !tbaa !8
  %53 = getelementptr inbounds i64, ptr @C, i64 %52
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef @C, ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %54

54:                                               ; preds = %65, %44
  %55 = load i64, ptr %4, align 8, !tbaa !8
  %56 = load i64, ptr @N, align 8, !tbaa !8
  %57 = icmp slt i64 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %68

59:                                               ; preds = %54
  %60 = load i64, ptr %4, align 8, !tbaa !8
  %61 = load i64, ptr %4, align 8, !tbaa !8
  %62 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %63
  store i64 %60, ptr %64, align 8, !tbaa !8
  br label %65

65:                                               ; preds = %59
  %66 = load i64, ptr %4, align 8, !tbaa !8
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %4, align 8, !tbaa !8
  br label %54, !llvm.loop !13

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

69:                                               ; preds = %122, %68
  %70 = load i64, ptr %7, align 8, !tbaa !8
  %71 = load i64, ptr @N, align 8, !tbaa !8
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %125

74:                                               ; preds = %69
  br label %75

75:                                               ; preds = %91, %74
  %76 = load i64, ptr %5, align 8, !tbaa !8
  %77 = load i64, ptr @N, align 8, !tbaa !8
  %78 = icmp slt i64 %76, %77
  br i1 %78, label %79, label %89

79:                                               ; preds = %75
  %80 = load i64, ptr %5, align 8, !tbaa !8
  %81 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = load i64, ptr %7, align 8, !tbaa !8
  %84 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = load i64, ptr @K, align 8, !tbaa !8
  %87 = sub nsw i64 %85, %86
  %88 = icmp slt i64 %82, %87
  br label %89

89:                                               ; preds = %79, %75
  %90 = phi i1 [ false, %75 ], [ %88, %79 ]
  br i1 %90, label %91, label %94

91:                                               ; preds = %89
  %92 = load i64, ptr %5, align 8, !tbaa !8
  %93 = add nsw i64 %92, 1
  store i64 %93, ptr %5, align 8, !tbaa !8
  br label %75, !llvm.loop !14

94:                                               ; preds = %89
  br label %95

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

99:                                               ; preds = %95
  %100 = load i64, ptr %6, align 8, !tbaa !8
  %101 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %103 = load i64, ptr %7, align 8, !tbaa !8
  %104 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !8
  %106 = load i64, ptr @K, align 8, !tbaa !8
  %107 = add nsw i64 %105, %106
  %108 = icmp sle i64 %102, %107
  br label %109

109:                                              ; preds = %99, %95
  %110 = phi i1 [ false, %95 ], [ %108, %99 ]
  br i1 %110, label %111, label %114

111:                                              ; preds = %109
  %112 = load i64, ptr %6, align 8, !tbaa !8
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %6, align 8, !tbaa !8
  br label %95, !llvm.loop !15

114:                                              ; preds = %109
  %115 = load i64, ptr %5, align 8, !tbaa !8
  %116 = load i64, ptr %7, align 8, !tbaa !8
  %117 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %116
  store i64 %115, ptr %117, align 8, !tbaa !8
  %118 = load i64, ptr %6, align 8, !tbaa !8
  %119 = sub nsw i64 %118, 1
  %120 = load i64, ptr %7, align 8, !tbaa !8
  %121 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %120
  store i64 %119, ptr %121, align 8, !tbaa !8
  br label %122

122:                                              ; preds = %114
  %123 = load i64, ptr %7, align 8, !tbaa !8
  %124 = add nsw i64 %123, 1
  store i64 %124, ptr %7, align 8, !tbaa !8
  br label %69, !llvm.loop !16

125:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %126 = load i64, ptr @N, align 8, !tbaa !8
  %127 = sub nsw i64 %126, 1
  store i64 %127, ptr %8, align 8, !tbaa !8
  br label %128

128:                                              ; preds = %152, %125
  %129 = load i64, ptr %8, align 8, !tbaa !8
  %130 = icmp sge i64 %129, 0
  br i1 %130, label %132, label %131

131:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %155

132:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %133 = load i64, ptr %8, align 8, !tbaa !8
  %134 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !8
  store i64 %135, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %136 = load i64, ptr %9, align 8, !tbaa !8
  %137 = call noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %136, i64 noundef 1)
  store i64 %137, ptr %10, align 8, !tbaa !8
  %138 = load i64, ptr %9, align 8, !tbaa !8
  %139 = load i64, ptr %9, align 8, !tbaa !8
  %140 = load i64, ptr %10, align 8, !tbaa !8
  %141 = sub nsw i64 0, %140
  call void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %138, i64 noundef %139, i64 noundef %141, i64 noundef 1)
  %142 = load i64, ptr %9, align 8, !tbaa !8
  %143 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !8
  %145 = sub nsw i64 %144, 1
  call void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef 0, i64 noundef %145, i64 noundef 1, i64 noundef 1)
  %146 = load i64, ptr %9, align 8, !tbaa !8
  %147 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !8
  %149 = add nsw i64 %148, 1
  %150 = load i64, ptr @N, align 8, !tbaa !8
  %151 = sub nsw i64 %150, 1
  call void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %149, i64 noundef %151, i64 noundef 1, i64 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %152

152:                                              ; preds = %132
  %153 = load i64, ptr %8, align 8, !tbaa !8
  %154 = add nsw i64 %153, -1
  store i64 %154, ptr %8, align 8, !tbaa !8
  br label %128, !llvm.loop !17

155:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  call void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %156

156:                                              ; preds = %189, %155
  %157 = load i64, ptr %12, align 8, !tbaa !8
  %158 = load i64, ptr @N, align 8, !tbaa !8
  %159 = icmp slt i64 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %193

161:                                              ; preds = %156
  %162 = load i64, ptr %12, align 8, !tbaa !8
  %163 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !8
  %165 = invoke noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %164, i64 noundef 1)
          to label %166 unwind label %180

166:                                              ; preds = %161
  %167 = icmp eq i64 %165, 0
  br i1 %167, label %168, label %188

168:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  %169 = load i64, ptr %12, align 8, !tbaa !8
  %170 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %169
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %170, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %171 unwind label %184

171:                                              ; preds = %168
  invoke void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %11, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %172 unwind label %184

172:                                              ; preds = %171
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  %173 = load i64, ptr %12, align 8, !tbaa !8
  %174 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !8
  %176 = load i64, ptr %12, align 8, !tbaa !8
  %177 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %176
  %178 = load i64, ptr %177, align 8, !tbaa !8
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %175, i64 noundef %178, i64 noundef 10000000000000000, i64 noundef 1)
          to label %179 unwind label %180

179:                                              ; preds = %172
  br label %188

180:                                              ; preds = %172, %161
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %13, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %14, align 4
  br label %192

184:                                              ; preds = %171, %168
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %13, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  br label %192

188:                                              ; preds = %179, %166
  br label %189

189:                                              ; preds = %188
  %190 = load i64, ptr %12, align 8, !tbaa !8
  %191 = add nsw i64 %190, 1
  store i64 %191, ptr %12, align 8, !tbaa !8
  br label %156, !llvm.loop !18

192:                                              ; preds = %184, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %302

193:                                              ; preds = %160
  br label %194

194:                                              ; preds = %295, %193
  %195 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
          to label %196 unwind label %239

196:                                              ; preds = %194
  %197 = xor i1 %195, true
  br i1 %197, label %198, label %300

198:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %199 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
          to label %200 unwind label %243

200:                                              ; preds = %198
  %201 = getelementptr inbounds %"struct.std::pair", ptr %199, i32 0, i32 0
  %202 = load i64, ptr %201, align 8, !tbaa !19
  store i64 %202, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %203 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
          to label %204 unwind label %247

204:                                              ; preds = %200
  %205 = getelementptr inbounds %"struct.std::pair", ptr %203, i32 0, i32 1
  %206 = load i64, ptr %205, align 8, !tbaa !21
  store i64 %206, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %207 = load i64, ptr %17, align 8, !tbaa !8
  %208 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %207
  %209 = load i64, ptr %208, align 8, !tbaa !8
  store i64 %209, ptr %18, align 8, !tbaa !8
  invoke void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
          to label %210 unwind label %251

210:                                              ; preds = %204
  %211 = load i64, ptr %16, align 8, !tbaa !8
  %212 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %211)
          to label %213 unwind label %251

213:                                              ; preds = %210
  %214 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %212, i8 noundef signext 10)
          to label %215 unwind label %251

215:                                              ; preds = %213
  %216 = load i64, ptr %18, align 8, !tbaa !8
  %217 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !8
  %219 = sub nsw i64 %218, 1
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef 0, i64 noundef %219, i64 noundef -1, i64 noundef 1)
          to label %220 unwind label %251

220:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store i64 -1, ptr %19, align 8, !tbaa !8
  br label %221

221:                                              ; preds = %238, %220
  %222 = load i64, ptr %18, align 8, !tbaa !8
  %223 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %222
  %224 = load i64, ptr %223, align 8, !tbaa !8
  %225 = sub nsw i64 %224, 1
  %226 = invoke noundef i64 @_ZN4segt4nxtzExxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef 0, i64 noundef %225, i64 noundef 1)
          to label %227 unwind label %255

227:                                              ; preds = %221
  store i64 %226, ptr %19, align 8, !tbaa !8
  %228 = icmp ne i64 %226, -1
  br i1 %228, label %229, label %263

229:                                              ; preds = %227
  %230 = load i64, ptr %19, align 8, !tbaa !8
  %231 = load i64, ptr %19, align 8, !tbaa !8
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %230, i64 noundef %231, i64 noundef 10000000000000000, i64 noundef 1)
          to label %232 unwind label %255

232:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %233 = load i64, ptr %19, align 8, !tbaa !8
  %234 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %233
  %235 = load i64, ptr %19, align 8, !tbaa !8
  %236 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %235
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %234, ptr noundef nonnull align 8 dereferenceable(8) %236)
          to label %237 unwind label %259

237:                                              ; preds = %232
  invoke void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %11, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %238 unwind label %259

238:                                              ; preds = %237
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  br label %221, !llvm.loop !22

239:                                              ; preds = %194
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %13, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %14, align 4
  br label %302

243:                                              ; preds = %198
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %13, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %14, align 4
  br label %299

247:                                              ; preds = %200
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %13, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %14, align 4
  br label %298

251:                                              ; preds = %215, %213, %210, %204
  %252 = landingpad { ptr, i32 }
          cleanup
  %253 = extractvalue { ptr, i32 } %252, 0
  store ptr %253, ptr %13, align 8
  %254 = extractvalue { ptr, i32 } %252, 1
  store i32 %254, ptr %14, align 4
  br label %297

255:                                              ; preds = %281, %271, %263, %229, %221
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %13, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %14, align 4
  br label %296

259:                                              ; preds = %237, %232
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %13, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  br label %296

263:                                              ; preds = %227
  %264 = load i64, ptr %18, align 8, !tbaa !8
  %265 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %264
  %266 = load i64, ptr %265, align 8, !tbaa !8
  %267 = add nsw i64 %266, 1
  %268 = load i64, ptr @N, align 8, !tbaa !8
  %269 = sub nsw i64 %268, 1
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %267, i64 noundef %269, i64 noundef -1, i64 noundef 1)
          to label %270 unwind label %255

270:                                              ; preds = %263
  store i64 -1, ptr %19, align 8, !tbaa !8
  br label %271

271:                                              ; preds = %290, %270
  %272 = load i64, ptr %18, align 8, !tbaa !8
  %273 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %272
  %274 = load i64, ptr %273, align 8, !tbaa !8
  %275 = add nsw i64 %274, 1
  %276 = load i64, ptr @N, align 8, !tbaa !8
  %277 = sub nsw i64 %276, 1
  %278 = invoke noundef i64 @_ZN4segt4nxtzExxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %275, i64 noundef %277, i64 noundef 1)
          to label %279 unwind label %255

279:                                              ; preds = %271
  store i64 %278, ptr %19, align 8, !tbaa !8
  %280 = icmp ne i64 %278, -1
  br i1 %280, label %281, label %295

281:                                              ; preds = %279
  %282 = load i64, ptr %19, align 8, !tbaa !8
  %283 = load i64, ptr %19, align 8, !tbaa !8
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %282, i64 noundef %283, i64 noundef 10000000000000000, i64 noundef 1)
          to label %284 unwind label %255

284:                                              ; preds = %281
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %285 = load i64, ptr %19, align 8, !tbaa !8
  %286 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %285
  %287 = load i64, ptr %19, align 8, !tbaa !8
  %288 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %287
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %286, ptr noundef nonnull align 8 dereferenceable(8) %288)
          to label %289 unwind label %291

289:                                              ; preds = %284
  invoke void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %11, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %290 unwind label %291

290:                                              ; preds = %289
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  br label %271, !llvm.loop !23

291:                                              ; preds = %289, %284
  %292 = landingpad { ptr, i32 }
          cleanup
  %293 = extractvalue { ptr, i32 } %292, 0
  store ptr %293, ptr %13, align 8
  %294 = extractvalue { ptr, i32 } %292, 1
  store i32 %294, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  br label %296

295:                                              ; preds = %279
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %194, !llvm.loop !24

296:                                              ; preds = %291, %259, %255
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %297

297:                                              ; preds = %296, %251
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %298

298:                                              ; preds = %297, %247
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %299

299:                                              ; preds = %298, %243
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %302

300:                                              ; preds = %196
  call void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %301 = load i32, ptr %1, align 4
  ret i32 %301

302:                                              ; preds = %299, %239, %192
  call void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %303

303:                                              ; preds = %302
  %304 = load ptr, ptr %13, align 8
  %305 = load i32, ptr %14, align 4
  %306 = insertvalue { ptr, i32 } poison, ptr %304, 0
  %307 = insertvalue { ptr, i32 } %306, i32 %305, 1
  resume { ptr, i32 } %307
}

; 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: mustprogress uwtable
declare dso_local void @_ZN4segt4initExxx(ptr noundef nonnull align 8 dereferenceable(16000008), i64 noundef, i64 noundef, i64 noundef) #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 noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef, ptr noundef, ptr noundef) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008), i64 noundef, i64 noundef, i64 noundef, i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #6 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 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{!20, !9, i64 0}
!20 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!21 = !{!20, !9, i64 8}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !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.segt = type { i64, [500000 x i64], [500000 x i64], [500000 x i64], [500000 x 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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

@S = external dso_local global %struct.segt, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@sA = external dso_local global [100000 x i64], align 16
@C = external dso_local global [100000 x i64], align 16
@cc = external dso_local local_unnamed_addr global [100000 x i64], align 16
@L = external dso_local local_unnamed_addr global [100000 x i64], align 16
@R = external dso_local local_unnamed_addr global [100000 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::priority_queue", align 8
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = 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)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %14 = load i64, ptr @N, align 8, !tbaa !8
  %15 = add nsw i64 %14, -1
  tail call void @_ZN4segt4initExxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef 0, i64 noundef %15, i64 noundef 1)
  %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 = %.lr.ph, %0
  %.lcssa80 = phi i64 [ %16, %0 ], [ %32, %.lr.ph ]
  %18 = getelementptr inbounds i64, ptr @A, i64 %.lcssa80
  %19 = tail call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef nonnull @A, ptr noundef nonnull %18, ptr noundef nonnull @sA)
  %20 = load i64, ptr @N, align 8, !tbaa !8
  %21 = getelementptr inbounds i64, ptr @sA, i64 %20
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @sA, ptr noundef nonnull %21)
  %22 = load i64, ptr @N, align 8, !tbaa !8
  %23 = getelementptr inbounds i64, ptr @C, i64 %22
  tail call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @C, ptr noundef nonnull %23, i32 noundef 0)
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = getelementptr inbounds i64, ptr @C, i64 %24
  tail call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @C, ptr noundef nonnull %25)
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %.lr.ph84.preheader, label %._crit_edge101

.lr.ph84.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %26, 3
  %28 = icmp ult i64 %26, 4
  br i1 %28, label %.preheader79.unr-lcssa, label %.lr.ph84.preheader.new

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

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.081 = phi i64 [ %31, %.lr.ph ], [ 0, %0 ]
  %29 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.081
  %30 = 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) %29)
  %31 = add nuw nsw i64 %.081, 1
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader79.unr-lcssa:                           ; preds = %.lr.ph84, %.lr.ph84.preheader
  %.04882.unr = phi i64 [ 0, %.lr.ph84.preheader ], [ %54, %.lr.ph84 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader79, label %.lr.ph84.epil

.lr.ph84.epil:                                    ; preds = %.preheader79.unr-lcssa, %.lr.ph84.epil
  %.04882.epil = phi i64 [ %37, %.lr.ph84.epil ], [ %.04882.unr, %.preheader79.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph84.epil ], [ 0, %.preheader79.unr-lcssa ]
  %34 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %.04882.epil
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %35
  store i64 %.04882.epil, ptr %36, align 8, !tbaa !8
  %37 = add nuw nsw i64 %.04882.epil, 1
  %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 %.preheader79, label %.lr.ph84.epil, !llvm.loop !13

.preheader79:                                     ; preds = %.lr.ph84.epil, %.preheader79.unr-lcssa
  br i1 %27, label %.preheader78.lr.ph, label %._crit_edge101

.preheader78.lr.ph:                               ; preds = %.preheader79
  %38 = load i64, ptr @K, align 8
  br label %.preheader78

.lr.ph84:                                         ; preds = %.lr.ph84, %.lr.ph84.preheader.new
  %.04882 = phi i64 [ 0, %.lr.ph84.preheader.new ], [ %54, %.lr.ph84 ]
  %niter = phi i64 [ 0, %.lr.ph84.preheader.new ], [ %niter.next.3, %.lr.ph84 ]
  %39 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %.04882
  %40 = load i64, ptr %39, align 16, !tbaa !8
  %41 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %40
  store i64 %.04882, ptr %41, align 8, !tbaa !8
  %42 = or disjoint i64 %.04882, 1
  %43 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !8
  %45 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %44
  store i64 %42, ptr %45, align 8, !tbaa !8
  %46 = or disjoint i64 %.04882, 2
  %47 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %46
  %48 = load i64, ptr %47, align 16, !tbaa !8
  %49 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %48
  store i64 %46, ptr %49, align 8, !tbaa !8
  %50 = or disjoint i64 %.04882, 3
  %51 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %52
  store i64 %50, ptr %53, align 8, !tbaa !8
  %54 = add nuw nsw i64 %.04882, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader79.unr-lcssa, label %.lr.ph84, !llvm.loop !15

.preheader78:                                     ; preds = %.preheader78.lr.ph, %.critedge2
  %.04998 = phi i64 [ 0, %.preheader78.lr.ph ], [ %.1.lcssa, %.critedge2 ]
  %.05697 = phi i64 [ 0, %.preheader78.lr.ph ], [ %.157.lcssa, %.critedge2 ]
  %.05896 = phi i64 [ 0, %.preheader78.lr.ph ], [ %77, %.critedge2 ]
  %55 = icmp slt i64 %.04998, %26
  br i1 %55, label %.lr.ph87, label %.critedge

.lr.ph87:                                         ; preds = %.preheader78
  %56 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %.05896
  %57 = load i64, ptr %56, align 8, !tbaa !8
  %58 = sub nsw i64 %57, %38
  br label %59

.preheader77:                                     ; preds = %.critedge2
  br i1 %27, label %.lr.ph100, label %._crit_edge101

59:                                               ; preds = %.lr.ph87, %63
  %.186 = phi i64 [ %.04998, %.lr.ph87 ], [ %64, %63 ]
  %60 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %.186
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = icmp slt i64 %61, %58
  br i1 %62, label %63, label %.critedge

63:                                               ; preds = %59
  %64 = add i64 %.186, 1
  %exitcond109.not = icmp eq i64 %64, %26
  br i1 %exitcond109.not, label %.critedge, label %59, !llvm.loop !16

.critedge:                                        ; preds = %59, %63, %.preheader78
  %.1.lcssa = phi i64 [ %.04998, %.preheader78 ], [ %26, %63 ], [ %.186, %59 ]
  %65 = icmp slt i64 %.05697, %26
  br i1 %65, label %.lr.ph92, label %.critedge2

.lr.ph92:                                         ; preds = %.critedge
  %66 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %.05896
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = add nsw i64 %38, %67
  br label %69

69:                                               ; preds = %.lr.ph92, %72
  %.15791 = phi i64 [ %.05697, %.lr.ph92 ], [ %73, %72 ]
  %70 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %.15791
  %71 = load i64, ptr %70, align 8, !tbaa !8
  %.not71 = icmp sgt i64 %71, %68
  br i1 %.not71, label %.critedge2, label %72

72:                                               ; preds = %69
  %73 = add i64 %.15791, 1
  %exitcond110.not = icmp eq i64 %73, %26
  br i1 %exitcond110.not, label %.critedge2, label %69, !llvm.loop !17

.critedge2:                                       ; preds = %69, %72, %.critedge
  %.157.lcssa = phi i64 [ %.05697, %.critedge ], [ %26, %72 ], [ %.15791, %69 ]
  %74 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %.05896
  store i64 %.1.lcssa, ptr %74, align 8, !tbaa !8
  %75 = add nsw i64 %.157.lcssa, -1
  %76 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %.05896
  store i64 %75, ptr %76, align 8, !tbaa !8
  %77 = add nuw nsw i64 %.05896, 1
  %exitcond111.not = icmp eq i64 %77, %26
  br i1 %exitcond111.not, label %.preheader77, label %.preheader78, !llvm.loop !18

._crit_edge101:                                   ; preds = %.lr.ph100, %._crit_edge, %.preheader79, %.preheader77
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  %78 = load i64, ptr @N, align 8, !tbaa !8
  %79 = icmp sgt i64 %78, 0
  br i1 %79, label %.lr.ph104, label %._crit_edge105

.lr.ph100:                                        ; preds = %.preheader77, %.lr.ph100
  %.059.in99 = phi i64 [ %.059, %.lr.ph100 ], [ %26, %.preheader77 ]
  %.059 = add nsw i64 %.059.in99, -1
  %80 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %.059
  %81 = load i64, ptr %80, align 8, !tbaa !8
  %82 = tail call noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %81, i64 noundef 1)
  %83 = sub nsw i64 0, %82
  tail call void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %81, i64 noundef %81, i64 noundef %83, i64 noundef 1)
  %84 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %81
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = add nsw i64 %85, -1
  tail call void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef 0, i64 noundef %86, i64 noundef 1, i64 noundef 1)
  %87 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %81
  %88 = load i64, ptr %87, align 8, !tbaa !8
  %89 = add nsw i64 %88, 1
  %90 = load i64, ptr @N, align 8, !tbaa !8
  %91 = add nsw i64 %90, -1
  tail call void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %89, i64 noundef %91, i64 noundef 1, i64 noundef 1)
  %92 = icmp ugt i64 %.059.in99, 1
  br i1 %92, label %.lr.ph100, label %._crit_edge101, !llvm.loop !19

._crit_edge105:                                   ; preds = %110, %._crit_edge101
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %93 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %93, label %._crit_edge108, label %.lr.ph107

.lr.ph104:                                        ; preds = %._crit_edge101, %110
  %storemerge102 = phi i64 [ %112, %110 ], [ 0, %._crit_edge101 ]
  %94 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %storemerge102
  %95 = load i64, ptr %94, align 8, !tbaa !8
  %96 = invoke noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %95, i64 noundef 1)
          to label %97 unwind label %106

97:                                               ; preds = %.lr.ph104
  %98 = icmp eq i64 %96, 0
  br i1 %98, label %99, label %110

99:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %100 = load i64, ptr %2, align 8, !tbaa !8
  %101 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %100
  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) %101, ptr noundef nonnull align 8 dereferenceable(8) %2)
  invoke void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %102 unwind label %108

102:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %103 = load i64, ptr %2, align 8, !tbaa !8
  %104 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !8
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %105, i64 noundef %105, i64 noundef 10000000000000000, i64 noundef 1)
          to label %110 unwind label %106

106:                                              ; preds = %102, %.lr.ph104
  %107 = landingpad { ptr, i32 }
          cleanup
  br label %115

108:                                              ; preds = %99
  %109 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  br label %115

110:                                              ; preds = %97, %102
  %111 = load i64, ptr %2, align 8, !tbaa !8
  %112 = add nsw i64 %111, 1
  store i64 %112, ptr %2, align 8, !tbaa !8
  %113 = load i64, ptr @N, align 8, !tbaa !8
  %114 = icmp slt i64 %112, %113
  br i1 %114, label %.lr.ph104, label %._crit_edge105, !llvm.loop !20

115:                                              ; preds = %108, %106
  %.pn68 = phi { ptr, i32 } [ %107, %106 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %.loopexit.split-lp

.loopexit72:                                      ; preds = %156
  %116 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %116, label %._crit_edge108, label %.lr.ph107, !llvm.loop !21

.lr.ph107:                                        ; preds = %._crit_edge105, %.loopexit72
  %117 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %118 = load i64, ptr %117, align 8, !tbaa !22
  %119 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %120 = getelementptr inbounds i8, ptr %119, i64 8
  %121 = load i64, ptr %120, align 8, !tbaa !24
  %122 = getelementptr inbounds [100000 x i64], ptr @cc, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !8
  invoke void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
          to label %124 unwind label %141

124:                                              ; preds = %.lr.ph107
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %118)
          to label %126 unwind label %141

126:                                              ; preds = %124
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %125, i8 noundef signext 10)
          to label %128 unwind label %141

128:                                              ; preds = %126
  %129 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %123
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = add nsw i64 %130, -1
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef 0, i64 noundef %131, i64 noundef -1, i64 noundef 1)
          to label %.preheader73 unwind label %141

.preheader73:                                     ; preds = %128, %140
  %132 = load i64, ptr %129, align 8, !tbaa !8
  %133 = add nsw i64 %132, -1
  %134 = invoke noundef i64 @_ZN4segt4nxtzExxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef 0, i64 noundef %133, i64 noundef 1)
          to label %135 unwind label %.loopexit.split-lp.loopexit

135:                                              ; preds = %.preheader73
  %.not = icmp eq i64 %134, -1
  br i1 %.not, label %145, label %136

136:                                              ; preds = %135
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %134, i64 noundef %134, i64 noundef 10000000000000000, i64 noundef 1)
          to label %137 unwind label %.loopexit.split-lp.loopexit

137:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %138 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %134
  %139 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %134
  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) %138, ptr noundef nonnull align 8 dereferenceable(8) %139)
  invoke void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %140 unwind label %143

140:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %.preheader73, !llvm.loop !25

141:                                              ; preds = %128, %126, %124, %.lr.ph107
  %142 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

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

.loopexit.split-lp.loopexit:                      ; preds = %136, %.preheader73
  %lpad.loopexit74 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %145
  %lpad.loopexit.split-lp75 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

143:                                              ; preds = %137
  %144 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %.loopexit.split-lp

145:                                              ; preds = %135
  %146 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %123
  %147 = load i64, ptr %146, align 8, !tbaa !8
  %148 = add nsw i64 %147, 1
  %149 = load i64, ptr @N, align 8, !tbaa !8
  %150 = add nsw i64 %149, -1
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %148, i64 noundef %150, i64 noundef -1, i64 noundef 1)
          to label %.preheader unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader:                                       ; preds = %145, %161
  %151 = load i64, ptr %146, align 8, !tbaa !8
  %152 = add nsw i64 %151, 1
  %153 = load i64, ptr @N, align 8, !tbaa !8
  %154 = add nsw i64 %153, -1
  %155 = invoke noundef i64 @_ZN4segt4nxtzExxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %152, i64 noundef %154, i64 noundef 1)
          to label %156 unwind label %.loopexit

156:                                              ; preds = %.preheader
  %.not65 = icmp eq i64 %155, -1
  br i1 %.not65, label %.loopexit72, label %157

157:                                              ; preds = %156
  invoke void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008) @S, i64 noundef %155, i64 noundef %155, i64 noundef 10000000000000000, i64 noundef 1)
          to label %158 unwind label %.loopexit

158:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %159 = getelementptr inbounds [100000 x i64], ptr @sA, i64 0, i64 %155
  %160 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %155
  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) %159, ptr noundef nonnull align 8 dereferenceable(8) %160)
  invoke void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %161 unwind label %162

161:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %.preheader, !llvm.loop !26

162:                                              ; preds = %158
  %163 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %.loopexit.split-lp

._crit_edge108:                                   ; preds = %.loopexit72, %._crit_edge105
  call void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  ret i32 0

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %141, %162, %143, %115
  %.pn68.pn = phi { ptr, i32 } [ %.pn68, %115 ], [ %142, %141 ], [ %144, %143 ], [ %163, %162 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit74, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp75, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn68.pn
}

; 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 uwtable
declare dso_local void @_ZN4segt4initExxx(ptr noundef nonnull align 8 dereferenceable(16000008), i64 noundef, i64 noundef, i64 noundef) 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 noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(16000008), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt3updExxxx(ptr noundef nonnull align 8 dereferenceable(16000008), i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN4segt4nxtzExxx(ptr noundef nonnull align 8 dereferenceable(16000008), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxxESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #6 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 = { 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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = !{!23, !9, i64 0}
!23 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!24 = !{!23, !9, i64 8}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


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