; LLVM IR from tangjz/acm-icpc :: leetcode/extra (Shopee_003-Order Delivery)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair.10" = type { i32, i32 }

@_ZN4Flow1NE = external dso_local global i32, align 4
@_ZN4Flow1ME = external dso_local global i32, align 4
@_ZN4Flow1SE = external dso_local global i32, align 4
@_ZN4Flow1TE = external dso_local global i32, align 4
@_ZN4Flow3lnkE = external dso_local global [45 x i32], align 16
@_ZN4Flow4flowE = external dso_local global i32, align 4
@_ZN4Flow3sumE = external dso_local global i64, align 8
@_ZN4Flow4costE = external dso_local global i64, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Flow7addEdgeEiiix(i32 noundef, i32 noundef, i32 noundef, i64 noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Flow7minCostEi(i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN4Flow5solveEiRSt6vectorIS0_IiSaIiEESaIS2_EERS0_IS0_ISt4pairIiiESaIS7_EESaIS9_EERS2_(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #3 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = add nsw i32 %17, %18
  %20 = add nsw i32 %19, 2
  store i32 %20, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  %21 = load i32, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  %22 = sub nsw i32 %21, 2
  store i32 %22, ptr @_ZN4Flow1SE, align 4, !tbaa !5
  %23 = load i32, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  %24 = sub nsw i32 %23, 1
  store i32 %24, ptr @_ZN4Flow1TE, align 4, !tbaa !5
  store i64 0, ptr @_ZN4Flow4costE, align 8, !tbaa !11
  store i32 0, ptr @_ZN4Flow4flowE, align 4, !tbaa !5
  store i64 0, ptr @_ZN4Flow3sumE, align 8, !tbaa !11
  store i32 0, ptr @_ZN4Flow1ME, align 4, !tbaa !5
  %25 = load i32, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = mul i64 %26, 4
  call void @llvm.memset.p0.i64(ptr align 16 @_ZN4Flow3lnkE, i8 -1, i64 %27, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %114, %4
  %29 = load i32, ptr %10, align 4, !tbaa !5
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %117

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %34 = load ptr, ptr %7, align 8, !tbaa !9
  %35 = load i32, ptr %10, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIiiESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %36) #5
  store ptr %37, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %38 = load ptr, ptr %12, align 8, !tbaa !9
  %39 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #5
  %40 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %39, ptr %40, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %41 = load ptr, ptr %12, align 8, !tbaa !9
  %42 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #5
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  br label %44

44:                                               ; preds = %94, %33
  %45 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br i1 %45, label %47, label %46

46:                                               ; preds = %44
  store i32 5, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %96

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %48 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  store ptr %48, ptr %15, align 8, !tbaa !9
  %49 = load i32, ptr @_ZN4Flow1SE, align 4, !tbaa !5
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = load ptr, ptr %15, align 8, !tbaa !9
  %52 = getelementptr inbounds %"struct.std::pair.10", ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 4, !tbaa !13
  call void @_ZN4Flow7addEdgeEiiix(i32 noundef %49, i32 noundef %50, i32 noundef %53, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %88, %47
  %55 = load i32, ptr %16, align 4, !tbaa !5
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 7, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %91

59:                                               ; preds = %54
  %60 = load ptr, ptr %8, align 8, !tbaa !9
  %61 = load i32, ptr %16, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62) #5
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %87

66:                                               ; preds = %59
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = load i32, ptr %16, align 4, !tbaa !5
  %70 = add nsw i32 %68, %69
  %71 = load ptr, ptr %15, align 8, !tbaa !9
  %72 = getelementptr inbounds %"struct.std::pair.10", ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 4, !tbaa !13
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %76) #5
  %78 = load i32, ptr %16, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef %79) #5
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = load ptr, ptr %15, align 8, !tbaa !9
  %83 = getelementptr inbounds %"struct.std::pair.10", ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !15
  %85 = mul nsw i32 %81, %84
  %86 = sext i32 %85 to i64
  call void @_ZN4Flow7addEdgeEiiix(i32 noundef %67, i32 noundef %70, i32 noundef %73, i64 noundef %86)
  br label %87

87:                                               ; preds = %66, %59
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %16, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %16, align 4, !tbaa !5
  br label %54, !llvm.loop !16

91:                                               ; preds = %58
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %94

94:                                               ; preds = %91
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br label %44

96:                                               ; preds = %46
  %97 = load ptr, ptr %8, align 8, !tbaa !9
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %97, i64 noundef %99) #5
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %113

103:                                              ; preds = %96
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = add nsw i32 %104, %105
  %107 = load i32, ptr @_ZN4Flow1TE, align 4, !tbaa !5
  %108 = load ptr, ptr %8, align 8, !tbaa !9
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %110) #5
  %112 = load i32, ptr %111, align 4, !tbaa !5
  call void @_ZN4Flow7addEdgeEiiix(i32 noundef %106, i32 noundef %107, i32 noundef %112, i64 noundef 0)
  br label %113

113:                                              ; preds = %103, %96
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %10, align 4, !tbaa !5
  br label %28, !llvm.loop !18

117:                                              ; preds = %32
  call void @_ZN4Flow7minCostEi(i32 noundef 2147483647)
  %118 = load i64, ptr @_ZN4Flow4costE, align 8, !tbaa !11
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret i64 %118
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

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

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


