; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Random/Matrix Rotation (A)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@a = external dso_local global [310 x [310 x i32]], align 16
@b = external dso_local global [310 x [310 x i32]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

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

31:                                               ; preds = %54, %0
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %57

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

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

41:                                               ; preds = %37
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %53

42:                                               ; preds = %37
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [310 x [310 x i32]], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [310 x i32], ptr %45, i64 0, i64 %47
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %48)
  br label %50

50:                                               ; preds = %42
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %4, align 4, !tbaa !5
  br label %37, !llvm.loop !9

53:                                               ; preds = %41
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %2, align 4, !tbaa !5
  br label %31, !llvm.loop !11

57:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %58 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %58, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %59 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %59, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sdiv i32 %61, 2
  store i32 %62, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %196, %57
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %200

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %69 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %69, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %70 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %70, ptr %11, align 4, !tbaa !5
  br label %71

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

75:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %11, align 4, !tbaa !5
  store i32 %76, ptr %13, align 4, !tbaa !5
  %78 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %79 unwind label %81

79:                                               ; preds = %75
  store i64 %78, ptr %12, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %80 unwind label %81

80:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %71, !llvm.loop !12

81:                                               ; preds = %79, %75
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %14, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %199

85:                                               ; preds = %71
  br label %86

86:                                               ; preds = %95, %85
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = load i32, ptr @m, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %90, label %100

90:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %10, align 4, !tbaa !5
  store i32 %91, ptr %17, align 4, !tbaa !5
  %93 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %94 unwind label %96

94:                                               ; preds = %90
  store i64 %93, ptr %16, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %95 unwind label %96

95:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %86, !llvm.loop !13

96:                                               ; preds = %94, %90
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %14, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %199

100:                                              ; preds = %86
  br label %101

101:                                              ; preds = %110, %100
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = icmp sgt i32 %102, %103
  br i1 %104, label %105, label %115

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %11, align 4, !tbaa !5
  store i32 %106, ptr %19, align 4, !tbaa !5
  %108 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %109 unwind label %111

109:                                              ; preds = %105
  store i64 %108, ptr %18, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %110 unwind label %111

110:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %101, !llvm.loop !14

111:                                              ; preds = %109, %105
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %14, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %199

115:                                              ; preds = %101
  br label %116

116:                                              ; preds = %125, %115
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = icmp sgt i32 %117, %118
  br i1 %119, label %120, label %130

120:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = add nsw i32 %121, -1
  store i32 %122, ptr %10, align 4, !tbaa !5
  store i32 %121, ptr %21, align 4, !tbaa !5
  %123 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %124 unwind label %126

124:                                              ; preds = %120
  store i64 %123, ptr %20, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(8) %20)
          to label %125 unwind label %126

125:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %116, !llvm.loop !15

126:                                              ; preds = %124, %120
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %14, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %199

130:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %131 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  %132 = trunc i64 %131 to i32
  store i32 %132, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %188, %130
  %134 = load i32, ptr %23, align 4, !tbaa !5
  %135 = load i32, ptr %22, align 4, !tbaa !5
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %191

138:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %139 = load i32, ptr %23, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %140) #6
  %142 = getelementptr inbounds %"struct.std::pair", ptr %141, i32 0, i32 0
  %143 = load i32, ptr %142, align 4, !tbaa !16
  store i32 %143, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %144 = load i32, ptr %23, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %145) #6
  %147 = getelementptr inbounds %"struct.std::pair", ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !18
  store i32 %148, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %149 = load i32, ptr %22, align 4, !tbaa !5
  %150 = load i32, ptr %23, align 4, !tbaa !5
  %151 = load i32, ptr @r, align 4, !tbaa !5
  %152 = sub nsw i32 %150, %151
  %153 = load i32, ptr %22, align 4, !tbaa !5
  %154 = srem i32 %152, %153
  %155 = add nsw i32 %149, %154
  %156 = load i32, ptr %22, align 4, !tbaa !5
  %157 = srem i32 %155, %156
  %158 = sext i32 %157 to i64
  %159 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %158) #6
  %160 = getelementptr inbounds %"struct.std::pair", ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 4, !tbaa !16
  store i32 %161, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %162 = load i32, ptr %22, align 4, !tbaa !5
  %163 = load i32, ptr %23, align 4, !tbaa !5
  %164 = load i32, ptr @r, align 4, !tbaa !5
  %165 = sub nsw i32 %163, %164
  %166 = load i32, ptr %22, align 4, !tbaa !5
  %167 = srem i32 %165, %166
  %168 = add nsw i32 %162, %167
  %169 = load i32, ptr %22, align 4, !tbaa !5
  %170 = srem i32 %168, %169
  %171 = sext i32 %170 to i64
  %172 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %171) #6
  %173 = getelementptr inbounds %"struct.std::pair", ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 4, !tbaa !18
  store i32 %174, ptr %27, align 4, !tbaa !5
  %175 = load i32, ptr %24, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [310 x [310 x i32]], ptr @a, i64 0, i64 %176
  %178 = load i32, ptr %25, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [310 x i32], ptr %177, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = load i32, ptr %26, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [310 x [310 x i32]], ptr @b, i64 0, i64 %183
  %185 = load i32, ptr %27, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [310 x i32], ptr %184, i64 0, i64 %186
  store i32 %181, ptr %187, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %188

