; LLVM IR from kazunetakahashi/atcoder :: 2018/0304_ABC089 (D)

; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i64 }
%"struct.std::_Head_base.1" = type { i64 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::allocator" = type { i8 }

@V = external dso_local global [100010 x %"class.std::vector"], align 16
@sum = external dso_local global [100010 x %"class.std::vector"], align 16
@H = external dso_local global i64, align 8
@W = external dso_local global i64, align 8
@D = external dso_local global i64, align 8
@A = external dso_local global [310 x [310 x i32]], align 16
@Q = external dso_local global i32, align 4
@L = external dso_local global [100010 x i64], align 16
@R = external dso_local global [100010 x i64], align 16
@P = external dso_local global [100010 x %"class.std::tuple"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z4distSt5tupleIJxxEES0_(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 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 %"class.std::tuple", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::tuple", align 8
  %13 = alloca %"class.std::tuple", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector", align 8
  %16 = alloca i64, align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @H)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) @W)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) @D)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %61, %0
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = load i64, ptr @H, align 8, !tbaa !9
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %64

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

35:                                               ; preds = %57, %34
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = load i64, ptr @W, align 8, !tbaa !9
  %39 = icmp slt i64 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %35
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %60

41:                                               ; preds = %35
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [310 x [310 x i32]], ptr @A, i64 0, i64 %43
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [310 x i32], ptr %44, i64 0, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %47)
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [310 x [310 x i32]], ptr @A, i64 0, i64 %50
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [310 x i32], ptr %51, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr %54, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %41
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %4, align 4, !tbaa !5
  br label %35, !llvm.loop !11

60:                                               ; preds = %40
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %28, !llvm.loop !13

64:                                               ; preds = %33
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %90, %64
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr @Q, align 4, !tbaa !5
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %93

71:                                               ; preds = %66
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %73
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %74)
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %77
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %75, ptr noundef nonnull align 8 dereferenceable(8) %78)
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = add nsw i64 %83, -1
  store i64 %84, ptr %82, align 8, !tbaa !9
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !9
  %89 = add nsw i64 %88, -1
  store i64 %89, ptr %87, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %71
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %5, align 4, !tbaa !5
  br label %66, !llvm.loop !14

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

94:                                               ; preds = %122, %93
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = load i64, ptr @H, align 8, !tbaa !9
  %98 = icmp slt i64 %96, %97
  br i1 %98, label %100, label %99

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

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

101:                                              ; preds = %118, %100
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = load i64, ptr @W, align 8, !tbaa !9
  %105 = icmp slt i64 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %101
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %121

107:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #7
  call void @_ZNSt5tupleIJxxEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7) #7
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [310 x [310 x i32]], ptr @A, i64 0, i64 %109
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [310 x i32], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x %"class.std::tuple"], ptr @P, i64 0, i64 %115
  %117 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJxxEEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %116, ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #7
  br label %118

118:                                              ; preds = %107
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %7, align 4, !tbaa !5
  br label %101, !llvm.loop !15

121:                                              ; preds = %106
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %6, align 4, !tbaa !5
  br label %94, !llvm.loop !16

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

126:                                              ; preds = %162, %125
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = load i64, ptr @D, align 8, !tbaa !9
  %130 = icmp slt i64 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %126
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %165

132:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %133 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %133, ptr %10, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %143, %132
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = load i64, ptr @D, align 8, !tbaa !9
  %138 = add nsw i64 %136, %137
  %139 = load i64, ptr @H, align 8, !tbaa !9
  %140 = load i64, ptr @W, align 8, !tbaa !9
  %141 = mul nsw i64 %139, %140
  %142 = icmp slt i64 %138, %141
  br i1 %142, label %143, label %161

143:                                              ; preds = %134
  %144 = load i32, ptr %9, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100010 x %"class.std::tuple"], ptr @P, i64 0, i64 %148
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 16 %149, i64 16, i1 false)
  %150 = load i32, ptr %10, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = load i64, ptr @D, align 8, !tbaa !9
  %153 = add nsw i64 %151, %152
  %154 = getelementptr inbounds [100010 x %"class.std::tuple"], ptr @P, i64 0, i64 %153
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 16 %154, i64 16, i1 false)
  %155 = call noundef i64 @_Z4distSt5tupleIJxxEES0_(ptr noundef %12, ptr noundef %13)
  store i64 %155, ptr %11, align 8, !tbaa !9
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %146, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %156 = load i64, ptr @D, align 8, !tbaa !9
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = add nsw i64 %158, %156
  %160 = trunc i64 %159 to i32
  store i32 %160, ptr %10, align 4, !tbaa !5
  br label %134, !llvm.loop !17

161:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %9, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %9, align 4, !tbaa !5
  br label %126, !llvm.loop !18

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

166:                                              ; preds = %223, %165
  %167 = load i32, ptr %14, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = load i64, ptr @D, align 8, !tbaa !9
  %170 = icmp slt i64 %168, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %166
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %226

172:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #7
  %173 = load i32, ptr %14, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %174
  %176 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %175) #7
  %177 = add i64 %176, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %177, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %178 unwind label %192

178:                                              ; preds = %172
  %179 = load i32, ptr %14, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @sum, i64 0, i64 %180
  %182 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %181, ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %219, %178
  %184 = load i32, ptr %20, align 4, !tbaa !5
  %185 = load i32, ptr %14, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %186
  %188 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %187) #7
  %189 = trunc i64 %188 to i32
  %190 = icmp slt i32 %184, %189
  br i1 %190, label %196, label %191

191:                                              ; preds = %183
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %222

192:                                              ; preds = %172
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %18, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %19, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %276

196:                                              ; preds = %183
  %197 = load i32, ptr %14, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @sum, i64 0, i64 %198
  %200 = load i32, ptr %20, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %199, i64 noundef %201) #7
  %203 = load i64, ptr %202, align 8, !tbaa !9
  %204 = load i32, ptr %14, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %205
  %207 = load i32, ptr %20, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %206, i64 noundef %208) #7
  %210 = load i64, ptr %209, align 8, !tbaa !9
  %211 = add nsw i64 %203, %210
  %212 = load i32, ptr %14, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @sum, i64 0, i64 %213
  %215 = load i32, ptr %20, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  %217 = sext i32 %216 to i64
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %214, i64 noundef %217) #7
  store i64 %211, ptr %218, align 8, !tbaa !9
  br label %219

219:                                              ; preds = %196
  %220 = load i32, ptr %20, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %20, align 4, !tbaa !5
  br label %183, !llvm.loop !19

222:                                              ; preds = %191
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %14, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %14, align 4, !tbaa !5
  br label %166, !llvm.loop !20

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

227:                                              ; preds = %271, %226
  %228 = load i32, ptr %21, align 4, !tbaa !5
  %229 = load i32, ptr @Q, align 4, !tbaa !5
  %230 = icmp slt i32 %228, %229
  br i1 %230, label %232, label %231

231:                                              ; preds = %227
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %274

232:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %233 = load i32, ptr %21, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %234
  %236 = load i64, ptr %235, align 8, !tbaa !9
  %237 = load i64, ptr @D, align 8, !tbaa !9
  %238 = srem i64 %236, %237
  %239 = trunc i64 %238 to i32
  store i32 %239, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %240 = load i32, ptr %21, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %241
  %243 = load i64, ptr %242, align 8, !tbaa !9
  %244 = load i64, ptr @D, align 8, !tbaa !9
  %245 = sdiv i64 %243, %244
  %246 = trunc i64 %245 to i32
  store i32 %246, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %247 = load i32, ptr %21, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %248
  %250 = load i64, ptr %249, align 8, !tbaa !9
  %251 = load i64, ptr @D, align 8, !tbaa !9
  %252 = sdiv i64 %250, %251
  %253 = trunc i64 %252 to i32
  store i32 %253, ptr %24, align 4, !tbaa !5
  %254 = load i32, ptr %22, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @sum, i64 0, i64 %255
  %257 = load i32, ptr %24, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %256, i64 noundef %258) #7
  %260 = load i64, ptr %259, align 8, !tbaa !9
  %261 = load i32, ptr %22, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @sum, i64 0, i64 %262
  %264 = load i32, ptr %23, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %263, i64 noundef %265) #7
  %267 = load i64, ptr %266, align 8, !tbaa !9
  %268 = sub nsw i64 %260, %267
  %269 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %268)
  %270 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %269, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %271

271:                                              ; preds = %232
  %272 = load i32, ptr %21, align 4, !tbaa !5
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %21, align 4, !tbaa !5
  br label %227, !llvm.loop !21

274:                                              ; preds = %231
  %275 = load i32, ptr %1, align 4
  ret i32 %275

