; LLVM IR from ouuan/CPTH :: tests/MonotonousQueue (MonotonousQueue)

; 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 }
%"class.std::allocator" = type { i8 }
%"class.CPTH::MonotonousQueue" = type { %"class.std::vector.0", i64, %"class.std::function" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon = type { ptr, ptr }
%"class.CPTH::MonotonousQueue.5" = type { %"class.std::vector.0", i64, %"class.std::function" }
%class.anon.6 = type { i8 }
%"struct.std::pair" = type { i32, i32 }
%class.anon.7 = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.CPTH::MonotonousQueue", align 8
  %10 = alloca %"class.std::function", align 8
  %11 = alloca %class.anon, align 8
  %12 = alloca %"class.CPTH::MonotonousQueue.5", align 8
  %13 = alloca %"class.std::function", align 8
  %14 = alloca %class.anon.6, align 1
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair", align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::function", align 8
  %21 = alloca %class.anon.7, align 8
  %22 = alloca %"struct.std::pair", align 4
  %23 = alloca %"struct.std::pair", align 4
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca %"struct.std::pair", align 4
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca %"struct.std::pair", align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #7
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %30, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %31 unwind label %45

31:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %42, %31
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %36, label %53

36:                                               ; preds = %32
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %38) #7
  %40 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %39)
          to label %41 unwind label %49

41:                                               ; preds = %36
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %4, align 4, !tbaa !5
  br label %32, !llvm.loop !9

45:                                               ; preds = %0
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  br label %249

49:                                               ; preds = %36
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %7, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %8, align 4
  br label %248

53:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %54 = getelementptr inbounds %class.anon, ptr %11, i32 0, i32 0
  store ptr %4, ptr %54, align 8, !tbaa !11
  %55 = getelementptr inbounds %class.anon, ptr %11, i32 0, i32 1
  store ptr %3, ptr %55, align 8, !tbaa !11
  call void @"_ZNSt8functionIFbRKSt4pairIiiEEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EEC2ESt8functionIFbRKS2_EE(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef %10)
          to label %56 unwind label %62

56:                                               ; preds = %53
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  call void @_ZNSt8functionIFbRKSt4pairIiiEEEC2IZN4CPTH15MonotonousQueueIS1_St4lessIS1_EEC1ES5_Ed_UlS3_E_vEEOT_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EEC2ESt8functionIFbRKS2_EE(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef %13)
          to label %57 unwind label %66

57:                                               ; preds = %56
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  %58 = invoke noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
          to label %59 unwind label %70

59:                                               ; preds = %57
  br i1 %58, label %60, label %61

60:                                               ; preds = %59
  br label %75

61:                                               ; preds = %59
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 25, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

62:                                               ; preds = %53
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %7, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %8, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %247

66:                                               ; preds = %56
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %7, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %8, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  br label %246

70:                                               ; preds = %210, %165, %112, %111, %57
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %7, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %8, align 4
  br label %245

74:                                               ; No predecessors!
  br label %75

75:                                               ; preds = %74, %60
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %107, %75
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = icmp sle i32 %77, 10000
  br i1 %78, label %79, label %111

79:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = mul nsw i32 %80, 233
  store i32 %81, ptr %16, align 4, !tbaa !5
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_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) %16, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %82 unwind label %93

82:                                               ; preds = %79
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef nonnull align 4 dereferenceable(8) %15)
          to label %83 unwind label %93

83:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %84 = invoke i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
          to label %85 unwind label %97

85:                                               ; preds = %83
  store i64 %84, ptr %17, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = mul nsw i32 %86, 233
  store i32 %87, ptr %19, align 4, !tbaa !5
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_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) %19, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %88 unwind label %101

88:                                               ; preds = %85
  %89 = invoke noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %90 unwind label %101

90:                                               ; preds = %88
  br i1 %89, label %91, label %92

91:                                               ; preds = %90
  br label %106

92:                                               ; preds = %90
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 29, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

93:                                               ; preds = %82, %79
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %7, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %245

97:                                               ; preds = %83
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %7, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %8, align 4
  br label %110

101:                                              ; preds = %88, %85
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %7, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %110

105:                                              ; No predecessors!
  br label %106

106:                                              ; preds = %105, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %4, align 4, !tbaa !5
  br label %76, !llvm.loop !13

110:                                              ; preds = %101, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %245

111:                                              ; preds = %76
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
          to label %112 unwind label %70

112:                                              ; preds = %111
  %113 = invoke noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
          to label %114 unwind label %70

