; LLVM IR from tangjz/acm-icpc :: leetcode/extra/Shopee_003-Order Delivery.ll (ZN4Flow4SPFAEv)

; 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.Flow::Edge" = type { i32, i32, i32, i64 }

@_ZN4Flow1NE = external dso_local global i32, align 4
@_ZN4Flow1SE = external dso_local global i32, align 4
@_ZN4Flow1TE = external dso_local global i32, align 4
@_ZN4Flow3lnkE = external dso_local global [45 x i32], align 16
@_ZN4Flow3disE = external dso_local global [45 x i64], align 16
@_ZN4Flow3sumE = external dso_local global i64, align 8
@_ZN4Flow1eE = external dso_local global [819 x %"struct.Flow::Edge"], align 16
@_ZN4Flow3visE = external dso_local global [45 x i8], align 16
@_ZZN4Flow4SPFAEvE3que = external hidden global [45 x i32], 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: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN4Flow4SPFAEv() #1 {
  %1 = alloca i1, align 1
  %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 i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  %11 = load i32, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = mul i64 %12, 8
  call void @llvm.memset.p0.i64(ptr align 16 @_ZN4Flow3disE, i8 63, i64 %13, i1 false)
  %14 = load i32, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = mul i64 %15, 1
  call void @llvm.memset.p0.i64(ptr align 16 @_ZN4Flow3visE, i8 0, i64 %16, i1 false)
  %17 = load i32, ptr @_ZN4Flow1TE, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %18
  store i64 0, ptr %19, align 8, !tbaa !9
  %20 = load i32, ptr @_ZN4Flow1TE, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [45 x i8], ptr @_ZN4Flow3visE, i64 0, i64 %21
  store i8 1, ptr %22, align 1, !tbaa !11
  %23 = load i32, ptr @_ZN4Flow1TE, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %24 to i64
  %27 = getelementptr inbounds [45 x i32], ptr @_ZZN4Flow4SPFAEvE3que, i64 0, i64 %26
  store i32 %23, ptr %27, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %118, %0
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp ne i32 %29, %30
  br i1 %31, label %32, label %119

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %33 to i64
  %36 = getelementptr inbounds [45 x i32], ptr @_ZZN4Flow4SPFAEvE3que, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %37, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [45 x i8], ptr @_ZN4Flow3visE, i64 0, i64 %39
  store i8 0, ptr %40, align 1, !tbaa !11
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 45
  br i1 %42, label %43, label %44