276:                                              ; preds = %192
  %277 = load ptr, ptr %18, align 8
  %278 = load i32, ptr %19, align 4
  %279 = insertvalue { ptr, i32 } poison, ptr %277, 0
  %280 = insertvalue { ptr, i32 } %279, i32 %278, 1
  resume { ptr, i32 } %280
}

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #4

; 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 void @_ZNSt5tupleIJxxEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i64 }
%"struct.std::_Head_base.1" = type { i64 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::allocator" = type { i8 }

@V = external dso_local global [100010 x %"class.std::vector"], align 16
@sum = external dso_local global [100010 x %"class.std::vector"], align 16
@H = external dso_local global i64, align 8
@W = external dso_local global i64, align 8
@D = external dso_local global i64, align 8
@A = external dso_local global [310 x [310 x i32]], align 16
@Q = external dso_local global i32, align 4
@L = external dso_local global [100010 x i64], align 16
@R = external dso_local global [100010 x i64], align 16
@P = external dso_local global [100010 x %"class.std::tuple"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z4distSt5tupleIJxxEES0_(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::tuple", align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::tuple", align 8
  %6 = alloca %"class.std::tuple", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = 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) @H)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) @W)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @D)
  %13 = load i64, ptr @H, align 8, !tbaa !5
  %14 = icmp sgt i64 %13, 0
  %15 = load i64, ptr @W, align 8
  %16 = icmp sgt i64 %15, 0
  %or.cond = select i1 %14, i1 %16, i1 false
  br i1 %or.cond, label %.preheader62, label %._crit_edge65

.preheader62:                                     ; preds = %0, %._crit_edge
  %17 = phi i64 [ %23, %._crit_edge ], [ %13, %0 ]
  %18 = phi i64 [ %24, %._crit_edge ], [ %15, %0 ]
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %._crit_edge ], [ 0, %0 ]
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge65:                                    ; preds = %._crit_edge, %0
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  %21 = load i32, ptr @Q, align 4, !tbaa !9
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph68, label %._crit_edge69

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr @H, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader62
  %23 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %17, %.preheader62 ]
  %24 = phi i64 [ %30, %._crit_edge.loopexit ], [ %18, %.preheader62 ]
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %25 = icmp sgt i64 %23, %indvars.iv.next93
  br i1 %25, label %.preheader62, label %._crit_edge65, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader62, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader62 ]
  %26 = getelementptr inbounds [310 x [310 x i32]], ptr @A, i64 0, i64 %indvars.iv92, i64 %indvars.iv
  %27 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %28 = load i32, ptr %26, align 4, !tbaa !9
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %26, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = load i64, ptr @W, align 8, !tbaa !5
  %31 = icmp sgt i64 %30, %indvars.iv.next
  br i1 %31, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !14

._crit_edge69:                                    ; preds = %.lr.ph68, %._crit_edge65
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !9
  %32 = load i64, ptr @H, align 8, !tbaa !5
  %33 = icmp sgt i64 %32, 0
  %34 = load i64, ptr @W, align 8
  %35 = icmp sgt i64 %34, 0
  %or.cond132 = select i1 %33, i1 %35, i1 false
  br i1 %or.cond132, label %.lr.ph74.split, label %._crit_edge75

.lr.ph68:                                         ; preds = %._crit_edge65, %.lr.ph68
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %.lr.ph68 ], [ 0, %._crit_edge65 ]
  %36 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %indvars.iv95
  %37 = 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) %36)
  %38 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv95
  %39 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 8 dereferenceable(8) %38)
  %40 = load i64, ptr %36, align 8, !tbaa !5
  %41 = add nsw i64 %40, -1
  store i64 %41, ptr %36, align 8, !tbaa !5
  %42 = load i64, ptr %38, align 8, !tbaa !5
  %43 = add nsw i64 %42, -1
  store i64 %43, ptr %38, align 8, !tbaa !5
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %44 = load i32, ptr @Q, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next96, %45
  br i1 %46, label %.lr.ph68, label %._crit_edge69, !llvm.loop !15

