; LLVM IR from eyangch/competitive-programming :: Codeforces/1687 (c)

; 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"

%"struct.std::pair" = type { i64, i64 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, std::pair<long long, long long>>, std::pair<long long, std::pair<long long, long long>>, std::_Identity<std::pair<long long, std::pair<long long, long long>>>, std::less<std::pair<long long, std::pair<long long, long long>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, std::pair<long long, long long>>, std::pair<long long, std::pair<long long, long long>>, std::_Identity<std::pair<long long, std::pair<long long, long long>>>, std::less<std::pair<long long, std::pair<long long, long long>>>>::_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 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair.5" = type { i64, %"struct.std::pair" }
%"struct.std::pair.3" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@A = external dso_local global [200000 x i64], align 16
@B = external dso_local global [200000 x i64], align 16
@P = external dso_local global [200000 x i64], align 16
@pf2 = external dso_local global [200001 x i64], align 16
@S = external dso_local global [200000 x %"struct.std::pair"], align 16
@Z = external dso_local global [200000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::set", align 8
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca i64, align 8
  %17 = alloca %"struct.std::pair.5", align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair.3", align 8
  %21 = alloca %"struct.std::pair.5", align 8
  %22 = alloca i64, align 8
  %23 = alloca %"struct.std::pair", align 8
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair.3", align 8
  %26 = alloca i64, align 8
  %27 = alloca i8, align 1
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %33 = alloca %"struct.std::pair.5", align 8
  %34 = alloca %"struct.std::pair", align 8
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %38 = alloca i64, align 8
  %39 = alloca i64, align 8
  %40 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %41 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  %42 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %43 = getelementptr i8, ptr %42, i64 -24
  %44 = load i64, ptr %43, align 8
  %45 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %44
  %46 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %45, ptr noundef null)
  %47 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %49

49:                                               ; preds = %361, %359, %0
  %50 = load i64, ptr @T, align 8, !tbaa !8
  %51 = add nsw i64 %50, -1
  store i64 %51, ptr @T, align 8, !tbaa !8
  %52 = icmp ne i64 %50, 0
  br i1 %52, label %53, label %365

53:                                               ; preds = %49
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 8 dereferenceable(8) @M)
  store i64 0, ptr @P, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %56

56:                                               ; preds = %65, %53
  %57 = load i64, ptr %2, align 8, !tbaa !8
  %58 = load i64, ptr @N, align 8, !tbaa !8
  %59 = icmp slt i64 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %68

61:                                               ; preds = %56
  %62 = load i64, ptr %2, align 8, !tbaa !8
  %63 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %62
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %63)
  br label %65

65:                                               ; preds = %61
  %66 = load i64, ptr %2, align 8, !tbaa !8
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %2, align 8, !tbaa !8
  br label %56, !llvm.loop !11

68:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %69

69:                                               ; preds = %78, %68
  %70 = load i64, ptr %3, align 8, !tbaa !8
  %71 = load i64, ptr @N, align 8, !tbaa !8
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %81

74:                                               ; preds = %69
  %75 = load i64, ptr %3, align 8, !tbaa !8
  %76 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %75
  %77 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %76)
  br label %78

78:                                               ; preds = %74
  %79 = load i64, ptr %3, align 8, !tbaa !8
  %80 = add nsw i64 %79, 1
  store i64 %80, ptr %3, align 8, !tbaa !8
  br label %69, !llvm.loop !13

81:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %82

82:                                               ; preds = %102, %81
  %83 = load i64, ptr %4, align 8, !tbaa !8
  %84 = load i64, ptr @N, align 8, !tbaa !8
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %105

87:                                               ; preds = %82
  %88 = load i64, ptr %4, align 8, !tbaa !8
  %89 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !8
  %91 = load i64, ptr %4, align 8, !tbaa !8
  %92 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !8
  %94 = sub nsw i64 %90, %93
  %95 = load i64, ptr %4, align 8, !tbaa !8
  %96 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = add nsw i64 %94, %97
  %99 = load i64, ptr %4, align 8, !tbaa !8
  %100 = add nsw i64 %99, 1
  %101 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %100
  store i64 %98, ptr %101, align 8, !tbaa !8
  br label %102

102:                                              ; preds = %87
  %103 = load i64, ptr %4, align 8, !tbaa !8
  %104 = add nsw i64 %103, 1
  store i64 %104, ptr %4, align 8, !tbaa !8
  br label %82, !llvm.loop !14

105:                                              ; preds = %86
  %106 = load i64, ptr @M, align 8, !tbaa !8
  %107 = getelementptr inbounds i64, ptr @Z, i64 %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !15
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @Z, ptr noundef %107, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  %108 = load i64, ptr @N, align 8, !tbaa !8
  %109 = getelementptr inbounds i64, ptr @pf2, i64 %108
  %110 = getelementptr inbounds i64, ptr %109, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !15
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @pf2, ptr noundef %110, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #8
  call void @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #8
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %111 unwind label %117

111:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %112

112:                                              ; preds = %202, %111
  %113 = load i64, ptr %11, align 8, !tbaa !8
  %114 = load i64, ptr @M, align 8, !tbaa !8
  %115 = icmp slt i64 %113, %114
  br i1 %115, label %121, label %116

116:                                              ; preds = %112
  store i32 13, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %214

117:                                              ; preds = %105
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %9, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %10, align 4
  br label %364

121:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %122 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %123 unwind label %148

123:                                              ; preds = %121
  %124 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %122, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %125 unwind label %148

125:                                              ; preds = %123
  %126 = load i64, ptr %13, align 8, !tbaa !8
  %127 = add nsw i64 %126, -1
  store i64 %127, ptr %13, align 8, !tbaa !8
  %128 = load i64, ptr %14, align 8, !tbaa !8
  %129 = add nsw i64 %128, -1
  store i64 %129, ptr %14, align 8, !tbaa !8
  %130 = load i64, ptr %13, align 8, !tbaa !8
  %131 = getelementptr inbounds [200001 x i64], ptr @pf2, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = add nsw i64 %132, 1
  store i64 %133, ptr %131, align 8, !tbaa !8
  %134 = load i64, ptr %14, align 8, !tbaa !8
  %135 = add nsw i64 %134, 1
  %136 = getelementptr inbounds [200001 x i64], ptr @pf2, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !8
  %138 = add nsw i64 %137, -1
  store i64 %138, ptr %136, align 8, !tbaa !8
  %139 = load i64, ptr %13, align 8, !tbaa !8
  %140 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %139
  %141 = load i64, ptr %140, align 8, !tbaa !8
  %142 = icmp eq i64 %141, 0
  br i1 %142, label %143, label %152

143:                                              ; preds = %125
  %144 = load i64, ptr %11, align 8, !tbaa !8
  %145 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !8
  %147 = or i64 %146, 1
  store i64 %147, ptr %145, align 8, !tbaa !8
  br label %152

148:                                              ; preds = %174, %123, %121
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %9, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %10, align 4
  br label %213

152:                                              ; preds = %143, %125
  %153 = load i64, ptr %14, align 8, !tbaa !8
  %154 = add nsw i64 %153, 1
  %155 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !8
  %157 = icmp eq i64 %156, 0
  br i1 %157, label %158, label %163

158:                                              ; preds = %152
  %159 = load i64, ptr %11, align 8, !tbaa !8
  %160 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !8
  %162 = or i64 %161, 2
  store i64 %162, ptr %160, align 8, !tbaa !8
  br label %163

163:                                              ; preds = %158, %152
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %164 = load i64, ptr %14, align 8, !tbaa !8
  %165 = add nsw i64 %164, 1
  store i64 %165, ptr %16, align 8, !tbaa !8
  invoke void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %166 unwind label %176

166:                                              ; preds = %163
  %167 = load i64, ptr %11, align 8, !tbaa !8
  %168 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @S, i64 0, i64 %167
  %169 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %168, ptr noundef nonnull align 8 dereferenceable(16) %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  %170 = load i64, ptr %11, align 8, !tbaa !8
  %171 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !8
  %173 = icmp eq i64 %172, 3
  br i1 %173, label %174, label %180

174:                                              ; preds = %166
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %175 unwind label %148

175:                                              ; preds = %174
  store i32 15, ptr %12, align 4
  br label %199

176:                                              ; preds = %163
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %9, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  br label %213

180:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 1, ptr %19, align 4, !tbaa !15
  invoke void @_ZNSt4pairIxxEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %181 unwind label %205

181:                                              ; preds = %180
  invoke void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %182 unwind label %205

182:                                              ; preds = %181
  %183 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %184 unwind label %205

184:                                              ; preds = %182
  %185 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 0
  %186 = extractvalue { ptr, i8 } %183, 0
  store ptr %186, ptr %185, align 8
  %187 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 1
  %188 = extractvalue { ptr, i8 } %183, 1
  store i8 %188, ptr %187, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %189 = load i64, ptr %14, align 8, !tbaa !8
  %190 = add nsw i64 %189, 1
  store i64 %190, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 2, ptr %24, align 4, !tbaa !15
  invoke void @_ZNSt4pairIxxEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %191 unwind label %209

191:                                              ; preds = %184
  invoke void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %192 unwind label %209

192:                                              ; preds = %191
  %193 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %194 unwind label %209

194:                                              ; preds = %192
  %195 = getelementptr inbounds { ptr, i8 }, ptr %25, i32 0, i32 0
  %196 = extractvalue { ptr, i8 } %193, 0
  store ptr %196, ptr %195, align 8
  %197 = getelementptr inbounds { ptr, i8 }, ptr %25, i32 0, i32 1
  %198 = extractvalue { ptr, i8 } %193, 1
  store i8 %198, ptr %197, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #8
  store i32 0, ptr %12, align 4
  br label %199

