; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2009-10/island2.ll (Z5checkii)

; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@done = external dso_local global [1000 x [1000 x i8]], align 16
@q = external dso_local global %"class.std::queue", align 8

; 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
declare dso_local noundef zeroext i1 @_Z5validSt4pairIiiE(i64) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4numAii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z2adSt4pairIiiEi(i64, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3isASt4pairIiiE(i64) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5checkii(i32 noundef %0, i32 noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca %"struct.std::pair", align 4
  %17 = alloca %"struct.std::pair", align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair", align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %21 = load i64, ptr %5, align 4
  %22 = call noundef zeroext i1 @_Z5validSt4pairIiiE(i64 %21)
  br i1 %22, label %24, label %23

23:                                               ; preds = %2
  br label %101

24:                                               ; preds = %2
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1000 x [1000 x i8]], ptr @done, i64 0, i64 %26
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1000 x i8], ptr %27, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9, !range !11, !noundef !12
  %32 = trunc i8 %31 to i1
  br i1 %32, label %33, label %34

33:                                               ; preds = %24
  br label %101

34:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  store i8 0, ptr %6, align 1, !tbaa !9
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = call noundef i32 @_Z4numAii(i32 noundef %35, i32 noundef %36)
  %38 = icmp sge i32 %37, 3
  br i1 %38, label %39, label %40

39:                                               ; preds = %34
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %40

40:                                               ; preds = %39, %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %85, %40
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = icmp slt i32 %42, 4
  br i1 %43, label %45, label %44

44:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %88

45:                                               ; preds = %41
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = load i64, ptr %9, align 4
  %48 = call i64 @_Z2adSt4pairIiiEi(i64 %47, i32 noundef %46)
  store i64 %48, ptr %8, align 4
  %49 = load i64, ptr %8, align 4
  %50 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %49)
  br i1 %50, label %51, label %84

51:                                               ; preds = %45
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  %54 = load i64, ptr %11, align 4
  %55 = call i64 @_Z2adSt4pairIiiEi(i64 %54, i32 noundef %53)
  store i64 %55, ptr %10, align 4
  %56 = load i64, ptr %10, align 4
  %57 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %56)
  br i1 %57, label %58, label %84

58:                                               ; preds = %51
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = add nsw i32 %59, 2
  %61 = load i64, ptr %13, align 4
  %62 = call i64 @_Z2adSt4pairIiiEi(i64 %61, i32 noundef %60)
  store i64 %62, ptr %12, align 4
  %63 = load i64, ptr %12, align 4
  %64 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %63)
  br i1 %64, label %65, label %84

65:                                               ; preds = %58
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = add nsw i32 %66, 3
  %68 = load i64, ptr %15, align 4
  %69 = call i64 @_Z2adSt4pairIiiEi(i64 %68, i32 noundef %67)
  store i64 %69, ptr %14, align 4
  %70 = load i64, ptr %14, align 4
  %71 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %70)
  br i1 %71, label %72, label %84

72:                                               ; preds = %65
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = add nsw i32 %73, 3
  %75 = load i64, ptr %18, align 4
  %76 = call i64 @_Z2adSt4pairIiiEi(i64 %75, i32 noundef %74)
  store i64 %76, ptr %17, align 4
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = add nsw i32 %77, 2
  %79 = load i64, ptr %17, align 4
  %80 = call i64 @_Z2adSt4pairIiiEi(i64 %79, i32 noundef %78)
  store i64 %80, ptr %16, align 4
  %81 = load i64, ptr %16, align 4
  %82 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %81)
  br i1 %82, label %83, label %84

83:                                               ; preds = %72
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %84

84:                                               ; preds = %83, %72, %65, %58, %51, %45
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %7, align 4, !tbaa !5
  br label %41, !llvm.loop !13

88:                                               ; preds = %44
  %89 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %90 = trunc i8 %89 to i1
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  store i32 1, ptr %19, align 4
  br label %99

92:                                               ; preds = %88
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1000 x [1000 x i8]], ptr @done, i64 0, i64 %94
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1000 x i8], ptr %95, i64 0, i64 %97
  store i8 1, ptr %98, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(8) %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  store i32 0, ptr %19, align 4
  br label %99

