; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1344D)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.anon = type { i8 }
%class.anon.0 = type { i8 }
%class.anon.2 = type { ptr, ptr }
%"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, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@_ZZ4mainE1a = external hidden global [300001 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE1b = external hidden global [300001 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %class.anon, align 1
  %10 = alloca %class.anon.0, align 1
  %11 = alloca %class.anon.2, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca %"class.std::priority_queue", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca { i64, i32 }, align 8
  %25 = alloca i32, align 4
  %26 = alloca %"struct.std::pair", align 8
  %27 = alloca i64, align 8
  %28 = alloca { i64, i32 }, align 8
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %216, %0
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %47, %35
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr @_ZZ4mainE1a, i64 %44
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %45)
  br label %47

47:                                               ; preds = %42
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %7, align 4, !tbaa !5
  br label %37, !llvm.loop !9

50:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 4000000000000000000, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  %51 = getelementptr inbounds %class.anon.2, ptr %11, i32 0, i32 0
  store ptr %5, ptr %51, align 8, !tbaa !13
  %52 = getelementptr inbounds %class.anon.2, ptr %11, i32 0, i32 1
  store ptr %10, ptr %52, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 -4000000000000000000, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store i64 4000000000000000000, ptr %13, align 8, !tbaa !11
  br label %53

53:                                               ; preds = %91, %50
  %54 = load i64, ptr %12, align 8, !tbaa !11
  %55 = load i64, ptr %13, align 8, !tbaa !11
  %56 = icmp slt i64 %54, %55
  br i1 %56, label %57, label %92

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %58 = load i64, ptr %12, align 8, !tbaa !11
  %59 = load i64, ptr %13, align 8, !tbaa !11
  %60 = load i64, ptr %12, align 8, !tbaa !11
  %61 = sub nsw i64 %59, %60
  %62 = add nsw i64 %61, 1
  %63 = sdiv i64 %62, 2
  %64 = add nsw i64 %58, %63
  store i64 %64, ptr %14, align 8, !tbaa !11
  %65 = load i64, ptr %14, align 8, !tbaa !11
  call void @"_ZZ4mainENK3$_2clEx"(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %65)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store i64 0, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %79, %57
  %67 = load i32, ptr %16, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %82

71:                                               ; preds = %66
  %72 = load i32, ptr %16, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = load i64, ptr %15, align 8, !tbaa !11
  %78 = add nsw i64 %77, %76
  store i64 %78, ptr %15, align 8, !tbaa !11
  br label %79

79:                                               ; preds = %71
  %80 = load i32, ptr %16, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %16, align 4, !tbaa !5
  br label %66, !llvm.loop !15

82:                                               ; preds = %70
  %83 = load i64, ptr %15, align 8, !tbaa !11
  %84 = load i64, ptr %6, align 8, !tbaa !11
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %86, label %89

86:                                               ; preds = %82
  %87 = load i64, ptr %14, align 8, !tbaa !11
  %88 = sub nsw i64 %87, 1
  store i64 %88, ptr %13, align 8, !tbaa !11
  br label %91

89:                                               ; preds = %82
  %90 = load i64, ptr %14, align 8, !tbaa !11
  store i64 %90, ptr %12, align 8, !tbaa !11
  br label %91

91:                                               ; preds = %89, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %53, !llvm.loop !16

92:                                               ; preds = %53
  %93 = load i64, ptr %12, align 8, !tbaa !11
  %94 = add nsw i64 %93, 1
  call void @"_ZZ4mainENK3$_2clEx"(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %94)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %95 = load i64, ptr %6, align 8, !tbaa !11
  store i64 %95, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #8
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %137, %92
  %97 = load i32, ptr %19, align 4, !tbaa !5
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %140

101:                                              ; preds = %96
  %102 = load i32, ptr %19, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = load i64, ptr %17, align 8, !tbaa !11
  %108 = sub nsw i64 %107, %106
  store i64 %108, ptr %17, align 8, !tbaa !11
  %109 = load i32, ptr %19, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %19, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = icmp slt i32 %112, %116
  br i1 %117, label %118, label %136

118:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %119 = load i32, ptr %19, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr %19, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = invoke noundef i64 @"_ZZ4mainENK3$_1clEii"(ptr noundef nonnull align 1 dereferenceable(1) %10, i32 noundef %122, i32 noundef %126)
          to label %128 unwind label %132

128:                                              ; preds = %118
  store i64 %127, ptr %21, align 8, !tbaa !11
  %129 = invoke { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %130 unwind label %132

130:                                              ; preds = %128
  store { i64, i32 } %129, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %24, i64 12, i1 false)
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %18, ptr noundef nonnull align 8 dereferenceable(12) %20)
          to label %131 unwind label %132

131:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #8
  br label %136

132:                                              ; preds = %130, %128, %118
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %22, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %219

136:                                              ; preds = %131, %101
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %19, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %19, align 4, !tbaa !5
  br label %96, !llvm.loop !17

140:                                              ; preds = %100
  br label %141

141:                                              ; preds = %183, %140
  %142 = load i64, ptr %17, align 8, !tbaa !11
  %143 = icmp sgt i64 %142, 0
  br i1 %143, label %144, label %187

144:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %145 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
          to label %146 unwind label %174

146:                                              ; preds = %144
  %147 = getelementptr inbounds %"struct.std::pair", ptr %145, i32 0, i32 1
  %148 = load i32, ptr %147, align 8, !tbaa !18
  store i32 %148, ptr %25, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
          to label %149 unwind label %174

149:                                              ; preds = %146
  %150 = load i32, ptr %25, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %152, align 4, !tbaa !5
  %155 = load i32, ptr %25, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = icmp slt i32 %154, %158
  br i1 %159, label %160, label %182

160:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %161 = load i32, ptr %25, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load i32, ptr %25, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = invoke noundef i64 @"_ZZ4mainENK3$_1clEii"(ptr noundef nonnull align 1 dereferenceable(1) %10, i32 noundef %164, i32 noundef %168)
          to label %170 unwind label %178

170:                                              ; preds = %160
  store i64 %169, ptr %27, align 8, !tbaa !11
  %171 = invoke { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %172 unwind label %178

172:                                              ; preds = %170
  store { i64, i32 } %171, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %28, i64 12, i1 false)
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %18, ptr noundef nonnull align 8 dereferenceable(12) %26)
          to label %173 unwind label %178

173:                                              ; preds = %172
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  br label %182

174:                                              ; preds = %146, %144
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %22, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %23, align 4
  br label %186

178:                                              ; preds = %172, %170, %160
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %22, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  br label %186

182:                                              ; preds = %173, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %183

183:                                              ; preds = %182
  %184 = load i64, ptr %17, align 8, !tbaa !11
  %185 = add nsw i64 %184, -1
  store i64 %185, ptr %17, align 8, !tbaa !11
  br label %141, !llvm.loop !20

186:                                              ; preds = %178, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %219

187:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %208, %187
  %189 = load i32, ptr %29, align 4, !tbaa !5
  %190 = load i32, ptr %5, align 4, !tbaa !5
  %191 = icmp slt i32 %189, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %188
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %215

193:                                              ; preds = %188
  %194 = load i32, ptr %29, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = load i32, ptr %29, align 4, !tbaa !5
  %199 = load i32, ptr %5, align 4, !tbaa !5
  %200 = sub nsw i32 %199, 1
  %201 = icmp eq i32 %198, %200
  %202 = zext i1 %201 to i64
  %203 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %202
  %204 = load i8, ptr %203, align 1, !tbaa !21
  %205 = sext i8 %204 to i32
  %206 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %197, i32 noundef %205)
          to label %207 unwind label %211

207:                                              ; preds = %193
  br label %208

208:                                              ; preds = %207
  %209 = load i32, ptr %29, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %29, align 4, !tbaa !5
  br label %188, !llvm.loop !22

211:                                              ; preds = %193
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %22, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %219

215:                                              ; preds = %192
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %18) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %216

216:                                              ; preds = %215
  %217 = load i32, ptr %3, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !23

219:                                              ; preds = %211, %186, %132
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %18) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %222

220:                                              ; preds = %34
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %221 = load i32, ptr %1, align 4
  ret i32 %221

222:                                              ; preds = %219
  %223 = load ptr, ptr %22, align 8
  %224 = load i32, ptr %23, align 4
  %225 = insertvalue { ptr, i32 } poison, ptr %223, 0
  %226 = insertvalue { ptr, i32 } %225, i32 %224, 1
  resume { ptr, i32 } %226
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZ4mainENK3$_2clEx"(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(12)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @"_ZZ4mainENK3$_1clEii"(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) #6 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #4 align 2

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

declare i32 @printf(ptr noundef, ...) #2

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.anon.0 = type { i8 }
%class.anon.2 = type { ptr, ptr }
%"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, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@_ZZ4mainE1a = external hidden global [300001 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE1b = external hidden local_unnamed_addr global [300001 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
.critedge:
  %0 = alloca i32, align 4
  %1 = alloca i64, align 8
  %2 = alloca %class.anon.0, align 1
  %3 = alloca %class.anon.2, align 8
  %4 = alloca %"class.std::priority_queue", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %0, ptr noundef nonnull %1)
  %12 = load i32, ptr %0, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.critedge
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  store ptr %0, ptr %3, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %2, ptr %14, align 8, !tbaa !9
  br label %20

