; LLVM IR from reyadussalahin/problem-solving :: graph/dfs/codeforces/F1363E/Solution.ll (Z3dfsix)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@adj = external dso_local global [200010 x %"class.std::vector"], align 16
@seen = external dso_local global [200010 x i8], align 16
@a = external dso_local global [200010 x i64], align 16
@b = external dso_local global [200010 x i32], align 16
@c = external dso_local global [200010 x i32], align 16
@minTotCost = external dso_local global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z3dfsix(i32 noundef %0, i64 noundef %1) #0 {
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [200010 x i8], ptr @seen, i64 0, i64 %15
  store i8 1, ptr %16, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  %17 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i64 %17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @adj, i64 0, i64 %19
  store ptr %20, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %21 = load ptr, ptr %8, align 8, !tbaa !13
  %22 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %24 = load ptr, ptr %8, align 8, !tbaa !13
  %25 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #4
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  br label %27

27:                                               ; preds = %57, %2
  %28 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br i1 %28, label %30, label %29

29:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %59

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  %32 = load i32, ptr %31, align 4, !tbaa !5
  store i32 %32, ptr %11, align 4, !tbaa !5
  %33 = load i32, ptr %11, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [200010 x i8], ptr @seen, i64 0, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !11, !range !15, !noundef !16
  %37 = trunc i8 %36 to i1
  br i1 %37, label %56, label %38

38:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %39 = load i32, ptr %11, align 4, !tbaa !5
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %41
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %44 = load i64, ptr %43, align 8, !tbaa !9
  %45 = call i64 @_Z3dfsix(i32 noundef %39, i64 noundef %44)
  store i64 %45, ptr %12, align 4
  %46 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %47 = load i32, ptr %46, align 4, !tbaa !17
  %48 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %49 = load i32, ptr %48, align 4, !tbaa !17
  %50 = add nsw i32 %49, %47
  store i32 %50, ptr %48, align 4, !tbaa !17
  %51 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !19
  %53 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %54 = load i32, ptr %53, align 4, !tbaa !19
  %55 = add nsw i32 %54, %52
  store i32 %55, ptr %53, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %56

56:                                               ; preds = %38, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %57

57:                                               ; preds = %56
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br label %27

59:                                               ; preds = %29
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [200010 x i32], ptr @b, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [200010 x i32], ptr @c, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp ne i32 %63, %67
  br i1 %68, label %69, label %84

69:                                               ; preds = %59
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [200010 x i32], ptr @c, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %79

75:                                               ; preds = %69
  %76 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !17
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %76, align 4, !tbaa !17
  br label %83

79:                                               ; preds = %69
  %80 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !19
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %80, align 4, !tbaa !19
  br label %83

83:                                               ; preds = %79, %75
  br label %84

84:                                               ; preds = %83, %59
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !9
  %89 = load i64, ptr %5, align 8, !tbaa !9
  %90 = icmp sle i64 %88, %89
  br i1 %90, label %91, label %114

91:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %92 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %93 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %92, ptr noundef nonnull align 4 dereferenceable(4) %93)
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %13, align 4, !tbaa !5
  %96 = load i64, ptr @minTotCost, align 8, !tbaa !9
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = mul nsw i64 2, %98
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = mul nsw i64 %99, %103
  %105 = add nsw i64 %96, %104
  store i64 %105, ptr @minTotCost, align 8, !tbaa !9
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %108 = load i32, ptr %107, align 4, !tbaa !17
  %109 = sub nsw i32 %108, %106
  store i32 %109, ptr %107, align 4, !tbaa !17
  %110 = load i32, ptr %13, align 4, !tbaa !5
  %111 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !19
  %113 = sub nsw i32 %112, %110
  store i32 %113, ptr %111, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %114

114:                                              ; preds = %91, %84
  %115 = load i64, ptr %3, align 4
  ret i64 %115
}

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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 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 #4 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!19 = !{!18, !6, i64 4}


; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@adj = external dso_local global [200010 x %"class.std::vector"], align 16
@seen = external dso_local local_unnamed_addr global [200010 x i8], align 16
@a = external dso_local global [200010 x i64], align 16
@b = external dso_local local_unnamed_addr global [200010 x i32], align 16
@c = external dso_local local_unnamed_addr global [200010 x i32], align 16
@minTotCost = external dso_local local_unnamed_addr global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z3dfsix(i32 noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i64 %1, ptr %4, align 8, !tbaa !5
  %9 = sext i32 %0 to i64
  %10 = getelementptr inbounds [200010 x i8], ptr @seen, i64 0, i64 %9
  store i8 1, ptr %10, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !11
  %11 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %11, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  %12 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @adj, i64 0, i64 %9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %13 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  store ptr %13, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %14 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  store ptr %14, ptr %8, align 8
  %15 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %16 = trunc i64 %11 to i32
  %17 = lshr i64 %11, 32
  %18 = trunc nuw i64 %17 to i32
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %19 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %9
  %20 = getelementptr inbounds i8, ptr %3, i64 4
  br label %27

._crit_edge:                                      ; preds = %44, %2
  %21 = phi i32 [ %16, %2 ], [ %45, %44 ]
  %22 = phi i32 [ %18, %2 ], [ %46, %44 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  %23 = getelementptr inbounds [200010 x i32], ptr @b, i64 0, i64 %9
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %25 = getelementptr inbounds [200010 x i32], ptr @c, i64 0, i64 %9
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %.not = icmp eq i32 %24, %26
  br i1 %.not, label %58, label %51

27:                                               ; preds = %.lr.ph, %44
  %28 = phi i32 [ %16, %.lr.ph ], [ %45, %44 ]
  %29 = phi i32 [ %18, %.lr.ph ], [ %46, %44 ]
  %30 = phi i32 [ %18, %.lr.ph ], [ %47, %44 ]
  %31 = phi i32 [ %16, %.lr.ph ], [ %48, %44 ]
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [200010 x i8], ptr @seen, i64 0, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !9, !range !13, !noundef !14
  %37 = trunc nuw i8 %36 to i1
  br i1 %37, label %44, label %38

38:                                               ; preds = %27
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = call i64 @_Z3dfsix(i32 noundef %33, i64 noundef %40)
  %.sroa.0.0.extract.trunc = trunc i64 %41 to i32
  %.sroa.4.0.extract.shift = lshr i64 %41, 32
  %.sroa.4.0.extract.trunc = trunc nuw i64 %.sroa.4.0.extract.shift to i32
  %42 = add nsw i32 %31, %.sroa.0.0.extract.trunc
  store i32 %42, ptr %3, align 8, !tbaa !15
  %43 = add nsw i32 %30, %.sroa.4.0.extract.trunc
  store i32 %43, ptr %20, align 4, !tbaa !17
  br label %44

44:                                               ; preds = %38, %27
  %45 = phi i32 [ %42, %38 ], [ %28, %27 ]
  %46 = phi i32 [ %43, %38 ], [ %29, %27 ]
  %47 = phi i32 [ %43, %38 ], [ %30, %27 ]
  %48 = phi i32 [ %42, %38 ], [ %31, %27 ]
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %50 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  br i1 %50, label %27, label %._crit_edge

51:                                               ; preds = %._crit_edge
  %52 = icmp eq i32 %26, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %51
  %54 = add nsw i32 %21, 1
  store i32 %54, ptr %3, align 8, !tbaa !15
  br label %58

55:                                               ; preds = %51
  %56 = getelementptr inbounds i8, ptr %3, i64 4
  %57 = add nsw i32 %22, 1
  store i32 %57, ptr %56, align 4, !tbaa !17
  br label %58

58:                                               ; preds = %53, %55, %._crit_edge
  %59 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %9
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = load i64, ptr %4, align 8, !tbaa !5
  %.not14 = icmp sgt i64 %60, %61
  br i1 %.not14, label %76, label %62

62:                                               ; preds = %58
  %63 = getelementptr inbounds i8, ptr %3, i64 4
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %63)
  %65 = load i32, ptr %64, align 4, !tbaa !11
  %66 = load i64, ptr @minTotCost, align 8, !tbaa !5
  %67 = sext i32 %65 to i64
  %68 = shl nsw i64 %67, 1
  %69 = load i64, ptr %59, align 8, !tbaa !5
  %70 = mul nsw i64 %68, %69
  %71 = add nsw i64 %70, %66
  store i64 %71, ptr @minTotCost, align 8, !tbaa !5
  %72 = load <2 x i32>, ptr %3, align 8, !tbaa !11
  %73 = insertelement <2 x i32> poison, i32 %65, i64 0
  %74 = shufflevector <2 x i32> %73, <2 x i32> poison, <2 x i32> zeroinitializer
  %75 = sub nsw <2 x i32> %72, %74
  store <2 x i32> %75, ptr %3, align 8, !tbaa !11
  br label %76

76:                                               ; preds = %62, %58
  %77 = load i64, ptr %3, align 8
  ret i64 %77
}

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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 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 #4 = { 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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !12, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!17 = !{!16, !12, i64 4}


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