; LLVM IR from tangjz/acm-icpc :: codeforces/complete/341E.ll (Z5solvev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca i32, align 4
  %10 = alloca [3 x %"struct.std::pair"], align 16
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %21 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
          to label %22 unwind label %28

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

23:                                               ; preds = %49, %22
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %32, label %27

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

28:                                               ; preds = %210, %56, %0
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %4, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %5, align 4
  br label %244

32:                                               ; preds = %23
  %33 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %7)
          to label %34 unwind label %40

34:                                               ; preds = %32
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %37, label %48

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %38 unwind label %44

38:                                               ; preds = %37
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %39 unwind label %44

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

40:                                               ; preds = %32
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %4, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %5, align 4
  br label %52

44:                                               ; preds = %38, %37
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %4, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %52

48:                                               ; preds = %39, %34
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %6, align 4, !tbaa !5
  br label %23, !llvm.loop !9

52:                                               ; preds = %44, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %244

53:                                               ; preds = %27
  %54 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %55 = icmp ult i64 %54, 2
  br i1 %55, label %56, label %59

56:                                               ; preds = %53
  %57 = invoke i32 @puts(ptr noundef @.str.2)
          to label %58 unwind label %28

58:                                               ; preds = %56
  store i32 1, ptr %9, align 4
  br label %241

59:                                               ; preds = %53
  br label %60

60:                                               ; preds = %208, %59
  %61 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %62 = icmp ugt i64 %61, 2
  br i1 %62, label %63, label %210

63:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  %64 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i32 0, i32 0
  %65 = getelementptr inbounds %"struct.std::pair", ptr %64, i64 3
  br label %66

66:                                               ; preds = %68, %63
  %67 = phi ptr [ %64, %63 ], [ %69, %68 ]
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %67)
          to label %68 unwind label %76

68:                                               ; preds = %66
  %69 = getelementptr inbounds %"struct.std::pair", ptr %67, i64 1
  %70 = icmp eq ptr %69, %65
  br i1 %70, label %71, label %66

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

72:                                               ; preds = %87, %71
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = icmp slt i32 %73, 3
  br i1 %74, label %80, label %75

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

76:                                               ; preds = %94, %66
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %4, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %5, align 4
  br label %209

80:                                               ; preds = %72
  %81 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 %83
  %85 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %84, ptr noundef nonnull align 4 dereferenceable(8) %81)
          to label %86 unwind label %90

86:                                               ; preds = %80
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %11, align 4, !tbaa !5
  br label %72, !llvm.loop !11

90:                                               ; preds = %80
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %4, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %209

94:                                               ; preds = %75
  %95 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %96 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i64 3
  invoke void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef %95, ptr noundef %97)
          to label %98 unwind label %76

98:                                               ; preds = %94
  br label %99

99:                                               ; preds = %177, %118, %98
  %100 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %101 = getelementptr inbounds %"struct.std::pair", ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 16, !tbaa !12
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %104, label %183

104:                                              ; preds = %99
  %105 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 1
  %106 = getelementptr inbounds %"struct.std::pair", ptr %105, i32 0, i32 0
  %107 = load i32, ptr %106, align 8, !tbaa !12
  %108 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 2
  %109 = getelementptr inbounds %"struct.std::pair", ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 16, !tbaa !12
  %111 = icmp eq i32 %107, %110
  br i1 %111, label %112, label %131

112:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %113 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 2
  %114 = getelementptr inbounds %"struct.std::pair", ptr %113, i32 0, i32 1
  %115 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 1
  %116 = getelementptr inbounds %"struct.std::pair", ptr %115, i32 0, i32 1
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %114, ptr noundef nonnull align 4 dereferenceable(4) %116)
          to label %117 unwind label %127

117:                                              ; preds = %112
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %118 unwind label %127

118:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %119 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 2
  %120 = getelementptr inbounds %"struct.std::pair", ptr %119, i32 0, i32 0
  %121 = load i32, ptr %120, align 16, !tbaa !12
  %122 = shl i32 %121, 1
  store i32 %122, ptr %120, align 16, !tbaa !12
  %123 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 1
  %124 = getelementptr inbounds %"struct.std::pair", ptr %123, i32 0, i32 0
  store i32 0, ptr %124, align 8, !tbaa !12
  %125 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %126 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 1
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %125, ptr noundef nonnull align 4 dereferenceable(8) %126) #6
  br label %99, !llvm.loop !14

127:                                              ; preds = %117, %112
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %4, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %209

131:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %132 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 1
  %133 = getelementptr inbounds %"struct.std::pair", ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 8, !tbaa !12
  %135 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %136 = getelementptr inbounds %"struct.std::pair", ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 16, !tbaa !12
  %138 = sdiv i32 %134, %137
  store i32 %138, ptr %13, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %153, %131
  %140 = load i32, ptr %13, align 4, !tbaa !5
  %141 = icmp sgt i32 %140, 0
  br i1 %141, label %142, label %173

142:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = and i32 %143, 1
  %145 = sub nsw i32 2, %144
  store i32 %145, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %146 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %147 = getelementptr inbounds %"struct.std::pair", ptr %146, i32 0, i32 1
  %148 = load i32, ptr %14, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 %149
  %151 = getelementptr inbounds %"struct.std::pair", ptr %150, i32 0, i32 1
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %147, ptr noundef nonnull align 4 dereferenceable(4) %151)
          to label %152 unwind label %169

152:                                              ; preds = %142
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(8) %15)
          to label %153 unwind label %169

153:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %154 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %155 = getelementptr inbounds %"struct.std::pair", ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 16, !tbaa !12
  %157 = load i32, ptr %14, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 %158
  %160 = getelementptr inbounds %"struct.std::pair", ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 8, !tbaa !12
  %162 = sub nsw i32 %161, %156
  store i32 %162, ptr %160, align 8, !tbaa !12
  %163 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %164 = getelementptr inbounds %"struct.std::pair", ptr %163, i32 0, i32 0
  %165 = load i32, ptr %164, align 16, !tbaa !12
  %166 = shl i32 %165, 1
  store i32 %166, ptr %164, align 16, !tbaa !12
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = ashr i32 %167, 1
  store i32 %168, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %139, !llvm.loop !15

169:                                              ; preds = %152, %142
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %4, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %182

173:                                              ; preds = %139
  %174 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %175 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 0
  %176 = getelementptr inbounds %"struct.std::pair", ptr %175, i64 3
  invoke void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef %174, ptr noundef %176)
          to label %177 unwind label %178

177:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %99, !llvm.loop !14

178:                                              ; preds = %173
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %4, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %5, align 4
  br label %182

182:                                              ; preds = %178, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %209

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

184:                                              ; preds = %205, %183
  %185 = load i32, ptr %16, align 4, !tbaa !5
  %186 = icmp slt i32 %185, 3
  br i1 %186, label %188, label %187

187:                                              ; preds = %184
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %208

188:                                              ; preds = %184
  %189 = load i32, ptr %16, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 %190
  %192 = getelementptr inbounds %"struct.std::pair", ptr %191, i32 0, i32 0
  %193 = load i32, ptr %192, align 8, !tbaa !12
  %194 = icmp sgt i32 %193, 0
  br i1 %194, label %195, label %204

195:                                              ; preds = %188
  %196 = load i32, ptr %16, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %10, i64 0, i64 %197
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(8) %198)
          to label %199 unwind label %200

199:                                              ; preds = %195
  br label %204

200:                                              ; preds = %195
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %4, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %209

204:                                              ; preds = %199, %188
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %16, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %16, align 4, !tbaa !5
  br label %184, !llvm.loop !16

208:                                              ; preds = %187
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  br label %60, !llvm.loop !17

209:                                              ; preds = %200, %182, %127, %90, %76
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  br label %244

210:                                              ; preds = %60
  %211 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %212 = trunc i64 %211 to i32
  %213 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %212)
          to label %214 unwind label %28

214:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store ptr %3, ptr %17, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %215 = load ptr, ptr %17, align 8, !tbaa !18
  %216 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %215) #6
  %217 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %216, ptr %217, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %218 = load ptr, ptr %17, align 8, !tbaa !18
  %219 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %218) #6
  %220 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %219, ptr %220, align 8
  br label %221

221:                                              ; preds = %234, %214
  %222 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  br i1 %222, label %224, label %223

223:                                              ; preds = %221
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %240

224:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %225 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  store ptr %225, ptr %20, align 8, !tbaa !18
  %226 = load ptr, ptr %20, align 8, !tbaa !18
  %227 = getelementptr inbounds %"struct.std::pair", ptr %226, i32 0, i32 0
  %228 = load i32, ptr %227, align 4, !tbaa !12
  %229 = load ptr, ptr %20, align 8, !tbaa !18
  %230 = getelementptr inbounds %"struct.std::pair", ptr %229, i32 0, i32 1
  %231 = load i32, ptr %230, align 4, !tbaa !20
  %232 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %228, i32 noundef %231)
          to label %233 unwind label %236

233:                                              ; preds = %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %234

234:                                              ; preds = %233
  %235 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  br label %221

236:                                              ; preds = %224
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %4, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %244

240:                                              ; preds = %223
  store i32 0, ptr %9, align 4
  br label %241

241:                                              ; preds = %240, %58
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  %242 = load i32, ptr %9, align 4
  switch i32 %242, label %250 [
    i32 0, label %243
    i32 1, label %243
  ]

243:                                              ; preds = %241, %241
  ret void

244:                                              ; preds = %236, %209, %52, %28
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %245

245:                                              ; preds = %244
  %246 = load ptr, ptr %4, align 8
  %247 = load i32, ptr %5, align 4
  %248 = insertvalue { ptr, i32 } poison, ptr %246, 0
  %249 = insertvalue { ptr, i32 } %248, i32 %247, 1
  resume { ptr, i32 } %249

250:                                              ; preds = %241
  unreachable
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare i32 @puts(ptr noundef) #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) #4

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

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

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

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

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

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

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

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

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca [3 x %"struct.std::pair"], align 16
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %.not35 = icmp slt i32 %13, 1
  br i1 %.not35, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %31, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %14 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %15 = icmp ult i64 %14, 2
  br i1 %15, label %35, label %.preheader34

.preheader34:                                     ; preds = %._crit_edge
  %16 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %17 = icmp ugt i64 %16, 2
  br i1 %17, label %.lr.ph43, label %._crit_edge44

.lr.ph43:                                         ; preds = %.preheader34
  %18 = getelementptr inbounds i8, ptr %7, i64 24
  %19 = getelementptr inbounds i8, ptr %7, i64 8
  %20 = getelementptr inbounds i8, ptr %7, i64 16
  %21 = getelementptr inbounds i8, ptr %7, i64 4
  %22 = getelementptr inbounds i8, ptr %7, i64 20
  %23 = getelementptr inbounds i8, ptr %7, i64 12
  br label %.preheader33.preheader

.lr.ph:                                           ; preds = %0, %31
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %27, label %31

27:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %4)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %28 unwind label %29

28:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %31

29:                                               ; preds = %27
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %104

31:                                               ; preds = %.lr.ph, %28
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %32, %34
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

35:                                               ; preds = %._crit_edge
  %36 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %103

.preheader33.preheader:                           ; preds = %.lr.ph43, %86
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %19)
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %20)
  %37 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %38 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %37)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %39 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %40 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(8) %39)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %41 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %42 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(8) %41)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  invoke void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef nonnull %7, ptr noundef nonnull %18)
          to label %.preheader32 unwind label %45

.preheader32:                                     ; preds = %.preheader33.preheader
  %43 = load i32, ptr %7, align 16, !tbaa !11
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph41, label %.preheader

45:                                               ; preds = %.preheader33.preheader
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %89

.lr.ph41:                                         ; preds = %.preheader32, %.backedge
  %47 = phi i32 [ %55, %.backedge ], [ %43, %.preheader32 ]
  %48 = load i32, ptr %19, align 8, !tbaa !11
  %49 = load i32, ptr %20, align 16, !tbaa !11
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %51, label %59

