; LLVM IR from tangjz/acm-icpc :: Summer_Training/2016-07-19/A - Abandoned country - liuzy.ll (Z3BFSv)

; 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.Edge = type { i32, i32, i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@N = external dso_local global i32, align 4
@V = external dso_local global [110000 x i32], align 16
@use = external dso_local global [3100000 x i32], align 16
@son = external dso_local global [110000 x i32], align 16
@stamp = external dso_local global i32, align 4
@pre = external dso_local global [110000 x i32], align 16
@t = external dso_local global [110000 x i32], align 16
@in = external dso_local global [110000 x i32], align 16
@E = external dso_local global [3100000 x %struct.Edge], align 16
@ans2 = external dso_local global i64, align 8
@Q = external dso_local global %"class.std::queue", align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3BFSv() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr getelementptr inbounds ([110000 x i32], ptr @pre, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) @Q, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  store i32 1, ptr getelementptr inbounds ([110000 x i32], ptr @in, i64 0, i64 1), align 4, !tbaa !5
  br label %4

4:                                                ; preds = %65, %0
  %5 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  %6 = xor i1 %5, true
  br i1 %6, label %7, label %66

7:                                                ; preds = %4
  %8 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  %9 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %9, ptr %1, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = load i32, ptr @stamp, align 4, !tbaa !5
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr @stamp, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [110000 x i32], ptr @t, i64 0, i64 %13
  store i32 %10, ptr %14, align 4, !tbaa !5
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [110000 x i32], ptr @V, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %18, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %59, %7
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %65

22:                                               ; preds = %19
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [3100000 x i32], ptr @use, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %58

28:                                               ; preds = %22
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %30
  %32 = getelementptr inbounds %struct.Edge, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [110000 x i32], ptr @in, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %58, label %38

38:                                               ; preds = %28
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.Edge, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [110000 x i32], ptr @pre, i64 0, i64 %45
  store i32 %39, ptr %46, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %48
  %50 = getelementptr inbounds %struct.Edge, ptr %49, i32 0, i32 1
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @Q, ptr noundef nonnull align 4 dereferenceable(4) %50)
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %52
  %54 = getelementptr inbounds %struct.Edge, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [110000 x i32], ptr @in, i64 0, i64 %56
  store i32 1, ptr %57, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %38, %28, %22
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %61
  %63 = getelementptr inbounds %struct.Edge, ptr %62, i32 0, i32 3
  %64 = load i32, ptr %63, align 4, !tbaa !11
  store i32 %64, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !12

65:                                               ; preds = %19
  br label %4, !llvm.loop !14

66:                                               ; preds = %4
  %67 = load i32, ptr @stamp, align 4, !tbaa !5
  store i32 %67, ptr %2, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %122, %66
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %125

71:                                               ; preds = %68
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [110000 x i32], ptr @t, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %1, align 4, !tbaa !5
  %76 = load i32, ptr %1, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [110000 x i32], ptr @son, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %78, align 4, !tbaa !5
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [110000 x i32], ptr @son, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = load i32, ptr %1, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [110000 x i32], ptr @pre, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %90
  %92 = getelementptr inbounds %struct.Edge, ptr %91, i32 0, i32 2
  %93 = load i32, ptr %92, align 8, !tbaa !15
  %94 = sext i32 %93 to i64
  %95 = mul nsw i64 %85, %94
  %96 = load i32, ptr @N, align 4, !tbaa !5
  %97 = load i32, ptr %1, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [110000 x i32], ptr @son, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sub nsw i32 %96, %100
  %102 = sext i32 %101 to i64
  %103 = mul nsw i64 %95, %102
  %104 = load i64, ptr @ans2, align 8, !tbaa !16
  %105 = add nsw i64 %104, %103
  store i64 %105, ptr @ans2, align 8, !tbaa !16
  %106 = load i32, ptr %1, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [110000 x i32], ptr @son, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr %1, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [110000 x i32], ptr @pre, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.Edge, ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 16, !tbaa !18
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [110000 x i32], ptr @son, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = add nsw i32 %120, %109
  store i32 %121, ptr %119, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %71
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  store i32 %124, ptr %2, align 4, !tbaa !5
  br label %68, !llvm.loop !19

125:                                              ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret void
}

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !6, i64 4}
!10 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = !{!10, !6, i64 12}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!10, !6, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = !{!10, !6, i64 0}
!19 = distinct !{!19, !13}


