; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/FASTFLOW (A)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, long long>, std::_Select1st<std::pair<const std::pair<int, int>, long long>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, long long>, std::_Select1st<std::pair<const std::pair<int, int>, long long>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.8" = type { %"struct.std::pair", i64 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@cap = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %18 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 160352) #8
  %19 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(160352) %18, i32 noundef %19)
          to label %20 unwind label %26

20:                                               ; preds = %0
  store ptr %18, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %52, %20
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = load i32, ptr @m, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %30, label %25

25:                                               ; preds = %21
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %55

26:                                               ; preds = %0
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %3, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %18, i64 noundef 160352) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %87

30:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %7, ptr noundef %8, ptr noundef %9)
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = icmp eq i32 %32, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  store i32 4, ptr %6, align 4
  br label %49

36:                                               ; preds = %30
  %37 = load i32, ptr %9, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %39 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store i64 %39, ptr %10, align 4
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @cap, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %41 = load i64, ptr %40, align 8, !tbaa !11
  %42 = add nsw i64 %41, %38
  store i64 %42, ptr %40, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %43 = load i32, ptr %9, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %45 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i64 %45, ptr %11, align 4
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @cap, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = add nsw i64 %47, %44
  store i64 %48, ptr %46, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  store i32 0, ptr %6, align 4
  br label %49

49:                                               ; preds = %36, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  %50 = load i32, ptr %6, align 4
  switch i32 %50, label %92 [
    i32 0, label %51
    i32 4, label %52
  ]

51:                                               ; preds = %49
  br label %52

52:                                               ; preds = %51, %49
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !5
  br label %21, !llvm.loop !13

55:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %56 = call ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @cap) #7
  %57 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %12, i32 0, i32 0
  store ptr %56, ptr %57, align 8
  br label %58

58:                                               ; preds = %79, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %59 = call ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cap) #7
  %60 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  %61 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEES6_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %81

63:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %64 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %65 = getelementptr inbounds %"struct.std::pair.8", ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %"struct.std::pair", ptr %65, i32 0, i32 0
  %67 = load i32, ptr %66, align 8, !tbaa !15
  store i32 %67, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %68 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %69 = getelementptr inbounds %"struct.std::pair.8", ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %"struct.std::pair", ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !18
  store i32 %71, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %72 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %73 = getelementptr inbounds %"struct.std::pair.8", ptr %72, i32 0, i32 1
  %74 = load i64, ptr %73, align 8, !tbaa !19
  store i64 %74, ptr %16, align 8, !tbaa !11
  %75 = load ptr, ptr %2, align 8, !tbaa !9
  %76 = load i32, ptr %14, align 4, !tbaa !5
  %77 = load i32, ptr %15, align 4, !tbaa !5
  %78 = load i64, ptr %16, align 8, !tbaa !11
  call void @_ZN7maxFlow7addEdgeEiix(ptr noundef nonnull align 8 dereferenceable(160352) %75, i32 noundef %76, i32 noundef %77, i64 noundef %78)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %79

79:                                               ; preds = %63
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br label %58, !llvm.loop !20

81:                                               ; preds = %62
  %82 = load ptr, ptr %2, align 8, !tbaa !9
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = call noundef i64 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(160352) %82, i32 noundef 1, i32 noundef %83)
  %85 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %84)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %86 = load i32, ptr %1, align 4
  ret i32 %86

87:                                               ; preds = %26
  %88 = load ptr, ptr %3, align 8
  %89 = load i32, ptr %4, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91

92:                                               ; preds = %49
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(160352), i32 noundef) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maxFlow7addEdgeEiix(ptr noundef nonnull align 8 dereferenceable(160352), i32 noundef, i32 noundef, i64 noundef) #6 align 2

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

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(160352), i32 noundef, i32 noundef) #6 align 2

attributes #0 = { mustprogress norecurse 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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nobuiltin allocsize(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 = { 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 = { nobuiltin nounwind "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 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIKS_IiiExE", !17, i64 0, !12, i64 8}
!17 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!18 = !{!16, !6, i64 4}
!19 = !{!16, !12, i64 8}
!20 = distinct !{!20, !14}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, long long>, std::_Select1st<std::pair<const std::pair<int, int>, long long>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, long long>, std::_Select1st<std::pair<const std::pair<int, int>, long long>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@cap = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %9 = tail call noalias noundef nonnull dereferenceable(160352) ptr @_Znwm(i64 noundef 160352) #6
  %10 = load i32, ptr @n, align 4, !tbaa !5
  tail call void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(160352) %9, i32 noundef %10)
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %33, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %13 = call ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @cap) #7
  store ptr %13, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %14 = call ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cap) #7
  store ptr %14, ptr %7, align 8
  %15 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEES6_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %15, label %.lr.ph9, label %._crit_edge10

.lr.ph:                                           ; preds = %0, %33
  %.07 = phi i32 [ %34, %33 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp eq i32 %17, %18
  br i1 %19, label %33, label %20

20:                                               ; preds = %.lr.ph
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %23 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %23, ptr %4, align 8
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @cap, ptr noundef nonnull align 4 dereferenceable(8) %4)
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = add nsw i64 %25, %22
  store i64 %26, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %29 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %29, ptr %5, align 8
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @cap, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = add nsw i64 %31, %28
  store i64 %32, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %33

33:                                               ; preds = %.lr.ph, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %34 = add nuw nsw i32 %.07, 1
  %35 = load i32, ptr @m, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge10:                                    ; preds = %.lr.ph9, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = call noundef i64 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(160352) %9, i32 noundef 1, i32 noundef %37)
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %38)
  ret i32 0

.lr.ph9:                                          ; preds = %._crit_edge, %.lr.ph9
  %40 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %41 = load i32, ptr %40, align 8, !tbaa !13
  %42 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %43 = getelementptr inbounds i8, ptr %42, i64 4
  %44 = load i32, ptr %43, align 4, !tbaa !16
  %45 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = load i64, ptr %46, align 8, !tbaa !17
  call void @_ZN7maxFlow7addEdgeEiix(ptr noundef nonnull align 8 dereferenceable(160352) %9, i32 noundef %41, i32 noundef %44, i64 noundef %47)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %49 = call ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cap) #7
  store ptr %49, ptr %7, align 8
  %50 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiExEES6_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %50, label %.lr.ph9, label %._crit_edge10, !llvm.loop !18
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(160352), i32 noundef) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIiiExSt4lessIS1_ESaIS0_IKS1_xEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maxFlow7addEdgeEiix(ptr noundef nonnull align 8 dereferenceable(160352), i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(160352), i32 noundef, i32 noundef) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress norecurse 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 = { nofree nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nobuiltin allocsize(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 = { 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 = { 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 #6 = { builtin allocsize(0) }
attributes #7 = { 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 = !{!"_ZTSSt4pairIKS_IiiExE", !15, i64 0, !10, i64 8}
!15 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!16 = !{!14, !6, i64 4}
!17 = !{!14, !10, i64 8}
!18 = distinct !{!18, !12}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass