; LLVM IR from eyangch/competitive-programming :: AtCoder/arc123 (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::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" }

@N = external dso_local global i64, align 8
@A = external dso_local global [200000 x i64], align 16
@B = external dso_local global [200000 x i64], align 16
@C = external dso_local global [200000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %24 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %25 = getelementptr i8, ptr %24, i64 -24
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %26
  %28 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %27, ptr noundef null)
  %29 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %31

31:                                               ; preds = %40, %0
  %32 = load i64, ptr %2, align 8, !tbaa !8
  %33 = load i64, ptr @N, align 8, !tbaa !8
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %43

36:                                               ; preds = %31
  %37 = load i64, ptr %2, align 8, !tbaa !8
  %38 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %38)
  br label %40

40:                                               ; preds = %36
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = add nsw i64 %41, 1
  store i64 %42, ptr %2, align 8, !tbaa !8
  br label %31, !llvm.loop !11

43:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %44

44:                                               ; preds = %104, %43
  %45 = load i64, ptr %13, align 8, !tbaa !8
  %46 = load i64, ptr @N, align 8, !tbaa !8
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %107

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %50 = load i64, ptr %13, align 8, !tbaa !8
  %51 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = load i64, ptr %11, align 8, !tbaa !8
  %54 = sub nsw i64 %52, %53
  %55 = load i64, ptr %12, align 8, !tbaa !8
  %56 = add nsw i64 %54, %55
  store i64 %56, ptr %14, align 8, !tbaa !8
  %57 = load i64, ptr %14, align 8, !tbaa !8
  %58 = icmp sge i64 %57, 0
  br i1 %58, label %59, label %63

59:                                               ; preds = %49
  %60 = load i64, ptr %14, align 8, !tbaa !8
  %61 = load i64, ptr %11, align 8, !tbaa !8
  %62 = add nsw i64 %61, %60
  store i64 %62, ptr %11, align 8, !tbaa !8
  br label %67

63:                                               ; preds = %49
  %64 = load i64, ptr %14, align 8, !tbaa !8
  %65 = load i64, ptr %12, align 8, !tbaa !8
  %66 = sub nsw i64 %65, %64
  store i64 %66, ptr %12, align 8, !tbaa !8
  br label %67

67:                                               ; preds = %63, %59
  %68 = load i64, ptr %11, align 8, !tbaa !8
  %69 = load i64, ptr %13, align 8, !tbaa !8
  %70 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %69
  store i64 %68, ptr %70, align 8, !tbaa !8
  %71 = load i64, ptr %12, align 8, !tbaa !8
  %72 = load i64, ptr %13, align 8, !tbaa !8
  %73 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %72
  store i64 %71, ptr %73, align 8, !tbaa !8
  %74 = load i64, ptr %11, align 8, !tbaa !8
  %75 = icmp sge i64 %74, 0
  br i1 %75, label %76, label %82

76:                                               ; preds = %67
  %77 = load i64, ptr %11, align 8, !tbaa !8
  %78 = load i64, ptr %3, align 8, !tbaa !8
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %3, align 8, !tbaa !8
  %80 = load i64, ptr %7, align 8, !tbaa !8
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %7, align 8, !tbaa !8
  br label %88

82:                                               ; preds = %67
  %83 = load i64, ptr %11, align 8, !tbaa !8
  %84 = load i64, ptr %4, align 8, !tbaa !8
  %85 = add nsw i64 %84, %83
  store i64 %85, ptr %4, align 8, !tbaa !8
  %86 = load i64, ptr %8, align 8, !tbaa !8
  %87 = add nsw i64 %86, 1
  store i64 %87, ptr %8, align 8, !tbaa !8
  br label %88

88:                                               ; preds = %82, %76
  %89 = load i64, ptr %12, align 8, !tbaa !8
  %90 = icmp sge i64 %89, 0
  br i1 %90, label %91, label %97

91:                                               ; preds = %88
  %92 = load i64, ptr %12, align 8, !tbaa !8
  %93 = load i64, ptr %5, align 8, !tbaa !8
  %94 = add nsw i64 %93, %92
  store i64 %94, ptr %5, align 8, !tbaa !8
  %95 = load i64, ptr %9, align 8, !tbaa !8
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %9, align 8, !tbaa !8
  br label %103

97:                                               ; preds = %88
  %98 = load i64, ptr %12, align 8, !tbaa !8
  %99 = load i64, ptr %6, align 8, !tbaa !8
  %100 = add nsw i64 %99, %98
  store i64 %100, ptr %6, align 8, !tbaa !8
  %101 = load i64, ptr %10, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %10, align 8, !tbaa !8
  br label %103

103:                                              ; preds = %97, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %104

104:                                              ; preds = %103
  %105 = load i64, ptr %13, align 8, !tbaa !8
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %13, align 8, !tbaa !8
  br label %44, !llvm.loop !13

107:                                              ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 9223372036854775807, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !8
  br label %108

108:                                              ; preds = %208, %107
  %109 = load i64, ptr %16, align 8, !tbaa !8
  %110 = load i64, ptr @N, align 8, !tbaa !8
  %111 = icmp slt i64 %109, %110
  br i1 %111, label %116, label %112

112:                                              ; preds = %108
  %113 = load i64, ptr %17, align 8, !tbaa !8
  %114 = load i64, ptr @N, align 8, !tbaa !8
  %115 = icmp slt i64 %113, %114
  br label %116

116:                                              ; preds = %112, %108
  %117 = phi i1 [ true, %108 ], [ %115, %112 ]
  br i1 %117, label %118, label %218

118:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store i64 9223372036854775807, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 9223372036854775807, ptr %20, align 8, !tbaa !8
  %119 = load i64, ptr %16, align 8, !tbaa !8
  %120 = load i64, ptr @N, align 8, !tbaa !8
  %121 = icmp slt i64 %119, %120
  br i1 %121, label %122, label %126

122:                                              ; preds = %118
  %123 = load i64, ptr %16, align 8, !tbaa !8
  %124 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !8
  store i64 %125, ptr %19, align 8, !tbaa !8
  br label %126

126:                                              ; preds = %122, %118
  %127 = load i64, ptr %17, align 8, !tbaa !8
  %128 = load i64, ptr @N, align 8, !tbaa !8
  %129 = icmp slt i64 %127, %128
  br i1 %129, label %130, label %134

130:                                              ; preds = %126
  %131 = load i64, ptr %17, align 8, !tbaa !8
  %132 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !8
  store i64 %133, ptr %20, align 8, !tbaa !8
  br label %134

134:                                              ; preds = %130, %126
  %135 = load i64, ptr %19, align 8, !tbaa !8
  %136 = load i64, ptr %20, align 8, !tbaa !8
  %137 = icmp slt i64 %135, %136
  br i1 %137, label %138, label %173

138:                                              ; preds = %134
  %139 = load i64, ptr %19, align 8, !tbaa !8
  %140 = icmp sge i64 %139, 0
  br i1 %140, label %141, label %170

141:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %142 = load i64, ptr %19, align 8, !tbaa !8
  %143 = load i64, ptr %18, align 8, !tbaa !8
  %144 = sub nsw i64 %142, %143
  store i64 %144, ptr %21, align 8, !tbaa !8
  %145 = load i64, ptr %19, align 8, !tbaa !8
  store i64 %145, ptr %18, align 8, !tbaa !8
  %146 = load i64, ptr %7, align 8, !tbaa !8
  %147 = load i64, ptr %21, align 8, !tbaa !8
  %148 = mul nsw i64 %146, %147
  %149 = load i64, ptr %3, align 8, !tbaa !8
  %150 = sub nsw i64 %149, %148
  store i64 %150, ptr %3, align 8, !tbaa !8
  %151 = load i64, ptr %9, align 8, !tbaa !8
  %152 = load i64, ptr %21, align 8, !tbaa !8
  %153 = mul nsw i64 %151, %152
  %154 = load i64, ptr %5, align 8, !tbaa !8
  %155 = sub nsw i64 %154, %153
  store i64 %155, ptr %5, align 8, !tbaa !8
  %156 = load i64, ptr %8, align 8, !tbaa !8
  %157 = load i64, ptr %21, align 8, !tbaa !8
  %158 = mul nsw i64 %156, %157
  %159 = load i64, ptr %4, align 8, !tbaa !8
  %160 = add nsw i64 %159, %158
  store i64 %160, ptr %4, align 8, !tbaa !8
  %161 = load i64, ptr %10, align 8, !tbaa !8
  %162 = load i64, ptr %21, align 8, !tbaa !8
  %163 = mul nsw i64 %161, %162
  %164 = load i64, ptr %6, align 8, !tbaa !8
  %165 = add nsw i64 %164, %163
  store i64 %165, ptr %6, align 8, !tbaa !8
  %166 = load i64, ptr %7, align 8, !tbaa !8
  %167 = add nsw i64 %166, -1
  store i64 %167, ptr %7, align 8, !tbaa !8
  %168 = load i64, ptr %8, align 8, !tbaa !8
  %169 = add nsw i64 %168, 1
  store i64 %169, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %170

170:                                              ; preds = %141, %138
  %171 = load i64, ptr %16, align 8, !tbaa !8
  %172 = add nsw i64 %171, 1
  store i64 %172, ptr %16, align 8, !tbaa !8
  br label %208

173:                                              ; preds = %134
  %174 = load i64, ptr %20, align 8, !tbaa !8
  %175 = icmp sge i64 %174, 0
  br i1 %175, label %176, label %205

176:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %177 = load i64, ptr %20, align 8, !tbaa !8
  %178 = load i64, ptr %18, align 8, !tbaa !8
  %179 = sub nsw i64 %177, %178
  store i64 %179, ptr %22, align 8, !tbaa !8
  %180 = load i64, ptr %20, align 8, !tbaa !8
  store i64 %180, ptr %18, align 8, !tbaa !8
  %181 = load i64, ptr %7, align 8, !tbaa !8
  %182 = load i64, ptr %22, align 8, !tbaa !8
  %183 = mul nsw i64 %181, %182
  %184 = load i64, ptr %3, align 8, !tbaa !8
  %185 = sub nsw i64 %184, %183
  store i64 %185, ptr %3, align 8, !tbaa !8
  %186 = load i64, ptr %9, align 8, !tbaa !8
  %187 = load i64, ptr %22, align 8, !tbaa !8
  %188 = mul nsw i64 %186, %187
  %189 = load i64, ptr %5, align 8, !tbaa !8
  %190 = sub nsw i64 %189, %188
  store i64 %190, ptr %5, align 8, !tbaa !8
  %191 = load i64, ptr %8, align 8, !tbaa !8
  %192 = load i64, ptr %22, align 8, !tbaa !8
  %193 = mul nsw i64 %191, %192
  %194 = load i64, ptr %4, align 8, !tbaa !8
  %195 = add nsw i64 %194, %193
  store i64 %195, ptr %4, align 8, !tbaa !8
  %196 = load i64, ptr %10, align 8, !tbaa !8
  %197 = load i64, ptr %22, align 8, !tbaa !8
  %198 = mul nsw i64 %196, %197
  %199 = load i64, ptr %6, align 8, !tbaa !8
  %200 = add nsw i64 %199, %198
  store i64 %200, ptr %6, align 8, !tbaa !8
  %201 = load i64, ptr %9, align 8, !tbaa !8
  %202 = add nsw i64 %201, -1
  store i64 %202, ptr %9, align 8, !tbaa !8
  %203 = load i64, ptr %10, align 8, !tbaa !8
  %204 = add nsw i64 %203, 1
  store i64 %204, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %205

205:                                              ; preds = %176, %173
  %206 = load i64, ptr %17, align 8, !tbaa !8
  %207 = add nsw i64 %206, 1
  store i64 %207, ptr %17, align 8, !tbaa !8
  br label %208

208:                                              ; preds = %205, %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %209 = load i64, ptr %3, align 8, !tbaa !8
  %210 = load i64, ptr %5, align 8, !tbaa !8
  %211 = add nsw i64 %209, %210
  %212 = load i64, ptr %4, align 8, !tbaa !8
  %213 = add nsw i64 %211, %212
  %214 = load i64, ptr %6, align 8, !tbaa !8
  %215 = add nsw i64 %213, %214
  store i64 %215, ptr %23, align 8, !tbaa !8
  %216 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %217 = load i64, ptr %216, align 8, !tbaa !8
  store i64 %217, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %108, !llvm.loop !14

218:                                              ; preds = %116
  %219 = load i64, ptr %15, align 8, !tbaa !8
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %219)
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %220, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  %222 = load i32, ptr %1, align 4
  ret i32 %222
}

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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

@N = external dso_local global i64, align 8
@A = external dso_local global [200000 x i64], align 16
@B = external dso_local local_unnamed_addr global [200000 x i64], align 16
@C = external dso_local local_unnamed_addr global [200000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = 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) @N)
  %10 = load i64, ptr @N, align 8
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge.thread

.preheader:                                       ; preds = %.lr.ph
  %12 = icmp sgt i64 %16, 0
  br i1 %12, label %.lr.ph159, label %._crit_edge.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.0151 = phi i64 [ %15, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.0151
  %14 = 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) %13)
  %15 = add nuw nsw i64 %.0151, 1
  %16 = load i64, ptr @N, align 8
  %17 = icmp slt i64 %15, %16
  br i1 %17, label %.lr.ph, label %.preheader, !llvm.loop !8

._crit_edge.thread:                               ; preds = %.preheader, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 9223372036854775807, ptr %1, align 8, !tbaa !10
  br label %._crit_edge181

