; LLVM IR from sunkafei/xcpc-algorithm-templates :: 算法/图论/一般图最大权匹配.ll (Z14weight_blossomv)

; 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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@g = external dso_local global [1023 x [1023 x %struct.edge]], align 16
@n = external dso_local global i32, align 4
@num = external dso_local global i32, align 4
@lab = external dso_local global [1023 x i32], align 16
@match = external dso_local global [1023 x i32], align 16
@st = external dso_local global [1023 x i32], align 16
@from = external dso_local global [1023 x [1023 x i32]], align 16
@flower = external dso_local global [1023 x %"class.std::vector"], align 16

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z8matchingv() #3

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

; Function Attrs: mustprogress uwtable
define dso_local { i64, i32 } @_Z14weight_blossomv() #3 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %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
  %12 = alloca { i64, i32 }, align 8
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds i32, ptr @match, i64 %14
  %16 = getelementptr inbounds i32, ptr %15, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @match, ptr noundef %16, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %17 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %17, ptr @num, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %31, %0
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %34

23:                                               ; preds = %18
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1023 x i32], ptr @st, i64 0, i64 %26
  store i32 %24, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1023 x %"class.std::vector"], ptr @flower, i64 0, i64 %29
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  br label %31

31:                                               ; preds = %23
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %5, align 4, !tbaa !5
  br label %18, !llvm.loop !11

34:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %74, %34
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %70, %40
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = icmp sle i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %73

46:                                               ; preds = %41
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %46
  %51 = load i32, ptr %7, align 4, !tbaa !5
  br label %53

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52, %50
  %54 = phi i32 [ %51, %50 ], [ 0, %52 ]
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [1023 x [1023 x i32]], ptr @from, i64 0, i64 %56
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1023 x i32], ptr %57, i64 0, i64 %59
  store i32 %54, ptr %60, align 4, !tbaa !5
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1023 x [1023 x %struct.edge]], ptr @g, i64 0, i64 %62
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1023 x %struct.edge], ptr %63, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.edge, ptr %66, i32 0, i32 2
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %67)
  %69 = load i32, ptr %68, align 4, !tbaa !5
  store i32 %69, ptr %6, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %53
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %9, align 4, !tbaa !5
  br label %41, !llvm.loop !13

73:                                               ; preds = %45
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %7, align 4, !tbaa !5
  br label %35, !llvm.loop !14

77:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %88, %77
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = icmp sle i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %91

83:                                               ; preds = %78
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = load i32, ptr %10, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1023 x i32], ptr @lab, i64 0, i64 %86
  store i32 %84, ptr %87, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %83
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %10, align 4, !tbaa !5
  br label %78, !llvm.loop !15

91:                                               ; preds = %82
  br label %92

92:                                               ; preds = %94, %91
  %93 = call noundef zeroext i1 @_Z8matchingv()
  br i1 %93, label %94, label %97

94:                                               ; preds = %92
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %3, align 4, !tbaa !5
  br label %92, !llvm.loop !16

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %132, %97
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = icmp sle i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %135

103:                                              ; preds = %98
  %104 = load i32, ptr %11, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1023 x i32], ptr @match, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %131

109:                                              ; preds = %103
  %110 = load i32, ptr %11, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1023 x i32], ptr @match, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %116, label %131

116:                                              ; preds = %109
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1023 x [1023 x %struct.edge]], ptr @g, i64 0, i64 %118
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1023 x i32], ptr @match, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1023 x %struct.edge], ptr %119, i64 0, i64 %124
  %126 = getelementptr inbounds %struct.edge, ptr %125, i32 0, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !17
  %128 = sext i32 %127 to i64
  %129 = load i64, ptr %4, align 8, !tbaa !9
  %130 = add nsw i64 %129, %128
  store i64 %130, ptr %4, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %116, %109, %103
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %11, align 4, !tbaa !5
  br label %98, !llvm.loop !19

