; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x29-总结与练习/186. 巴士.ll (Z3dfsiii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, i32 }

@routes = external dso_local global %"class.std::vector", align 8
@n = external dso_local global i32, align 4
@bus = external dso_local global [60 x i32], align 16
@e = external dso_local global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z3dfsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #2 {
  %4 = alloca i1, align 1
  %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 i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !5
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = load i32, ptr @e, align 4, !tbaa !5
  %17 = icmp eq i32 %15, %16
  br i1 %17, label %18, label %22

18:                                               ; preds = %3
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp eq i32 %19, %20
  store i1 %21, ptr %4, align 1
  br label %108

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %23 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %23, ptr %8, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %102, %22
  %25 = load i32, ptr %8, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @routes) #4
  %28 = icmp ult i64 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %24
  store i32 2, ptr %9, align 4
  br label %105

30:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #4
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @routes, i64 noundef %32) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %33, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %34 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 1
  %35 = getelementptr inbounds %"struct.std::pair.0", ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 4, !tbaa !9
  store i32 %36, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %37 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 1
  %38 = getelementptr inbounds %"struct.std::pair.0", ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !12
  store i32 %39, ptr %12, align 4, !tbaa !5
  %40 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 0
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = load i32, ptr @e, align 4, !tbaa !5
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = sub nsw i32 %42, %43
  %45 = mul nsw i32 %41, %44
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = add nsw i32 %45, %46
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %30
  store i32 4, ptr %9, align 4
  br label %99

51:                                               ; preds = %30
  %52 = load i32, ptr %11, align 4, !tbaa !5
  %53 = load i32, ptr %12, align 4, !tbaa !5
  %54 = call noundef zeroext i1 @_Z5checkii(i32 noundef %52, i32 noundef %53)
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 4, ptr %9, align 4
  br label %99

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %57 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %57, ptr %13, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %68, %56
  %59 = load i32, ptr %13, align 4, !tbaa !5
  %60 = icmp slt i32 %59, 60
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %72

62:                                               ; preds = %58
  %63 = load i32, ptr %13, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [60 x i32], ptr @bus, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %65, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %62
  %69 = load i32, ptr %12, align 4, !tbaa !5
  %70 = load i32, ptr %13, align 4, !tbaa !5
  %71 = add nsw i32 %70, %69
  store i32 %71, ptr %13, align 4, !tbaa !5
  br label %58, !llvm.loop !14

72:                                               ; preds = %61
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !13
  %78 = add nsw i32 %75, %77
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = call noundef zeroext i1 @_Z3dfsiii(i32 noundef %74, i32 noundef %78, i32 noundef %79)
  br i1 %80, label %81, label %82

81:                                               ; preds = %72
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %99

82:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %83 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %83, ptr %14, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %94, %82
  %85 = load i32, ptr %14, align 4, !tbaa !5
  %86 = icmp slt i32 %85, 60
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %98

88:                                               ; preds = %84
  %89 = load i32, ptr %14, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [60 x i32], ptr @bus, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %91, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %88
  %95 = load i32, ptr %12, align 4, !tbaa !5
  %96 = load i32, ptr %14, align 4, !tbaa !5
  %97 = add nsw i32 %96, %95
  store i32 %97, ptr %14, align 4, !tbaa !5
  br label %84, !llvm.loop !16

98:                                               ; preds = %87
  store i32 0, ptr %9, align 4
  br label %99

99:                                               ; preds = %98, %81, %55, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #4
  %100 = load i32, ptr %9, align 4
  switch i32 %100, label %105 [
    i32 0, label %101
    i32 4, label %102
  ]

101:                                              ; preds = %99
  br label %102

102:                                              ; preds = %101, %99
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %8, align 4, !tbaa !5
  br label %24, !llvm.loop !17

105:                                              ; preds = %99, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %106 = load i32, ptr %9, align 4
  switch i32 %106, label %110 [
    i32 2, label %107
    i32 1, label %108
  ]

107:                                              ; preds = %105
  store i1 false, ptr %4, align 1
  br label %108

108:                                              ; preds = %107, %105, %18
  %109 = load i1, ptr %4, align 1
  ret i1 %109

110:                                              ; preds = %105
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !6, i64 4}
!10 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !11, i64 4}
!11 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@routes = external dso_local global %"class.std::vector", align 8
@n = external dso_local local_unnamed_addr global i32, align 4
@bus = external dso_local local_unnamed_addr global [60 x i32], align 16
@e = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z3dfsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = load i32, ptr @e, align 4, !tbaa !5
  %5 = icmp eq i32 %4, %0
  br i1 %5, label %9, label %.preheader35