199:                                              ; preds = %194, %175
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %200 = load i32, ptr %12, align 4
  switch i32 %200, label %372 [
    i32 0, label %201
    i32 15, label %202
  ]

201:                                              ; preds = %199
  br label %202

202:                                              ; preds = %201, %199
  %203 = load i64, ptr %11, align 8, !tbaa !8
  %204 = add nsw i64 %203, 1
  store i64 %204, ptr %11, align 8, !tbaa !8
  br label %112, !llvm.loop !17

205:                                              ; preds = %182, %181, %180
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %9, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  br label %213

209:                                              ; preds = %192, %191, %184
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %9, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #8
  br label %213

213:                                              ; preds = %209, %205, %176, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %363

214:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  store i64 0, ptr %26, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #8
  store i8 1, ptr %27, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  store i64 0, ptr %28, align 8, !tbaa !8
  br label %215

215:                                              ; preds = %238, %214
  %216 = load i64, ptr %28, align 8, !tbaa !8
  %217 = load i64, ptr @N, align 8, !tbaa !8
  %218 = icmp slt i64 %216, %217
  br i1 %218, label %220, label %219

219:                                              ; preds = %215
  store i32 16, ptr %12, align 4
  br label %241

220:                                              ; preds = %215
  %221 = load i64, ptr %28, align 8, !tbaa !8
  %222 = getelementptr inbounds [200001 x i64], ptr @pf2, i64 0, i64 %221
  %223 = load i64, ptr %222, align 8, !tbaa !8
  %224 = load i64, ptr %26, align 8, !tbaa !8
  %225 = add nsw i64 %224, %223
  store i64 %225, ptr %26, align 8, !tbaa !8
  %226 = load i64, ptr %26, align 8, !tbaa !8
  %227 = icmp eq i64 %226, 0
  br i1 %227, label %228, label %237

228:                                              ; preds = %220
  %229 = load i64, ptr %28, align 8, !tbaa !8
  %230 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %229
  %231 = load i64, ptr %230, align 8, !tbaa !8
  %232 = load i64, ptr %28, align 8, !tbaa !8
  %233 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %232
  %234 = load i64, ptr %233, align 8, !tbaa !8
  %235 = icmp ne i64 %231, %234
  br i1 %235, label %236, label %237

236:                                              ; preds = %228
  store i8 0, ptr %27, align 1, !tbaa !18
  store i32 16, ptr %12, align 4
  br label %241

237:                                              ; preds = %228, %220
  br label %238

238:                                              ; preds = %237
  %239 = load i64, ptr %28, align 8, !tbaa !8
  %240 = add nsw i64 %239, 1
  store i64 %240, ptr %28, align 8, !tbaa !8
  br label %215, !llvm.loop !20

241:                                              ; preds = %236, %219
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %242

242:                                              ; preds = %241
  %243 = load i8, ptr %27, align 1, !tbaa !18, !range !21, !noundef !22
  %244 = trunc i8 %243 to i1
  br i1 %244, label %254, label %245

245:                                              ; preds = %242
  %246 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %247 unwind label %250

247:                                              ; preds = %245
  %248 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %246, i8 noundef signext 10)
          to label %249 unwind label %250

249:                                              ; preds = %247
  store i32 2, ptr %12, align 4
  br label %359, !llvm.loop !23

250:                                              ; preds = %355, %353, %350, %348, %255, %247, %245
  %251 = landingpad { ptr, i32 }
          cleanup
  %252 = extractvalue { ptr, i32 } %251, 0
  store ptr %252, ptr %9, align 8
  %253 = extractvalue { ptr, i32 } %251, 1
  store i32 %253, ptr %10, align 4
  br label %362

254:                                              ; preds = %242
  br label %255

255:                                              ; preds = %342, %254
  %256 = invoke noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %257 unwind label %250

257:                                              ; preds = %255
  %258 = xor i1 %256, true
  br i1 %258, label %259, label %346

259:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %260 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIxSt5dequeIxSaIxEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %261 unwind label %314

261:                                              ; preds = %259
  %262 = load i64, ptr %260, align 8, !tbaa !8
  store i64 %262, ptr %29, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %263 = load i64, ptr %29, align 8, !tbaa !8
  %264 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @S, i64 0, i64 %263
  %265 = getelementptr inbounds %"struct.std::pair", ptr %264, i32 0, i32 0
  %266 = load i64, ptr %265, align 16, !tbaa !24
  store i64 %266, ptr %30, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %267 = load i64, ptr %29, align 8, !tbaa !8
  %268 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @S, i64 0, i64 %267
  %269 = getelementptr inbounds %"struct.std::pair", ptr %268, i32 0, i32 1
  %270 = load i64, ptr %269, align 8, !tbaa !26
  store i64 %270, ptr %31, align 8, !tbaa !8
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %271 unwind label %318