.lr.ph:                                           ; preds = %.critedge, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.critedge ]
  %15 = getelementptr inbounds i32, ptr @_ZZ4mainE1a, i64 %indvars.iv
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr %0, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !11

20:                                               ; preds = %._crit_edge, %._crit_edge58
  %.04360 = phi i64 [ -4000000000000000000, %._crit_edge ], [ %.144, %._crit_edge58 ]
  %.04559 = phi i64 [ 4000000000000000000, %._crit_edge ], [ %.146, %._crit_edge58 ]
  %21 = add i64 %.04559, 1
  %22 = sub i64 %21, %.04360
  %23 = sdiv i64 %22, 2
  %24 = add nsw i64 %23, %.04360
  call void @"_ZZ4mainENK3$_2clEx"(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %24)
  %25 = load i32, ptr %0, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph57.preheader, label %._crit_edge58

.lr.ph57.preheader:                               ; preds = %20
  %wide.trip.count = zext nneg i32 %25 to i64
  %min.iters.check = icmp ult i32 %25, 4
  br i1 %min.iters.check, label %.lr.ph57.preheader91, label %vector.ph

.lr.ph57.preheader91:                             ; preds = %middle.block, %.lr.ph57.preheader
  %indvars.iv75.ph = phi i64 [ 0, %.lr.ph57.preheader ], [ %n.vec, %middle.block ]
  %.04254.ph = phi i64 [ 0, %.lr.ph57.preheader ], [ %34, %middle.block ]
  br label %.lr.ph57

vector.ph:                                        ; preds = %.lr.ph57.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %31, %vector.body ]
  %vec.phi87 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %32, %vector.body ]
  %27 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %index
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %wide.load = load <2 x i32>, ptr %27, align 16, !tbaa !5
  %wide.load88 = load <2 x i32>, ptr %28, align 8, !tbaa !5
  %29 = sext <2 x i32> %wide.load to <2 x i64>
  %30 = sext <2 x i32> %wide.load88 to <2 x i64>
  %31 = add <2 x i64> %vec.phi, %29
  %32 = add <2 x i64> %vec.phi87, %30
  %index.next = add nuw i64 %index, 4
  %33 = icmp eq i64 %index.next, %n.vec
  br i1 %33, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %32, %31
  %34 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge58, label %.lr.ph57.preheader91

._crit_edge58:                                    ; preds = %.lr.ph57, %middle.block, %20
  %.042.lcssa = phi i64 [ 0, %20 ], [ %34, %middle.block ], [ %42, %.lr.ph57 ]
  %35 = load i64, ptr %1, align 8, !tbaa !16
  %36 = icmp slt i64 %.042.lcssa, %35
  %37 = add nsw i64 %24, -1
  %.146 = select i1 %36, i64 %37, i64 %.04559
  %.144 = select i1 %36, i64 %.04360, i64 %24
  %38 = icmp slt i64 %.144, %.146
  br i1 %38, label %20, label %43, !llvm.loop !18

.lr.ph57:                                         ; preds = %.lr.ph57.preheader91, %.lr.ph57
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph57 ], [ %indvars.iv75.ph, %.lr.ph57.preheader91 ]
  %.04254 = phi i64 [ %42, %.lr.ph57 ], [ %.04254.ph, %.lr.ph57.preheader91 ]
  %39 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %indvars.iv75
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = add nsw i64 %.04254, %41
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !19

43:                                               ; preds = %._crit_edge58
  %44 = add nsw i64 %.144, 1
  call void @"_ZZ4mainENK3$_2clEx"(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %44)
  %45 = load i64, ptr %1, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  %46 = load i32, ptr %0, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph64, label %._crit_edge65

.lr.ph64:                                         ; preds = %43
  %.sroa.27.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  br label %50