114:                                              ; preds = %112
  br i1 %113, label %115, label %116

115:                                              ; preds = %114
  br label %118

116:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 32, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

117:                                              ; No predecessors!
  br label %118

118:                                              ; preds = %117, %115
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %119 = getelementptr inbounds %class.anon.7, ptr %21, i32 0, i32 0
  store ptr %4, ptr %119, align 8, !tbaa !11
  %120 = getelementptr inbounds %class.anon.7, ptr %21, i32 0, i32 1
  store ptr %3, ptr %120, align 8, !tbaa !11
  call void @"_ZNSt8functionIFbRKSt4pairIiiEEEC2IZ4mainE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(16) %21) #7
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE11setValidateESt8functionIFbRKS2_EE(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef %20)
          to label %121 unwind label %141

121:                                              ; preds = %118
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %138, %121
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 1
  %126 = icmp slt i32 %123, %125
  br i1 %126, label %127, label %153

127:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %129) #7
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 4 dereferenceable(4) %130, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %131 unwind label %145

131:                                              ; preds = %127
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %132 unwind label %145

132:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %134) #7
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(4) %135, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %136 unwind label %149

136:                                              ; preds = %132
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef nonnull align 4 dereferenceable(8) %23)
          to label %137 unwind label %149

137:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %4, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %4, align 4, !tbaa !5
  br label %122, !llvm.loop !14

141:                                              ; preds = %118
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %7, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %8, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  br label %245

145:                                              ; preds = %131, %127
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %7, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %245

149:                                              ; preds = %136, %132
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %7, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %245

153:                                              ; preds = %122
  %154 = load i32, ptr %3, align 4, !tbaa !5
  %155 = sub nsw i32 %154, 1
  store i32 %155, ptr %4, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %191, %153
  %157 = load i32, ptr %4, align 4, !tbaa !5
  %158 = load i32, ptr %2, align 4, !tbaa !5
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %160, label %198

160:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %161 = load i32, ptr %4, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %162) #7
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(4) %163, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %164 unwind label %171

164:                                              ; preds = %160
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef nonnull align 4 dereferenceable(8) %24)
          to label %165 unwind label %171

165:                                              ; preds = %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  %166 = invoke noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %167 unwind label %70

167:                                              ; preds = %165
  %168 = xor i1 %166, true
  br i1 %168, label %169, label %170

169:                                              ; preds = %167
  br label %176

170:                                              ; preds = %167
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 47, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

171:                                              ; preds = %164, %160
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %7, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %245

175:                                              ; No predecessors!
  br label %176

176:                                              ; preds = %175, %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %177 = invoke i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %178 unwind label %194

178:                                              ; preds = %176
  store i64 %177, ptr %25, align 4
  %179 = getelementptr inbounds %"struct.std::pair", ptr %25, i32 0, i32 0
  %180 = load i32, ptr %179, align 4, !tbaa !15
  %181 = load i32, ptr %4, align 4, !tbaa !5
  %182 = load i32, ptr %2, align 4, !tbaa !5
  %183 = sub nsw i32 %182, 1
  %184 = icmp eq i32 %181, %183
  %185 = zext i1 %184 to i64
  %186 = getelementptr inbounds [3 x i8], ptr @.str.7, i64 0, i64 %185
  %187 = load i8, ptr %186, align 1, !tbaa !17
  %188 = sext i8 %187 to i32
  %189 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %180, i32 noundef %188)
          to label %190 unwind label %194

190:                                              ; preds = %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %4, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %4, align 4, !tbaa !5
  br label %156, !llvm.loop !18

194:                                              ; preds = %178, %176
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %7, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %245

198:                                              ; preds = %156
  %199 = load i32, ptr %3, align 4, !tbaa !5
  %200 = sub nsw i32 %199, 1
  store i32 %200, ptr %4, align 4, !tbaa !5
  br label %201

201:                                              ; preds = %236, %198
  %202 = load i32, ptr %4, align 4, !tbaa !5
  %203 = load i32, ptr %2, align 4, !tbaa !5
  %204 = icmp slt i32 %202, %203
  br i1 %204, label %205, label %243

205:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %206 = load i32, ptr %4, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %207) #7
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(4) %208, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %209 unwind label %216

209:                                              ; preds = %205
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef nonnull align 4 dereferenceable(8) %26)
          to label %210 unwind label %216

210:                                              ; preds = %209
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  %211 = invoke noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
          to label %212 unwind label %70

212:                                              ; preds = %210
  %213 = xor i1 %211, true
  br i1 %213, label %214, label %215