; 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.Edge = type { i32, i32, i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@N = external dso_local local_unnamed_addr global i32, align 4
@V = external dso_local local_unnamed_addr global [110000 x i32], align 16
@use = external dso_local local_unnamed_addr global [3100000 x i32], align 16
@son = external dso_local local_unnamed_addr global [110000 x i32], align 16
@stamp = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global [110000 x i32], align 16
@t = external dso_local local_unnamed_addr global [110000 x i32], align 16
@in = external dso_local local_unnamed_addr global [110000 x i32], align 16
@E = external dso_local global [3100000 x %struct.Edge], align 16
@ans2 = external dso_local local_unnamed_addr global i64, align 8
@Q = external dso_local global %"class.std::queue", align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3BFSv() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  store i32 0, ptr getelementptr inbounds (i8, ptr @pre, i64 4), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  store i32 1, ptr %1, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) @Q, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  store i32 1, ptr getelementptr inbounds (i8, ptr @in, i64 4), align 4, !tbaa !5
  %2 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  br i1 %2, label %._crit_edge, label %.lr.ph25

.loopexit:                                        ; preds = %26, %.lr.ph25
  %3 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  br i1 %3, label %._crit_edge, label %.lr.ph25, !llvm.loop !9

.lr.ph25:                                         ; preds = %0, %.loopexit
  %4 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  %5 = load i32, ptr %4, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  %6 = load i32, ptr @stamp, align 4, !tbaa !5
  %7 = add nsw i32 %6, 1
  store i32 %7, ptr @stamp, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds [110000 x i32], ptr @t, i64 0, i64 %8
  store i32 %5, ptr %9, align 4, !tbaa !5
  %10 = sext i32 %5 to i64
  %11 = getelementptr inbounds [110000 x i32], ptr @V, i64 0, i64 %10
  %.022 = load i32, ptr %11, align 4, !tbaa !5
  %.not1923 = icmp eq i32 %.022, 0
  br i1 %.not1923, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph25, %26
  %.024 = phi i32 [ %.0, %26 ], [ %.022, %.lr.ph25 ]
  %12 = sext i32 %.024 to i64
  %13 = getelementptr inbounds [3100000 x i32], ptr @use, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %.not20 = icmp eq i32 %14, 0
  br i1 %.not20, label %26, label %15

15:                                               ; preds = %.lr.ph
  %16 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %12, i32 1
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [110000 x i32], ptr @in, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %.not21 = icmp eq i32 %20, 0
  br i1 %.not21, label %21, label %26

21:                                               ; preds = %15
  %22 = getelementptr inbounds [110000 x i32], ptr @pre, i64 0, i64 %18
  store i32 %.024, ptr %22, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @Q, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %23 = load i32, ptr %16, align 4, !tbaa !11
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [110000 x i32], ptr @in, i64 0, i64 %24
  store i32 1, ptr %25, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %.lr.ph, %15, %21
  %27 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %12, i32 3
  %.0 = load i32, ptr %27, align 4, !tbaa !5
  %.not19 = icmp eq i32 %.0, 0
  br i1 %.not19, label %.loopexit, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.loopexit, %0
  %28 = load i32, ptr @stamp, align 4, !tbaa !5
  %.not26 = icmp eq i32 %28, 0
  br i1 %.not26, label %57, label %.lr.ph29

.lr.ph29:                                         ; preds = %._crit_edge
  %ans2.promoted = load i64, ptr @ans2, align 8, !tbaa !14
  %29 = load i32, ptr @N, align 4, !tbaa !5
  %30 = sext i32 %28 to i64
  br label %31

31:                                               ; preds = %.lr.ph29, %31
  %indvars.iv = phi i64 [ %30, %.lr.ph29 ], [ %indvars.iv.next, %31 ]
  %32 = phi i64 [ %ans2.promoted, %.lr.ph29 ], [ %50, %31 ]
  %33 = getelementptr inbounds [110000 x i32], ptr @t, i64 0, i64 %indvars.iv
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [110000 x i32], ptr @son, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [110000 x i32], ptr @pre, i64 0, i64 %35
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %42, i32 2
  %44 = load i32, ptr %43, align 8, !tbaa !16
  %45 = sext i32 %44 to i64
  %46 = mul nsw i64 %45, %39
  %47 = sub nsw i32 %29, %38
  %48 = sext i32 %47 to i64
  %49 = mul nsw i64 %46, %48
  %50 = add nsw i64 %49, %32
  %51 = getelementptr inbounds [3100000 x %struct.Edge], ptr @E, i64 0, i64 %42
  %52 = load i32, ptr %51, align 16, !tbaa !17
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [110000 x i32], ptr @son, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %55, %38
  store i32 %56, ptr %54, align 4, !tbaa !5
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not = icmp eq i64 %indvars.iv.next, 0
  br i1 %.not, label %._crit_edge30, label %31, !llvm.loop !18

._crit_edge30:                                    ; preds = %31
  store i64 %50, ptr @ans2, align 8, !tbaa !14
  br label %57

57:                                               ; preds = %._crit_edge30, %._crit_edge
  ret void
}

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nounwind }

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

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


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