; LLVM IR from Tunghohin/Competitive_Coding :: Luogu/p1038.ll (Z5solvev)

; 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.graph = type { [100010 x %"struct.graph::edge"], [100010 x i64], i64 }
%"struct.graph::edge" = type { i64, i64, i64 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@st = external dso_local global [100010 x i64], align 16
@u = external dso_local global [100010 x i64], align 16
@dg = external dso_local global [100010 x i64], align 16
@g = external dso_local global %struct.graph, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 1, ptr %3, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %31, %0
  %20 = load i64, ptr %3, align 8, !tbaa !5
  %21 = load i64, ptr %1, align 8, !tbaa !5
  %22 = icmp sle i64 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %34

24:                                               ; preds = %19
  %25 = load i64, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %25
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = load i64, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %29)
  br label %31

31:                                               ; preds = %24
  %32 = load i64, ptr %3, align 8, !tbaa !5
  %33 = add nsw i64 %32, 1
  store i64 %33, ptr %3, align 8, !tbaa !5
  br label %19, !llvm.loop !9

34:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %51, %34
  %36 = load i64, ptr %4, align 8, !tbaa !5
  %37 = load i64, ptr %2, align 8, !tbaa !5
  %38 = icmp sle i64 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %44 = load i64, ptr %5, align 8, !tbaa !5
  %45 = load i64, ptr %6, align 8, !tbaa !5
  %46 = load i64, ptr %7, align 8, !tbaa !5
  call void @_ZN5graph8add_edgeExxx(ptr noundef nonnull align 8 dereferenceable(3200328) @g, i64 noundef %44, i64 noundef %45, i64 noundef %46)
  %47 = load i64, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds [100010 x i64], ptr @dg, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %48, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %51

51:                                               ; preds = %40
  %52 = load i64, ptr %4, align 8, !tbaa !5
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %4, align 8, !tbaa !5
  br label %35, !llvm.loop !11

54:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #5
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 1, ptr %9, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %79, %54
  %56 = load i64, ptr %9, align 8, !tbaa !5
  %57 = load i64, ptr %1, align 8, !tbaa !5
  %58 = icmp sle i64 %56, %57
  br i1 %58, label %60, label %59

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

60:                                               ; preds = %55
  %61 = load i64, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds [100010 x i64], ptr @dg, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = icmp eq i64 %63, 0
  br i1 %64, label %65, label %78

65:                                               ; preds = %60
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %66 unwind label %74

66:                                               ; preds = %65
  %67 = load i64, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = load i64, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = add nsw i64 %72, %69
  store i64 %73, ptr %71, align 8, !tbaa !5
  br label %78

74:                                               ; preds = %65
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %10, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %210

78:                                               ; preds = %66, %60
  br label %79

79:                                               ; preds = %78
  %80 = load i64, ptr %9, align 8, !tbaa !5
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %9, align 8, !tbaa !5
  br label %55, !llvm.loop !12

82:                                               ; preds = %59
  br label %83

83:                                               ; preds = %159, %82
  %84 = invoke noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %85 unwind label %105

85:                                               ; preds = %83
  %86 = xor i1 %84, true
  br i1 %86, label %87, label %161

87:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIxSt5dequeIxSaIxEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %89 unwind label %109

89:                                               ; preds = %87
  %90 = load i64, ptr %88, align 8, !tbaa !5
  store i64 %90, ptr %12, align 8, !tbaa !5
  %91 = load i64, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = load i64, ptr %12, align 8, !tbaa !5
  %95 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = sub nsw i64 %96, %93
  store i64 %97, ptr %95, align 8, !tbaa !5
  %98 = load i64, ptr %12, align 8, !tbaa !5
  %99 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !5
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %102, label %113

102:                                              ; preds = %89
  %103 = load i64, ptr %12, align 8, !tbaa !5
  %104 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %103
  store i64 0, ptr %104, align 8, !tbaa !5
  br label %113

