; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan (1072)

; 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.FlowGraph = type { i32, i32, i32, [400020 x %"struct.FlowGraph<long long>::edge"], [1010 x i32], i32, [1010 x i32], [1010 x i32], i32 }
%"struct.FlowGraph<long long>::edge" = type { i32, i32, i64 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@g = external dso_local global %class.FlowGraph, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %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 i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %25 = load i32, ptr %3, align 4, !tbaa !8
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = mul nsw i32 %25, %26
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %29 = load i32, ptr %4, align 4, !tbaa !8
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %5, align 4, !tbaa !8
  %31 = load i32, ptr %4, align 4, !tbaa !8
  %32 = load i32, ptr %5, align 4, !tbaa !8
  %33 = load i32, ptr %5, align 4, !tbaa !8
  %34 = load i32, ptr %3, align 4, !tbaa !8
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = mul nsw i32 %34, %35
  call void @_ZN9FlowGraphIxE4initEiiii(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %31, i32 noundef %32, i32 noundef %33, i32 noundef %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %115, %0
  %38 = load i32, ptr %7, align 4, !tbaa !8
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %118

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %43

43:                                               ; preds = %111, %42
  %44 = load i32, ptr %9, align 4, !tbaa !8
  %45 = load i32, ptr %3, align 4, !tbaa !8
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %114

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %49 = load i32, ptr %3, align 4, !tbaa !8
  %50 = load i32, ptr %7, align 4, !tbaa !8
  %51 = sub nsw i32 %50, 1
  %52 = mul nsw i32 %49, %51
  %53 = load i32, ptr %9, align 4, !tbaa !8
  %54 = add nsw i32 %52, %53
  store i32 %54, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %56 = load i32, ptr %11, align 4, !tbaa !8
  %57 = load i32, ptr %6, align 4, !tbaa !8
  %58 = add nsw i32 %57, %56
  store i32 %58, ptr %6, align 4, !tbaa !8
  %59 = load i32, ptr %7, align 4, !tbaa !8
  %60 = load i32, ptr %9, align 4, !tbaa !8
  %61 = add nsw i32 %59, %60
  %62 = srem i32 %61, 2
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %105

64:                                               ; preds = %48
  %65 = load i32, ptr %4, align 4, !tbaa !8
  %66 = load i32, ptr %10, align 4, !tbaa !8
  %67 = load i32, ptr %11, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %65, i32 noundef %66, i64 noundef %68)
  %69 = load i32, ptr %7, align 4, !tbaa !8
  %70 = sub nsw i32 %69, 1
  %71 = icmp sge i32 %70, 1
  br i1 %71, label %72, label %77

72:                                               ; preds = %64
  %73 = load i32, ptr %10, align 4, !tbaa !8
  %74 = load i32, ptr %10, align 4, !tbaa !8
  %75 = load i32, ptr %3, align 4, !tbaa !8
  %76 = sub nsw i32 %74, %75
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %73, i32 noundef %76, i64 noundef 1061109567)
  br label %77

77:                                               ; preds = %72, %64
  %78 = load i32, ptr %7, align 4, !tbaa !8
  %79 = add nsw i32 %78, 1
  %80 = load i32, ptr %2, align 4, !tbaa !8
  %81 = icmp sle i32 %79, %80
  br i1 %81, label %82, label %87

82:                                               ; preds = %77
  %83 = load i32, ptr %10, align 4, !tbaa !8
  %84 = load i32, ptr %10, align 4, !tbaa !8
  %85 = load i32, ptr %3, align 4, !tbaa !8
  %86 = add nsw i32 %84, %85
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %83, i32 noundef %86, i64 noundef 1061109567)
  br label %87

87:                                               ; preds = %82, %77
  %88 = load i32, ptr %9, align 4, !tbaa !8
  %89 = sub nsw i32 %88, 1
  %90 = icmp sge i32 %89, 1
  br i1 %90, label %91, label %95

91:                                               ; preds = %87
  %92 = load i32, ptr %10, align 4, !tbaa !8
  %93 = load i32, ptr %10, align 4, !tbaa !8
  %94 = sub nsw i32 %93, 1
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %92, i32 noundef %94, i64 noundef 1061109567)
  br label %95

95:                                               ; preds = %91, %87
  %96 = load i32, ptr %9, align 4, !tbaa !8
  %97 = add nsw i32 %96, 1
  %98 = load i32, ptr %3, align 4, !tbaa !8
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %100, label %104

100:                                              ; preds = %95
  %101 = load i32, ptr %10, align 4, !tbaa !8
  %102 = load i32, ptr %10, align 4, !tbaa !8
  %103 = add nsw i32 %102, 1
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %101, i32 noundef %103, i64 noundef 1061109567)
  br label %104