._crit_edge:                                      ; preds = %.lr.ph159
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 9223372036854775807, ptr %1, align 8, !tbaa !10
  br i1 %12, label %.lr.ph180, label %._crit_edge181

.lr.ph159:                                        ; preds = %.preheader, %.lr.ph159
  %.082158 = phi i64 [ %27, %.lr.ph159 ], [ 0, %.preheader ]
  %.099157 = phi i64 [ %28, %.lr.ph159 ], [ 0, %.preheader ]
  %.0100156 = phi i64 [ %.1101, %.lr.ph159 ], [ 0, %.preheader ]
  %.0102155 = phi i64 [ %.1103, %.lr.ph159 ], [ 0, %.preheader ]
  %.0130152 = phi i64 [ %29, %.lr.ph159 ], [ 0, %.preheader ]
  %18 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.099157
  %19 = load i64, ptr %18, align 8, !tbaa !10
  %20 = sub nsw i64 %19, %.0102155
  %21 = add nsw i64 %20, %.0100156
  %22 = icmp sgt i64 %21, -1
  %23 = add i64 %19, %.0100156
  %24 = sub i64 0, %20
  %.1103 = select i1 %22, i64 %23, i64 %.0102155
  %.1101 = select i1 %22, i64 %.0100156, i64 %24
  %25 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %.099157
  store i64 %.1103, ptr %25, align 8, !tbaa !10
  %26 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.099157
  store i64 %.1101, ptr %26, align 8, !tbaa !10
  %27 = add nuw nsw i64 %.1103, %.082158
  %28 = add nuw nsw i64 %.099157, 1
  %29 = add nuw nsw i64 %.1101, %.0130152
  %exitcond.not = icmp eq i64 %28, %16
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph159, !llvm.loop !13

.lr.ph180:                                        ; preds = %._crit_edge, %72
  %30 = phi i1 [ %80, %72 ], [ true, %._crit_edge ]
  %31 = phi i1 [ %79, %72 ], [ true, %._crit_edge ]
  %.2178 = phi i64 [ %.5, %72 ], [ %27, %._crit_edge ]
  %.085177 = phi i64 [ %.388, %72 ], [ 0, %._crit_edge ]
  %.089174 = phi i64 [ %.190, %72 ], [ 0, %._crit_edge ]
  %.091171 = phi i64 [ %.192, %72 ], [ 0, %._crit_edge ]
  %.295170 = phi i64 [ %.598, %72 ], [ 0, %._crit_edge ]
  %.2106169 = phi i64 [ %.4108, %72 ], [ 0, %._crit_edge ]
  %.2111168 = phi i64 [ %.4113, %72 ], [ %16, %._crit_edge ]
  %.2116167 = phi i64 [ %.4118, %72 ], [ 0, %._crit_edge ]
  %.2121166 = phi i64 [ %.4123, %72 ], [ %16, %._crit_edge ]
  %.2126165 = phi i64 [ %.5129, %72 ], [ 0, %._crit_edge ]
  %.2132164 = phi i64 [ %.5135, %72 ], [ %29, %._crit_edge ]
  br i1 %31, label %32, label %.thread143

32:                                               ; preds = %.lr.ph180
  %33 = getelementptr inbounds [200000 x i64], ptr @B, i64 0, i64 %.091171
  %34 = load i64, ptr %33, align 8, !tbaa !10
  br i1 %30, label %37, label %.thread

.thread143:                                       ; preds = %.lr.ph180
  br i1 %30, label %.thread149, label %.thread140

.thread149:                                       ; preds = %.thread143
  %35 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.089174
  %36 = load i64, ptr %35, align 8, !tbaa !10
  br label %57

37:                                               ; preds = %32
  %38 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.089174
  %39 = load i64, ptr %38, align 8, !tbaa !10
  %40 = icmp slt i64 %34, %39
  br i1 %40, label %41, label %57

.thread:                                          ; preds = %32
  %.not = icmp eq i64 %34, 9223372036854775807
  br i1 %.not, label %.thread140, label %41

41:                                               ; preds = %.thread, %37
  %42 = icmp sgt i64 %34, -1
  br i1 %42, label %43, label %55

43:                                               ; preds = %41
  %44 = sub nsw i64 %34, %.085177
  %45 = mul nsw i64 %44, %.2121166
  %46 = sub nsw i64 %.2178, %45
  %47 = mul nsw i64 %44, %.2111168
  %48 = sub nsw i64 %.2132164, %47
  %49 = mul nsw i64 %44, %.2116167
  %50 = add nsw i64 %49, %.295170
  %51 = mul nsw i64 %44, %.2106169
  %52 = add nsw i64 %51, %.2126165
  %53 = add nsw i64 %.2121166, -1
  %54 = add nsw i64 %.2116167, 1
  br label %55

55:                                               ; preds = %43, %41
  %.3133 = phi i64 [ %48, %43 ], [ %.2132164, %41 ]
  %.3127 = phi i64 [ %52, %43 ], [ %.2126165, %41 ]
  %.3122 = phi i64 [ %53, %43 ], [ %.2121166, %41 ]
  %.3117 = phi i64 [ %54, %43 ], [ %.2116167, %41 ]
  %.396 = phi i64 [ %50, %43 ], [ %.295170, %41 ]
  %.186 = phi i64 [ %34, %43 ], [ %.085177, %41 ]
  %.3 = phi i64 [ %46, %43 ], [ %.2178, %41 ]
  %56 = add nsw i64 %.091171, 1
  br label %72

57:                                               ; preds = %.thread149, %37
  %.083139 = phi i64 [ %39, %37 ], [ %36, %.thread149 ]
  %58 = icmp sgt i64 %.083139, -1
  br i1 %58, label %.thread140, label %70

.thread140:                                       ; preds = %.thread143, %.thread, %57
  %.083139142 = phi i64 [ %.083139, %57 ], [ 9223372036854775807, %.thread ], [ 9223372036854775807, %.thread143 ]
  %59 = sub nsw i64 %.083139142, %.085177
  %60 = mul nsw i64 %59, %.2121166
  %61 = sub nsw i64 %.2178, %60
  %62 = mul nsw i64 %59, %.2111168
  %63 = sub nsw i64 %.2132164, %62
  %64 = mul nsw i64 %59, %.2116167
  %65 = add nsw i64 %64, %.295170
  %66 = mul nsw i64 %59, %.2106169
  %67 = add nsw i64 %66, %.2126165
  %68 = add nsw i64 %.2111168, -1
  %69 = add nsw i64 %.2106169, 1
  br label %70

70:                                               ; preds = %.thread140, %57
  %.4134 = phi i64 [ %63, %.thread140 ], [ %.2132164, %57 ]
  %.4128 = phi i64 [ %67, %.thread140 ], [ %.2126165, %57 ]
  %.3112 = phi i64 [ %68, %.thread140 ], [ %.2111168, %57 ]
  %.3107 = phi i64 [ %69, %.thread140 ], [ %.2106169, %57 ]
  %.497 = phi i64 [ %65, %.thread140 ], [ %.295170, %57 ]
  %.287 = phi i64 [ %.083139142, %.thread140 ], [ %.085177, %57 ]
  %.4 = phi i64 [ %61, %.thread140 ], [ %.2178, %57 ]
  %71 = add nsw i64 %.089174, 1
  br label %72

72:                                               ; preds = %70, %55
  %.5135 = phi i64 [ %.3133, %55 ], [ %.4134, %70 ]
  %.5129 = phi i64 [ %.3127, %55 ], [ %.4128, %70 ]
  %.4123 = phi i64 [ %.3122, %55 ], [ %.2121166, %70 ]
  %.4118 = phi i64 [ %.3117, %55 ], [ %.2116167, %70 ]
  %.4113 = phi i64 [ %.2111168, %55 ], [ %.3112, %70 ]
  %.4108 = phi i64 [ %.2106169, %55 ], [ %.3107, %70 ]
  %.598 = phi i64 [ %.396, %55 ], [ %.497, %70 ]
  %.192 = phi i64 [ %56, %55 ], [ %.091171, %70 ]
  %.190 = phi i64 [ %.089174, %55 ], [ %71, %70 ]
  %.388 = phi i64 [ %.186, %55 ], [ %.287, %70 ]
  %.5 = phi i64 [ %.3, %55 ], [ %.4, %70 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %73 = add i64 %.5129, %.5135
  %74 = add i64 %73, %.598
  %75 = add i64 %74, %.5
  store i64 %75, ptr %2, align 8, !tbaa !10
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %77 = load i64, ptr %76, align 8, !tbaa !10
  store i64 %77, ptr %1, align 8, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %78 = load i64, ptr @N, align 8
  %79 = icmp slt i64 %.192, %78
  %80 = icmp slt i64 %.190, %78
  %81 = select i1 %79, i1 true, i1 %80
  br i1 %81, label %.lr.ph180, label %._crit_edge181, !llvm.loop !14

._crit_edge181:                                   ; preds = %72, %._crit_edge.thread, %._crit_edge
  %82 = phi i64 [ 9223372036854775807, %._crit_edge ], [ 9223372036854775807, %._crit_edge.thread ], [ %77, %72 ]
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %82)
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %83, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0
}

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}


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