._crit_edge75:                                    ; preds = %._crit_edge72, %._crit_edge69
  %47 = phi i64 [ %32, %._crit_edge69 ], [ %54, %._crit_edge72 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %48 = load i64, ptr @D, align 8, !tbaa !5
  %49 = icmp sgt i64 %48, 0
  br i1 %49, label %.preheader61.preheader, label %.preheader

.preheader61.preheader:                           ; preds = %._crit_edge75
  %.pre115 = load i64, ptr @W, align 8, !tbaa !5
  br label %.preheader61

.lr.ph74.split:                                   ; preds = %._crit_edge69, %._crit_edge72
  %50 = phi i64 [ %54, %._crit_edge72 ], [ %32, %._crit_edge69 ]
  %51 = phi i32 [ %57, %._crit_edge72 ], [ 0, %._crit_edge69 ]
  %52 = phi i64 [ %56, %._crit_edge72 ], [ %34, %._crit_edge69 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !9
  %53 = icmp sgt i64 %52, 0
  br i1 %53, label %.lr.ph71, label %._crit_edge72

._crit_edge72.loopexit:                           ; preds = %.lr.ph71
  %.pre113 = load i32, ptr %1, align 4, !tbaa !9
  %.pre114 = load i64, ptr @H, align 8, !tbaa !5
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit, %.lr.ph74.split
  %54 = phi i64 [ %.pre114, %._crit_edge72.loopexit ], [ %50, %.lr.ph74.split ]
  %55 = phi i32 [ %.pre113, %._crit_edge72.loopexit ], [ %51, %.lr.ph74.split ]
  %56 = phi i64 [ %72, %._crit_edge72.loopexit ], [ %52, %.lr.ph74.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %57 = add nsw i32 %55, 1
  store i32 %57, ptr %1, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = icmp sgt i64 %54, %58
  br i1 %59, label %.lr.ph74.split, label %._crit_edge75, !llvm.loop !16

.lr.ph71:                                         ; preds = %.lr.ph74.split, %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @_ZNSt5tupleIJxxEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #7
  %60 = load i32, ptr %1, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = load i32, ptr %2, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [310 x [310 x i32]], ptr @A, i64 0, i64 %61, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100010 x %"class.std::tuple"], ptr @P, i64 0, i64 %66
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJxxEEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %69 = load i32, ptr %2, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %2, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = load i64, ptr @W, align 8, !tbaa !5
  %73 = icmp sgt i64 %72, %71
  br i1 %73, label %.lr.ph71, label %._crit_edge72.loopexit, !llvm.loop !17

.preheader61:                                     ; preds = %.preheader61.preheader, %._crit_edge78
  %74 = phi i64 [ %48, %.preheader61.preheader ], [ %98, %._crit_edge78 ]
  %75 = phi i64 [ %.pre115, %.preheader61.preheader ], [ %99, %._crit_edge78 ]
  %76 = phi i64 [ %47, %.preheader61.preheader ], [ %100, %._crit_edge78 ]
  %indvars.iv101 = phi i64 [ 0, %.preheader61.preheader ], [ %indvars.iv.next102, %._crit_edge78 ]
  %77 = add nsw i64 %74, %indvars.iv101
  %78 = mul nsw i64 %75, %76
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %.lr.ph77, label %._crit_edge78

.lr.ph77:                                         ; preds = %.preheader61
  %80 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %indvars.iv101
  %81 = trunc nuw nsw i64 %indvars.iv101 to i32
  br label %83

.preheader60:                                     ; preds = %._crit_edge78
  %82 = icmp sgt i64 %98, 0
  br i1 %82, label %.lr.ph85, label %.preheader

83:                                               ; preds = %.lr.ph77, %83
  %84 = phi i64 [ %77, %.lr.ph77 ], [ %93, %83 ]
  %85 = phi i64 [ %indvars.iv101, %.lr.ph77 ], [ %92, %83 ]
  %.05276 = phi i32 [ %81, %.lr.ph77 ], [ %91, %83 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %86 = getelementptr inbounds [100010 x %"class.std::tuple"], ptr @P, i64 0, i64 %85
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %86, i64 16, i1 false)
  %87 = getelementptr inbounds [100010 x %"class.std::tuple"], ptr @P, i64 0, i64 %84
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %87, i64 16, i1 false)
  %88 = call noundef i64 @_Z4distSt5tupleIJxxEES0_(ptr noundef nonnull %5, ptr noundef nonnull %6)
  store i64 %88, ptr %4, align 8, !tbaa !5
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %80, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %89 = load i64, ptr @D, align 8, !tbaa !5
  %90 = trunc i64 %89 to i32
  %91 = add i32 %.05276, %90
  %92 = sext i32 %91 to i64
  %93 = add nsw i64 %89, %92
  %94 = load i64, ptr @H, align 8, !tbaa !5
  %95 = load i64, ptr @W, align 8, !tbaa !5
  %96 = mul nsw i64 %95, %94
  %97 = icmp slt i64 %93, %96
  br i1 %97, label %83, label %._crit_edge78, !llvm.loop !18

._crit_edge78:                                    ; preds = %83, %.preheader61
  %98 = phi i64 [ %74, %.preheader61 ], [ %89, %83 ]
  %99 = phi i64 [ %75, %.preheader61 ], [ %95, %83 ]
  %100 = phi i64 [ %76, %.preheader61 ], [ %94, %83 ]
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %101 = icmp sgt i64 %98, %indvars.iv.next102
  br i1 %101, label %.preheader61, label %.preheader60, !llvm.loop !19

.preheader:                                       ; preds = %._crit_edge83, %._crit_edge75, %.preheader60
  %102 = load i32, ptr @Q, align 4, !tbaa !9
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %.lr.ph87, label %._crit_edge88

.lr.ph85:                                         ; preds = %.preheader60, %._crit_edge83
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %._crit_edge83 ], [ 0, %.preheader60 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  %104 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %indvars.iv107
  %105 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  %106 = add i64 %105, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %106, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %107 unwind label %115

107:                                              ; preds = %.lr.ph85
  %108 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @sum, i64 0, i64 %indvars.iv107
  %109 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %108, ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  %110 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  %111 = trunc i64 %110 to i32
  %112 = icmp sgt i32 %111, 0
  br i1 %112, label %.lr.ph82, label %._crit_edge83

._crit_edge83:                                    ; preds = %.lr.ph82, %107
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %113 = load i64, ptr @D, align 8, !tbaa !5
  %114 = icmp sgt i64 %113, %indvars.iv.next108
  br i1 %114, label %.lr.ph85, label %.preheader, !llvm.loop !20

115:                                              ; preds = %.lr.ph85
  %116 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  resume { ptr, i32 } %116

.lr.ph82:                                         ; preds = %107, %.lr.ph82
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %.lr.ph82 ], [ 0, %107 ]
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %indvars.iv104) #7
  %118 = load i64, ptr %117, align 8, !tbaa !5
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %indvars.iv104) #7
  %120 = load i64, ptr %119, align 8, !tbaa !5
  %121 = add nsw i64 %120, %118
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %indvars.iv.next105) #7
  store i64 %121, ptr %122, align 8, !tbaa !5
  %123 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  %sext116 = shl i64 %123, 32
  %124 = ashr exact i64 %sext116, 32
  %125 = icmp slt i64 %indvars.iv.next105, %124
  br i1 %125, label %.lr.ph82, label %._crit_edge83, !llvm.loop !21