105:                                              ; preds = %83
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %10, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %11, align 4
  br label %210

109:                                              ; preds = %113, %87
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %10, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %11, align 4
  br label %160

113:                                              ; preds = %102, %89
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %114 unwind label %109

114:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %115 = load i64, ptr %12, align 8, !tbaa !5
  %116 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (%struct.graph, ptr @g, i32 0, i32 1), i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !5
  store i64 %117, ptr %13, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %154, %114
  %119 = load i64, ptr %13, align 8, !tbaa !5
  %120 = icmp ne i64 %119, 0
  br i1 %120, label %122, label %121

121:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %159

122:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %123 = load i64, ptr %13, align 8, !tbaa !5
  %124 = getelementptr inbounds [100010 x %"struct.graph::edge"], ptr @g, i64 0, i64 %123
  %125 = getelementptr inbounds %"struct.graph::edge", ptr %124, i32 0, i32 0
  %126 = load i64, ptr %125, align 8, !tbaa !13
  store i64 %126, ptr %14, align 8, !tbaa !5
  %127 = load i64, ptr %13, align 8, !tbaa !5
  %128 = getelementptr inbounds [100010 x %"struct.graph::edge"], ptr @g, i64 0, i64 %127
  %129 = getelementptr inbounds %"struct.graph::edge", ptr %128, i32 0, i32 2
  %130 = load i64, ptr %129, align 8, !tbaa !15
  %131 = load i64, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !5
  %134 = mul nsw i64 %130, %133
  %135 = load i64, ptr %14, align 8, !tbaa !5
  %136 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !5
  %138 = add nsw i64 %137, %134
  store i64 %138, ptr %136, align 8, !tbaa !5
  %139 = load i64, ptr %14, align 8, !tbaa !5
  %140 = getelementptr inbounds [100010 x i64], ptr @dg, i64 0, i64 %139
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = add nsw i64 %141, -1
  store i64 %142, ptr %140, align 8, !tbaa !5
  %143 = load i64, ptr %14, align 8, !tbaa !5
  %144 = getelementptr inbounds [100010 x i64], ptr @dg, i64 0, i64 %143
  %145 = load i64, ptr %144, align 8, !tbaa !5
  %146 = icmp eq i64 %145, 0
  br i1 %146, label %147, label %153

147:                                              ; preds = %122
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %148 unwind label %149

148:                                              ; preds = %147
  br label %153

149:                                              ; preds = %147
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %10, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %160

153:                                              ; preds = %148, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %154

154:                                              ; preds = %153
  %155 = load i64, ptr %13, align 8, !tbaa !5
  %156 = getelementptr inbounds [100010 x %"struct.graph::edge"], ptr @g, i64 0, i64 %155
  %157 = getelementptr inbounds %"struct.graph::edge", ptr %156, i32 0, i32 1
  %158 = load i64, ptr %157, align 8, !tbaa !16
  store i64 %158, ptr %13, align 8, !tbaa !5
  br label %118, !llvm.loop !17

159:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %83, !llvm.loop !18

160:                                              ; preds = %149, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %210

161:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 1, ptr %16, align 8, !tbaa !5
  br label %162

162:                                              ; preds = %195, %161
  %163 = load i64, ptr %16, align 8, !tbaa !5
  %164 = load i64, ptr %1, align 8, !tbaa !5
  %165 = icmp sle i64 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %198

167:                                              ; preds = %162
  %168 = load i64, ptr %16, align 8, !tbaa !5
  %169 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (%struct.graph, ptr @g, i32 0, i32 1), i64 0, i64 %168
  %170 = load i64, ptr %169, align 8, !tbaa !5
  %171 = icmp eq i64 %170, 0
  br i1 %171, label %172, label %194

172:                                              ; preds = %167
  %173 = load i64, ptr %16, align 8, !tbaa !5
  %174 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !5
  %176 = icmp ne i64 %175, 0
  br i1 %176, label %177, label %194