99:                                               ; preds = %92, %91
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  %100 = load i32, ptr %19, align 4
  switch i32 %100, label %102 [
    i32 0, label %101
    i32 1, label %101
  ]

101:                                              ; preds = %99, %99, %33, %23
  ret void

102:                                              ; preds = %99
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(8)) #2 align 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 = { 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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@done = external dso_local local_unnamed_addr global [1000 x [1000 x i8]], align 16
@q = external dso_local global %"class.std::queue", align 8

; 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 noundef zeroext i1 @_Z5validSt4pairIiiE(i64) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z2adSt4pairIiiEi(i64, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3isASt4pairIiiE(i64) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5checkii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair", align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %12 = load i64, ptr %5, align 8
  %13 = call noundef zeroext i1 @_Z5validSt4pairIiiE(i64 %12)
  br i1 %13, label %14, label %115

14:                                               ; preds = %2
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [1000 x [1000 x i8]], ptr @done, i64 0, i64 %16, i64 %18
  %20 = load i8, ptr %19, align 1, !tbaa !9, !range !11, !noundef !12
  %21 = trunc nuw i8 %20 to i1
  br i1 %21, label %115, label %22

22:                                               ; preds = %14
  %23 = call noundef i32 @_Z4numAii(i32 noundef %15, i32 noundef %17)
  %24 = icmp sgt i32 %23, 2
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %25 = load i64, ptr %6, align 8
  %26 = call i64 @_Z2adSt4pairIiiEi(i64 %25, i32 noundef 0)
  %27 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %26)
  br i1 %27, label %28, label %45

28:                                               ; preds = %22
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %29 = load i64, ptr %7, align 8
  %30 = call i64 @_Z2adSt4pairIiiEi(i64 %29, i32 noundef 1)
  %31 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %30)
  br i1 %31, label %32, label %45

32:                                               ; preds = %28
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %33 = load i64, ptr %8, align 8
  %34 = call i64 @_Z2adSt4pairIiiEi(i64 %33, i32 noundef 2)
  %35 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %34)
  br i1 %35, label %36, label %45

36:                                               ; preds = %32
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %37 = load i64, ptr %9, align 8
  %38 = call i64 @_Z2adSt4pairIiiEi(i64 %37, i32 noundef 3)
  %39 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %38)
  br i1 %39, label %40, label %45

40:                                               ; preds = %36
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %41 = load i64, ptr %10, align 8
  %42 = call i64 @_Z2adSt4pairIiiEi(i64 %41, i32 noundef 3)
  %43 = call i64 @_Z2adSt4pairIiiEi(i64 %42, i32 noundef 2)
  %44 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %43)
  %spec.select15 = or i1 %44, %24
  br label %45

45:                                               ; preds = %40, %22, %28, %32, %36
  %.2 = phi i1 [ %24, %36 ], [ %24, %32 ], [ %24, %28 ], [ %24, %22 ], [ %spec.select15, %40 ]
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %46 = load i64, ptr %6, align 8
  %47 = call i64 @_Z2adSt4pairIiiEi(i64 %46, i32 noundef 1)
  %48 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %47)
  br i1 %48, label %49, label %66

49:                                               ; preds = %45
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %50 = load i64, ptr %7, align 8
  %51 = call i64 @_Z2adSt4pairIiiEi(i64 %50, i32 noundef 2)
  %52 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %51)
  br i1 %52, label %53, label %66

53:                                               ; preds = %49
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %54 = load i64, ptr %8, align 8
  %55 = call i64 @_Z2adSt4pairIiiEi(i64 %54, i32 noundef 3)
  %56 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %55)
  br i1 %56, label %57, label %66

57:                                               ; preds = %53
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %58 = load i64, ptr %9, align 8
  %59 = call i64 @_Z2adSt4pairIiiEi(i64 %58, i32 noundef 4)
  %60 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %59)
  br i1 %60, label %61, label %66

