; LLVM IR from DionysiosB/CodeForces :: 0500-0599 (546C-SoldierAndCards)

; 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::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<std::deque<int>, std::deque<int>>, std::pair<std::deque<int>, std::deque<int>>, std::_Identity<std::pair<std::deque<int>, std::deque<int>>>, std::less<std::pair<std::deque<int>, std::deque<int>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::deque<int>, std::deque<int>>, std::pair<std::deque<int>, std::deque<int>>, std::_Identity<std::pair<std::deque<int>, std::deque<int>>>, std::less<std::pair<std::deque<int>, std::deque<int>>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { %"class.std::deque", %"class.std::deque" }
%"struct.std::pair.3" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 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 %"class.std::deque", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::deque", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::set", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca i1, align 1
  %17 = alloca i1, align 1
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca %"struct.std::pair.3", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #6
  call void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %23 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4)
          to label %24 unwind label %30

24:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %38, %24
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %34, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %45

30:                                               ; preds = %0
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %5, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %6, align 4
  br label %171

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %35 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %8)
          to label %36 unwind label %41

36:                                               ; preds = %34
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %37 unwind label %41

37:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %38

38:                                               ; preds = %37
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %7, align 4, !tbaa !5
  br label %25, !llvm.loop !9

41:                                               ; preds = %36, %34
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %5, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %171

45:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #6
  invoke void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %46 unwind label %54

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %47 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %10)
          to label %48 unwind label %58

48:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %66, %48
  %50 = load i32, ptr %11, align 4, !tbaa !5
  %51 = load i32, ptr %10, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %62, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %73

54:                                               ; preds = %45
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %5, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %6, align 4
  br label %170

58:                                               ; preds = %46
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %5, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %6, align 4
  br label %169

62:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %63 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %12)
          to label %64 unwind label %69

64:                                               ; preds = %62
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %65 unwind label %69

65:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %11, align 4, !tbaa !5
  br label %49, !llvm.loop !11

69:                                               ; preds = %64, %62
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %5, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %169

73:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #6
  call void @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %142, %73
  %75 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  %76 = icmp ugt i64 %75, 0
  store i1 false, ptr %16, align 1
  store i1 false, ptr %17, align 1
  br i1 %76, label %77, label %85

77:                                               ; preds = %74
  %78 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  %79 = icmp ugt i64 %78, 0
  br i1 %79, label %80, label %85

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 160, ptr %15) #6
  store i1 true, ptr %16, align 1
  invoke void @_ZNSt4pairISt5dequeIiSaIiEES2_EC2IRS2_S5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS7_S8_EEEbE4typeELb1EEEOS7_OS8_(ptr noundef nonnull align 8 dereferenceable(160) %15, ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %81 unwind label %111

81:                                               ; preds = %80
  store i1 true, ptr %17, align 1
  %82 = invoke noundef i64 @_ZNKSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EE5countERKS4_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(160) %15)
          to label %83 unwind label %115

83:                                               ; preds = %81
  %84 = icmp ult i64 %82, 1
  br label %85

85:                                               ; preds = %83, %77, %74
  %86 = phi i1 [ false, %77 ], [ false, %74 ], [ %84, %83 ]
  %87 = load i1, ptr %17, align 1
  br i1 %87, label %88, label %89

88:                                               ; preds = %85
  call void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %15) #6
  br label %89

89:                                               ; preds = %88, %85
  %90 = load i1, ptr %16, align 1
  br i1 %90, label %91, label %92

91:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 160, ptr %15) #6
  br label %92

92:                                               ; preds = %91, %89
  br i1 %86, label %93, label %145

93:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 160, ptr %18) #6
  invoke void @_ZNSt4pairISt5dequeIiSaIiEES2_EC2IRS2_S5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS7_S8_EEEbE4typeELb1EEEOS7_OS8_(ptr noundef nonnull align 8 dereferenceable(160) %18, ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %94 unwind label %126

94:                                               ; preds = %93
  %95 = invoke { ptr, i8 } @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EE6insertEOS4_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(160) %18)
          to label %96 unwind label %130

96:                                               ; preds = %94
  %97 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %98 = extractvalue { ptr, i8 } %95, 0
  store ptr %98, ptr %97, align 8
  %99 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %100 = extractvalue { ptr, i8 } %95, 1
  store i8 %100, ptr %99, align 8
  call void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %18) #6
  call void @llvm.lifetime.end.p0(i64 160, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  %102 = load i32, ptr %101, align 4, !tbaa !5
  store i32 %102, ptr %20, align 4, !tbaa !5
  call void @_ZNSt5dequeIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  %104 = load i32, ptr %103, align 4, !tbaa !5
  store i32 %104, ptr %21, align 4, !tbaa !5
  call void @_ZNSt5dequeIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  %105 = load i32, ptr %20, align 4, !tbaa !5
  %106 = load i32, ptr %21, align 4, !tbaa !5
  %107 = icmp sgt i32 %105, %106
  br i1 %107, label %108, label %139

108:                                              ; preds = %96
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %109 unwind label %135

109:                                              ; preds = %108
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %110 unwind label %135

110:                                              ; preds = %109
  br label %142

111:                                              ; preds = %80
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %5, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %6, align 4
  br label %122

115:                                              ; preds = %81
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %5, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %6, align 4
  %119 = load i1, ptr %17, align 1
  br i1 %119, label %120, label %121

120:                                              ; preds = %115
  call void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %15) #6
  br label %121