177:                                              ; preds = %172
  store i64 1, ptr %15, align 8, !tbaa !5
  %178 = load i64, ptr %16, align 8, !tbaa !5
  %179 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %178)
          to label %180 unwind label %190

180:                                              ; preds = %177
  %181 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %179, i8 noundef signext 32)
          to label %182 unwind label %190

182:                                              ; preds = %180
  %183 = load i64, ptr %16, align 8, !tbaa !5
  %184 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %183
  %185 = load i64, ptr %184, align 8, !tbaa !5
  %186 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %181, i64 noundef %185)
          to label %187 unwind label %190

187:                                              ; preds = %182
  %188 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %186, i8 noundef signext 10)
          to label %189 unwind label %190

189:                                              ; preds = %187
  br label %194

190:                                              ; preds = %187, %182, %180, %177
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %10, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %209

194:                                              ; preds = %189, %172, %167
  br label %195

195:                                              ; preds = %194
  %196 = load i64, ptr %16, align 8, !tbaa !5
  %197 = add nsw i64 %196, 1
  store i64 %197, ptr %16, align 8, !tbaa !5
  br label %162, !llvm.loop !19

198:                                              ; preds = %166
  %199 = load i64, ptr %15, align 8, !tbaa !5
  %200 = icmp ne i64 %199, 0
  br i1 %200, label %208, label %201

201:                                              ; preds = %198
  %202 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %203 unwind label %204

203:                                              ; preds = %201
  br label %208

204:                                              ; preds = %201
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %10, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %11, align 4
  br label %209

208:                                              ; preds = %203, %198
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void

209:                                              ; preds = %204, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %210

210:                                              ; preds = %209, %160, %105, %74
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  br label %211