271:                                              ; preds = %261
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  store i32 0, ptr %35, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  store i32 0, ptr %36, align 4, !tbaa !15
  invoke void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 4 dereferenceable(4) %35, ptr noundef nonnull align 4 dereferenceable(4) %36)
          to label %272 unwind label %322

272:                                              ; preds = %271
  invoke void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(16) %34)
          to label %273 unwind label %322

273:                                              ; preds = %272
  %274 = invoke ptr @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE11lower_boundERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(24) %33)
          to label %275 unwind label %322

275:                                              ; preds = %273
  %276 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %32, i32 0, i32 0
  store ptr %274, ptr %276, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #8
  br label %277

277:                                              ; preds = %335, %275
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %278 = call ptr @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  %279 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %37, i32 0, i32 0
  store ptr %278, ptr %279, align 8
  %280 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEES5_(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 8 dereferenceable(8) %37) #8
  br i1 %280, label %281, label %287

281:                                              ; preds = %277
  %282 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #8
  %283 = getelementptr inbounds %"struct.std::pair.5", ptr %282, i32 0, i32 0
  %284 = load i64, ptr %283, align 8, !tbaa !27
  %285 = load i64, ptr %31, align 8, !tbaa !8
  %286 = icmp sle i64 %284, %285
  br label %287

287:                                              ; preds = %281, %277
  %288 = phi i1 [ false, %277 ], [ %286, %281 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  br i1 %288, label %289, label %342

289:                                              ; preds = %287
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  %290 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #8
  %291 = getelementptr inbounds %"struct.std::pair.5", ptr %290, i32 0, i32 1
  %292 = getelementptr inbounds %"struct.std::pair", ptr %291, i32 0, i32 0
  %293 = load i64, ptr %292, align 8, !tbaa !29
  store i64 %293, ptr %38, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %294 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #8
  %295 = getelementptr inbounds %"struct.std::pair.5", ptr %294, i32 0, i32 1
  %296 = getelementptr inbounds %"struct.std::pair", ptr %295, i32 0, i32 1
  %297 = load i64, ptr %296, align 8, !tbaa !30
  store i64 %297, ptr %39, align 8, !tbaa !8
  %298 = load i64, ptr %38, align 8, !tbaa !8
  %299 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %298
  %300 = load i64, ptr %299, align 8, !tbaa !8
  %301 = icmp ne i64 %300, 3
  br i1 %301, label %302, label %331

302:                                              ; preds = %289
  %303 = load i64, ptr %39, align 8, !tbaa !8
  %304 = load i64, ptr %38, align 8, !tbaa !8
  %305 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %304
  %306 = load i64, ptr %305, align 8, !tbaa !8
  %307 = or i64 %306, %303
  store i64 %307, ptr %305, align 8, !tbaa !8
  %308 = load i64, ptr %38, align 8, !tbaa !8
  %309 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %308
  %310 = load i64, ptr %309, align 8, !tbaa !8
  %311 = icmp eq i64 %310, 3
  br i1 %311, label %312, label %330

312:                                              ; preds = %302
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %313 unwind label %326

313:                                              ; preds = %312
  br label %330

314:                                              ; preds = %259
  %315 = landingpad { ptr, i32 }
          cleanup
  %316 = extractvalue { ptr, i32 } %315, 0
  store ptr %316, ptr %9, align 8
  %317 = extractvalue { ptr, i32 } %315, 1
  store i32 %317, ptr %10, align 4
  br label %345

318:                                              ; preds = %261
  %319 = landingpad { ptr, i32 }
          cleanup
  %320 = extractvalue { ptr, i32 } %319, 0
  store ptr %320, ptr %9, align 8
  %321 = extractvalue { ptr, i32 } %319, 1
  store i32 %321, ptr %10, align 4
  br label %344

322:                                              ; preds = %273, %272, %271
  %323 = landingpad { ptr, i32 }
          cleanup
  %324 = extractvalue { ptr, i32 } %323, 0
  store ptr %324, ptr %9, align 8
  %325 = extractvalue { ptr, i32 } %323, 1
  store i32 %325, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #8
  br label %343

326:                                              ; preds = %312
  %327 = landingpad { ptr, i32 }
          cleanup
  %328 = extractvalue { ptr, i32 } %327, 0
  store ptr %328, ptr %9, align 8
  %329 = extractvalue { ptr, i32 } %327, 1
  store i32 %329, ptr %10, align 4
  br label %341

330:                                              ; preds = %313, %302
  br label %331

331:                                              ; preds = %330, %289
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %41, ptr align 8 %32, i64 8, i1 false), !tbaa.struct !31
  %332 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %41, i32 0, i32 0
  %333 = load ptr, ptr %332, align 8
  %334 = invoke ptr @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr %333)
          to label %335 unwind label %337

335:                                              ; preds = %331
  %336 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %40, i32 0, i32 0
  store ptr %334, ptr %336, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %40, i64 8, i1 false), !tbaa.struct !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  br label %277, !llvm.loop !34