135:                                              ; preds = %102
  %136 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store { i64, i32 } %136, ptr %12, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %1, ptr align 8 %12, i64 12, i1 false)
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %137 = load { i64, i32 }, ptr %1, align 8
  ret { i64, i32 } %137
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !6, i64 8}
!18 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !6, i64 8}
!19 = distinct !{!19, !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"

%struct.edge = type { i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@g = external dso_local global [1023 x [1023 x %struct.edge]], align 16
@n = external dso_local local_unnamed_addr global i32, align 4
@num = external dso_local local_unnamed_addr global i32, align 4
@lab = external dso_local local_unnamed_addr global [1023 x i32], align 16
@match = external dso_local global [1023 x i32], align 16
@st = external dso_local local_unnamed_addr global [1023 x i32], align 16
@from = external dso_local local_unnamed_addr global [1023 x [1023 x i32]], align 16
@flower = external dso_local global [1023 x %"class.std::vector"], align 16

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z8matchingv() local_unnamed_addr #2

; 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 #3

; Function Attrs: mustprogress uwtable
define dso_local { i64, i32 } @_Z14weight_blossomv() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds i32, ptr @match, i64 %6
  %8 = getelementptr inbounds i8, ptr %7, i64 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @match, ptr noundef nonnull %8, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %9, ptr @num, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %.not41 = icmp slt i32 %9, 0
  br i1 %.not41, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %.preheader38

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  %.not3347 = icmp slt i32 %13, 1
  br i1 %.not3347, label %.preheader38, label %.preheader40

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %10 = getelementptr inbounds [1023 x i32], ptr @st, i64 0, i64 %indvars.iv
  %11 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %11, ptr %10, align 4, !tbaa !5
  %12 = getelementptr inbounds [1023 x %"class.std::vector"], ptr @flower, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %.not.not = icmp slt i64 %indvars.iv, %14
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader40:                                     ; preds = %._crit_edge, %._crit_edge46
  %15 = phi i32 [ %23, %._crit_edge46 ], [ 0, %._crit_edge ]
  %16 = phi i32 [ %24, %._crit_edge46 ], [ %13, %._crit_edge ]
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %._crit_edge46 ], [ 1, %._crit_edge ]
  %.not3743 = icmp slt i32 %16, 1
  br i1 %.not3743, label %.preheader40.._crit_edge46_crit_edge, label %.lr.ph45

.preheader40.._crit_edge46_crit_edge:             ; preds = %.preheader40
  %.pre = sext i32 %16 to i64
  br label %._crit_edge46

.lr.ph45:                                         ; preds = %.preheader40
  %17 = trunc nuw nsw i64 %indvars.iv66 to i32
  br label %25

.preheader39:                                     ; preds = %._crit_edge46
  %.not3449 = icmp slt i32 %24, 1
  br i1 %.not3449, label %.preheader38, label %.lr.ph51

.lr.ph51:                                         ; preds = %.preheader39
  %18 = add nuw i32 %24, 1
  %wide.trip.count = zext i32 %18 to i64
  %19 = zext nneg i32 %24 to i64
  %min.iters.check = icmp ult i32 %24, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph51
  %indvars.iv69.ph = phi i64 [ 1, %.lr.ph51 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph51
  %n.vec = and i64 %19, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %23, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %20 = getelementptr inbounds [1023 x i32], ptr @lab, i64 0, i64 %offset.idx
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store <4 x i32> %broadcast.splat, ptr %20, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %21, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %22 = icmp eq i64 %index.next, %n.vec
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %19
  br i1 %cmp.n, label %.preheader38, label %scalar.ph.preheader

._crit_edge46:                                    ; preds = %25, %.preheader40.._crit_edge46_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader40.._crit_edge46_crit_edge ], [ %33, %25 ]
  %23 = phi i32 [ %15, %.preheader40.._crit_edge46_crit_edge ], [ %31, %25 ]
  %24 = phi i32 [ %16, %.preheader40.._crit_edge46_crit_edge ], [ %32, %25 ]
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %.not33.not = icmp slt i64 %indvars.iv66, %.pre-phi
  br i1 %.not33.not, label %.preheader40, label %.preheader39, !llvm.loop !14

25:                                               ; preds = %.lr.ph45, %25
  %indvars.iv63 = phi i64 [ 1, %.lr.ph45 ], [ %indvars.iv.next64, %25 ]
  %26 = icmp eq i64 %indvars.iv66, %indvars.iv63
  %27 = select i1 %26, i32 %17, i32 0
  %28 = getelementptr inbounds [1023 x [1023 x i32]], ptr @from, i64 0, i64 %indvars.iv66, i64 %indvars.iv63
  store i32 %27, ptr %28, align 4, !tbaa !5
  %29 = getelementptr inbounds [1023 x [1023 x %struct.edge]], ptr @g, i64 0, i64 %indvars.iv66, i64 %indvars.iv63, i32 2
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr %4, align 4, !tbaa !5
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %.not37.not = icmp slt i64 %indvars.iv63, %33
  br i1 %.not37.not, label %25, label %._crit_edge46, !llvm.loop !16

.preheader38:                                     ; preds = %scalar.ph, %middle.block, %._crit_edge.thread, %._crit_edge, %.preheader39
  %34 = call noundef zeroext i1 @_Z8matchingv()
  br i1 %34, label %.lr.ph52, label %.preheader

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %scalar.ph ], [ %indvars.iv69.ph, %scalar.ph.preheader ]
  %35 = getelementptr inbounds [1023 x i32], ptr @lab, i64 0, i64 %indvars.iv69
  store i32 %23, ptr %35, align 4, !tbaa !5
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
  br i1 %exitcond.not, label %.preheader38, label %scalar.ph, !llvm.loop !17

.preheader:                                       ; preds = %.lr.ph52, %.preheader38
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %.not3554 = icmp slt i32 %36, 1
  br i1 %.not3554, label %._crit_edge57, label %.lr.ph56.preheader

.lr.ph56.preheader:                               ; preds = %.preheader
  %37 = zext nneg i32 %36 to i64
  %xtraiter = and i64 %37, 1
  %38 = icmp eq i32 %36, 1
  br i1 %38, label %._crit_edge57.loopexit.unr-lcssa, label %.lr.ph56.preheader.new