121:                                              ; preds = %120, %115
  br label %122

122:                                              ; preds = %121, %111
  %123 = load i1, ptr %16, align 1
  br i1 %123, label %124, label %125

124:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 160, ptr %15) #6
  br label %125

125:                                              ; preds = %124, %122
  br label %168

126:                                              ; preds = %93
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %5, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %6, align 4
  br label %134

130:                                              ; preds = %94
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %5, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %6, align 4
  call void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %18) #6
  br label %134

134:                                              ; preds = %130, %126
  call void @llvm.lifetime.end.p0(i64 160, ptr %18) #6
  br label %168

135:                                              ; preds = %140, %139, %109, %108
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %5, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %168

139:                                              ; preds = %96
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %140 unwind label %135

140:                                              ; preds = %139
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %141 unwind label %135

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141, %110
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %74, !llvm.loop !12

145:                                              ; preds = %92
  %146 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  %147 = icmp ugt i64 %146, 0
  br i1 %147, label %148, label %158

148:                                              ; preds = %145
  %149 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  %150 = icmp ugt i64 %149, 0
  br i1 %150, label %151, label %158

151:                                              ; preds = %148
  %152 = invoke i32 @puts(ptr noundef @.str.2)
          to label %153 unwind label %154

153:                                              ; preds = %151
  br label %166

154:                                              ; preds = %158, %151
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %5, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %6, align 4
  br label %168

158:                                              ; preds = %148, %145
  %159 = load i32, ptr %14, align 4, !tbaa !5
  %160 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  %161 = icmp ugt i64 %160, 0
  %162 = zext i1 %161 to i64
  %163 = select i1 %161, i32 1, i32 2
  %164 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %159, i32 noundef %163)
          to label %165 unwind label %154

165:                                              ; preds = %158
  br label %166

166:                                              ; preds = %165, %153
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %167 = load i32, ptr %1, align 4
  ret i32 %167

168:                                              ; preds = %154, %135, %134, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #6
  br label %169

169:                                              ; preds = %168, %69, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  br label %170

170:                                              ; preds = %169, %54
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  br label %171

171:                                              ; preds = %170, %41, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %172

172:                                              ; preds = %171
  %173 = load ptr, ptr %5, align 8
  %174 = load i32, ptr %6, align 4
  %175 = insertvalue { ptr, i32 } poison, ptr %173, 0
  %176 = insertvalue { ptr, i32 } %175, i32 %174, 1
  resume { ptr, i32 } %176
}

; 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 uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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 void @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EE5countERKS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(160)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairISt5dequeIiSaIiEES2_EC2IRS2_S5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS7_S8_EEEbE4typeELb1EEEOS7_OS8_(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EE6insertEOS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(160)) #3 align 2

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

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

declare i32 @puts(ptr noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 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 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !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::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<std::deque<int>, std::deque<int>>, std::pair<std::deque<int>, std::deque<int>>, std::_Identity<std::pair<std::deque<int>, std::deque<int>>>, std::less<std::pair<std::deque<int>, std::deque<int>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::deque<int>, std::deque<int>>, std::pair<std::deque<int>, std::deque<int>>, std::_Identity<std::pair<std::deque<int>, std::deque<int>>>, std::less<std::pair<std::deque<int>, std::deque<int>>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { %"class.std::deque", %"class.std::deque" }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 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 %"class.std::deque", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::deque", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::set", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  call void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3)
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %18, %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #6
  invoke void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %24 unwind label %29

.lr.ph:                                           ; preds = %0, %18
  %.01643 = phi i32 [ %19, %18 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %4)
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %18 unwind label %22

18:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %19 = add nuw nsw i32 %.01643, 1
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

22:                                               ; preds = %.lr.ph
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %86

24:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph46, label %._crit_edge47

._crit_edge47:                                    ; preds = %32, %24
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #6
  call void @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  %28 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  %.not48 = icmp eq i64 %28, 0
  br i1 %.not48, label %.critedge.thread, label %.lr.ph51

29:                                               ; preds = %._crit_edge
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %85

.lr.ph46:                                         ; preds = %24, %32
  %.01544 = phi i32 [ %33, %32 ], [ 0, %24 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %7)
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %32 unwind label %36

32:                                               ; preds = %.lr.ph46
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %33 = add nuw nsw i32 %.01544, 1
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %.lr.ph46, label %._crit_edge47, !llvm.loop !11

36:                                               ; preds = %.lr.ph46
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %84

.lr.ph51:                                         ; preds = %._crit_edge47, %70
  %.01449 = phi i32 [ %71, %70 ], [ 0, %._crit_edge47 ]
  %38 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  %.not23 = icmp eq i64 %38, 0
  br i1 %.not23, label %.critedge.thread, label %39