188:                                              ; preds = %138
  %189 = load i32, ptr %23, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %23, align 4, !tbaa !5
  br label %133, !llvm.loop !19

191:                                              ; preds = %137
  %192 = load i32, ptr @n, align 4, !tbaa !5
  %193 = add nsw i32 %192, -1
  store i32 %193, ptr @n, align 4, !tbaa !5
  %194 = load i32, ptr @m, align 4, !tbaa !5
  %195 = add nsw i32 %194, -1
  store i32 %195, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %196

196:                                              ; preds = %191
  %197 = load i32, ptr %8, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %8, align 4, !tbaa !5
  br label %63, !llvm.loop !20

199:                                              ; preds = %126, %111, %96, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %231

200:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 1, ptr %28, align 4, !tbaa !5
  br label %201

201:                                              ; preds = %226, %200
  %202 = load i32, ptr %28, align 4, !tbaa !5
  %203 = load i32, ptr %5, align 4, !tbaa !5
  %204 = icmp sle i32 %202, %203
  br i1 %204, label %206, label %205

205:                                              ; preds = %201
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %229

206:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  store i32 1, ptr %29, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %221, %206
  %208 = load i32, ptr %29, align 4, !tbaa !5
  %209 = load i32, ptr %6, align 4, !tbaa !5
  %210 = icmp sle i32 %208, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %207
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %224

212:                                              ; preds = %207
  %213 = load i32, ptr %28, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [310 x [310 x i32]], ptr @b, i64 0, i64 %214
  %216 = load i32, ptr %29, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [310 x i32], ptr %215, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %219)
  br label %221

221:                                              ; preds = %212
  %222 = load i32, ptr %29, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %29, align 4, !tbaa !5
  br label %207, !llvm.loop !21

224:                                              ; preds = %211
  %225 = call i32 @puts(ptr noundef @.str.3)
  br label %226

226:                                              ; preds = %224
  %227 = load i32, ptr %28, align 4, !tbaa !5
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %28, align 4, !tbaa !5
  br label %201, !llvm.loop !22

229:                                              ; preds = %205
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %230 = load i32, ptr %1, align 4
  ret i32 %230

231:                                              ; preds = %199
  %232 = load ptr, ptr %14, align 8
  %233 = load i32, ptr %15, align 4
  %234 = insertvalue { ptr, i32 } poison, ptr %232, 0
  %235 = insertvalue { ptr, i32 } %234, i32 %233, 1
  resume { ptr, i32 } %235
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; 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

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

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@a = external dso_local global [310 x [310 x i32]], align 16
@b = external dso_local local_unnamed_addr global [310 x [310 x i32]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i32, align 4
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @r)
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %.not61 = icmp slt i32 %13, 1
  %.pre107 = load i32, ptr @m, align 4, !tbaa !5
  %14 = icmp slt i32 %.pre107, 1
  %or.cond = select i1 %.not61, i1 true, i1 %14
  br i1 %or.cond, label %._crit_edge63, label %.preheader58

.preheader58:                                     ; preds = %0, %._crit_edge
  %15 = phi i32 [ %21, %._crit_edge ], [ %13, %0 ]
  %16 = phi i32 [ %22, %._crit_edge ], [ %.pre107, %0 ]
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %._crit_edge ], [ 1, %0 ]
  %.not5359 = icmp slt i32 %16, 1
  br i1 %.not5359, label %._crit_edge, label %.lr.ph

._crit_edge63:                                    ; preds = %._crit_edge, %0
  %17 = phi i32 [ %.pre107, %0 ], [ %22, %._crit_edge ]
  %.lcssa = phi i32 [ %13, %0 ], [ %21, %._crit_edge ]
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %.not4974 = icmp slt i32 %19, 2
  br i1 %.not4974, label %.preheader54, label %.lr.ph77.preheader