211:                                              ; preds = %210
  %212 = load ptr, ptr %10, align 8
  %213 = load i32, ptr %11, align 4
  %214 = insertvalue { ptr, i32 } poison, ptr %212, 0
  %215 = insertvalue { ptr, i32 } %214, i32 %213, 1
  resume { ptr, i32 } %215
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5graph8add_edgeExxx(ptr noundef nonnull align 8 dereferenceable(3200328), i64 noundef, i64 noundef, i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #5 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN5graph4edgeE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!14, !6, i64 16}
!16 = !{!14, !6, i64 8}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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"

%struct.graph = type { [100010 x %"struct.graph::edge"], [100010 x i64], i64 }
%"struct.graph::edge" = type { i64, i64, i64 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@st = external dso_local global [100010 x i64], align 16
@u = external dso_local global [100010 x i64], align 16
@dg = external dso_local local_unnamed_addr global [100010 x i64], align 16
@g = external dso_local global %struct.graph, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::queue", align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %11 = load i64, ptr %1, align 8, !tbaa !5
  %.not45 = icmp slt i64 %11, 1
  br i1 %.not45, label %.preheader43, label %.lr.ph

.preheader43:                                     ; preds = %.lr.ph, %0
  %12 = load i64, ptr %2, align 8, !tbaa !5
  %.not3347 = icmp slt i64 %12, 1
  br i1 %.not3347, label %._crit_edge, label %.lr.ph49

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.02646 = phi i64 [ %17, %.lr.ph ], [ 1, %0 ]
  %13 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %.02646
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %15 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %.02646
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %17 = add nuw nsw i64 %.02646, 1
  %18 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not = icmp slt i64 %.02646, %18
  br i1 %.not.not, label %.lr.ph, label %.preheader43, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph49, %.preheader43
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #6
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store i64 1, ptr %7, align 8, !tbaa !5
  %19 = load i64, ptr %1, align 8, !tbaa !5
  %.not3450 = icmp slt i64 %19, 1
  br i1 %.not3450, label %._crit_edge54, label %.lr.ph53

.lr.ph49:                                         ; preds = %.preheader43, %.lr.ph49
  %.03148 = phi i64 [ %30, %.lr.ph49 ], [ 1, %.preheader43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %23 = load i64, ptr %3, align 8, !tbaa !5
  %24 = load i64, ptr %4, align 8, !tbaa !5
  %25 = load i64, ptr %5, align 8, !tbaa !5
  call void @_ZN5graph8add_edgeExxx(ptr noundef nonnull align 8 dereferenceable(3200328) @g, i64 noundef %23, i64 noundef %24, i64 noundef %25)
  %26 = load i64, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds [100010 x i64], ptr @dg, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %29 = add nsw i64 %28, 1
  store i64 %29, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %30 = add nuw nsw i64 %.03148, 1
  %31 = load i64, ptr %2, align 8, !tbaa !5
  %.not33.not = icmp slt i64 %.03148, %31
  br i1 %.not33.not, label %.lr.ph49, label %._crit_edge, !llvm.loop !11

._crit_edge54:                                    ; preds = %47, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %32 = call noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %32, label %.preheader, label %.lr.ph61

.lr.ph53:                                         ; preds = %._crit_edge, %47
  %33 = phi i64 [ %48, %47 ], [ %19, %._crit_edge ]
  %storemerge51 = phi i64 [ %50, %47 ], [ 1, %._crit_edge ]
  %34 = getelementptr inbounds [100010 x i64], ptr @dg, i64 0, i64 %storemerge51
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = icmp eq i64 %35, 0
  br i1 %36, label %37, label %47

37:                                               ; preds = %.lr.ph53
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %38 unwind label %45

38:                                               ; preds = %37
  %39 = load i64, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !5
  %42 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %39
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = add nsw i64 %43, %41
  store i64 %44, ptr %42, align 8, !tbaa !5
  %.pre = load i64, ptr %1, align 8, !tbaa !5
  br label %47

45:                                               ; preds = %37
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %104

47:                                               ; preds = %.lr.ph53, %38
  %48 = phi i64 [ %33, %.lr.ph53 ], [ %.pre, %38 ]
  %49 = phi i64 [ %storemerge51, %.lr.ph53 ], [ %39, %38 ]
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %7, align 8, !tbaa !5
  %.not34.not = icmp slt i64 %49, %48
  br i1 %.not34.not, label %.lr.ph53, label %._crit_edge54, !llvm.loop !12

.loopexit:                                        ; preds = %78, %.lr.ph61
  %51 = call noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %51, label %.preheader, label %.lr.ph61, !llvm.loop !13

.preheader:                                       ; preds = %.loopexit, %._crit_edge54
  %52 = load i64, ptr %1, align 8, !tbaa !5
  %.not3562 = icmp slt i64 %52, 1
  br i1 %.not3562, label %._crit_edge66.thread, label %.lr.ph65.outer

.lr.ph65.outer:                                   ; preds = %.preheader, %.thread
  %.ph = phi i64 [ %.pre68, %.thread ], [ %52, %.preheader ]
  %.064.ph = phi i64 [ %100, %.thread ], [ 1, %.preheader ]
  %53 = phi i1 [ false, %.thread ], [ true, %.preheader ]
  br label %.lr.ph65

.lr.ph61:                                         ; preds = %._crit_edge54, %.loopexit
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIxSt5dequeIxSaIxEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %55
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = sub nsw i64 %59, %57
  %spec.select = call i64 @llvm.smax.i64(i64 %60, i64 0)
  store i64 %spec.select, ptr %58, align 8, !tbaa !5
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %61 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @g, i64 2400240), i64 0, i64 %55
  %.02555 = load i64, ptr %61, align 8, !tbaa !5
  %.not4056 = icmp eq i64 %.02555, 0
  br i1 %.not4056, label %.loopexit, label %.lr.ph59

.lr.ph59:                                         ; preds = %.lr.ph61, %78
  %.02557 = phi i64 [ %.025, %78 ], [ %.02555, %.lr.ph61 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %62 = getelementptr inbounds [100010 x %"struct.graph::edge"], ptr @g, i64 0, i64 %.02557
  %63 = load i64, ptr %62, align 8, !tbaa !14
  store i64 %63, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %62, i64 16
  %65 = load i64, ptr %64, align 8, !tbaa !16
  %66 = load i64, ptr %58, align 8, !tbaa !5
  %67 = mul nsw i64 %66, %65
  %68 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %63
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = add nsw i64 %69, %67
  store i64 %70, ptr %68, align 8, !tbaa !5
  %71 = getelementptr inbounds [100010 x i64], ptr @dg, i64 0, i64 %63
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = add nsw i64 %72, -1
  store i64 %73, ptr %71, align 8, !tbaa !5
  %74 = icmp eq i64 %73, 0
  br i1 %74, label %75, label %78

75:                                               ; preds = %.lr.ph59
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %78 unwind label %76

76:                                               ; preds = %75
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %104

78:                                               ; preds = %75, %.lr.ph59
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %79 = getelementptr inbounds i8, ptr %62, i64 8
  %.025 = load i64, ptr %79, align 8, !tbaa !5
  %.not40 = icmp eq i64 %.025, 0
  br i1 %.not40, label %.loopexit, label %.lr.ph59, !llvm.loop !17

._crit_edge66:                                    ; preds = %98
  br i1 %53, label %._crit_edge66.thread, label %._crit_edge66.thread73

.lr.ph65:                                         ; preds = %.lr.ph65.outer, %98
  %.064 = phi i64 [ %99, %98 ], [ %.064.ph, %.lr.ph65.outer ]
  %80 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @g, i64 2400240), i64 0, i64 %.064
  %81 = load i64, ptr %80, align 8, !tbaa !5
  %82 = icmp eq i64 %81, 0
  br i1 %82, label %83, label %98

83:                                               ; preds = %.lr.ph65
  %84 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %.064
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %.not37 = icmp eq i64 %85, 0
  br i1 %.not37, label %98, label %86

86:                                               ; preds = %83
  %87 = getelementptr inbounds [100010 x i64], ptr @st, i64 0, i64 %.064
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.064)
          to label %89 unwind label %96

89:                                               ; preds = %86
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %88, i8 noundef signext 32)
          to label %91 unwind label %96

