; LLVM IR from lzyrapx/Competitive-Programming :: LibreOJ/102（最小费用最大流）.ll (Z4SPFARiS_)

; 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.node = 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
@s = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@head = external dso_local global [401 x i32], align 16
@edge = external dso_local global [30000 x %struct.node], align 16
@dis = external dso_local global [401 x i32], align 16
@num = external dso_local global [401 x i32], align 16
@Minflow = external dso_local global [401 x i32], align 16
@q = external dso_local global %"class.std::queue", align 8
@vis = external dso_local global [401 x i8], align 16
@_ZL3INF = external hidden constant i32, align 4

; 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 noundef zeroext i1 @_Z4SPFARiS_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #1 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !9
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds i32, ptr @dis, i64 %12
  %14 = getelementptr inbounds i32, ptr %13, i64 1
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef getelementptr inbounds (i32, ptr @dis, i64 1), ptr noundef %14, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3INF)
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 401, i1 false)
  %15 = load i32, ptr @s, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %16
  store i32 0, ptr %17, align 4, !tbaa !9
  %18 = load i32, ptr @s, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %19
  store i32 2147483647, ptr %20, align 4, !tbaa !9
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(4) @s)
  %21 = load i32, ptr @s, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [401 x i8], ptr @vis, i64 0, i64 %22
  store i8 1, ptr %23, align 1, !tbaa !11
  br label %24

24:                                               ; preds = %114, %2
  %25 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %26 = xor i1 %25, true
  br i1 %26, label %27, label %115

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %29 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %29, ptr %6, align 4, !tbaa !9
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [401 x i8], ptr @vis, i64 0, i64 %31
  store i8 0, ptr %32, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [401 x i32], ptr @head, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !9
  store i32 %36, ptr %7, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %108, %27
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = xor i32 %38, -1
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %114

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %44
  %46 = getelementptr inbounds %struct.node, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 16, !tbaa !13
  store i32 %47, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %49
  %51 = getelementptr inbounds %struct.node, ptr %50, i32 0, i32 3
  %52 = load i32, ptr %51, align 4, !tbaa !15
  store i32 %52, ptr %9, align 4, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %54
  %56 = getelementptr inbounds %struct.node, ptr %55, i32 0, i32 2
  %57 = load i32, ptr %56, align 8, !tbaa !16
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %107

59:                                               ; preds = %42
  %60 = load i32, ptr %6, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = load i32, ptr %9, align 4, !tbaa !9
  %65 = add nsw i32 %63, %64
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = icmp slt i32 %65, %69
  br i1 %70, label %71, label %107

71:                                               ; preds = %59
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = add nsw i32 %75, %76
  %78 = load i32, ptr %8, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %79
  store i32 %77, ptr %80, align 4, !tbaa !9
  %81 = load i32, ptr %7, align 4, !tbaa !9
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [401 x i32], ptr @num, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %86
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %89
  %91 = getelementptr inbounds %struct.node, ptr %90, i32 0, i32 2
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %87, ptr noundef nonnull align 4 dereferenceable(4) %91)
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = load i32, ptr %8, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %95
  store i32 %93, ptr %96, align 4, !tbaa !9
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [401 x i8], ptr @vis, i64 0, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !11, !range !17, !noundef !18
  %101 = trunc i8 %100 to i1
  br i1 %101, label %106, label %102

102:                                              ; preds = %71
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %103 = load i32, ptr %8, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [401 x i8], ptr @vis, i64 0, i64 %104
  store i8 1, ptr %105, align 1, !tbaa !11
  br label %106

106:                                              ; preds = %102, %71
  br label %107

107:                                              ; preds = %106, %59, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %7, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %110
  %112 = getelementptr inbounds %struct.node, ptr %111, i32 0, i32 1
  %113 = load i32, ptr %112, align 4, !tbaa !19
  store i32 %113, ptr %7, align 4, !tbaa !9
  br label %37, !llvm.loop !20

114:                                              ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %24, !llvm.loop !22

115:                                              ; preds = %24
  %116 = load i32, ptr @t, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !9
  %120 = icmp eq i32 %119, 2147483647
  br i1 %120, label %121, label %122

121:                                              ; preds = %115
  store i1 false, ptr %3, align 1
  br label %187

122:                                              ; preds = %115
  %123 = load i32, ptr @t, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = add nsw i32 %128, %126
  store i32 %129, ptr %127, align 4, !tbaa !9
  %130 = load i32, ptr @t, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !9
  %134 = load i32, ptr @t, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = mul nsw i32 %133, %137
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load i32, ptr %139, align 4, !tbaa !9
  %141 = add nsw i32 %140, %138
  store i32 %141, ptr %139, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %142 = load i32, ptr @t, align 4, !tbaa !9
  store i32 %142, ptr %10, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %176, %122
  %144 = load i32, ptr %10, align 4, !tbaa !9
  %145 = load i32, ptr @s, align 4, !tbaa !9
  %146 = icmp ne i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %186

148:                                              ; preds = %143
  %149 = load i32, ptr @t, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !9
  %153 = load i32, ptr %10, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [401 x i32], ptr @num, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %157
  %159 = getelementptr inbounds %struct.node, ptr %158, i32 0, i32 2
  %160 = load i32, ptr %159, align 8, !tbaa !16
  %161 = sub nsw i32 %160, %152
  store i32 %161, ptr %159, align 8, !tbaa !16
  %162 = load i32, ptr @t, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !9
  %166 = load i32, ptr %10, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [401 x i32], ptr @num, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !9
  %170 = xor i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.node, ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 8, !tbaa !16
  %175 = add nsw i32 %174, %165
  store i32 %175, ptr %173, align 8, !tbaa !16
  br label %176

176:                                              ; preds = %148
  %177 = load i32, ptr %10, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [401 x i32], ptr @num, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !9
  %181 = xor i32 %180, 1
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %182
  %184 = getelementptr inbounds %struct.node, ptr %183, i32 0, i32 0
  %185 = load i32, ptr %184, align 16, !tbaa !13
  store i32 %185, ptr %10, align 4, !tbaa !9
  br label %143, !llvm.loop !23

186:                                              ; preds = %147
  store i1 true, ptr %3, align 1
  br label %187

187:                                              ; preds = %186, %121
  %188 = load i1, ptr %3, align 1
  ret i1 %188
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 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)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 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)) #5

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


; 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.node = 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
@s = external dso_local global i32, align 4
@t = external dso_local local_unnamed_addr global i32, align 4
@head = external dso_local local_unnamed_addr global [401 x i32], align 16
@edge = external dso_local global [30000 x %struct.node], align 16
@dis = external dso_local global [401 x i32], align 16
@num = external dso_local local_unnamed_addr global [401 x i32], align 16
@Minflow = external dso_local global [401 x i32], align 16
@q = external dso_local global %"class.std::queue", align 8
@vis = external dso_local local_unnamed_addr global [401 x i8], align 16
@_ZL3INF = external hidden constant i32, align 4

; 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 noundef zeroext i1 @_Z4SPFARiS_(ptr nocapture noundef nonnull align 4 dereferenceable(4) %0, ptr nocapture noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #1 {
  %3 = alloca i32, align 4
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = sext i32 %4 to i64
  %6 = getelementptr inbounds i32, ptr @dis, i64 %5
  %7 = getelementptr inbounds i8, ptr %6, i64 4
  tail call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @dis, i64 4), ptr noundef nonnull %7, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3INF)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(401) @vis, i8 0, i64 401, i1 false)
  %8 = load i32, ptr @s, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %9
  store i32 0, ptr %10, align 4, !tbaa !5
  %11 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %9
  store i32 2147483647, ptr %11, align 4, !tbaa !5
  tail call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(4) @s)
  %12 = load i32, ptr @s, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [401 x i8], ptr @vis, i64 0, i64 %13
  store i8 1, ptr %14, align 1, !tbaa !9
  %15 = tail call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  br i1 %15, label %._crit_edge, label %.lr.ph29

.loopexit25:                                      ; preds = %53, %.lr.ph29
  %16 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  br i1 %16, label %._crit_edge, label %.lr.ph29, !llvm.loop !11

.lr.ph29:                                         ; preds = %2, %.loopexit25
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %18 = load i32, ptr %17, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [401 x i8], ptr @vis, i64 0, i64 %19
  store i8 0, ptr %20, align 1, !tbaa !9
  %21 = getelementptr inbounds [401 x i32], ptr @head, i64 0, i64 %19
  %.02126 = load i32, ptr %21, align 4, !tbaa !5
  %.not2327 = icmp eq i32 %.02126, -1
  br i1 %.not2327, label %.loopexit25, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph29
  %22 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %19
  %23 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %19
  br label %24