43:                                               ; preds = %32
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %43, %32
  %45 = phi i1 [ false, %32 ], [ false, %43 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [45 x i32], ptr @_ZN4Flow3lnkE, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  store i32 %49, ptr %5, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %112, %44
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = icmp ne i32 %51, -1
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %118

54:                                               ; preds = %50
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = xor i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %57
  %59 = getelementptr inbounds %"struct.Flow::Edge", ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 8, !tbaa !13
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %63, label %62

62:                                               ; preds = %54
  br label %112

63:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %65
  %67 = getelementptr inbounds %"struct.Flow::Edge", ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !15
  store i32 %68, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = xor i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %75
  %77 = getelementptr inbounds %"struct.Flow::Edge", ptr %76, i32 0, i32 3
  %78 = load i64, ptr %77, align 8, !tbaa !16
  %79 = add nsw i64 %72, %78
  store i64 %79, ptr %7, align 8, !tbaa !9
  %80 = load i64, ptr %7, align 8, !tbaa !9
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = icmp slt i64 %80, %84
  br i1 %85, label %86, label %111

86:                                               ; preds = %63
  %87 = load i64, ptr %7, align 8, !tbaa !9
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %89
  store i64 %87, ptr %90, align 8, !tbaa !9
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [45 x i8], ptr @_ZN4Flow3visE, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !11, !range !17, !noundef !18
  %95 = trunc i8 %94 to i1
  br i1 %95, label %110, label %96

96:                                               ; preds = %86
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = load i32, ptr %3, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %3, align 4, !tbaa !5
  %100 = sext i32 %98 to i64
  %101 = getelementptr inbounds [45 x i32], ptr @_ZZN4Flow4SPFAEvE3que, i64 0, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !5
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [45 x i8], ptr @_ZN4Flow3visE, i64 0, i64 %103
  store i8 1, ptr %104, align 1, !tbaa !11
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = icmp eq i32 %105, 45
  br i1 %106, label %107, label %108

107:                                              ; preds = %96
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %107, %96
  %109 = phi i1 [ false, %96 ], [ false, %107 ]
  br label %110

110:                                              ; preds = %108, %86
  br label %111

111:                                              ; preds = %110, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %112

112:                                              ; preds = %111, %62
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %114
  %116 = getelementptr inbounds %"struct.Flow::Edge", ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 8, !tbaa !19
  store i32 %117, ptr %5, align 4, !tbaa !5
  br label %50, !llvm.loop !20

118:                                              ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %28, !llvm.loop !22

119:                                              ; preds = %28
  %120 = load i32, ptr @_ZN4Flow1SE, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = icmp eq i64 %123, 4557430888798830399
  br i1 %124, label %125, label %126

125:                                              ; preds = %119
  store i1 false, ptr %1, align 1
  store i32 1, ptr %8, align 4
  br label %178

126:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %168, %126
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = load i32, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  %130 = icmp slt i32 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %127
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %171

132:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %133 = load i32, ptr %9, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [45 x i32], ptr @_ZN4Flow3lnkE, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  store i32 %136, ptr %10, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %161, %132
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = icmp ne i32 %138, -1
  br i1 %139, label %141, label %140

140:                                              ; preds = %137
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %167

141:                                              ; preds = %137
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %143
  %145 = getelementptr inbounds %"struct.Flow::Edge", ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !15
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %151
  %153 = load i64, ptr %152, align 8, !tbaa !9
  %154 = sub nsw i64 %149, %153
  %155 = load i32, ptr %10, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %156
  %158 = getelementptr inbounds %"struct.Flow::Edge", ptr %157, i32 0, i32 3
  %159 = load i64, ptr %158, align 8, !tbaa !16
  %160 = add nsw i64 %159, %154
  store i64 %160, ptr %158, align 8, !tbaa !16
  br label %161

161:                                              ; preds = %141
  %162 = load i32, ptr %10, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %163
  %165 = getelementptr inbounds %"struct.Flow::Edge", ptr %164, i32 0, i32 0
  %166 = load i32, ptr %165, align 8, !tbaa !19
  store i32 %166, ptr %10, align 4, !tbaa !5
  br label %137, !llvm.loop !23

167:                                              ; preds = %140
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %9, align 4, !tbaa !5
  br label %127, !llvm.loop !24

171:                                              ; preds = %131
  %172 = load i32, ptr @_ZN4Flow1SE, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !9
  %176 = load i64, ptr @_ZN4Flow3sumE, align 8, !tbaa !9
  %177 = add nsw i64 %176, %175
  store i64 %177, ptr @_ZN4Flow3sumE, align 8, !tbaa !9
  store i1 true, ptr %1, align 1
  store i32 1, ptr %8, align 4
  br label %178

178:                                              ; preds = %171, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  %179 = load i1, ptr %1, align 1
  ret i1 %179
}

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

attributes #0 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTSN4Flow4EdgeE", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16}
!15 = !{!14, !6, i64 4}
!16 = !{!14, !10, i64 16}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!14, !6, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !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.Flow::Edge" = type { i32, i32, i32, i64 }