337:                                              ; preds = %331
  %338 = landingpad { ptr, i32 }
          cleanup
  %339 = extractvalue { ptr, i32 } %338, 0
  store ptr %339, ptr %9, align 8
  %340 = extractvalue { ptr, i32 } %338, 1
  store i32 %340, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %341

341:                                              ; preds = %337, %326
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  br label %343

342:                                              ; preds = %287
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  br label %255, !llvm.loop !35

343:                                              ; preds = %341, %322
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %344

344:                                              ; preds = %343, %318
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  br label %345

345:                                              ; preds = %344, %314
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  br label %362

346:                                              ; preds = %257
  %347 = call noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  br i1 %347, label %348, label %353

348:                                              ; preds = %346
  %349 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %350 unwind label %250

350:                                              ; preds = %348
  %351 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %349, i8 noundef signext 10)
          to label %352 unwind label %250

352:                                              ; preds = %350
  br label %358

353:                                              ; preds = %346
  %354 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %355 unwind label %250

355:                                              ; preds = %353
  %356 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %354, i8 noundef signext 10)
          to label %357 unwind label %250

357:                                              ; preds = %355
  br label %358

358:                                              ; preds = %357, %352
  store i32 0, ptr %12, align 4
  br label %359

359:                                              ; preds = %358, %249
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #8
  call void @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #8
  %360 = load i32, ptr %12, align 4
  switch i32 %360, label %372 [
    i32 0, label %361
    i32 2, label %49
  ]

361:                                              ; preds = %359
  br label %49, !llvm.loop !23

362:                                              ; preds = %345, %250
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %363

363:                                              ; preds = %362, %213
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  br label %364

364:                                              ; preds = %363, %117
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #8
  call void @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #8
  br label %367

365:                                              ; preds = %49
  %366 = load i32, ptr %1, align 4
  ret i32 %366

367:                                              ; preds = %364
  %368 = load ptr, ptr %9, align 8
  %369 = load i32, ptr %10, align 4
  %370 = insertvalue { ptr, i32 } poison, ptr %368, 0
  %371 = insertvalue { ptr, i32 } %370, i32 %369, 1
  resume { ptr, i32 } %371

372:                                              ; preds = %359, %199
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = distinct !{!17, !12}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !10, i64 0}
!20 = distinct !{!20, !12}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !12}
!24 = !{!25, !9, i64 0}
!25 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!26 = !{!25, !9, i64 8}
!27 = !{!28, !9, i64 0}
!28 = !{!"_ZTSSt4pairIxS_IxxEE", !9, i64 0, !25, i64 8}
!29 = !{!28, !9, i64 8}
!30 = !{!28, !9, i64 16}
!31 = !{i64 0, i64 8, !32}
!32 = !{!33, !33, i64 0}
!33 = !{!"any pointer", !10, i64 0}
!34 = distinct !{!34, !12}
!35 = distinct !{!35, !12}


; 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"

%"struct.std::pair" = type { i64, i64 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, std::pair<long long, long long>>, std::pair<long long, std::pair<long long, long long>>, std::_Identity<std::pair<long long, std::pair<long long, long long>>>, std::less<std::pair<long long, std::pair<long long, long long>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, std::pair<long long, long long>>, std::pair<long long, std::pair<long long, long long>>, std::_Identity<std::pair<long long, std::pair<long long, long long>>>, std::less<std::pair<long long, std::pair<long long, long long>>>>::_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 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair.5" = type { i64, %"struct.std::pair" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@A = external dso_local global [200000 x i64], align 16
@B = external dso_local global [200000 x i64], align 16
@P = external dso_local local_unnamed_addr global [200000 x i64], align 16
@pf2 = external dso_local global [200001 x i64], align 16
@S = external dso_local global [200000 x %"struct.std::pair"], align 16
@Z = external dso_local global [200000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 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 %"class.std::set", align 8
  %4 = alloca %"class.std::queue", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::pair.5", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.5", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::pair.5", align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca i64, align 8
  %25 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %27
  %29 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %28, ptr noundef null)
  %30 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %31 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %32 = load i64, ptr @T, align 8, !tbaa !8
  %33 = add nsw i64 %32, -1
  store i64 %33, ptr @T, align 8, !tbaa !8
  %.not73 = icmp eq i64 %32, 0
  br i1 %.not73, label %._crit_edge76, label %.lr.ph75

.lr.ph75:                                         ; preds = %0, %202
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(8) @M)
  store i64 0, ptr @P, align 16, !tbaa !8
  %36 = load i64, ptr @N, align 8, !tbaa !8
  %37 = icmp sgt i64 %36, 0
  br i1 %37, label %.lr.ph, label %._crit_edge