214:                                              ; preds = %212
  br label %221

215:                                              ; preds = %212
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.3, i32 noundef 54, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

216:                                              ; preds = %209, %205
  %217 = landingpad { ptr, i32 }
          cleanup
  %218 = extractvalue { ptr, i32 } %217, 0
  store ptr %218, ptr %7, align 8
  %219 = extractvalue { ptr, i32 } %217, 1
  store i32 %219, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %245

220:                                              ; No predecessors!
  br label %221

221:                                              ; preds = %220, %214
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %222 = invoke i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
          to label %223 unwind label %239

223:                                              ; preds = %221
  store i64 %222, ptr %27, align 4
  %224 = getelementptr inbounds %"struct.std::pair", ptr %27, i32 0, i32 0
  %225 = load i32, ptr %224, align 4, !tbaa !15
  %226 = load i32, ptr %4, align 4, !tbaa !5
  %227 = load i32, ptr %2, align 4, !tbaa !5
  %228 = sub nsw i32 %227, 1
  %229 = icmp eq i32 %226, %228
  %230 = zext i1 %229 to i64
  %231 = getelementptr inbounds [3 x i8], ptr @.str.7, i64 0, i64 %230
  %232 = load i8, ptr %231, align 1, !tbaa !17
  %233 = sext i8 %232 to i32
  %234 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %225, i32 noundef %233)
          to label %235 unwind label %239

235:                                              ; preds = %223
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %4, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %4, align 4, !tbaa !5
  br label %201, !llvm.loop !19

239:                                              ; preds = %223, %221
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %7, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %245

243:                                              ; preds = %201
  store i32 0, ptr %1, align 4
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %12) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #7
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %244 = load i32, ptr %1, align 4
  ret i32 %244

245:                                              ; preds = %239, %216, %194, %171, %149, %145, %141, %110, %93, %70
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %12) #7
  br label %246

246:                                              ; preds = %245, %66
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #7
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9) #7
  br label %247

247:                                              ; preds = %246, %62
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #7
  br label %248

248:                                              ; preds = %247, %49
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  br label %249

249:                                              ; preds = %248, %45
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %250

250:                                              ; preds = %249
  %251 = load ptr, ptr %7, align 8
  %252 = load i32, ptr %8, align 4
  %253 = insertvalue { ptr, i32 } poison, ptr %251, 0
  %254 = insertvalue { ptr, i32 } %253, i32 %252, 1
  resume { ptr, i32 } %254
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFbRKSt4pairIiiEEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_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 #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #6

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFbRKSt4pairIiiEEEC2IZ4mainE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; 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 }
%"class.std::allocator" = type { i8 }
%"class.CPTH::MonotonousQueue" = type { %"class.std::vector.0", i64, %"class.std::function" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon = type { ptr, ptr }
%"class.CPTH::MonotonousQueue.5" = type { %"class.std::vector.0", i64, %"class.std::function" }
%class.anon.6 = type { i8 }
%"struct.std::pair" = type { i32, i32 }
%class.anon.7 = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"class.CPTH::MonotonousQueue", align 8
  %7 = alloca %"class.std::function", align 8
  %8 = alloca %class.anon, align 8
  %9 = alloca %"class.CPTH::MonotonousQueue.5", align 8
  %10 = alloca %"class.std::function", align 8
  %11 = alloca %class.anon.6, align 1
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::function", align 8
  %18 = alloca %class.anon.7, align 8
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca %"struct.std::pair", align 4
  %21 = alloca %"struct.std::pair", align 4
  %22 = alloca %"struct.std::pair", align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %25, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %26 unwind label %36

26:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %26, %.lr.ph
  %storemerge24 = phi i32 [ %33, %.lr.ph ], [ 0, %26 ]
  %29 = sext i32 %storemerge24 to i64
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %29) #7
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %30)
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %3, align 4, !tbaa !5
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !9

36:                                               ; preds = %0
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  br label %153

._crit_edge:                                      ; preds = %.lr.ph, %26
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  store ptr %3, ptr %8, align 8, !tbaa !11
  %38 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr %2, ptr %38, align 8, !tbaa !11
  call void @"_ZNSt8functionIFbRKSt4pairIiiEEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EEC2ESt8functionIFbRKS2_EE(ptr noundef nonnull align 8 dereferenceable(64) %6, ptr noundef nonnull %7)
          to label %39 unwind label %44