@_ZN4Flow1NE = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Flow1SE = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Flow1TE = external dso_local local_unnamed_addr global i32, align 4
@_ZN4Flow3lnkE = external dso_local local_unnamed_addr global [45 x i32], align 16
@_ZN4Flow3disE = external dso_local local_unnamed_addr global [45 x i64], align 16
@_ZN4Flow3sumE = external dso_local local_unnamed_addr global i64, align 8
@_ZN4Flow1eE = external dso_local local_unnamed_addr global [819 x %"struct.Flow::Edge"], align 16
@_ZN4Flow3visE = external dso_local local_unnamed_addr global [45 x i8], align 16
@_ZZN4Flow4SPFAEvE3que = external hidden local_unnamed_addr global [45 x i32], align 16

; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local noundef zeroext i1 @_ZN4Flow4SPFAEv() local_unnamed_addr #0 {
  %1 = load i32, ptr @_ZN4Flow1NE, align 4, !tbaa !5
  %2 = sext i32 %1 to i64
  %3 = shl nsw i64 %2, 3
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZN4Flow3disE, i8 63, i64 %3, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZN4Flow3visE, i8 0, i64 %2, i1 false)
  %4 = load i32, ptr @_ZN4Flow1TE, align 4, !tbaa !5
  %5 = sext i32 %4 to i64
  %6 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %5
  store i64 0, ptr %6, align 8, !tbaa !9
  %7 = getelementptr inbounds [45 x i8], ptr @_ZN4Flow3visE, i64 0, i64 %5
  store i8 1, ptr %7, align 1, !tbaa !11
  store i32 %4, ptr @_ZZN4Flow4SPFAEvE3que, align 16, !tbaa !5
  br label %8

.loopexit:                                        ; preds = %._crit_edge54, %8
  %.1.lcssa = phi i32 [ %.03544, %8 ], [ %.3, %._crit_edge54 ]
  %.not = icmp eq i32 %spec.store.select, %.1.lcssa
  br i1 %.not, label %45, label %8, !llvm.loop !13

8:                                                ; preds = %0, %.loopexit
  %.03345 = phi i32 [ 0, %0 ], [ %spec.store.select, %.loopexit ]
  %.03544 = phi i32 [ 1, %0 ], [ %.1.lcssa, %.loopexit ]
  %9 = add nsw i32 %.03345, 1
  %10 = sext i32 %.03345 to i64
  %11 = getelementptr inbounds [45 x i32], ptr @_ZZN4Flow4SPFAEvE3que, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [45 x i8], ptr @_ZN4Flow3visE, i64 0, i64 %13
  store i8 0, ptr %14, align 1, !tbaa !11
  %15 = icmp eq i32 %9, 45
  %spec.store.select = select i1 %15, i32 0, i32 %9
  %16 = getelementptr inbounds [45 x i32], ptr @_ZN4Flow3lnkE, i64 0, i64 %13
  %.03440 = load i32, ptr %16, align 4, !tbaa !5
  %.not3841 = icmp eq i32 %.03440, -1
  br i1 %.not3841, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %8
  %17 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %13
  br label %18

18:                                               ; preds = %.lr.ph, %._crit_edge54
  %.03443 = phi i32 [ %.03440, %.lr.ph ], [ %.034, %._crit_edge54 ]
  %.142 = phi i32 [ %.03544, %.lr.ph ], [ %.3, %._crit_edge54 ]
  %19 = xor i32 %.03443, 1
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %20
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = load i32, ptr %22, align 8, !tbaa !15
  %.not39 = icmp eq i32 %23, 0
  %.pre = sext i32 %.03443 to i64
  br i1 %.not39, label %._crit_edge54, label %24

24:                                               ; preds = %18
  %25 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %.pre, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = load i64, ptr %17, align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %21, i64 16
  %29 = load i64, ptr %28, align 8, !tbaa !18
  %30 = add nsw i64 %29, %27
  %31 = sext i32 %26 to i64
  %32 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = icmp slt i64 %30, %33
  br i1 %34, label %35, label %._crit_edge54