.preheader56:                                     ; preds = %.lr.ph
  %38 = icmp sgt i64 %42, 0
  br i1 %38, label %.lr.ph59, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph75, %.lr.ph
  %.057 = phi i64 [ %41, %.lr.ph ], [ 0, %.lr.ph75 ]
  %39 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.057
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = add nuw nsw i64 %.057, 1
  %42 = load i64, ptr @N, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %.lr.ph, label %.preheader56, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph59
  %44 = icmp sgt i64 %49, 0
  br i1 %44, label %.lr.ph61.preheader, label %._crit_edge

.lr.ph61.preheader:                               ; preds = %.preheader
  %.pre = load i64, ptr @P, align 16, !tbaa !8
  %xtraiter = and i64 %49, 1
  %45 = icmp eq i64 %49, 1
  br i1 %45, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph61.preheader.new

.lr.ph61.preheader.new:                           ; preds = %.lr.ph61.preheader
  %unroll_iter = and i64 %49, 9223372036854775806
  br label %.lr.ph61

.lr.ph59:                                         ; preds = %.preheader56, %.lr.ph59
  %.03058 = phi i64 [ %48, %.lr.ph59 ], [ 0, %.preheader56 ]
  %46 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %.03058
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %46)
  %48 = add nuw nsw i64 %.03058, 1
  %49 = load i64, ptr @N, align 8, !tbaa !8
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %.lr.ph59, label %.preheader, !llvm.loop !13

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph61, %.lr.ph61.preheader
  %.unr = phi i64 [ %.pre, %.lr.ph61.preheader ], [ %76, %.lr.ph61 ]
  %.03160.unr = phi i64 [ 0, %.lr.ph61.preheader ], [ %77, %.lr.ph61 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph61.epil

.lr.ph61.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %51 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.03160.unr
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %.03160.unr
  %54 = load i64, ptr %53, align 8, !tbaa !8
  %55 = sub i64 %52, %54
  %56 = add nsw i64 %55, %.unr
  %57 = add nuw nsw i64 %.03160.unr, 1
  %58 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %57
  store i64 %56, ptr %58, align 8, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph61.epil, %._crit_edge.loopexit.unr-lcssa, %.lr.ph75, %.preheader56, %.preheader
  %59 = load i64, ptr @M, align 8, !tbaa !8
  %60 = getelementptr inbounds i64, ptr @Z, i64 %59
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !14
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @Z, ptr noundef nonnull %60, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %61 = load i64, ptr @N, align 8, !tbaa !8
  %gep = getelementptr i64, ptr getelementptr inbounds (i8, ptr @pf2, i64 8), i64 %61
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !14
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @pf2, ptr noundef nonnull %gep, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #7
  call void @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #7
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %79 unwind label %83

.lr.ph61:                                         ; preds = %.lr.ph61, %.lr.ph61.preheader.new
  %62 = phi i64 [ %.pre, %.lr.ph61.preheader.new ], [ %76, %.lr.ph61 ]
  %.03160 = phi i64 [ 0, %.lr.ph61.preheader.new ], [ %77, %.lr.ph61 ]
  %niter = phi i64 [ 0, %.lr.ph61.preheader.new ], [ %niter.next.1, %.lr.ph61 ]
  %63 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.03160
  %64 = load i64, ptr %63, align 16, !tbaa !8
  %65 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %.03160
  %66 = load i64, ptr %65, align 16, !tbaa !8
  %67 = sub i64 %64, %66
  %68 = add nsw i64 %67, %62
  %69 = or disjoint i64 %.03160, 1
  %70 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %69
  store i64 %68, ptr %70, align 8, !tbaa !8
  %71 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %69
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %69
  %74 = load i64, ptr %73, align 8, !tbaa !8
  %75 = sub i64 %72, %74
  %76 = add nsw i64 %75, %68
  %77 = add nuw nsw i64 %.03160, 2
  %78 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %77
  store i64 %76, ptr %78, align 16, !tbaa !8
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph61, !llvm.loop !16

79:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  %80 = load i64, ptr @M, align 8, !tbaa !8
  %81 = icmp sgt i64 %80, 0
  br i1 %81, label %.lr.ph63, label %._crit_edge64

._crit_edge64:                                    ; preds = %134, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %82 = load i64, ptr @N, align 8, !tbaa !8
  %.not4465 = icmp sgt i64 %82, 0
  br i1 %.not4465, label %.lr.ph69, label %.critedge55.preheader

83:                                               ; preds = %._crit_edge
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %206

.lr.ph63:                                         ; preds = %79, %134
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %85 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %86 unwind label %107

86:                                               ; preds = %.lr.ph63
  %87 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %85, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %88 unwind label %107

88:                                               ; preds = %86
  %89 = load i64, ptr %6, align 8, !tbaa !8
  %90 = add nsw i64 %89, -1
  store i64 %90, ptr %6, align 8, !tbaa !8
  %91 = load i64, ptr %7, align 8, !tbaa !8
  %92 = add nsw i64 %91, -1
  store i64 %92, ptr %7, align 8, !tbaa !8
  %93 = getelementptr inbounds [200001 x i64], ptr @pf2, i64 0, i64 %90
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %93, align 8, !tbaa !8
  %96 = getelementptr inbounds [200001 x i64], ptr @pf2, i64 0, i64 %91
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = add nsw i64 %97, -1
  store i64 %98, ptr %96, align 8, !tbaa !8
  %99 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %90
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = icmp eq i64 %100, 0
  br i1 %101, label %102, label %109

102:                                              ; preds = %88
  %103 = load i64, ptr %5, align 8, !tbaa !8
  %104 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !8
  %106 = or i64 %105, 1
  store i64 %106, ptr %104, align 8, !tbaa !8
  br label %109

107:                                              ; preds = %126, %86, %.lr.ph63
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %143

109:                                              ; preds = %102, %88
  %110 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %91
  %111 = load i64, ptr %110, align 8, !tbaa !8
  %112 = icmp eq i64 %111, 0
  br i1 %112, label %113, label %118

113:                                              ; preds = %109
  %114 = load i64, ptr %5, align 8, !tbaa !8
  %115 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = or i64 %116, 2
  store i64 %117, ptr %115, align 8, !tbaa !8
  br label %118

118:                                              ; preds = %113, %109
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store i64 %91, ptr %9, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IRxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %119 = load i64, ptr %5, align 8, !tbaa !8
  %120 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @S, i64 0, i64 %119
  %121 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %120, ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  %122 = load i64, ptr %5, align 8, !tbaa !8
  %123 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !8
  %125 = icmp eq i64 %124, 3
  br i1 %125, label %126, label %127

126:                                              ; preds = %118
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %134 unwind label %107

127:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  store i32 1, ptr %12, align 4, !tbaa !14
  call void @_ZNSt4pairIxxEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %128 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %129 unwind label %139

129:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %130 = load i64, ptr %7, align 8, !tbaa !8
  %131 = add nsw i64 %130, 1
  store i64 %131, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  store i32 2, ptr %16, align 4, !tbaa !14
  call void @_ZNSt4pairIxxEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %132 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %133 unwind label %141

133:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  br label %134

134:                                              ; preds = %126, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %135 = load i64, ptr %5, align 8, !tbaa !8
  %136 = add nsw i64 %135, 1
  store i64 %136, ptr %5, align 8, !tbaa !8
  %137 = load i64, ptr @M, align 8, !tbaa !8
  %138 = icmp slt i64 %136, %137
  br i1 %138, label %.lr.ph63, label %._crit_edge64, !llvm.loop !17

139:                                              ; preds = %127
  %140 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  br label %143

141:                                              ; preds = %129
  %142 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  br label %143

143:                                              ; preds = %141, %139, %107
  %.pn50 = phi { ptr, i32 } [ %108, %107 ], [ %142, %141 ], [ %140, %139 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %205

.critedge55.preheader:                            ; preds = %154, %._crit_edge64
  %144 = call noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %144, label %.critedge55._crit_edge, label %.lr.ph72

.lr.ph69:                                         ; preds = %._crit_edge64, %154
  %.03967 = phi i64 [ %155, %154 ], [ 0, %._crit_edge64 ]
  %.04166 = phi i64 [ %147, %154 ], [ 0, %._crit_edge64 ]
  %145 = getelementptr inbounds [200001 x i64], ptr @pf2, i64 0, i64 %.03967
  %146 = load i64, ptr %145, align 8, !tbaa !8
  %147 = add nsw i64 %146, %.04166
  %148 = icmp eq i64 %147, 0
  br i1 %148, label %149, label %154

149:                                              ; preds = %.lr.ph69
  %150 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.03967
  %151 = load i64, ptr %150, align 8, !tbaa !8
  %152 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %.03967
  %153 = load i64, ptr %152, align 8, !tbaa !8
  %.not43 = icmp eq i64 %151, %153
  br i1 %.not43, label %154, label %.invoke81

154:                                              ; preds = %.lr.ph69, %149
  %155 = add nuw nsw i64 %.03967, 1
  %exitcond78.not = icmp eq i64 %155, %82
  br i1 %exitcond78.not, label %.critedge55.preheader, label %.lr.ph69, !llvm.loop !18

156:                                              ; preds = %.invoke81, %.invoke
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %205

.lr.ph72:                                         ; preds = %.critedge55.preheader, %.critedge55
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIxSt5dequeIxSaIxEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %159 = load i64, ptr %158, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %160 = getelementptr inbounds [200000 x %"struct.std::pair"], ptr @S, i64 0, i64 %159
  %161 = load i64, ptr %160, align 16, !tbaa !19
  store i64 %161, ptr %17, align 8, !tbaa !8
  %162 = getelementptr inbounds i8, ptr %160, i64 8
  %163 = load i64, ptr %162, align 8, !tbaa !21
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #7
  store i32 0, ptr %21, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #7
  store i32 0, ptr %22, align 4, !tbaa !14
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(16) %20)
  %164 = invoke ptr @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE11lower_boundERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %165 unwind label %184

165:                                              ; preds = %.lr.ph72
  store ptr %164, ptr %18, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #7
  %166 = call ptr @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  store ptr %166, ptr %23, align 8
  %167 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEES5_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  br i1 %167, label %.lr.ph71, label %.critedge

.lr.ph71:                                         ; preds = %165, %190
  %168 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %169 = load i64, ptr %168, align 8, !tbaa !22
  %.not45 = icmp sgt i64 %169, %163
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #7
  br i1 %.not45, label %.critedge55, label %170

170:                                              ; preds = %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #7
  %171 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %172 = getelementptr inbounds i8, ptr %171, i64 8
  %173 = load i64, ptr %172, align 8, !tbaa !24
  store i64 %173, ptr %24, align 8, !tbaa !8
  %174 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %175 = load i64, ptr %24, align 8, !tbaa !8
  %176 = getelementptr inbounds [200000 x i64], ptr @Z, i64 0, i64 %175
  %177 = load i64, ptr %176, align 8, !tbaa !8
  %.not46 = icmp eq i64 %177, 3
  br i1 %.not46, label %188, label %178

178:                                              ; preds = %170
  %179 = getelementptr inbounds i8, ptr %174, i64 16
  %180 = load i64, ptr %179, align 8, !tbaa !25
  %181 = or i64 %180, %177
  store i64 %181, ptr %176, align 8, !tbaa !8
  %182 = icmp eq i64 %181, 3
  br i1 %182, label %183, label %188

183:                                              ; preds = %178
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %188 unwind label %186

184:                                              ; preds = %.lr.ph72
  %185 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #7
  br label %197

186:                                              ; preds = %183
  %187 = landingpad { ptr, i32 }
          cleanup
  br label %195

188:                                              ; preds = %178, %183, %170
  %.sroa.0.0.copyload = load ptr, ptr %18, align 8, !tbaa !26
  %189 = invoke ptr @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr %.sroa.0.0.copyload)
          to label %190 unwind label %193