._crit_edge65:                                    ; preds = %67, %43
  %48 = phi i32 [ %46, %43 ], [ %68, %67 ]
  %.039.lcssa = phi i64 [ %45, %43 ], [ %56, %67 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %49 = icmp sgt i64 %.039.lcssa, 0
  br i1 %49, label %.lr.ph69, label %.preheader

.lr.ph69:                                         ; preds = %._crit_edge65
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  br label %74

50:                                               ; preds = %.lr.ph64, %67
  %51 = phi i32 [ %46, %.lr.ph64 ], [ %68, %67 ]
  %.03962 = phi i64 [ %45, %.lr.ph64 ], [ %56, %67 ]
  %storemerge61 = phi i32 [ 0, %.lr.ph64 ], [ %70, %67 ]
  %52 = sext i32 %storemerge61 to i64
  %53 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = sub nsw i64 %.03962, %55
  %57 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %52
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp slt i32 %54, %58
  br i1 %59, label %60, label %67

60:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %61 = call noundef i64 @"_ZZ4mainENK3$_1clEii"(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %54, i32 noundef %58)
  store i64 %61, ptr %7, align 8, !tbaa !16
  %62 = invoke { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %63 unwind label %65

63:                                               ; preds = %60
  %.fca.0.extract4 = extractvalue { i64, i32 } %62, 0
  %.fca.1.extract5 = extractvalue { i64, i32 } %62, 1
  store i64 %.fca.0.extract4, ptr %6, align 8
  store i32 %.fca.1.extract5, ptr %.sroa.27.0..sroa_idx, align 8
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 8 dereferenceable(12) %6)
          to label %64 unwind label %65

64:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  %.pre = load i32, ptr %5, align 4, !tbaa !5
  %.pre81 = load i32, ptr %0, align 4, !tbaa !5
  br label %67

65:                                               ; preds = %63, %60
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %114

67:                                               ; preds = %50, %64
  %68 = phi i32 [ %51, %50 ], [ %.pre81, %64 ]
  %69 = phi i32 [ %storemerge61, %50 ], [ %.pre, %64 ]
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %5, align 4, !tbaa !5
  %71 = icmp slt i32 %70, %68
  br i1 %71, label %50, label %._crit_edge65, !llvm.loop !20

.preheader.loopexit:                              ; preds = %96
  %.pre82 = load i32, ptr %0, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %._crit_edge65
  %72 = phi i32 [ %.pre82, %.preheader.loopexit ], [ %48, %._crit_edge65 ]
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph71, label %._crit_edge72

74:                                               ; preds = %.lr.ph69, %96
  %.14067 = phi i64 [ %.039.lcssa, %.lr.ph69 ], [ %97, %96 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %75 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = load i32, ptr %76, align 8, !tbaa !21
  store i32 %77, ptr %8, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %78 unwind label %92

78:                                               ; preds = %74
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %81, align 4, !tbaa !5
  %84 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %80
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp slt i32 %83, %85
  br i1 %86, label %87, label %96

87:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %88 = call noundef i64 @"_ZZ4mainENK3$_1clEii"(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %83, i32 noundef %85)
  store i64 %88, ptr %10, align 8, !tbaa !16
  %89 = invoke { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %90 unwind label %94

90:                                               ; preds = %87
  %.fca.0.extract = extractvalue { i64, i32 } %89, 0
  %.fca.1.extract = extractvalue { i64, i32 } %89, 1
  store i64 %.fca.0.extract, ptr %9, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 8 dereferenceable(12) %9)
          to label %91 unwind label %94

91:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  br label %96

92:                                               ; preds = %74
  %93 = landingpad { ptr, i32 }
          cleanup
  br label %99

94:                                               ; preds = %90, %87
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  br label %99

96:                                               ; preds = %91, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  %97 = add nsw i64 %.14067, -1
  %98 = icmp sgt i64 %.14067, 1
  br i1 %98, label %74, label %.preheader.loopexit, !llvm.loop !23

99:                                               ; preds = %94, %92
  %.pn = phi { ptr, i32 } [ %95, %94 ], [ %93, %92 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %114

._crit_edge72:                                    ; preds = %.lr.ph71, %.preheader
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #8
  ret i32 0

.lr.ph71:                                         ; preds = %.preheader, %.lr.ph71
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.lr.ph71 ], [ 0, %.preheader ]
  %100 = phi i32 [ %111, %.lr.ph71 ], [ %72, %.preheader ]
  %101 = getelementptr inbounds [300001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %indvars.iv78
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %100, -1
  %104 = zext i32 %103 to i64
  %105 = icmp eq i64 %indvars.iv78, %104
  %106 = zext i1 %105 to i64
  %107 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !24
  %109 = sext i8 %108 to i32
  %110 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %102, i32 noundef %109)
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %111 = load i32, ptr %0, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = icmp slt i64 %indvars.iv.next79, %112
  br i1 %113, label %.lr.ph71, label %._crit_edge72, !llvm.loop !25

114:                                              ; preds = %99, %65
  %.pn50 = phi { ptr, i32 } [ %66, %65 ], [ %.pn, %99 ]
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #8
  resume { ptr, i32 } %.pn50
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZ4mainENK3$_2clEx"(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @"_ZZ4mainENK3$_1clEii"(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) local_unnamed_addr #6 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #4 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #7

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

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

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


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