.lr.ph56.preheader.new:                           ; preds = %.lr.ph56.preheader
  %unroll_iter = and i64 %37, 2147483646
  br label %.lr.ph56

.lr.ph52:                                         ; preds = %.preheader38, %.lr.ph52
  %39 = phi i32 [ %40, %.lr.ph52 ], [ 0, %.preheader38 ]
  %40 = add nuw nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  %41 = call noundef zeroext i1 @_Z8matchingv()
  br i1 %41, label %.lr.ph52, label %.preheader, !llvm.loop !18

._crit_edge57.loopexit.unr-lcssa:                 ; preds = %72, %.lr.ph56.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph56.preheader ], [ %73, %72 ]
  %indvars.iv72.unr = phi i64 [ 1, %.lr.ph56.preheader ], [ %indvars.iv.next73.1, %72 ]
  %.unr = phi i64 [ 0, %.lr.ph56.preheader ], [ %73, %72 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge57, label %.lr.ph56.epil

.lr.ph56.epil:                                    ; preds = %._crit_edge57.loopexit.unr-lcssa
  %42 = getelementptr inbounds [1023 x i32], ptr @match, i64 0, i64 %indvars.iv72.unr
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %.not36.epil = icmp ne i32 %43, 0
  %44 = sext i32 %43 to i64
  %45 = icmp sgt i64 %indvars.iv72.unr, %44
  %or.cond.epil = and i1 %.not36.epil, %45
  br i1 %or.cond.epil, label %46, label %._crit_edge57

46:                                               ; preds = %.lr.ph56.epil
  %47 = getelementptr inbounds [1023 x [1023 x %struct.edge]], ptr @g, i64 0, i64 %indvars.iv72.unr, i64 %44, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !19
  %49 = sext i32 %48 to i64
  %50 = add nsw i64 %.unr, %49
  br label %._crit_edge57

._crit_edge57:                                    ; preds = %._crit_edge57.loopexit.unr-lcssa, %46, %.lr.ph56.epil, %.preheader
  %.lcssa53 = phi i64 [ 0, %.preheader ], [ %.lcssa.ph, %._crit_edge57.loopexit.unr-lcssa ], [ %.unr, %.lr.ph56.epil ], [ %50, %46 ]
  store i64 %.lcssa53, ptr %3, align 8, !tbaa !21
  %51 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  ret { i64, i32 } %51

.lr.ph56:                                         ; preds = %72, %.lr.ph56.preheader.new
  %indvars.iv72 = phi i64 [ 1, %.lr.ph56.preheader.new ], [ %indvars.iv.next73.1, %72 ]
  %52 = phi i64 [ 0, %.lr.ph56.preheader.new ], [ %73, %72 ]
  %niter = phi i64 [ 0, %.lr.ph56.preheader.new ], [ %niter.next.1, %72 ]
  %53 = getelementptr inbounds [1023 x i32], ptr @match, i64 0, i64 %indvars.iv72
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %.not36 = icmp ne i32 %54, 0
  %55 = sext i32 %54 to i64
  %56 = icmp sgt i64 %indvars.iv72, %55
  %or.cond = and i1 %.not36, %56
  br i1 %or.cond, label %57, label %.lr.ph56.1

57:                                               ; preds = %.lr.ph56
  %58 = getelementptr inbounds [1023 x [1023 x %struct.edge]], ptr @g, i64 0, i64 %indvars.iv72, i64 %55, i32 2
  %59 = load i32, ptr %58, align 4, !tbaa !19
  %60 = sext i32 %59 to i64
  %61 = add nsw i64 %52, %60
  br label %.lr.ph56.1

.lr.ph56.1:                                       ; preds = %.lr.ph56, %57
  %62 = phi i64 [ %52, %.lr.ph56 ], [ %61, %57 ]
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %63 = getelementptr inbounds [1023 x i32], ptr @match, i64 0, i64 %indvars.iv.next73
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %.not36.1 = icmp ne i32 %64, 0
  %65 = sext i32 %64 to i64
  %66 = icmp sge i64 %indvars.iv72, %65
  %or.cond.1 = and i1 %.not36.1, %66
  br i1 %or.cond.1, label %67, label %72

67:                                               ; preds = %.lr.ph56.1
  %68 = getelementptr inbounds [1023 x [1023 x %struct.edge]], ptr @g, i64 0, i64 %indvars.iv.next73, i64 %65, i32 2
  %69 = load i32, ptr %68, align 4, !tbaa !19
  %70 = sext i32 %69 to i64
  %71 = add nsw i64 %62, %70
  br label %72

72:                                               ; preds = %67, %.lr.ph56.1
  %73 = phi i64 [ %62, %.lr.ph56.1 ], [ %71, %67 ]
  %indvars.iv.next73.1 = add nuw nsw i64 %indvars.iv72, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge57.loopexit.unr-lcssa, label %.lr.ph56, !llvm.loop !23
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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 #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !13, !12}
!18 = distinct !{!18, !10}
!19 = !{!20, !6, i64 8}
!20 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !6, i64 8}
!21 = !{!22, !22, i64 0}
!22 = !{!"long long", !7, i64 0}
!23 = distinct !{!23, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass