; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/189 Division 2/Problem B (B)

; 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<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 { i32, i32 }
%"class.std::basic_ostream" = type { ptr, %"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 }

@n = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@cur = external dso_local global i32, align 4
@adj = external dso_local global [100 x %"class.std::vector"], align 16
@s = external dso_local global [100 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3bfsii(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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %119, %0
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp slt i32 %8, %9
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %7
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @t, ptr noundef @a, ptr noundef @b)
  %14 = load i32, ptr @t, align 4, !tbaa !5
  %15 = icmp eq i32 %14, 1
  br i1 %15, label %16, label %106

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %17 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b)
  store i64 %17, ptr %4, align 4
  %18 = load i32, ptr @cur, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %19
  %21 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %100, %16
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = load i32, ptr @cur, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %103

27:                                               ; preds = %22
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %29
  %31 = getelementptr inbounds %"struct.std::pair", ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %33 = load i32, ptr @a, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %35, label %43

35:                                               ; preds = %27
  %36 = load i32, ptr @a, align 4, !tbaa !5
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %38
  %40 = getelementptr inbounds %"struct.std::pair", ptr %39, i32 0, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !11
  %42 = icmp slt i32 %36, %41
  br i1 %42, label %59, label %43

43:                                               ; preds = %35, %27
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %45
  %47 = getelementptr inbounds %"struct.std::pair", ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !9
  %49 = load i32, ptr @b, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %63

51:                                               ; preds = %43
  %52 = load i32, ptr @b, align 4, !tbaa !5
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %54
  %56 = getelementptr inbounds %"struct.std::pair", ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !11
  %58 = icmp slt i32 %52, %57
  br i1 %58, label %59, label %63

59:                                               ; preds = %51, %35
  %60 = load i32, ptr @cur, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100 x %"class.std::vector"], ptr @adj, i64 0, i64 %61
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %63

63:                                               ; preds = %59, %51, %43
  %64 = load i32, ptr @a, align 4, !tbaa !5
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %66
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !9
  %70 = icmp slt i32 %64, %69
  br i1 %70, label %71, label %79

71:                                               ; preds = %63
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %73
  %75 = getelementptr inbounds %"struct.std::pair", ptr %74, i32 0, i32 0
  %76 = load i32, ptr %75, align 8, !tbaa !9
  %77 = load i32, ptr @b, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %95, label %79

79:                                               ; preds = %71, %63
  %80 = load i32, ptr @a, align 4, !tbaa !5
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %82
  %84 = getelementptr inbounds %"struct.std::pair", ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !11
  %86 = icmp slt i32 %80, %85
  br i1 %86, label %87, label %99

87:                                               ; preds = %79
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %89
  %91 = getelementptr inbounds %"struct.std::pair", ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !11
  %93 = load i32, ptr @b, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %95, label %99

95:                                               ; preds = %87, %71
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100 x %"class.std::vector"], ptr @adj, i64 0, i64 %97
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %98, ptr noundef nonnull align 4 dereferenceable(4) @cur)
  br label %99

99:                                               ; preds = %95, %87, %79
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %5, align 4, !tbaa !5
  br label %22, !llvm.loop !12

103:                                              ; preds = %26
  %104 = load i32, ptr @cur, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr @cur, align 4, !tbaa !5
  br label %118

106:                                              ; preds = %12
  %107 = load i32, ptr @a, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = load i32, ptr @b, align 4, !tbaa !5
  %110 = sub nsw i32 %109, 1
  %111 = call noundef i32 @_Z3bfsii(i32 noundef %108, i32 noundef %110)
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %115

113:                                              ; preds = %106
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  br label %117

115:                                              ; preds = %106
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  br label %117

117:                                              ; preds = %115, %113
  br label %118

118:                                              ; preds = %117, %103
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %2, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %2, align 4, !tbaa !5
  br label %7, !llvm.loop !14

122:                                              ; preds = %11
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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


; 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<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 { i32, i32 }
%"class.std::basic_ostream" = type { ptr, %"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 }

@n = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@cur = external dso_local global i32, align 4
@adj = external dso_local global [100 x %"class.std::vector"], align 16
@s = external dso_local global [100 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3bfsii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph13, label %._crit_edge14

._crit_edge14:                                    ; preds = %68, %0
  ret i32 0

.lr.ph13:                                         ; preds = %0, %68
  %.011 = phi i32 [ %69, %68 ], [ 0, %0 ]
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @t, ptr noundef nonnull @a, ptr noundef nonnull @b)
  %7 = load i32, ptr @t, align 4, !tbaa !5
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %9, label %58

9:                                                ; preds = %.lr.ph13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %10 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b)
  store i64 %10, ptr %1, align 8
  %11 = load i32, ptr @cur, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %12
  %14 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(8) %1) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @cur, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %9
  %.pre16 = load i32, ptr @a, align 4, !tbaa !5
  br label %.lr.ph

._crit_edge:                                      ; preds = %52, %9
  %.lcssa = phi i32 [ %15, %9 ], [ %56, %52 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %17 = add nsw i32 %.lcssa, 1
  store i32 %17, ptr @cur, align 4, !tbaa !5
  br label %68

.lr.ph:                                           ; preds = %.lr.ph.preheader, %52
  %18 = phi i32 [ %54, %52 ], [ %.pre16, %.lr.ph.preheader ]
  %19 = phi i32 [ %56, %52 ], [ %15, %.lr.ph.preheader ]
  %storemerge10 = phi i32 [ %55, %52 ], [ 0, %.lr.ph.preheader ]
  %20 = sext i32 %storemerge10 to i64
  %21 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %20
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp slt i32 %22, %18
  br i1 %23, label %24, label %28

24:                                               ; preds = %.lr.ph
  %25 = getelementptr inbounds i8, ptr %21, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = icmp slt i32 %18, %26
  br i1 %27, label %35, label %28

28:                                               ; preds = %24, %.lr.ph
  %29 = load i32, ptr @b, align 4
  %30 = icmp slt i32 %22, %29
  br i1 %30, label %31, label %38

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %21, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = icmp slt i32 %29, %33
  br i1 %34, label %35, label %38

35:                                               ; preds = %31, %24
  %36 = sext i32 %19 to i64
  %37 = getelementptr inbounds [100 x %"class.std::vector"], ptr @adj, i64 0, i64 %36
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.pre17 = load i32, ptr @a, align 4, !tbaa !5
  %.pre18 = load i32, ptr %2, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre18 to i64
  %.phi.trans.insert19 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %.phi.trans.insert
  %.pre20 = load i32, ptr %.phi.trans.insert19, align 8, !tbaa !9
  %.pre21 = load i32, ptr @b, align 4
  br label %38

38:                                               ; preds = %35, %31, %28
  %.pre-phi = phi i64 [ %.phi.trans.insert, %35 ], [ %20, %31 ], [ %20, %28 ]
  %39 = phi i32 [ %.pre21, %35 ], [ %29, %31 ], [ %29, %28 ]
  %40 = phi i32 [ %.pre20, %35 ], [ %22, %31 ], [ %22, %28 ]
  %41 = phi i32 [ %.pre18, %35 ], [ %storemerge10, %31 ], [ %storemerge10, %28 ]
  %42 = phi i32 [ %.pre17, %35 ], [ %18, %31 ], [ %18, %28 ]
  %43 = icmp slt i32 %42, %40
  %44 = icmp slt i32 %40, %39
  %or.cond = select i1 %43, i1 %44, i1 false
  br i1 %or.cond, label %50, label %45

45:                                               ; preds = %38
  %46 = getelementptr inbounds [100 x %"struct.std::pair"], ptr @s, i64 0, i64 %.pre-phi, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !11
  %48 = icmp slt i32 %42, %47
  %49 = icmp slt i32 %47, %39
  %or.cond9 = select i1 %48, i1 %49, i1 false
  br i1 %or.cond9, label %50, label %52

50:                                               ; preds = %45, %38
  %51 = getelementptr inbounds [100 x %"class.std::vector"], ptr @adj, i64 0, i64 %.pre-phi
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 4 dereferenceable(4) @cur)
  %.pre = load i32, ptr @a, align 4, !tbaa !5
  %.pre22 = load i32, ptr %2, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %45, %50
  %53 = phi i32 [ %41, %45 ], [ %.pre22, %50 ]
  %54 = phi i32 [ %42, %45 ], [ %.pre, %50 ]
  %55 = add nsw i32 %53, 1
  store i32 %55, ptr %2, align 4, !tbaa !5
  %56 = load i32, ptr @cur, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %.lr.ph, label %._crit_edge, !llvm.loop !12

58:                                               ; preds = %.lr.ph13
  %59 = load i32, ptr @a, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  %61 = load i32, ptr @b, align 4, !tbaa !5
  %62 = add nsw i32 %61, -1
  %63 = call noundef i32 @_Z3bfsii(i32 noundef %60, i32 noundef %62)
  %.not = icmp eq i32 %63, 0
  br i1 %.not, label %66, label %64

64:                                               ; preds = %58
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  br label %68

66:                                               ; preds = %58
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
  br label %68

68:                                               ; preds = %._crit_edge, %66, %64
  %69 = add nuw nsw i32 %.011, 1
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %.lr.ph13, label %._crit_edge14, !llvm.loop !14
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

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


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