190:                                              ; preds = %188
  store ptr %189, ptr %18, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #7
  %191 = call ptr @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  store ptr %191, ptr %23, align 8
  %192 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEES5_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  br i1 %192, label %.lr.ph71, label %.critedge, !llvm.loop !28

193:                                              ; preds = %188
  %194 = landingpad { ptr, i32 }
          cleanup
  br label %195

195:                                              ; preds = %193, %186
  %.pn = phi { ptr, i32 } [ %194, %193 ], [ %187, %186 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #7
  br label %197

.critedge:                                        ; preds = %190, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #7
  br label %.critedge55

.critedge55:                                      ; preds = %.lr.ph71, %.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  %196 = call noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %196, label %.critedge55._crit_edge, label %.lr.ph72, !llvm.loop !29

197:                                              ; preds = %195, %184
  %.pn.pn = phi { ptr, i32 } [ %.pn, %195 ], [ %185, %184 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  br label %205

.critedge55._crit_edge:                           ; preds = %.critedge55, %.critedge55.preheader
  %198 = call noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  %.str.1..str.2 = select i1 %198, ptr @.str.1, ptr @.str.2
  br label %.invoke81

.invoke81:                                        ; preds = %149, %.critedge55._crit_edge
  %199 = phi ptr [ %.str.1..str.2, %.critedge55._crit_edge ], [ @.str, %149 ]
  %200 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %199)
          to label %.invoke unwind label %156

.invoke:                                          ; preds = %.invoke81
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %200, i8 noundef signext 10)
          to label %202 unwind label %156

202:                                              ; preds = %.invoke
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  call void @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #7
  %203 = load i64, ptr @T, align 8, !tbaa !8
  %204 = add nsw i64 %203, -1
  store i64 %204, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %203, 0
  br i1 %.not, label %._crit_edge76, label %.lr.ph75

205:                                              ; preds = %156, %197, %143
  %.pn50.pn = phi { ptr, i32 } [ %.pn50, %143 ], [ %.pn.pn, %197 ], [ %157, %156 ]
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #7
  br label %206

206:                                              ; preds = %205, %83
  %.pn50.pn.pn = phi { ptr, i32 } [ %.pn50.pn, %205 ], [ %84, %83 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  call void @_ZNSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn50.pn.pn

._crit_edge76:                                    ; preds = %202, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIxS0_IxxEEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IxxEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

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

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !10, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{!20, !9, i64 0}
!20 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!21 = !{!20, !9, i64 8}
!22 = !{!23, !9, i64 0}
!23 = !{!"_ZTSSt4pairIxS_IxxEE", !9, i64 0, !20, i64 8}
!24 = !{!23, !9, i64 8}
!25 = !{!23, !9, i64 16}
!26 = !{!27, !27, i64 0}
!27 = !{!"any pointer", !10, i64 0}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}


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