; 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.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZN4Flow1NE = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Flow1ME = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Flow1SE = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Flow1TE = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Flow3lnkE = external dso_local local_unnamed_addr global [45 x i32], align 16
@_ZN4Flow4flowE = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Flow3sumE = external dso_local local_unnamed_addr global i64, align 8
@_ZN4Flow4costE = external dso_local local_unnamed_addr global i64, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Flow7addEdgeEiiix(i32 noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Flow7minCostEi(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN4Flow5solveEiRSt6vectorIS0_IiSaIiEESaIS2_EERS0_IS0_ISt4pairIiiESaIS7_EESaIS9_EERS2_(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #3 {
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = shl nsw i32 %0, 1
  %8 = add nsw i32 %7, 2
  store i32 %8, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  store i32 %7, ptr @_ZN4Flow1SE, align 4, !tbaa !5
  %9 = or disjoint i32 %7, 1
  store i32 %9, ptr @_ZN4Flow1TE, align 4, !tbaa !5
  store i64 0, ptr @_ZN4Flow4costE, align 8, !tbaa !9
  store i32 0, ptr @_ZN4Flow4flowE, align 4, !tbaa !5
  store i64 0, ptr @_ZN4Flow3sumE, align 8, !tbaa !9
  store i32 0, ptr @_ZN4Flow1ME, align 4, !tbaa !5
  %10 = sext i32 %8 to i64
  %11 = shl nsw i64 %10, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZN4Flow3lnkE, i8 -1, i64 %11, i1 false)
  %12 = icmp sgt i32 %0, 0
  br i1 %12, label %.lr.ph.split.us.preheader, label %._crit_edge

.lr.ph.split.us.preheader:                        ; preds = %4
  %13 = zext nneg i32 %0 to i64
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader, %26
  %indvars.iv42 = phi i64 [ 0, %.lr.ph.split.us.preheader ], [ %indvars.iv.next43, %26 ]
  %.03040.us = phi i32 [ 0, %.lr.ph.split.us.preheader ], [ %.1.lcssa.us, %26 ]
  %14 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIiiESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv42) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %15 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  store ptr %15, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %16 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  store ptr %16, ptr %6, align 8
  %17 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %17, label %.lr.ph.us.us, label %._crit_edge38.split.us.us

._crit_edge38.split.us.us:                        ; preds = %._crit_edge.us.us, %.lr.ph.split.us
  %.1.lcssa.us = phi i32 [ %.03040.us, %.lr.ph.split.us ], [ %45, %._crit_edge.us.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv42) #5
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %.not.us = icmp eq i32 %19, 0
  br i1 %.not.us, label %26, label %20

20:                                               ; preds = %._crit_edge38.split.us.us
  %21 = load i32, ptr @_ZN4Flow1TE, align 4, !tbaa !5
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv42) #5
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = trunc i64 %indvars.iv42 to i32
  %25 = add i32 %24, %0
  call void @_ZN4Flow7addEdgeEiiix(i32 noundef %25, i32 noundef %21, i32 noundef %23, i64 noundef 0)
  br label %26

26:                                               ; preds = %20, %._crit_edge38.split.us.us
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %exitcond46.not = icmp eq i64 %indvars.iv.next43, %13
  br i1 %exitcond46.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !11

.lr.ph.us.us:                                     ; preds = %.lr.ph.split.us, %._crit_edge.us.us
  %.135.us.us = phi i32 [ %45, %._crit_edge.us.us ], [ %.03040.us, %.lr.ph.split.us ]
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %28 = load i32, ptr @_ZN4Flow1SE, align 4, !tbaa !5
  %29 = load i32, ptr %27, align 4, !tbaa !13
  call void @_ZN4Flow7addEdgeEiiix(i32 noundef %28, i32 noundef %.135.us.us, i32 noundef %29, i64 noundef 0)
  %30 = getelementptr inbounds i8, ptr %27, i64 4
  br label %31

31:                                               ; preds = %44, %.lr.ph.us.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %44 ], [ 0, %.lr.ph.us.us ]
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #5
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %.not33.us.us = icmp eq i32 %33, 0
  br i1 %.not33.us.us, label %44, label %34

34:                                               ; preds = %31
  %35 = load i32, ptr %27, align 4, !tbaa !13
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv42) #5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %indvars.iv) #5
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr %30, align 4, !tbaa !15
  %40 = mul nsw i32 %39, %38
  %41 = sext i32 %40 to i64
  %42 = trunc i64 %indvars.iv to i32
  %43 = add i32 %42, %0
  call void @_ZN4Flow7addEdgeEiiix(i32 noundef %.135.us.us, i32 noundef %43, i32 noundef %35, i64 noundef %41)
  br label %44

44:                                               ; preds = %34, %31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %13
  br i1 %exitcond.not, label %._crit_edge.us.us, label %31, !llvm.loop !16

._crit_edge.us.us:                                ; preds = %44
  %45 = add nsw i32 %.135.us.us, 1
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %47 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %47, label %.lr.ph.us.us, label %._crit_edge38.split.us.us

._crit_edge:                                      ; preds = %26, %4
  call void @_ZN4Flow7minCostEi(i32 noundef 2147483647)
  %48 = load i64, ptr @_ZN4Flow4costE, align 8, !tbaa !9
  ret i64 %48
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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


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