.preheader35:                                     ; preds = %3
  %6 = sext i32 %2 to i64
  %7 = tail call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @routes) #2
  %.not40 = icmp ugt i64 %7, %6
  br i1 %.not40, label %.lr.ph43, label %.loopexit36

.lr.ph43:                                         ; preds = %.preheader35
  %8 = add nsw i32 %0, 1
  br label %12

9:                                                ; preds = %3
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp eq i32 %10, %1
  br label %.loopexit36

12:                                               ; preds = %.lr.ph43, %.loopexit
  %indvars.iv50 = phi i64 [ %6, %.lr.ph43 ], [ %indvars.iv.next51, %.loopexit ]
  %13 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @routes, i64 noundef %indvars.iv50) #2
  %.sroa.0.0.copyload = load i32, ptr %13, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 4
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4
  %14 = load i32, ptr @e, align 4, !tbaa !5
  %15 = sub nsw i32 %14, %0
  %16 = mul nsw i32 %15, %.sroa.0.0.copyload
  %17 = add nsw i32 %16, %1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %.loopexit, label %20

20:                                               ; preds = %12
  %21 = tail call noundef zeroext i1 @_Z5checkii(i32 noundef %.sroa.5.0.copyload, i32 noundef %.sroa.6.0.copyload)
  br i1 %21, label %.preheader34, label %.loopexit

.preheader34:                                     ; preds = %20
  %22 = icmp slt i32 %.sroa.5.0.copyload, 60
  br i1 %22, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %.preheader34
  %23 = sext i32 %.sroa.5.0.copyload to i64
  %24 = sext i32 %.sroa.6.0.copyload to i64
  %25 = add nsw i64 %23, %24
  %smax55 = tail call i64 @llvm.smax.i64(i64 %25, i64 60)
  %26 = icmp slt i64 %25, 60
  %umin56.neg = sext i1 %26 to i64
  %27 = select i1 %26, i64 2, i64 1
  %28 = add i64 %smax55, %umin56.neg
  %29 = sub i64 %28, %25
  %30 = udiv i64 %29, %24
  %31 = add i64 %27, %30
  %min.iters.check59 = icmp ugt i64 %31, 7
  %ident.check54.not = icmp eq i32 %.sroa.6.0.copyload, 1
  %or.cond = select i1 %min.iters.check59, i1 %ident.check54.not, i1 false
  br i1 %or.cond, label %vector.ph60, label %.lr.ph.preheader74

.lr.ph.preheader74:                               ; preds = %middle.block57, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ %23, %.lr.ph.preheader ], [ %ind.end63, %middle.block57 ]
  br label %.lr.ph

vector.ph60:                                      ; preds = %.lr.ph.preheader
  %n.vec62 = and i64 %31, -8
  %32 = mul nuw i64 %n.vec62, %24
  %ind.end63 = add i64 %32, %23
  br label %vector.body65

vector.body65:                                    ; preds = %vector.body65, %vector.ph60
  %index66 = phi i64 [ 0, %vector.ph60 ], [ %index.next70, %vector.body65 ]
  %33 = mul nuw i64 %index66, %24
  %offset.idx67 = add i64 %33, %23
  %34 = getelementptr inbounds [60 x i32], ptr @bus, i64 0, i64 %offset.idx67
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %wide.load68 = load <4 x i32>, ptr %34, align 4, !tbaa !5
  %wide.load69 = load <4 x i32>, ptr %35, align 4, !tbaa !5
  %36 = add nsw <4 x i32> %wide.load68, <i32 -1, i32 -1, i32 -1, i32 -1>
  %37 = add nsw <4 x i32> %wide.load69, <i32 -1, i32 -1, i32 -1, i32 -1>
  store <4 x i32> %36, ptr %34, align 4, !tbaa !5
  store <4 x i32> %37, ptr %35, align 4, !tbaa !5
  %index.next70 = add nuw i64 %index66, 8
  %38 = icmp eq i64 %index.next70, %n.vec62
  br i1 %38, label %middle.block57, label %vector.body65, !llvm.loop !9

middle.block57:                                   ; preds = %vector.body65
  %cmp.n71 = icmp eq i64 %31, %n.vec62
  br i1 %cmp.n71, label %._crit_edge, label %.lr.ph.preheader74

._crit_edge:                                      ; preds = %.lr.ph, %middle.block57
  %39 = add nsw i32 %.sroa.0.0.copyload, %1
  %40 = trunc nsw i64 %indvars.iv50 to i32
  %41 = tail call noundef zeroext i1 @_Z3dfsiii(i32 noundef %8, i32 noundef %39, i32 noundef %40)
  br i1 %41, label %.loopexit36, label %.preheader

._crit_edge.thread:                               ; preds = %.preheader34
  %42 = add nsw i32 %.sroa.0.0.copyload, %1
  %43 = trunc nsw i64 %indvars.iv50 to i32
  %44 = tail call noundef zeroext i1 @_Z3dfsiii(i32 noundef %8, i32 noundef %42, i32 noundef %43)
  br i1 %44, label %.loopexit36, label %.loopexit

.preheader:                                       ; preds = %._crit_edge
  br i1 %22, label %.lr.ph39.preheader, label %.loopexit

.lr.ph39.preheader:                               ; preds = %.preheader
  %45 = sext i32 %.sroa.5.0.copyload to i64
  %46 = sext i32 %.sroa.6.0.copyload to i64
  %47 = add nsw i64 %23, %24
  %smax = tail call i64 @llvm.smax.i64(i64 %47, i64 60)
  %48 = icmp slt i64 %47, 60
  %umin.neg = sext i1 %48 to i64
  %49 = select i1 %48, i64 2, i64 1
  %50 = add i64 %smax, %umin.neg
  %51 = sub i64 %50, %47
  %52 = udiv i64 %51, %24
  %53 = add i64 %49, %52
  %min.iters.check = icmp ugt i64 %53, 7
  %ident.check.not = icmp eq i32 %.sroa.6.0.copyload, 1
  %or.cond72 = select i1 %min.iters.check, i1 %ident.check.not, i1 false
  br i1 %or.cond72, label %vector.ph, label %.lr.ph39.preheader73

.lr.ph39.preheader73:                             ; preds = %middle.block, %.lr.ph39.preheader
  %indvars.iv47.ph = phi i64 [ %45, %.lr.ph39.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph39

vector.ph:                                        ; preds = %.lr.ph39.preheader
  %n.vec = and i64 %53, -8
  %54 = mul nuw i64 %n.vec, %24
  %ind.end = add i64 %54, %45
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %55 = mul nuw i64 %index, %24
  %offset.idx = add i64 %55, %45
  %56 = getelementptr inbounds [60 x i32], ptr @bus, i64 0, i64 %offset.idx
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %wide.load = load <4 x i32>, ptr %56, align 4, !tbaa !5
  %wide.load52 = load <4 x i32>, ptr %57, align 4, !tbaa !5
  %58 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %59 = add nsw <4 x i32> %wide.load52, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %58, ptr %56, align 4, !tbaa !5
  store <4 x i32> %59, ptr %57, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %60 = icmp eq i64 %index.next, %n.vec
  br i1 %60, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %53, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph39.preheader73

.lr.ph:                                           ; preds = %.lr.ph.preheader74, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader74 ]
  %61 = getelementptr inbounds [60 x i32], ptr @bus, i64 0, i64 %indvars.iv
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %61, align 4, !tbaa !5
  %indvars.iv.next = add nsw i64 %indvars.iv, %24
  %64 = icmp slt i64 %indvars.iv.next, 60
  br i1 %64, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.lr.ph39:                                         ; preds = %.lr.ph39.preheader73, %.lr.ph39
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %.lr.ph39 ], [ %indvars.iv47.ph, %.lr.ph39.preheader73 ]
  %65 = getelementptr inbounds [60 x i32], ptr @bus, i64 0, i64 %indvars.iv47
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %65, align 4, !tbaa !5
  %indvars.iv.next48 = add nsw i64 %indvars.iv47, %46
  %68 = icmp slt i64 %indvars.iv.next48, 60
  br i1 %68, label %.lr.ph39, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph39, %middle.block, %._crit_edge.thread, %.preheader, %12, %20
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %69 = tail call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @routes) #2
  %.not = icmp ugt i64 %69, %indvars.iv.next51
  br i1 %.not, label %12, label %.loopexit36, !llvm.loop !16

.loopexit36:                                      ; preds = %._crit_edge, %.loopexit, %._crit_edge.thread, %.preheader35, %9
  %.3 = phi i1 [ %11, %9 ], [ false, %.preheader35 ], [ true, %._crit_edge.thread ], [ true, %._crit_edge ], [ false, %.loopexit ]
  ret i1 %.3
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #1

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11, !12}
!14 = distinct !{!14, !10, !11}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10}


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