35:                                               ; preds = %24
  store i64 %30, ptr %32, align 8, !tbaa !9
  %36 = getelementptr inbounds [45 x i8], ptr @_ZN4Flow3visE, i64 0, i64 %31
  %37 = load i8, ptr %36, align 1, !tbaa !11, !range !19, !noundef !20
  %38 = trunc nuw i8 %37 to i1
  br i1 %38, label %._crit_edge54, label %39

39:                                               ; preds = %35
  %40 = add nsw i32 %.142, 1
  %41 = sext i32 %.142 to i64
  %42 = getelementptr inbounds [45 x i32], ptr @_ZZN4Flow4SPFAEvE3que, i64 0, i64 %41
  store i32 %26, ptr %42, align 4, !tbaa !5
  store i8 1, ptr %36, align 1, !tbaa !11
  %43 = icmp eq i32 %40, 45
  %spec.store.select1 = select i1 %43, i32 0, i32 %40
  br label %._crit_edge54

._crit_edge54:                                    ; preds = %18, %24, %39, %35
  %.3 = phi i32 [ %.142, %24 ], [ %spec.store.select1, %39 ], [ %.142, %35 ], [ %.142, %18 ]
  %44 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %.pre
  %.034 = load i32, ptr %44, align 8, !tbaa !5
  %.not38 = icmp eq i32 %.034, -1
  br i1 %.not38, label %.loopexit, label %18, !llvm.loop !21

45:                                               ; preds = %.loopexit
  %46 = load i32, ptr @_ZN4Flow1SE, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %50 = icmp ne i64 %49, 4557430888798830399
  br i1 %50, label %.preheader, label %69

.preheader:                                       ; preds = %45
  %51 = icmp sgt i32 %1, 0
  br i1 %51, label %.lr.ph51.preheader, label %._crit_edge52

.lr.ph51.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.lr.ph51

._crit_edge52:                                    ; preds = %._crit_edge, %.preheader
  %52 = load i64, ptr @_ZN4Flow3sumE, align 8, !tbaa !9
  %53 = add nsw i64 %52, %49
  store i64 %53, ptr @_ZN4Flow3sumE, align 8, !tbaa !9
  br label %69

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %54 = getelementptr inbounds [45 x i32], ptr @_ZN4Flow3lnkE, i64 0, i64 %indvars.iv
  %.046 = load i32, ptr %54, align 4, !tbaa !5
  %.not3747 = icmp eq i32 %.046, -1
  br i1 %.not3747, label %._crit_edge, label %.lr.ph49

.lr.ph49:                                         ; preds = %.lr.ph51
  %55 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %indvars.iv
  %56 = load i64, ptr %55, align 8, !tbaa !9
  br label %57

._crit_edge:                                      ; preds = %57, %.lr.ph51
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !22

57:                                               ; preds = %.lr.ph49, %57
  %.048 = phi i32 [ %.046, %.lr.ph49 ], [ %.0, %57 ]
  %58 = sext i32 %.048 to i64
  %59 = getelementptr inbounds [819 x %"struct.Flow::Edge"], ptr @_ZN4Flow1eE, i64 0, i64 %58
  %60 = getelementptr inbounds i8, ptr %59, i64 4
  %61 = load i32, ptr %60, align 4, !tbaa !17
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [45 x i64], ptr @_ZN4Flow3disE, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = sub i64 %64, %56
  %66 = getelementptr inbounds i8, ptr %59, i64 16
  %67 = load i64, ptr %66, align 8, !tbaa !18
  %68 = add nsw i64 %65, %67
  store i64 %68, ptr %66, align 8, !tbaa !18
  %.0 = load i32, ptr %59, align 8, !tbaa !5
  %.not37 = icmp eq i32 %.0, -1
  br i1 %.not37, label %._crit_edge, label %57, !llvm.loop !23

69:                                               ; preds = %45, %._crit_edge52
  ret i1 %50
}

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

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

!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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSN4Flow4EdgeE", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16}
!17 = !{!16, !6, i64 4}
!18 = !{!16, !10, i64 16}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}


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