._crit_edge88:                                    ; preds = %.lr.ph87, %.preheader
  ret i32 0

.lr.ph87:                                         ; preds = %.preheader, %.lr.ph87
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %.lr.ph87 ], [ 0, %.preheader ]
  %126 = getelementptr inbounds [100010 x i64], ptr @L, i64 0, i64 %indvars.iv110
  %127 = load i64, ptr %126, align 8, !tbaa !5
  %128 = load i64, ptr @D, align 8, !tbaa !5
  %129 = srem i64 %127, %128
  %130 = sdiv i64 %127, %128
  %131 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv110
  %132 = load i64, ptr %131, align 8, !tbaa !5
  %133 = sdiv i64 %132, %128
  %sext = shl i64 %129, 32
  %134 = ashr exact i64 %sext, 32
  %135 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @sum, i64 0, i64 %134
  %sext57 = shl i64 %133, 32
  %136 = ashr exact i64 %sext57, 32
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %135, i64 noundef %136) #7
  %138 = load i64, ptr %137, align 8, !tbaa !5
  %sext58 = shl i64 %130, 32
  %139 = ashr exact i64 %sext58, 32
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %135, i64 noundef %139) #7
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = sub nsw i64 %138, %141
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %142)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %145 = load i32, ptr @Q, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = icmp slt i64 %indvars.iv.next111, %146
  br i1 %147, label %.lr.ph87, label %._crit_edge88, !llvm.loop !22
}

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; 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 void @_ZNSt5tupleIJxxEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

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

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

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


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