51:                                               ; preds = %.lr.ph41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %23)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %52 unwind label %57

52:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %53 = load i32, ptr %20, align 16, !tbaa !11
  %54 = shl i32 %53, 1
  store i32 %54, ptr %20, align 16, !tbaa !11
  store i32 0, ptr %19, align 8, !tbaa !11
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %19) #6
  br label %.backedge

.backedge:                                        ; preds = %52, %._crit_edge40
  %55 = load i32, ptr %7, align 16, !tbaa !11
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph41, label %.preheader, !llvm.loop !13

57:                                               ; preds = %51
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %89

59:                                               ; preds = %.lr.ph41
  %60 = sdiv i32 %48, %47
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %.lr.ph39, label %._crit_edge40

.lr.ph39:                                         ; preds = %59, %67
  %.02137 = phi i32 [ %72, %67 ], [ %60, %59 ]
  %62 = and i32 %.02137, 1
  %63 = sub nuw nsw i32 2, %62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %64 = zext nneg i32 %63 to i64
  %65 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %7, i64 0, i64 %64
  %66 = getelementptr inbounds i8, ptr %65, i64 4
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %66)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %67 unwind label %73

67:                                               ; preds = %.lr.ph39
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %68 = load i32, ptr %7, align 16, !tbaa !11
  %69 = load i32, ptr %65, align 8, !tbaa !11
  %70 = sub nsw i32 %69, %68
  store i32 %70, ptr %65, align 8, !tbaa !11
  %71 = shl i32 %68, 1
  store i32 %71, ptr %7, align 16, !tbaa !11
  %72 = lshr i32 %.02137, 1
  %.not = icmp ult i32 %.02137, 2
  br i1 %.not, label %._crit_edge40, label %.lr.ph39, !llvm.loop !14

73:                                               ; preds = %.lr.ph39
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %89

._crit_edge40:                                    ; preds = %67, %59
  invoke void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef nonnull %7, ptr noundef nonnull %18)
          to label %.backedge unwind label %75

75:                                               ; preds = %._crit_edge40
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %89

77:                                               ; preds = %85, %81
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %89

.preheader:                                       ; preds = %.backedge, %.preheader32
  %79 = load i32, ptr %19, align 8, !tbaa !11
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %.preheader
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %82 unwind label %77

82:                                               ; preds = %81, %.preheader
  %83 = load i32, ptr %20, align 16, !tbaa !11
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %82
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(8) %20)
          to label %86 unwind label %77

86:                                               ; preds = %85, %82
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  %87 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %88 = icmp ugt i64 %87, 2
  br i1 %88, label %.preheader33.preheader, label %._crit_edge44, !llvm.loop !15

89:                                               ; preds = %73, %75, %77, %57, %45
  %.pn28 = phi { ptr, i32 } [ %58, %57 ], [ %78, %77 ], [ %46, %45 ], [ %74, %73 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %104

._crit_edge44:                                    ; preds = %86, %.preheader34
  %90 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %91 = trunc i64 %90 to i32
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %91)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %93 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  store ptr %93, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %94 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  store ptr %94, ptr %11, align 8
  %95 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  br i1 %95, label %.lr.ph46, label %._crit_edge47

._crit_edge47:                                    ; preds = %.lr.ph46, %._crit_edge44
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %103

.lr.ph46:                                         ; preds = %._crit_edge44, %.lr.ph46
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %97 = load i32, ptr %96, align 4, !tbaa !11
  %98 = getelementptr inbounds i8, ptr %96, i64 4
  %99 = load i32, ptr %98, align 4, !tbaa !16
  %100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %97, i32 noundef %99)
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %102 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  br i1 %102, label %.lr.ph46, label %._crit_edge47

103:                                              ; preds = %._crit_edge47, %35
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void

104:                                              ; preds = %89, %29
  %.pn30 = phi { ptr, i32 } [ %30, %29 ], [ %.pn28, %89 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn30
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

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

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

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

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass