; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/VK Cup 2015 Finals/Problem G (G)

; 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 }
%"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 }
%"struct.std::pair" = type { i32, i32 }

@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@mx = external dso_local global %"class.std::vector", align 8
@mn = external dso_local global %"class.std::vector", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) @y)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %32, %0
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %35

29:                                               ; preds = %24
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @a, ptr noundef @b)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %31 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b)
  store i64 %31, ptr %3, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @mx, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %32

32:                                               ; preds = %29
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %24, !llvm.loop !9

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

36:                                               ; preds = %44, %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %47

41:                                               ; preds = %36
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @a, ptr noundef @b)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %43 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b)
  store i64 %43, ptr %5, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @mn, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %44

44:                                               ; preds = %41
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %4, align 4, !tbaa !5
  br label %36, !llvm.loop !11

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

48:                                               ; preds = %96, %47
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %99

53:                                               ; preds = %48
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %55) #5
  %57 = getelementptr inbounds %"struct.std::pair", ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 4, !tbaa !12
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = icmp sgt i32 %58, %59
  br i1 %60, label %61, label %72

61:                                               ; preds = %53
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %63) #5
  %65 = getelementptr inbounds %"struct.std::pair", ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 4, !tbaa !12
  store i32 %66, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %68) #5
  %70 = getelementptr inbounds %"struct.std::pair", ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !14
  store i32 %71, ptr %7, align 4, !tbaa !5
  br label %95

72:                                               ; preds = %53
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %74) #5
  %76 = getelementptr inbounds %"struct.std::pair", ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !12
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = icmp eq i32 %77, %78
  br i1 %79, label %80, label %94

80:                                               ; preds = %72
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %82) #5
  %84 = getelementptr inbounds %"struct.std::pair", ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !14
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = icmp sgt i32 %85, %86
  br i1 %87, label %88, label %94

88:                                               ; preds = %80
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %90) #5
  %92 = getelementptr inbounds %"struct.std::pair", ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 4, !tbaa !14
  store i32 %93, ptr %7, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %88, %80, %72
  br label %95

95:                                               ; preds = %94, %61
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %8, align 4, !tbaa !5
  br label %48, !llvm.loop !15

99:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %148, %99
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %151

105:                                              ; preds = %100
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %107) #5
  %109 = getelementptr inbounds %"struct.std::pair", ptr %108, i32 0, i32 1
  %110 = load i32, ptr %109, align 4, !tbaa !14
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = icmp sgt i32 %110, %111
  br i1 %112, label %113, label %124

113:                                              ; preds = %105
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %115) #5
  %117 = getelementptr inbounds %"struct.std::pair", ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !14
  store i32 %118, ptr %10, align 4, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %120) #5
  %122 = getelementptr inbounds %"struct.std::pair", ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 4, !tbaa !12
  store i32 %123, ptr %9, align 4, !tbaa !5
  br label %147

124:                                              ; preds = %105
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %126) #5
  %128 = getelementptr inbounds %"struct.std::pair", ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !14
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = icmp eq i32 %129, %130
  br i1 %131, label %132, label %146

132:                                              ; preds = %124
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %134) #5
  %136 = getelementptr inbounds %"struct.std::pair", ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 4, !tbaa !12
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = icmp sgt i32 %137, %138
  br i1 %139, label %140, label %146

140:                                              ; preds = %132
  %141 = load i32, ptr %11, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %142) #5
  %144 = getelementptr inbounds %"struct.std::pair", ptr %143, i32 0, i32 0
  %145 = load i32, ptr %144, align 4, !tbaa !12
  store i32 %145, ptr %9, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %140, %132, %124
  br label %147

147:                                              ; preds = %146, %113
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %11, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %11, align 4, !tbaa !5
  br label %100, !llvm.loop !16

151:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %200, %151
  %153 = load i32, ptr %14, align 4, !tbaa !5
  %154 = load i32, ptr @m, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %203

157:                                              ; preds = %152
  %158 = load i32, ptr %14, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %159) #5
  %161 = getelementptr inbounds %"struct.std::pair", ptr %160, i32 0, i32 0
  %162 = load i32, ptr %161, align 4, !tbaa !12
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = icmp sgt i32 %162, %163
  br i1 %164, label %165, label %176

165:                                              ; preds = %157
  %166 = load i32, ptr %14, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %167) #5
  %169 = getelementptr inbounds %"struct.std::pair", ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 4, !tbaa !12
  store i32 %170, ptr %12, align 4, !tbaa !5
  %171 = load i32, ptr %14, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %172) #5
  %174 = getelementptr inbounds %"struct.std::pair", ptr %173, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !14
  store i32 %175, ptr %13, align 4, !tbaa !5
  br label %199

176:                                              ; preds = %157
  %177 = load i32, ptr %14, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %178) #5
  %180 = getelementptr inbounds %"struct.std::pair", ptr %179, i32 0, i32 0
  %181 = load i32, ptr %180, align 4, !tbaa !12
  %182 = load i32, ptr %12, align 4, !tbaa !5
  %183 = icmp eq i32 %181, %182
  br i1 %183, label %184, label %198

184:                                              ; preds = %176
  %185 = load i32, ptr %14, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %186) #5
  %188 = getelementptr inbounds %"struct.std::pair", ptr %187, i32 0, i32 1
  %189 = load i32, ptr %188, align 4, !tbaa !14
  %190 = load i32, ptr %13, align 4, !tbaa !5
  %191 = icmp sgt i32 %189, %190
  br i1 %191, label %192, label %198

192:                                              ; preds = %184
  %193 = load i32, ptr %14, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %194) #5
  %196 = getelementptr inbounds %"struct.std::pair", ptr %195, i32 0, i32 1
  %197 = load i32, ptr %196, align 4, !tbaa !14
  store i32 %197, ptr %13, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %192, %184, %176
  br label %199

199:                                              ; preds = %198, %165
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %14, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %14, align 4, !tbaa !5
  br label %152, !llvm.loop !17

203:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %252, %203
  %205 = load i32, ptr %17, align 4, !tbaa !5
  %206 = load i32, ptr @m, align 4, !tbaa !5
  %207 = icmp slt i32 %205, %206
  br i1 %207, label %209, label %208

208:                                              ; preds = %204
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %255

209:                                              ; preds = %204
  %210 = load i32, ptr %17, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %211) #5
  %213 = getelementptr inbounds %"struct.std::pair", ptr %212, i32 0, i32 1
  %214 = load i32, ptr %213, align 4, !tbaa !14
  %215 = load i32, ptr %16, align 4, !tbaa !5
  %216 = icmp sgt i32 %214, %215
  br i1 %216, label %217, label %228

217:                                              ; preds = %209
  %218 = load i32, ptr %17, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %219) #5
  %221 = getelementptr inbounds %"struct.std::pair", ptr %220, i32 0, i32 1
  %222 = load i32, ptr %221, align 4, !tbaa !14
  store i32 %222, ptr %16, align 4, !tbaa !5
  %223 = load i32, ptr %17, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %224) #5
  %226 = getelementptr inbounds %"struct.std::pair", ptr %225, i32 0, i32 0
  %227 = load i32, ptr %226, align 4, !tbaa !12
  store i32 %227, ptr %15, align 4, !tbaa !5
  br label %251

228:                                              ; preds = %209
  %229 = load i32, ptr %17, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %230) #5
  %232 = getelementptr inbounds %"struct.std::pair", ptr %231, i32 0, i32 1
  %233 = load i32, ptr %232, align 4, !tbaa !14
  %234 = load i32, ptr %16, align 4, !tbaa !5
  %235 = icmp eq i32 %233, %234
  br i1 %235, label %236, label %250

236:                                              ; preds = %228
  %237 = load i32, ptr %17, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %238) #5
  %240 = getelementptr inbounds %"struct.std::pair", ptr %239, i32 0, i32 0
  %241 = load i32, ptr %240, align 4, !tbaa !12
  %242 = load i32, ptr %15, align 4, !tbaa !5
  %243 = icmp sgt i32 %241, %242
  br i1 %243, label %244, label %250

244:                                              ; preds = %236
  %245 = load i32, ptr %17, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %246) #5
  %248 = getelementptr inbounds %"struct.std::pair", ptr %247, i32 0, i32 0
  %249 = load i32, ptr %248, align 4, !tbaa !12
  store i32 %249, ptr %15, align 4, !tbaa !5
  br label %250

250:                                              ; preds = %244, %236, %228
  br label %251

251:                                              ; preds = %250, %217
  br label %252

252:                                              ; preds = %251
  %253 = load i32, ptr %17, align 4, !tbaa !5
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %17, align 4, !tbaa !5
  br label %204, !llvm.loop !18

255:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %256 = load i32, ptr %6, align 4, !tbaa !5
  %257 = load i32, ptr %9, align 4, !tbaa !5
  %258 = add nsw i32 %256, %257
  %259 = sext i32 %258 to i64
  store i64 %259, ptr %18, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %260 = load i32, ptr %7, align 4, !tbaa !5
  %261 = load i32, ptr %10, align 4, !tbaa !5
  %262 = add nsw i32 %260, %261
  %263 = sext i32 %262 to i64
  store i64 %263, ptr %19, align 8, !tbaa !19
  %264 = load i32, ptr %12, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = load i64, ptr %18, align 8, !tbaa !19
  %267 = sub nsw i64 %266, %265
  store i64 %267, ptr %18, align 8, !tbaa !19
  %268 = load i32, ptr %15, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = load i64, ptr %18, align 8, !tbaa !19
  %271 = sub nsw i64 %270, %269
  store i64 %271, ptr %18, align 8, !tbaa !19
  %272 = load i32, ptr %13, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = load i64, ptr %19, align 8, !tbaa !19
  %275 = sub nsw i64 %274, %273
  store i64 %275, ptr %19, align 8, !tbaa !19
  %276 = load i32, ptr %16, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = load i64, ptr %19, align 8, !tbaa !19
  %279 = sub nsw i64 %278, %277
  store i64 %279, ptr %19, align 8, !tbaa !19
  %280 = load i32, ptr %6, align 4, !tbaa !5
  %281 = load i32, ptr %12, align 4, !tbaa !5
  %282 = icmp sgt i32 %280, %281
  br i1 %282, label %287, label %283

283:                                              ; preds = %255
  %284 = load i32, ptr %10, align 4, !tbaa !5
  %285 = load i32, ptr %16, align 4, !tbaa !5
  %286 = icmp sgt i32 %284, %285
  br i1 %286, label %287, label %289

287:                                              ; preds = %283, %255
  %288 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %20, align 4
  br label %375

289:                                              ; preds = %283
  %290 = load i64, ptr %18, align 8, !tbaa !19
  %291 = icmp slt i64 %290, 0
  br i1 %291, label %292, label %297

292:                                              ; preds = %289
  %293 = load i64, ptr %19, align 8, !tbaa !19
  %294 = icmp slt i64 %293, 0
  br i1 %294, label %295, label %297

295:                                              ; preds = %292
  %296 = call i32 @puts(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %20, align 4
  br label %375

297:                                              ; preds = %292, %289
  %298 = load i64, ptr @x, align 8, !tbaa !19
  %299 = load i32, ptr %6, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = add nsw i64 %298, %300
  %302 = load i32, ptr %12, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = sub nsw i64 %301, %303
  %305 = icmp slt i64 %304, 0
  br i1 %305, label %306, label %335

306:                                              ; preds = %297
  %307 = load i64, ptr @y, align 8, !tbaa !19
  %308 = load i32, ptr %7, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = add nsw i64 %307, %309
  %311 = load i32, ptr %13, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = sub nsw i64 %310, %312
  %314 = icmp slt i64 %313, 0
  br i1 %314, label %315, label %335

315:                                              ; preds = %306
  %316 = load i64, ptr @x, align 8, !tbaa !19
  %317 = load i32, ptr %9, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = add nsw i64 %316, %318
  %320 = load i32, ptr %12, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = sub nsw i64 %319, %321
  %323 = icmp slt i64 %322, 0
  br i1 %323, label %324, label %335

324:                                              ; preds = %315
  %325 = load i64, ptr @y, align 8, !tbaa !19
  %326 = load i32, ptr %10, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = add nsw i64 %325, %327
  %329 = load i32, ptr %13, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = sub nsw i64 %328, %330
  %332 = icmp slt i64 %331, 0
  br i1 %332, label %333, label %335

333:                                              ; preds = %324
  %334 = call i32 @puts(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %20, align 4
  br label %375

335:                                              ; preds = %324, %315, %306, %297
  %336 = load i64, ptr @x, align 8, !tbaa !19
  %337 = load i32, ptr %6, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = add nsw i64 %336, %338
  %340 = load i32, ptr %15, align 4, !tbaa !5
  %341 = sext i32 %340 to i64
  %342 = sub nsw i64 %339, %341
  %343 = icmp slt i64 %342, 0
  br i1 %343, label %344, label %373

344:                                              ; preds = %335
  %345 = load i64, ptr @y, align 8, !tbaa !19
  %346 = load i32, ptr %7, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = add nsw i64 %345, %347
  %349 = load i32, ptr %16, align 4, !tbaa !5
  %350 = sext i32 %349 to i64
  %351 = sub nsw i64 %348, %350
  %352 = icmp slt i64 %351, 0
  br i1 %352, label %353, label %373

353:                                              ; preds = %344
  %354 = load i64, ptr @x, align 8, !tbaa !19
  %355 = load i32, ptr %9, align 4, !tbaa !5
  %356 = sext i32 %355 to i64
  %357 = add nsw i64 %354, %356
  %358 = load i32, ptr %15, align 4, !tbaa !5
  %359 = sext i32 %358 to i64
  %360 = sub nsw i64 %357, %359
  %361 = icmp slt i64 %360, 0
  br i1 %361, label %362, label %373

362:                                              ; preds = %353
  %363 = load i64, ptr @y, align 8, !tbaa !19
  %364 = load i32, ptr %10, align 4, !tbaa !5
  %365 = sext i32 %364 to i64
  %366 = add nsw i64 %363, %365
  %367 = load i32, ptr %16, align 4, !tbaa !5
  %368 = sext i32 %367 to i64
  %369 = sub nsw i64 %366, %368
  %370 = icmp slt i64 %369, 0
  br i1 %370, label %371, label %373

371:                                              ; preds = %362
  %372 = call i32 @puts(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %20, align 4
  br label %375

373:                                              ; preds = %362, %353, %344, %335
  %374 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %20, align 4
  br label %375

375:                                              ; preds = %373, %371, %333, %295, %287
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %376 = load i32, ptr %1, align 4
  ret i32 %376
}

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

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

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

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

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

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

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

declare i32 @puts(ptr noundef) #1

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


; 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 }
%"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 }
%"struct.std::pair" = type { i32, i32 }

@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@mx = external dso_local global %"class.std::vector", align 8
@mn = external dso_local global %"class.std::vector", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca %"struct.std::pair", align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %4 = 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) @x)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) @y)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %.preheader109

.preheader109:                                    ; preds = %.lr.ph, %0
  %8 = phi i32 [ %6, %0 ], [ %14, %.lr.ph ]
  %9 = load i32, ptr @m, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph112, label %.preheader108

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.0103110 = phi i32 [ %13, %.lr.ph ], [ 0, %0 ]
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %12 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b)
  store i64 %12, ptr %1, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @mx, ptr noundef nonnull align 4 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %13 = add nuw nsw i32 %.0103110, 1
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %.lr.ph, label %.preheader109, !llvm.loop !9

.preheader108.loopexit:                           ; preds = %.lr.ph112
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader108

.preheader108:                                    ; preds = %.preheader108.loopexit, %.preheader109
  %16 = phi i32 [ %.pre, %.preheader108.loopexit ], [ %8, %.preheader109 ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph116, label %.preheader106

.lr.ph112:                                        ; preds = %.preheader109, %.lr.ph112
  %.0102111 = phi i32 [ %20, %.lr.ph112 ], [ 0, %.preheader109 ]
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %19 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b)
  store i64 %19, ptr %2, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @mn, ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %20 = add nuw nsw i32 %.0102111, 1
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %.lr.ph112, label %.preheader108.loopexit, !llvm.loop !11

.preheader107:                                    ; preds = %39
  %23 = icmp sgt i32 %40, 0
  br i1 %23, label %.lr.ph121, label %.preheader106

.lr.ph116:                                        ; preds = %.preheader108, %39
  %indvars.iv = phi i64 [ %indvars.iv.next, %39 ], [ 0, %.preheader108 ]
  %.098114 = phi i32 [ %.199, %39 ], [ 0, %.preheader108 ]
  %.0100113 = phi i32 [ %.1101, %39 ], [ 0, %.preheader108 ]
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %indvars.iv) #5
  %25 = load i32, ptr %24, align 4, !tbaa !12
  %26 = icmp sgt i32 %25, %.0100113
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %indvars.iv) #5
  %28 = load i32, ptr %27, align 4, !tbaa !12
  br i1 %26, label %.sink.split, label %29

29:                                               ; preds = %.lr.ph116
  %30 = icmp eq i32 %28, %.0100113
  br i1 %30, label %31, label %39

31:                                               ; preds = %29
  %32 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %indvars.iv) #5
  %33 = getelementptr inbounds i8, ptr %32, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !14
  %35 = icmp sgt i32 %34, %.098114
  br i1 %35, label %.sink.split, label %39

.sink.split:                                      ; preds = %31, %.lr.ph116
  %.1101.ph = phi i32 [ %28, %.lr.ph116 ], [ %.0100113, %31 ]
  %36 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %indvars.iv) #5
  %37 = getelementptr inbounds i8, ptr %36, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !14
  br label %39

39:                                               ; preds = %.sink.split, %31, %29
  %.1101 = phi i32 [ %.0100113, %31 ], [ %.0100113, %29 ], [ %.1101.ph, %.sink.split ]
  %.199 = phi i32 [ %.098114, %31 ], [ %.098114, %29 ], [ %38, %.sink.split ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next, %41
  br i1 %42, label %.lr.ph116, label %.preheader107, !llvm.loop !15

.preheader106:                                    ; preds = %60, %.preheader108, %.preheader107
  %.098.lcssa149 = phi i32 [ %.199, %.preheader107 ], [ 0, %.preheader108 ], [ %.199, %60 ]
  %.0100.lcssa148 = phi i32 [ %.1101, %.preheader107 ], [ 0, %.preheader108 ], [ %.1101, %60 ]
  %.095.lcssa = phi i32 [ 0, %.preheader107 ], [ 0, %.preheader108 ], [ %.196, %60 ]
  %.093.lcssa = phi i32 [ 0, %.preheader107 ], [ 0, %.preheader108 ], [ %.194, %60 ]
  %43 = load i32, ptr @m, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph127, label %._crit_edge

.lr.ph121:                                        ; preds = %.preheader107, %60
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %60 ], [ 0, %.preheader107 ]
  %.093119 = phi i32 [ %.194, %60 ], [ 0, %.preheader107 ]
  %.095118 = phi i32 [ %.196, %60 ], [ 0, %.preheader107 ]
  %45 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %indvars.iv137) #5
  %46 = getelementptr inbounds i8, ptr %45, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !14
  %48 = icmp sgt i32 %47, %.093119
  %49 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %indvars.iv137) #5
  %50 = getelementptr inbounds i8, ptr %49, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !14
  br i1 %48, label %.sink.split157, label %52

52:                                               ; preds = %.lr.ph121
  %53 = icmp eq i32 %51, %.093119
  br i1 %53, label %54, label %60

54:                                               ; preds = %52
  %55 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %indvars.iv137) #5
  %56 = load i32, ptr %55, align 4, !tbaa !12
  %57 = icmp sgt i32 %56, %.095118
  br i1 %57, label %.sink.split157, label %60

.sink.split157:                                   ; preds = %54, %.lr.ph121
  %.194.ph = phi i32 [ %51, %.lr.ph121 ], [ %.093119, %54 ]
  %58 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mx, i64 noundef %indvars.iv137) #5
  %59 = load i32, ptr %58, align 4, !tbaa !12
  br label %60

60:                                               ; preds = %.sink.split157, %54, %52
  %.196 = phi i32 [ %.095118, %54 ], [ %.095118, %52 ], [ %59, %.sink.split157 ]
  %.194 = phi i32 [ %.093119, %54 ], [ %.093119, %52 ], [ %.194.ph, %.sink.split157 ]
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next138, %62
  br i1 %63, label %.lr.ph121, label %.preheader106, !llvm.loop !16

.preheader:                                       ; preds = %81
  %64 = icmp sgt i32 %82, 0
  %65 = sext i32 %.189 to i64
  br i1 %64, label %.lr.ph133, label %._crit_edge

.lr.ph127:                                        ; preds = %.preheader106, %81
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %81 ], [ 0, %.preheader106 ]
  %.088125 = phi i32 [ %.189, %81 ], [ 0, %.preheader106 ]
  %.090124 = phi i32 [ %.191, %81 ], [ 0, %.preheader106 ]
  %66 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %indvars.iv140) #5
  %67 = load i32, ptr %66, align 4, !tbaa !12
  %68 = icmp sgt i32 %67, %.090124
  %69 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %indvars.iv140) #5
  %70 = load i32, ptr %69, align 4, !tbaa !12
  br i1 %68, label %.sink.split158, label %71

71:                                               ; preds = %.lr.ph127
  %72 = icmp eq i32 %70, %.090124
  br i1 %72, label %73, label %81

73:                                               ; preds = %71
  %74 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %indvars.iv140) #5
  %75 = getelementptr inbounds i8, ptr %74, i64 4
  %76 = load i32, ptr %75, align 4, !tbaa !14
  %77 = icmp sgt i32 %76, %.088125
  br i1 %77, label %.sink.split158, label %81

.sink.split158:                                   ; preds = %73, %.lr.ph127
  %.191.ph = phi i32 [ %70, %.lr.ph127 ], [ %.090124, %73 ]
  %78 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %indvars.iv140) #5
  %79 = getelementptr inbounds i8, ptr %78, i64 4
  %80 = load i32, ptr %79, align 4, !tbaa !14
  br label %81

81:                                               ; preds = %.sink.split158, %73, %71
  %.191 = phi i32 [ %.090124, %73 ], [ %.090124, %71 ], [ %.191.ph, %.sink.split158 ]
  %.189 = phi i32 [ %.088125, %73 ], [ %.088125, %71 ], [ %80, %.sink.split158 ]
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %82 = load i32, ptr @m, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = icmp slt i64 %indvars.iv.next141, %83
  br i1 %84, label %.lr.ph127, label %.preheader, !llvm.loop !17

._crit_edge.loopexit:                             ; preds = %105
  %85 = sext i32 %.186 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader106, %._crit_edge.loopexit, %.preheader
  %.088.lcssa153 = phi i64 [ %65, %.preheader ], [ %65, %._crit_edge.loopexit ], [ 0, %.preheader106 ]
  %.090.lcssa152 = phi i32 [ %.191, %.preheader ], [ %.191, %._crit_edge.loopexit ], [ 0, %.preheader106 ]
  %.085.lcssa = phi i64 [ 0, %.preheader ], [ %85, %._crit_edge.loopexit ], [ 0, %.preheader106 ]
  %.084.lcssa = phi i32 [ 0, %.preheader ], [ %.1, %._crit_edge.loopexit ], [ 0, %.preheader106 ]
  %86 = sext i32 %.090.lcssa152 to i64
  %87 = sext i32 %.084.lcssa to i64
  %88 = icmp sgt i32 %.0100.lcssa148, %.090.lcssa152
  %89 = icmp sgt i32 %.093.lcssa, %.084.lcssa
  %or.cond105 = select i1 %88, i1 true, i1 %89
  br i1 %or.cond105, label %152, label %109

.lr.ph133:                                        ; preds = %.preheader, %105
  %indvars.iv143 = phi i64 [ %indvars.iv.next144, %105 ], [ 0, %.preheader ]
  %.084131 = phi i32 [ %.1, %105 ], [ 0, %.preheader ]
  %.085130 = phi i32 [ %.186, %105 ], [ 0, %.preheader ]
  %90 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %indvars.iv143) #5
  %91 = getelementptr inbounds i8, ptr %90, i64 4
  %92 = load i32, ptr %91, align 4, !tbaa !14
  %93 = icmp sgt i32 %92, %.084131
  %94 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %indvars.iv143) #5
  %95 = getelementptr inbounds i8, ptr %94, i64 4
  %96 = load i32, ptr %95, align 4, !tbaa !14
  br i1 %93, label %.sink.split160, label %97

97:                                               ; preds = %.lr.ph133
  %98 = icmp eq i32 %96, %.084131
  br i1 %98, label %99, label %105