24:                                               ; preds = %.lr.ph, %53
  %.02128 = phi i32 [ %.02126, %.lr.ph ], [ %.021, %53 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %25 = sext i32 %.02128 to i64
  %26 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %25
  %27 = load i32, ptr %26, align 16, !tbaa !13
  store i32 %27, ptr %3, align 4, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %26, i64 8
  %29 = load i32, ptr %28, align 8, !tbaa !15
  %.not24 = icmp eq i32 %29, 0
  br i1 %.not24, label %53, label %30

30:                                               ; preds = %24
  %31 = getelementptr inbounds i8, ptr %26, i64 12
  %32 = load i32, ptr %31, align 4, !tbaa !16
  %33 = load i32, ptr %22, align 4, !tbaa !5
  %34 = add nsw i32 %33, %32
  %35 = sext i32 %27 to i64
  %36 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp slt i32 %34, %37
  br i1 %38, label %39, label %53

39:                                               ; preds = %30
  store i32 %34, ptr %36, align 4, !tbaa !5
  %40 = getelementptr inbounds [401 x i32], ptr @num, i64 0, i64 %35
  store i32 %.02128, ptr %40, align 4, !tbaa !5
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %44
  store i32 %42, ptr %45, align 4, !tbaa !5
  %46 = getelementptr inbounds [401 x i8], ptr @vis, i64 0, i64 %44
  %47 = load i8, ptr %46, align 1, !tbaa !9, !range !17, !noundef !18
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %53, label %49

49:                                               ; preds = %39
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [401 x i8], ptr @vis, i64 0, i64 %51
  store i8 1, ptr %52, align 1, !tbaa !9
  br label %53

53:                                               ; preds = %39, %49, %30, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %54 = getelementptr inbounds i8, ptr %26, i64 4
  %.021 = load i32, ptr %54, align 4, !tbaa !5
  %.not23 = icmp eq i32 %.021, -1
  br i1 %.not23, label %.loopexit25, label %24, !llvm.loop !19

._crit_edge:                                      ; preds = %.loopexit25, %2
  %55 = load i32, ptr @t, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp ne i32 %58, 2147483647
  br i1 %59, label %60, label %.loopexit

60:                                               ; preds = %._crit_edge
  %61 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %56
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %64 = add nsw i32 %63, %62
  store i32 %64, ptr %1, align 4, !tbaa !5
  %65 = load i32, ptr @t, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [401 x i32], ptr @dis, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %66
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = mul nsw i32 %70, %68
  %72 = load i32, ptr %0, align 4, !tbaa !5
  %73 = add nsw i32 %72, %71
  store i32 %73, ptr %0, align 4, !tbaa !5
  %74 = load i32, ptr @s, align 4, !tbaa !5
  %.030 = load i32, ptr @t, align 4, !tbaa !5
  %.not31 = icmp eq i32 %.030, %74
  br i1 %.not31, label %.loopexit, label %.lr.ph34

.lr.ph34:                                         ; preds = %60
  %75 = sext i32 %.030 to i64
  %76 = getelementptr inbounds [401 x i32], ptr @Minflow, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %.lr.ph34, %78
  %.032 = phi i32 [ %.030, %.lr.ph34 ], [ %.0, %78 ]
  %79 = sext i32 %.032 to i64
  %80 = getelementptr inbounds [401 x i32], ptr @num, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %82, i32 2
  %84 = load i32, ptr %83, align 8, !tbaa !15
  %85 = sub nsw i32 %84, %77
  store i32 %85, ptr %83, align 8, !tbaa !15
  %86 = xor i32 %81, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %87, i32 2
  %89 = load i32, ptr %88, align 8, !tbaa !15
  %90 = add nsw i32 %89, %77
  store i32 %90, ptr %88, align 8, !tbaa !15
  %91 = getelementptr inbounds [30000 x %struct.node], ptr @edge, i64 0, i64 %87
  %.0 = load i32, ptr %91, align 16, !tbaa !5
  %.not = icmp eq i32 %.0, %74
  br i1 %.not, label %.loopexit, label %78, !llvm.loop !20

.loopexit:                                        ; preds = %78, %60, %._crit_edge
  ret i1 %59
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 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 #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 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 #5

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


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