39:                                               ; preds = %._crit_edge
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #7
  call void @_ZNSt8functionIFbRKSt4pairIiiEEEC2IZN4CPTH15MonotonousQueueIS1_St4lessIS1_EEC1ES5_Ed_UlS3_E_vEEOT_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EEC2ESt8functionIFbRKS2_EE(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef nonnull %10)
          to label %40 unwind label %46

40:                                               ; preds = %39
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  %41 = invoke noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %42 unwind label %.loopexit.split-lp.loopexit.split-lp

42:                                               ; preds = %40
  br i1 %41, label %.preheader21, label %43

.preheader21:                                     ; preds = %42
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %48

43:                                               ; preds = %42
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 25, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

44:                                               ; preds = %._crit_edge
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  br label %152

46:                                               ; preds = %39
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  br label %151

.loopexit:                                        ; preds = %127
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %98
  %lpad.loopexit18 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %65, %40
  %lpad.loopexit.split-lp19 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

48:                                               ; preds = %.preheader21, %61
  %storemerge1025 = phi i32 [ 1, %.preheader21 ], [ %63, %61 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %49 = mul nsw i32 %storemerge1025, 233
  store i32 %49, ptr %13, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %50 unwind label %57

50:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %51 = invoke i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %52 unwind label %59

52:                                               ; preds = %50
  store i64 %51, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = mul nsw i32 %53, 233
  store i32 %54, ptr %16, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_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) %16, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %55 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %15)
  br i1 %55, label %61, label %56

56:                                               ; preds = %52
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 29, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

57:                                               ; preds = %48
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  br label %.loopexit.split-lp

59:                                               ; preds = %50
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  br label %.loopexit.split-lp

61:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %3, align 4, !tbaa !5
  %64 = icmp slt i32 %62, 10000
  br i1 %64, label %48, label %65, !llvm.loop !13

65:                                               ; preds = %61
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
  %66 = invoke noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %67 unwind label %.loopexit.split-lp.loopexit.split-lp

67:                                               ; preds = %65
  br i1 %66, label %69, label %68

68:                                               ; preds = %67
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 32, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

69:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #7
  store ptr %3, ptr %18, align 8, !tbaa !11
  %70 = getelementptr inbounds i8, ptr %18, i64 8
  store ptr %2, ptr %70, align 8, !tbaa !11
  call void @"_ZNSt8functionIFbRKSt4pairIiiEEEC2IZ4mainE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(16) %18) #7
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE11setValidateESt8functionIFbRKS2_EE(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef nonnull %17)
          to label %71 unwind label %90

71:                                               ; preds = %69
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = add nsw i32 %72, -1
  %74 = icmp sgt i32 %72, 1
  br i1 %74, label %.lr.ph28, label %.preheader

.preheader:                                       ; preds = %84, %71
  %75 = phi i32 [ %72, %71 ], [ %87, %84 ]
  %.lcssa = phi i32 [ %73, %71 ], [ %88, %84 ]
  store i32 %.lcssa, ptr %3, align 4, !tbaa !5
  %76 = load i32, ptr %1, align 4, !tbaa !5
  %77 = icmp slt i32 %.lcssa, %76
  br i1 %77, label %.lr.ph30, label %._crit_edge31

.lr.ph28:                                         ; preds = %71, %84
  %storemerge1126 = phi i32 [ %86, %84 ], [ 0, %71 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #7
  %78 = sext i32 %storemerge1126 to i64
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %78) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %79, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %6, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %80 unwind label %92

80:                                               ; preds = %.lr.ph28
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #7
  %81 = load i32, ptr %3, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %82) #7
  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) %83, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef nonnull align 4 dereferenceable(8) %20)
          to label %84 unwind label %94

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #7
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %3, align 4, !tbaa !5
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = add nsw i32 %87, -1
  %89 = icmp slt i32 %86, %88
  br i1 %89, label %.lr.ph28, label %.preheader, !llvm.loop !14

90:                                               ; preds = %69
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #7
  br label %.loopexit.split-lp

92:                                               ; preds = %.lr.ph28
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  br label %.loopexit.split-lp

94:                                               ; preds = %80
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #7
  br label %.loopexit.split-lp

.lr.ph30:                                         ; preds = %.preheader, %106
  %storemerge1229 = phi i32 [ %117, %106 ], [ %.lcssa, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #7
  %96 = sext i32 %storemerge1229 to i64
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %96) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %97, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %6, ptr noundef nonnull align 4 dereferenceable(8) %21)
          to label %98 unwind label %102