104:                                              ; preds = %100, %95
  br label %110

105:                                              ; preds = %48
  %106 = load i32, ptr %10, align 4, !tbaa !8
  %107 = load i32, ptr %5, align 4, !tbaa !8
  %108 = load i32, ptr %11, align 4, !tbaa !8
  %109 = sext i32 %108 to i64
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %106, i32 noundef %107, i64 noundef %109)
  br label %110

110:                                              ; preds = %105, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %9, align 4, !tbaa !8
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %9, align 4, !tbaa !8
  br label %43, !llvm.loop !11

114:                                              ; preds = %47
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %7, align 4, !tbaa !8
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %7, align 4, !tbaa !8
  br label %37, !llvm.loop !13

118:                                              ; preds = %41
  %119 = load i32, ptr %6, align 4, !tbaa !8
  %120 = sext i32 %119 to i64
  %121 = call noundef i64 @_ZN9FlowGraphIxE5dinicEv(ptr noundef nonnull align 8 dereferenceable(6412464) @g)
  %122 = sub nsw i64 %120, %121
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %122)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %124 = load i32, ptr %1, align 4
  ret i32 %124
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9FlowGraphIxE4initEiiii(ptr noundef nonnull align 8 dereferenceable(6412464), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464), i32 noundef, i32 noundef, i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN9FlowGraphIxE5dinicEv(ptr noundef nonnull align 8 dereferenceable(6412464)) #4 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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }

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

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


; 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.FlowGraph = type { i32, i32, i32, [400020 x %"struct.FlowGraph<long long>::edge"], [1010 x i32], i32, [1010 x i32], [1010 x i32], i32 }
%"struct.FlowGraph<long long>::edge" = type { i32, i32, i64 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@g = external dso_local global %class.FlowGraph, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %17 = load i32, ptr %2, align 4, !tbaa !8
  %18 = load i32, ptr %1, align 4, !tbaa !8
  %19 = mul nsw i32 %18, %17
  %20 = add nsw i32 %19, 1
  %21 = add nsw i32 %19, 2
  call void @_ZN9FlowGraphIxE4initEiiii(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %20, i32 noundef %21, i32 noundef %21, i32 noundef %19)
  %22 = load i32, ptr %1, align 4, !tbaa !8
  %.not41 = icmp slt i32 %22, 1
  %23 = load i32, ptr %2, align 4
  %24 = icmp slt i32 %23, 1
  %or.cond = select i1 %.not41, i1 true, i1 %24
  br i1 %or.cond, label %._crit_edge44, label %.preheader

.preheader:                                       ; preds = %0, %._crit_edge
  %25 = phi i32 [ %54, %._crit_edge ], [ %22, %0 ]
  %26 = phi i32 [ %55, %._crit_edge ], [ %23, %0 ]
  %.043 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %0 ]
  %.03242 = phi i32 [ %.pre-phi, %._crit_edge ], [ 1, %0 ]
  %.not3438 = icmp slt i32 %26, 1
  br i1 %.not3438, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %27 = add nsw i32 %.03242, -1
  %28 = icmp ugt i32 %.03242, 1
  %29 = mul nsw i32 %26, %27
  %30 = add nsw i32 %29, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %32 = load i32, ptr %3, align 4, !tbaa !8
  %33 = add nsw i32 %32, %.043
  %34 = and i32 %.03242, 1
  %.not35.peel.not = icmp eq i32 %34, 0
  %35 = sext i32 %32 to i64
  br i1 %.not35.peel.not, label %36, label %47

36:                                               ; preds = %.lr.ph
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %20, i32 noundef %30, i64 noundef %35)
  br i1 %28, label %37, label %40

37:                                               ; preds = %36
  %38 = load i32, ptr %2, align 4, !tbaa !8
  %39 = sub nsw i32 %30, %38
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %30, i32 noundef %39, i64 noundef 1061109567)
  br label %40

40:                                               ; preds = %37, %36
  %41 = load i32, ptr %1, align 4, !tbaa !8
  %.not36.not.peel = icmp slt i32 %.03242, %41
  br i1 %.not36.not.peel, label %42, label %._crit_edge48

42:                                               ; preds = %40
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = add nsw i32 %43, %30
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %30, i32 noundef %44, i64 noundef 1061109567)
  br label %._crit_edge48

._crit_edge48:                                    ; preds = %42, %40
  %.pre = load i32, ptr %2, align 4, !tbaa !8
  %.not37.not.peel = icmp sgt i32 %.pre, 1
  br i1 %.not37.not.peel, label %45, label %.thread

.thread:                                          ; preds = %._crit_edge48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %._crit_edge.loopexit

45:                                               ; preds = %._crit_edge48
  %46 = add nsw i32 %29, 2
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %30, i32 noundef %46, i64 noundef 1061109567)
  br label %48

47:                                               ; preds = %.lr.ph
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %30, i32 noundef %21, i64 noundef %35)
  br label %48

48:                                               ; preds = %47, %45
  %.pr = load i32, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %.not34.not.peel = icmp sgt i32 %.pr, 1
  br i1 %.not34.not.peel, label %.peel.next, label %._crit_edge.loopexit

._crit_edge44.loopexit46:                         ; preds = %._crit_edge
  %49 = sext i32 %.1.lcssa to i64
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %._crit_edge44.loopexit46, %0
  %.0.lcssa = phi i64 [ 0, %0 ], [ %49, %._crit_edge44.loopexit46 ]
  %50 = call noundef i64 @_ZN9FlowGraphIxE5dinicEv(ptr noundef nonnull align 8 dereferenceable(6412464) @g)
  %51 = sub nsw i64 %.0.lcssa, %50
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %51)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

._crit_edge.loopexit:                             ; preds = %80, %.thread, %48
  %53 = phi i32 [ %.pr, %48 ], [ %.pre, %.thread ], [ %82, %80 ]
  %.lcssa = phi i32 [ %33, %48 ], [ %33, %.thread ], [ %61, %80 ]
  %.pre50 = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader, %._crit_edge.loopexit
  %54 = phi i32 [ %.pre50, %._crit_edge.loopexit ], [ %25, %.preheader ]
  %55 = phi i32 [ %53, %._crit_edge.loopexit ], [ %26, %.preheader ]
  %.1.lcssa = phi i32 [ %.lcssa, %._crit_edge.loopexit ], [ %.043, %.preheader ]
  %.pre-phi = add nuw nsw i32 %.03242, 1
  %.not.not = icmp slt i32 %.03242, %54
  br i1 %.not.not, label %.preheader, label %._crit_edge44.loopexit46, !llvm.loop !11

.peel.next:                                       ; preds = %48, %80
  %56 = phi i32 [ %82, %80 ], [ %.pr, %48 ]
  %.140 = phi i32 [ %61, %80 ], [ %33, %48 ]
  %.03139 = phi i32 [ %81, %80 ], [ 2, %48 ]
  %57 = mul nsw i32 %56, %27
  %58 = add nsw i32 %57, %.03139
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %60 = load i32, ptr %3, align 4, !tbaa !8
  %61 = add nsw i32 %60, %.140
  %62 = add nuw nsw i32 %.03139, %.03242
  %63 = and i32 %62, 1
  %.not35 = icmp eq i32 %63, 0
  %64 = sext i32 %60 to i64
  br i1 %.not35, label %79, label %65

65:                                               ; preds = %.peel.next
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %20, i32 noundef %58, i64 noundef %64)
  br i1 %28, label %66, label %69

66:                                               ; preds = %65
  %67 = load i32, ptr %2, align 4, !tbaa !8
  %68 = sub nsw i32 %58, %67
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %58, i32 noundef %68, i64 noundef 1061109567)
  br label %69

69:                                               ; preds = %66, %65
  %70 = load i32, ptr %1, align 4, !tbaa !8
  %.not36.not = icmp slt i32 %.03242, %70
  br i1 %.not36.not, label %71, label %74

71:                                               ; preds = %69
  %72 = load i32, ptr %2, align 4, !tbaa !8
  %73 = add nsw i32 %72, %58
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %58, i32 noundef %73, i64 noundef 1061109567)
  br label %74

74:                                               ; preds = %71, %69
  %75 = add nsw i32 %58, -1
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %58, i32 noundef %75, i64 noundef 1061109567)
  %76 = load i32, ptr %2, align 4, !tbaa !8
  %.not37.not = icmp slt i32 %.03139, %76
  br i1 %.not37.not, label %77, label %80

77:                                               ; preds = %74
  %78 = add nsw i32 %58, 1
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %58, i32 noundef %78, i64 noundef 1061109567)
  br label %80

79:                                               ; preds = %.peel.next
  call void @_ZN9FlowGraphIxE8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(6412464) @g, i32 noundef %58, i32 noundef %21, i64 noundef %64)
  br label %80

80:                                               ; preds = %74, %77, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %81 = add nuw nsw i32 %.03139, 1
  %82 = load i32, ptr %2, align 4, !tbaa !8
  %.not34.not = icmp slt i32 %.03139, %82
  br i1 %.not34.not, label %.peel.next, label %._crit_edge.loopexit, !llvm.loop !14
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9FlowGraphIxE4initEiiii(ptr noundef nonnull align 8 dereferenceable(6412464), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN9FlowGraphIxE5dinicEv(ptr noundef nonnull align 8 dereferenceable(6412464)) local_unnamed_addr #4 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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }

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

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


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