61:                                               ; preds = %57
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %62 = load i64, ptr %10, align 8
  %63 = call i64 @_Z2adSt4pairIiiEi(i64 %62, i32 noundef 4)
  %64 = call i64 @_Z2adSt4pairIiiEi(i64 %63, i32 noundef 3)
  %65 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %64)
  %spec.select15.1 = or i1 %65, %.2
  br label %66

66:                                               ; preds = %61, %57, %53, %49, %45
  %.2.1 = phi i1 [ %.2, %57 ], [ %.2, %53 ], [ %.2, %49 ], [ %.2, %45 ], [ %spec.select15.1, %61 ]
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %67 = load i64, ptr %6, align 8
  %68 = call i64 @_Z2adSt4pairIiiEi(i64 %67, i32 noundef 2)
  %69 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %68)
  br i1 %69, label %70, label %87

70:                                               ; preds = %66
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %71 = load i64, ptr %7, align 8
  %72 = call i64 @_Z2adSt4pairIiiEi(i64 %71, i32 noundef 3)
  %73 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %72)
  br i1 %73, label %74, label %87

74:                                               ; preds = %70
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %75 = load i64, ptr %8, align 8
  %76 = call i64 @_Z2adSt4pairIiiEi(i64 %75, i32 noundef 4)
  %77 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %76)
  br i1 %77, label %78, label %87

78:                                               ; preds = %74
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %79 = load i64, ptr %9, align 8
  %80 = call i64 @_Z2adSt4pairIiiEi(i64 %79, i32 noundef 5)
  %81 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %80)
  br i1 %81, label %82, label %87

82:                                               ; preds = %78
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %83 = load i64, ptr %10, align 8
  %84 = call i64 @_Z2adSt4pairIiiEi(i64 %83, i32 noundef 5)
  %85 = call i64 @_Z2adSt4pairIiiEi(i64 %84, i32 noundef 4)
  %86 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %85)
  %spec.select15.2 = or i1 %86, %.2.1
  br label %87

87:                                               ; preds = %82, %78, %74, %70, %66
  %.2.2 = phi i1 [ %.2.1, %78 ], [ %.2.1, %74 ], [ %.2.1, %70 ], [ %.2.1, %66 ], [ %spec.select15.2, %82 ]
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %88 = load i64, ptr %6, align 8
  %89 = call i64 @_Z2adSt4pairIiiEi(i64 %88, i32 noundef 3)
  %90 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %89)
  br i1 %90, label %91, label %108

91:                                               ; preds = %87
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %92 = load i64, ptr %7, align 8
  %93 = call i64 @_Z2adSt4pairIiiEi(i64 %92, i32 noundef 4)
  %94 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %93)
  br i1 %94, label %95, label %108

95:                                               ; preds = %91
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %96 = load i64, ptr %8, align 8
  %97 = call i64 @_Z2adSt4pairIiiEi(i64 %96, i32 noundef 5)
  %98 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %97)
  br i1 %98, label %99, label %108

99:                                               ; preds = %95
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %100 = load i64, ptr %9, align 8
  %101 = call i64 @_Z2adSt4pairIiiEi(i64 %100, i32 noundef 6)
  %102 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %101)
  br i1 %102, label %103, label %108

103:                                              ; preds = %99
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %104 = load i64, ptr %10, align 8
  %105 = call i64 @_Z2adSt4pairIiiEi(i64 %104, i32 noundef 6)
  %106 = call i64 @_Z2adSt4pairIiiEi(i64 %105, i32 noundef 5)
  %107 = call noundef zeroext i1 @_Z5isEmpSt4pairIiiE(i64 %106)
  %spec.select15.3 = or i1 %107, %.2.2
  br i1 %spec.select15.3, label %109, label %115

108:                                              ; preds = %99, %95, %91, %87
  br i1 %.2.2, label %109, label %115

109:                                              ; preds = %103, %108
  %110 = load i32, ptr %3, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1000 x [1000 x i8]], ptr @done, i64 0, i64 %111, i64 %113
  store i8 1, ptr %114, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  br label %115

115:                                              ; preds = %103, %109, %108, %14, %2
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,SROAPass,SimplifyCFGPass