.lr.ph77.preheader:                               ; preds = %._crit_edge63
  %20 = lshr i32 %19, 1
  br label %.lr.ph77

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader58
  %21 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %15, %.preheader58 ]
  %22 = phi i32 [ %26, %._crit_edge.loopexit ], [ %16, %.preheader58 ]
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %23 = sext i32 %21 to i64
  %.not.not = icmp slt i64 %indvars.iv89, %23
  br i1 %.not.not, label %.preheader58, label %._crit_edge63, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader58, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader58 ]
  %24 = getelementptr inbounds [310 x [310 x i32]], ptr @a, i64 0, i64 %indvars.iv89, i64 %indvars.iv
  %25 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %24)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %.not53.not = icmp slt i64 %indvars.iv, %27
  br i1 %.not53.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

.preheader54:                                     ; preds = %._crit_edge73, %._crit_edge63
  %.not5082 = icmp slt i32 %.lcssa, 1
  br i1 %.not5082, label %._crit_edge84, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader54
  %.not5178 = icmp slt i32 %17, 1
  br i1 %.not5178, label %.preheader.us, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %28 = add nuw i32 %17, 1
  %29 = add nuw i32 %.lcssa, 1
  %wide.trip.count104 = zext i32 %29 to i64
  %wide.trip.count99 = zext i32 %28 to i64
  br label %.preheader

.preheader.us:                                    ; preds = %.preheader.lr.ph, %.preheader.us
  %.04083.us = phi i32 [ %31, %.preheader.us ], [ 1, %.preheader.lr.ph ]
  %30 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %31 = add nuw i32 %.04083.us, 1
  %exitcond106.not = icmp eq i32 %.04083.us, %.lcssa
  br i1 %exitcond106.not, label %._crit_edge84, label %.preheader.us, !llvm.loop !13

.lr.ph77:                                         ; preds = %.lr.ph77.preheader, %._crit_edge73
  %.04475 = phi i32 [ %88, %._crit_edge73 ], [ 1, %.lr.ph77.preheader ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 %.04475, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 %.04475, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = icmp slt i32 %.04475, %32
  br i1 %33, label %.lr.ph65, label %.preheader57

.preheader57.loopexit:                            ; preds = %42
  %.pre108 = load i32, ptr %2, align 4, !tbaa !5
  br label %.preheader57

.preheader57:                                     ; preds = %.preheader57.loopexit, %.lr.ph77
  %34 = phi i32 [ %43, %.preheader57.loopexit ], [ %.04475, %.lr.ph77 ]
  %35 = phi i32 [ %44, %.preheader57.loopexit ], [ %32, %.lr.ph77 ]
  %36 = phi i32 [ %.pre108, %.preheader57.loopexit ], [ %.04475, %.lr.ph77 ]
  %37 = icmp slt i32 %36, %35
  br i1 %37, label %.lr.ph66, label %.preheader56

.lr.ph65:                                         ; preds = %.lr.ph77, %42
  %38 = phi i32 [ %43, %42 ], [ %.04475, %.lr.ph77 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %3, align 4, !tbaa !5
  store i32 %38, ptr %5, align 4, !tbaa !5
  %40 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %41 unwind label %46

41:                                               ; preds = %.lr.ph65
  store i64 %40, ptr %4, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %42 unwind label %46

42:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = load i32, ptr @m, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %.lr.ph65, label %.preheader57.loopexit, !llvm.loop !14

46:                                               ; preds = %41, %.lr.ph65
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %119

.preheader56.loopexit:                            ; preds = %55
  %.pre109 = load i32, ptr %3, align 4, !tbaa !5
  br label %.preheader56

.preheader56:                                     ; preds = %.preheader56.loopexit, %.preheader57
  %48 = phi i32 [ %56, %.preheader56.loopexit ], [ %36, %.preheader57 ]
  %49 = phi i32 [ %.pre109, %.preheader56.loopexit ], [ %34, %.preheader57 ]
  %50 = icmp sgt i32 %49, %.04475
  br i1 %50, label %.lr.ph67, label %.preheader55

.lr.ph66:                                         ; preds = %.preheader57, %55
  %51 = phi i32 [ %56, %55 ], [ %36, %.preheader57 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !5
  store i32 %51, ptr %7, align 4, !tbaa !5
  %53 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %54 unwind label %59

54:                                               ; preds = %.lr.ph66
  store i64 %53, ptr %6, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %55 unwind label %59

55:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = load i32, ptr @m, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %.lr.ph66, label %.preheader56.loopexit, !llvm.loop !15

59:                                               ; preds = %54, %.lr.ph66
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %119

.preheader55.loopexit:                            ; preds = %67
  %.pre110 = load i32, ptr %2, align 4, !tbaa !5
  br label %.preheader55

.preheader55:                                     ; preds = %.preheader55.loopexit, %.preheader56
  %61 = phi i32 [ %.pre110, %.preheader55.loopexit ], [ %48, %.preheader56 ]
  %62 = icmp sgt i32 %61, %.04475
  br i1 %62, label %.lr.ph68, label %._crit_edge69

.lr.ph67:                                         ; preds = %.preheader56, %67
  %63 = phi i32 [ %68, %67 ], [ %49, %.preheader56 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr %3, align 4, !tbaa !5
  store i32 %63, ptr %9, align 4, !tbaa !5
  %65 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %66 unwind label %70

66:                                               ; preds = %.lr.ph67
  store i64 %65, ptr %8, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %67 unwind label %70

67:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, %.04475
  br i1 %69, label %.lr.ph67, label %.preheader55.loopexit, !llvm.loop !16

70:                                               ; preds = %66, %.lr.ph67
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %119

.lr.ph68:                                         ; preds = %.preheader55, %76
  %72 = phi i32 [ %77, %76 ], [ %61, %.preheader55 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %2, align 4, !tbaa !5
  store i32 %72, ptr %11, align 4, !tbaa !5
  %74 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %75 unwind label %79

75:                                               ; preds = %.lr.ph68
  store i64 %74, ptr %10, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %76 unwind label %79

76:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = icmp sgt i32 %77, %.04475
  br i1 %78, label %.lr.ph68, label %._crit_edge69, !llvm.loop !17

79:                                               ; preds = %75, %.lr.ph68
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %119

._crit_edge69:                                    ; preds = %76, %.preheader55
  %81 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %82 = trunc i64 %81 to i32
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph72.preheader, label %._crit_edge73

.lr.ph72.preheader:                               ; preds = %._crit_edge69
  %wide.trip.count = and i64 %81, 2147483647
  br label %.lr.ph72

._crit_edge73:                                    ; preds = %.lr.ph72, %._crit_edge69
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = add nsw i32 %84, -1
  store i32 %85, ptr @n, align 4, !tbaa !5
  %86 = load i32, ptr @m, align 4, !tbaa !5
  %87 = add nsw i32 %86, -1
  store i32 %87, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  %88 = add nuw nsw i32 %.04475, 1
  %exitcond95.not = icmp eq i32 %.04475, %20
  br i1 %exitcond95.not, label %.preheader54, label %.lr.ph77, !llvm.loop !18

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %.lr.ph72
  %indvars.iv92 = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next93, %.lr.ph72 ]
  %89 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv92) #6
  %90 = load i32, ptr %89, align 4, !tbaa !19
  %91 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv92) #6
  %92 = getelementptr inbounds i8, ptr %91, i64 4
  %93 = load i32, ptr %92, align 4, !tbaa !21
  %94 = load i32, ptr @r, align 4, !tbaa !5
  %95 = trunc nuw nsw i64 %indvars.iv92 to i32
  %96 = sub nsw i32 %95, %94
  %97 = srem i32 %96, %82
  %98 = add nsw i32 %97, %82
  %99 = srem i32 %98, %82
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %100) #6
  %102 = load i32, ptr %101, align 4, !tbaa !19
  %103 = load i32, ptr @r, align 4, !tbaa !5
  %104 = sub nsw i32 %95, %103
  %105 = srem i32 %104, %82
  %106 = add nsw i32 %105, %82
  %107 = srem i32 %106, %82
  %108 = sext i32 %107 to i64
  %109 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %108) #6
  %110 = getelementptr inbounds i8, ptr %109, i64 4
  %111 = load i32, ptr %110, align 4, !tbaa !21
  %112 = sext i32 %90 to i64
  %113 = sext i32 %93 to i64
  %114 = getelementptr inbounds [310 x [310 x i32]], ptr @a, i64 0, i64 %112, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %102 to i64
  %117 = sext i32 %111 to i64
  %118 = getelementptr inbounds [310 x [310 x i32]], ptr @b, i64 0, i64 %116, i64 %117
  store i32 %115, ptr %118, align 4, !tbaa !5
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge73, label %.lr.ph72, !llvm.loop !22

119:                                              ; preds = %79, %70, %59, %46
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %60, %59 ], [ %71, %70 ], [ %80, %79 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge81
  %indvars.iv101 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next102, %._crit_edge81 ]
  br label %121

._crit_edge84:                                    ; preds = %._crit_edge81, %.preheader.us, %.preheader54
  ret i32 0

._crit_edge81:                                    ; preds = %121
  %120 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
  br i1 %exitcond105.not, label %._crit_edge84, label %.preheader, !llvm.loop !13

121:                                              ; preds = %.preheader, %121
  %indvars.iv96 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next97, %121 ]
  %122 = getelementptr inbounds [310 x [310 x i32]], ptr @b, i64 0, i64 %indvars.iv101, i64 %indvars.iv96
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %123)
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
  br i1 %exitcond100.not, label %._crit_edge81, label %121, !llvm.loop !23
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__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 #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiRiESt4pairINSt25__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 #5

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

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

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

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


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