39:                                               ; preds = %.lr.ph51
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %9) #6
  invoke void @_ZNSt4pairISt5dequeIiSaIiEES2_EC2IRS2_S5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS7_S8_EEEbE4typeELb1EEEOS7_OS8_(ptr noundef nonnull align 8 dereferenceable(160) %9, ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %40 unwind label %55

40:                                               ; preds = %39
  %41 = invoke noundef i64 @_ZNKSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EE5countERKS4_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(160) %9)
          to label %.critedge unwind label %57

.critedge:                                        ; preds = %40
  %42 = icmp eq i64 %41, 0
  call void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %9) #6
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %9) #6
  br i1 %42, label %43, label %.critedge.thread

43:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %10) #6
  invoke void @_ZNSt4pairISt5dequeIiSaIiEES2_EC2IRS2_S5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS7_S8_EEEbE4typeELb1EEEOS7_OS8_(ptr noundef nonnull align 8 dereferenceable(160) %10, ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %44 unwind label %60

44:                                               ; preds = %43
  %45 = invoke { ptr, i8 } @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EE6insertEOS4_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(160) %10)
          to label %46 unwind label %62

46:                                               ; preds = %44
  call void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %10) #6
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  %48 = load i32, ptr %47, align 4, !tbaa !5
  store i32 %48, ptr %11, align 4, !tbaa !5
  call void @_ZNSt5dequeIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  %50 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %50, ptr %12, align 4, !tbaa !5
  call void @_ZNSt5dequeIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  %51 = load i32, ptr %11, align 4, !tbaa !5
  %52 = load i32, ptr %12, align 4, !tbaa !5
  %53 = icmp sgt i32 %51, %52
  br i1 %53, label %54, label %67

54:                                               ; preds = %46
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %.invoke unwind label %65

55:                                               ; preds = %39
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %59

57:                                               ; preds = %40
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %9) #6
  br label %59

59:                                               ; preds = %55, %57
  %.pn = phi { ptr, i32 } [ %58, %57 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %9) #6
  br label %83

60:                                               ; preds = %43
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %64

62:                                               ; preds = %44
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %10) #6
  br label %64

64:                                               ; preds = %62, %60
  %.pn28 = phi { ptr, i32 } [ %63, %62 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %10) #6
  br label %83

65:                                               ; preds = %.invoke, %67, %54
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  br label %83

67:                                               ; preds = %46
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %.invoke unwind label %65

.invoke:                                          ; preds = %54, %67
  %68 = phi ptr [ %5, %67 ], [ %2, %54 ]
  %69 = phi ptr [ %12, %67 ], [ %11, %54 ]
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %68, ptr noundef nonnull align 4 dereferenceable(4) %69)
          to label %70 unwind label %65

70:                                               ; preds = %.invoke
  %71 = add nuw nsw i32 %.01449, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  %72 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  %.not = icmp eq i64 %72, 0
  br i1 %.not, label %.critedge.thread, label %.lr.ph51, !llvm.loop !12

.critedge.thread:                                 ; preds = %.critedge, %70, %.lr.ph51, %._crit_edge47
  %.014.lcssa = phi i32 [ 0, %._crit_edge47 ], [ %.01449, %.lr.ph51 ], [ %71, %70 ], [ %.01449, %.critedge ]
  %73 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  %.not25 = icmp eq i64 %73, 0
  br i1 %.not25, label %78, label %74

74:                                               ; preds = %.critedge.thread
  %75 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  %.not26 = icmp eq i64 %75, 0
  br i1 %.not26, label %78, label %76

76:                                               ; preds = %74
  %77 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %82

78:                                               ; preds = %74, %.critedge.thread
  %79 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  %.not27 = icmp eq i64 %79, 0
  %80 = select i1 %.not27, i32 2, i32 1
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.014.lcssa, i32 noundef %80)
  br label %82

82:                                               ; preds = %78, %76
  call void @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

83:                                               ; preds = %59, %65, %64
  %.pn30 = phi { ptr, i32 } [ %66, %65 ], [ %.pn28, %64 ], [ %.pn, %59 ]
  call void @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #6
  br label %84

84:                                               ; preds = %83, %36
  %.pn32 = phi { ptr, i32 } [ %37, %36 ], [ %.pn30, %83 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  br label %85

85:                                               ; preds = %84, %29
  %.pn32.pn = phi { ptr, i32 } [ %.pn32, %84 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #6
  br label %86

86:                                               ; preds = %85, %22
  %.pn35 = phi { ptr, i32 } [ %23, %22 ], [ %.pn32.pn, %85 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn35
}

; 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 uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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 void @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EE5countERKS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairISt5dequeIiSaIiEES2_EC2IRS2_S5_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS7_S8_EEEbE4typeELb1EEEOS7_OS8_(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairISt5dequeIiSaIiEES2_ED2Ev(ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairISt5dequeIiSaIiEES3_ESt4lessIS4_ESaIS4_EE6insertEOS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 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 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 #6 = { nounwind }

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

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


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