99:                                               ; preds = %97
  %100 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %indvars.iv143) #5
  %101 = load i32, ptr %100, align 4, !tbaa !12
  %102 = icmp sgt i32 %101, %.085130
  br i1 %102, label %.sink.split160, label %105

.sink.split160:                                   ; preds = %99, %.lr.ph133
  %.1.ph = phi i32 [ %96, %.lr.ph133 ], [ %.084131, %99 ]
  %103 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @mn, i64 noundef %indvars.iv143) #5
  %104 = load i32, ptr %103, align 4, !tbaa !12
  br label %105

105:                                              ; preds = %.sink.split160, %99, %97
  %.186 = phi i32 [ %.085130, %99 ], [ %.085130, %97 ], [ %104, %.sink.split160 ]
  %.1 = phi i32 [ %.084131, %99 ], [ %.084131, %97 ], [ %.1.ph, %.sink.split160 ]
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %106 = load i32, ptr @m, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = icmp slt i64 %indvars.iv.next144, %107
  br i1 %108, label %.lr.ph133, label %._crit_edge.loopexit, !llvm.loop !18

109:                                              ; preds = %._crit_edge
  %110 = add nsw i64 %.088.lcssa153, %87
  %111 = add nsw i64 %.085.lcssa, %86
  %112 = add nsw i32 %.093.lcssa, %.098.lcssa149
  %113 = sext i32 %112 to i64
  %114 = add nsw i32 %.095.lcssa, %.0100.lcssa148
  %115 = sext i32 %114 to i64
  %116 = icmp sgt i64 %111, %115
  %117 = icmp sgt i64 %110, %113
  %or.cond = select i1 %116, i1 %117, i1 false
  br i1 %or.cond, label %152, label %118

118:                                              ; preds = %109
  %119 = load i64, ptr @x, align 8, !tbaa !19
  %120 = sext i32 %.0100.lcssa148 to i64
  %121 = add nsw i64 %119, %120
  %122 = icmp slt i64 %121, %86
  br i1 %122, label %123, label %136

123:                                              ; preds = %118
  %124 = load i64, ptr @y, align 8, !tbaa !19
  %125 = sext i32 %.098.lcssa149 to i64
  %126 = add nsw i64 %124, %125
  %127 = icmp slt i64 %126, %.088.lcssa153
  br i1 %127, label %128, label %136

128:                                              ; preds = %123
  %129 = sext i32 %.095.lcssa to i64
  %130 = add nsw i64 %119, %129
  %131 = icmp slt i64 %130, %86
  br i1 %131, label %132, label %136

132:                                              ; preds = %128
  %133 = sext i32 %.093.lcssa to i64
  %134 = add nsw i64 %124, %133
  %135 = icmp slt i64 %134, %.088.lcssa153
  br i1 %135, label %152, label %136

136:                                              ; preds = %132, %128, %123, %118
  %137 = icmp slt i64 %121, %.085.lcssa
  br i1 %137, label %138, label %151

138:                                              ; preds = %136
  %139 = load i64, ptr @y, align 8, !tbaa !19
  %140 = sext i32 %.098.lcssa149 to i64
  %141 = add nsw i64 %139, %140
  %142 = icmp slt i64 %141, %87
  br i1 %142, label %143, label %151

143:                                              ; preds = %138
  %144 = sext i32 %.095.lcssa to i64
  %145 = add nsw i64 %119, %144
  %146 = icmp slt i64 %145, %.085.lcssa
  br i1 %146, label %147, label %151

147:                                              ; preds = %143
  %148 = sext i32 %.093.lcssa to i64
  %149 = add nsw i64 %139, %148
  %150 = icmp slt i64 %149, %87
  br i1 %150, label %152, label %151

151:                                              ; preds = %147, %143, %138, %136
  br label %152

152:                                              ; preds = %147, %132, %109, %._crit_edge, %151
  %.str.3.sink = phi ptr [ @.str.3, %151 ], [ @.str.3, %._crit_edge ], [ @.str.4, %109 ], [ @.str.4, %132 ], [ @.str.4, %147 ]
  %153 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  ret i32 0
}

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

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

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

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

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

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

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

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

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


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