98:                                               ; preds = %.lr.ph30
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #7
  %99 = invoke noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64) %6)
          to label %100 unwind label %.loopexit.split-lp.loopexit

100:                                              ; preds = %98
  br i1 %99, label %101, label %104

101:                                              ; preds = %100
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 47, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

102:                                              ; preds = %.lr.ph30
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #7
  br label %.loopexit.split-lp

104:                                              ; preds = %100
  %105 = invoke i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64) %6)
          to label %106 unwind label %120

106:                                              ; preds = %104
  %.sroa.01.0.extract.trunc = trunc i64 %105 to i32
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = load i32, ptr %1, align 4, !tbaa !5
  %109 = add nsw i32 %108, -1
  %110 = icmp eq i32 %107, %109
  %111 = zext i1 %110 to i64
  %112 = getelementptr inbounds [3 x i8], ptr @.str.7, i64 0, i64 %111
  %113 = load i8, ptr %112, align 1, !tbaa !15
  %114 = sext i8 %113 to i32
  %115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %.sroa.01.0.extract.trunc, i32 noundef %114)
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %3, align 4, !tbaa !5
  %118 = load i32, ptr %1, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %.lr.ph30, label %._crit_edge31.loopexit, !llvm.loop !16

120:                                              ; preds = %104
  %121 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

._crit_edge31.loopexit:                           ; preds = %106
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge31

._crit_edge31:                                    ; preds = %._crit_edge31.loopexit, %.preheader
  %122 = phi i32 [ %118, %._crit_edge31.loopexit ], [ %76, %.preheader ]
  %123 = phi i32 [ %.pre, %._crit_edge31.loopexit ], [ %75, %.preheader ]
  %124 = add nsw i32 %123, -1
  store i32 %124, ptr %3, align 4, !tbaa !5
  %.not = icmp sgt i32 %123, %122
  br i1 %.not, label %._crit_edge35, label %.lr.ph34

.lr.ph34:                                         ; preds = %._crit_edge31, %135
  %storemerge1332 = phi i32 [ %146, %135 ], [ %124, %._crit_edge31 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #7
  %125 = sext i32 %storemerge1332 to i64
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %125) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 4 dereferenceable(4) %126, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %127 unwind label %131

127:                                              ; preds = %.lr.ph34
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  %128 = invoke noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %129 unwind label %.loopexit

129:                                              ; preds = %127
  br i1 %128, label %130, label %133

130:                                              ; preds = %129
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.3, i32 noundef 54, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

131:                                              ; preds = %.lr.ph34
  %132 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  br label %.loopexit.split-lp

133:                                              ; preds = %129
  %134 = invoke i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
          to label %135 unwind label %149

135:                                              ; preds = %133
  %.sroa.0.0.extract.trunc = trunc i64 %134 to i32
  %136 = load i32, ptr %3, align 4, !tbaa !5
  %137 = load i32, ptr %1, align 4, !tbaa !5
  %138 = add nsw i32 %137, -1
  %139 = icmp eq i32 %136, %138
  %140 = zext i1 %139 to i64
  %141 = getelementptr inbounds [3 x i8], ptr @.str.7, i64 0, i64 %140
  %142 = load i8, ptr %141, align 1, !tbaa !15
  %143 = sext i8 %142 to i32
  %144 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %.sroa.0.0.extract.trunc, i32 noundef %143)
  %145 = load i32, ptr %3, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %3, align 4, !tbaa !5
  %147 = load i32, ptr %1, align 4, !tbaa !5
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %.lr.ph34, label %._crit_edge35, !llvm.loop !17

149:                                              ; preds = %133
  %150 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

._crit_edge35:                                    ; preds = %135, %._crit_edge31
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #7
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %6) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %149, %131, %120, %102, %94, %92, %90, %59, %57
  %.pn = phi { ptr, i32 } [ %60, %59 ], [ %58, %57 ], [ %95, %94 ], [ %93, %92 ], [ %121, %120 ], [ %103, %102 ], [ %150, %149 ], [ %132, %131 ], [ %91, %90 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit18, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp19, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9) #7
  br label %151

151:                                              ; preds = %.loopexit.split-lp, %46
  %.pn.pn = phi { ptr, i32 } [ %.pn, %.loopexit.split-lp ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #7
  call void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %6) #7
  br label %152

152:                                              ; preds = %151, %44
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %151 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %153

153:                                              ; preds = %152, %36
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %152 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFbRKSt4pairIiiEEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_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 #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFbRKSt4pairIiiEEEC2IZ4mainE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4CPTH15MonotonousQueueISt4pairIiiESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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