91:                                               ; preds = %89
  %92 = load i64, ptr %87, align 8, !tbaa !5
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %90, i64 noundef %92)
          to label %94 unwind label %96

94:                                               ; preds = %91
  %95 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %93, i8 noundef signext 10)
          to label %.thread unwind label %96

96:                                               ; preds = %94, %91, %89, %86
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %104

98:                                               ; preds = %.lr.ph65, %83
  %99 = add nuw nsw i64 %.064, 1
  %.not35.not = icmp slt i64 %.064, %.ph
  br i1 %.not35.not, label %.lr.ph65, label %._crit_edge66, !llvm.loop !18

.thread:                                          ; preds = %94
  %.pre68 = load i64, ptr %1, align 8, !tbaa !5
  %100 = add nuw nsw i64 %.064, 1
  %.not35.not71 = icmp slt i64 %.064, %.pre68
  br i1 %.not35.not71, label %.lr.ph65.outer, label %._crit_edge66.thread73, !llvm.loop !18

._crit_edge66.thread:                             ; preds = %.preheader, %._crit_edge66
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %._crit_edge66.thread73 unwind label %102

102:                                              ; preds = %._crit_edge66.thread
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %104

._crit_edge66.thread73:                           ; preds = %.thread, %._crit_edge66.thread, %._crit_edge66
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret void

104:                                              ; preds = %96, %102, %76, %45
  %.pn41 = phi { ptr, i32 } [ %46, %45 ], [ %77, %76 ], [ %97, %96 ], [ %103, %102 ]
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn41
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5graph8add_edgeExxx(ptr noundef nonnull align 8 dereferenceable(3200328), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

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

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

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


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