; LLVM IR from kazunetakahashi/atcoder :: 201610_12/1218_ARC066 (E2)

; 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" }
%"class.std::initializer_list" = type { ptr, i64 }

@N = external dso_local global i32, align 4
@A = external dso_local global [100010 x i64], align 16
@op = external dso_local global [100010 x i8], align 16
@dp = external dso_local global [100010 x [3 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 i32, align 4
  %3 = alloca i8, align 1
  %4 = alloca i32, align 4
  %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 %"class.std::initializer_list", align 8
  %14 = alloca [3 x i64], align 8
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %40, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @N, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %43

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %23
  %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) %24)
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @N, align 4, !tbaa !5
  %28 = sub nsw i32 %27, 1
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %30, label %39

30:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #6
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %32 = load i8, ptr %3, align 1, !tbaa !9
  %33 = sext i8 %32 to i32
  %34 = icmp eq i32 %33, 43
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100010 x i8], ptr @op, i64 0, i64 %36
  %38 = zext i1 %34 to i8
  store i8 %38, ptr %37, align 1, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  br label %39

39:                                               ; preds = %30, %21
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !12

43:                                               ; preds = %20
  %44 = load i64, ptr @A, align 16, !tbaa !14
  store i64 %44, ptr @dp, align 16, !tbaa !14
  store i64 -1000000000000000, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !14
  store i64 -1000000000000000, ptr getelementptr inbounds ([3 x i64], ptr @dp, i64 0, i64 2), align 16, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %202, %43
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = load i32, ptr @N, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %205

50:                                               ; preds = %45
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sub nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100010 x i8], ptr @op, i64 0, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !10, !range !16, !noundef !17
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %116

57:                                               ; preds = %50
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %60
  %62 = getelementptr inbounds [3 x i64], ptr %61, i64 0, i64 2
  %63 = load i64, ptr %62, align 8, !tbaa !14
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !14
  %68 = add nsw i64 %63, %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %70
  %72 = getelementptr inbounds [3 x i64], ptr %71, i64 0, i64 2
  store i64 %68, ptr %72, align 8, !tbaa !14
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %75
  %77 = getelementptr inbounds [3 x i64], ptr %76, i64 0, i64 1
  %78 = load i64, ptr %77, align 8, !tbaa !14
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !14
  %83 = sub nsw i64 %78, %82
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %85
  %87 = getelementptr inbounds [3 x i64], ptr %86, i64 0, i64 1
  store i64 %83, ptr %87, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = sub nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %90
  %92 = getelementptr inbounds [3 x i64], ptr %91, i64 0, i64 1
  %93 = load i64, ptr %92, align 8, !tbaa !14
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !14
  %98 = sub nsw i64 %93, %97
  store i64 %98, ptr %5, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %101
  %103 = getelementptr inbounds [3 x i64], ptr %102, i64 0, i64 0
  %104 = load i64, ptr %103, align 8, !tbaa !14
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !14
  %109 = add nsw i64 %104, %108
  store i64 %109, ptr %6, align 8, !tbaa !14
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %111 = load i64, ptr %110, align 8, !tbaa !14
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %113
  %115 = getelementptr inbounds [3 x i64], ptr %114, i64 0, i64 0
  store i64 %111, ptr %115, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %201

116:                                              ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %119
  %121 = getelementptr inbounds [3 x i64], ptr %120, i64 0, i64 2
  %122 = load i64, ptr %121, align 8, !tbaa !14
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %124
  %126 = load i64, ptr %125, align 8, !tbaa !14
  %127 = add nsw i64 %122, %126
  store i64 %127, ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %130
  %132 = getelementptr inbounds [3 x i64], ptr %131, i64 0, i64 1
  %133 = load i64, ptr %132, align 8, !tbaa !14
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !14
  %138 = add nsw i64 %133, %137
  store i64 %138, ptr %8, align 8, !tbaa !14
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %140 = load i64, ptr %139, align 8, !tbaa !14
  %141 = load i32, ptr %4, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %142
  %144 = getelementptr inbounds [3 x i64], ptr %143, i64 0, i64 2
  store i64 %140, ptr %144, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %147
  %149 = getelementptr inbounds [3 x i64], ptr %148, i64 0, i64 1
  %150 = load i64, ptr %149, align 8, !tbaa !14
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !14
  %155 = add nsw i64 %150, %154
  store i64 %155, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %156 = load i32, ptr %4, align 4, !tbaa !5
  %157 = sub nsw i32 %156, 1
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %158
  %160 = getelementptr inbounds [3 x i64], ptr %159, i64 0, i64 0
  %161 = load i64, ptr %160, align 8, !tbaa !14
  %162 = load i32, ptr %4, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !14
  %166 = sub nsw i64 %161, %165
  store i64 %166, ptr %10, align 8, !tbaa !14
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %168 = load i64, ptr %167, align 8, !tbaa !14
  %169 = load i32, ptr %4, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %170
  %172 = getelementptr inbounds [3 x i64], ptr %171, i64 0, i64 1
  store i64 %168, ptr %172, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %173 = load i32, ptr %4, align 4, !tbaa !5
  %174 = sub nsw i32 %173, 1
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %175
  %177 = getelementptr inbounds [3 x i64], ptr %176, i64 0, i64 1
  %178 = load i64, ptr %177, align 8, !tbaa !14
  %179 = load i32, ptr %4, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %180
  %182 = load i64, ptr %181, align 8, !tbaa !14
  %183 = add nsw i64 %178, %182
  store i64 %183, ptr %11, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %184 = load i32, ptr %4, align 4, !tbaa !5
  %185 = sub nsw i32 %184, 1
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %186
  %188 = getelementptr inbounds [3 x i64], ptr %187, i64 0, i64 0
  %189 = load i64, ptr %188, align 8, !tbaa !14
  %190 = load i32, ptr %4, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %191
  %193 = load i64, ptr %192, align 8, !tbaa !14
  %194 = sub nsw i64 %189, %193
  store i64 %194, ptr %12, align 8, !tbaa !14
  %195 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %196 = load i64, ptr %195, align 8, !tbaa !14
  %197 = load i32, ptr %4, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %198
  %200 = getelementptr inbounds [3 x i64], ptr %199, i64 0, i64 0
  store i64 %196, ptr %200, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %201

201:                                              ; preds = %116, %57
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %4, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %4, align 4, !tbaa !5
  br label %45, !llvm.loop !18

205:                                              ; preds = %49
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  %206 = load i32, ptr @N, align 4, !tbaa !5
  %207 = sub nsw i32 %206, 1
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %208
  %210 = getelementptr inbounds [3 x i64], ptr %209, i64 0, i64 0
  %211 = load i64, ptr %210, align 8, !tbaa !14
  store i64 %211, ptr %14, align 8, !tbaa !14
  %212 = getelementptr inbounds i64, ptr %14, i64 1
  %213 = load i32, ptr @N, align 4, !tbaa !5
  %214 = sub nsw i32 %213, 1
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %215
  %217 = getelementptr inbounds [3 x i64], ptr %216, i64 0, i64 1
  %218 = load i64, ptr %217, align 8, !tbaa !14
  store i64 %218, ptr %212, align 8, !tbaa !14
  %219 = getelementptr inbounds i64, ptr %14, i64 2
  %220 = load i32, ptr @N, align 4, !tbaa !5
  %221 = sub nsw i32 %220, 1
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %222
  %224 = getelementptr inbounds [3 x i64], ptr %223, i64 0, i64 2
  %225 = load i64, ptr %224, align 8, !tbaa !14
  store i64 %225, ptr %219, align 8, !tbaa !14
  %226 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 0
  store ptr %14, ptr %226, align 8, !tbaa !19
  %227 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 1
  store i64 3, ptr %227, align 8, !tbaa !23
  %228 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %229 = load ptr, ptr %228, align 8
  %230 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %231 = load i64, ptr %230, align 8
  %232 = call noundef i64 @_ZSt3maxIxET_St16initializer_listIS0_E(ptr %229, i64 %231)
  %233 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %232)
  %234 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %233, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  %235 = load i32, ptr %1, align 4
  ret i32 %235
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #1

; 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 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; 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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt3maxIxET_St16initializer_listIS0_E(ptr, i64) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #5

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 = { 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 = { 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 #5 = { 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 #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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"bool", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !13}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTSSt16initializer_listIxE", !21, i64 0, !22, i64 8}
!21 = !{!"any pointer", !7, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!20, !22, i64 8}


; 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 i32, align 4
@A = external dso_local global [100010 x i64], align 16
@op = external dso_local local_unnamed_addr global [100010 x i8], align 16
@dp = external dso_local local_unnamed_addr global [100010 x [3 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 i8, align 1
  %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 [3 x i64], align 16
  %11 = 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) @N)
  %12 = load i32, ptr @N, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  %14 = load i64, ptr @A, align 16, !tbaa !9
  store i64 %14, ptr @dp, align 16, !tbaa !9
  store i64 -1000000000000000, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !9
  store i64 -1000000000000000, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !9
  br label %._crit_edge40

._crit_edge:                                      ; preds = %29
  %15 = load i64, ptr @A, align 16, !tbaa !9
  store i64 %15, ptr @dp, align 16, !tbaa !9
  store i64 -1000000000000000, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !9
  store i64 -1000000000000000, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !9
  %16 = icmp sgt i32 %30, 1
  br i1 %16, label %.lr.ph39, label %._crit_edge40

.lr.ph:                                           ; preds = %0, %29
  %indvars.iv = phi i64 [ %indvars.iv.next, %29 ], [ 0, %0 ]
  %17 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %19 = load i32, ptr @N, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv, %21
  br i1 %22, label %23, label %29

23:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #6
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %1)
  %25 = load i8, ptr %1, align 1, !tbaa !11
  %26 = icmp eq i8 %25, 43
  %27 = getelementptr inbounds [100010 x i8], ptr @op, i64 0, i64 %indvars.iv
  %28 = zext i1 %26 to i8
  store i8 %28, ptr %27, align 1, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #6
  %.pre = load i32, ptr @N, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %.lr.ph, %23
  %30 = phi i32 [ %19, %.lr.ph ], [ %.pre, %23 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = sext i32 %30 to i64
  %32 = icmp slt i64 %indvars.iv.next, %31
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge40:                                    ; preds = %93, %._crit_edge.thread, %._crit_edge
  %.lcssa = phi i32 [ %30, %._crit_edge ], [ %12, %._crit_edge.thread ], [ %94, %93 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  %33 = add nsw i32 %.lcssa, -1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %34
  %36 = load <2 x i64>, ptr %35, align 8, !tbaa !9
  store <2 x i64> %36, ptr %10, align 16, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %10, i64 16
  %38 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %34, i64 2
  %39 = load i64, ptr %38, align 8, !tbaa !9
  store i64 %39, ptr %37, align 16, !tbaa !9
  %40 = call noundef i64 @_ZSt3maxIxET_St16initializer_listIS0_E(ptr nonnull %10, i64 3)
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %40)
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  ret i32 0

.lr.ph39:                                         ; preds = %._crit_edge, %93
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %93 ], [ 1, %._crit_edge ]
  %43 = add nsw i64 %indvars.iv43, -1
  %44 = getelementptr inbounds [100010 x i8], ptr @op, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !12, !range !16, !noundef !17
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %47, label %64

47:                                               ; preds = %.lr.ph39
  %48 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %43
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv43
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = add nsw i64 %52, %50
  %54 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %indvars.iv43
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  store i64 %53, ptr %55, align 8, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %48, i64 8
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = sub nsw i64 %57, %52
  %59 = getelementptr inbounds i8, ptr %54, i64 8
  store i64 %58, ptr %59, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 %58, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %60 = load i64, ptr %48, align 8, !tbaa !9
  %61 = add nsw i64 %60, %52
  store i64 %61, ptr %3, align 8, !tbaa !9
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %63 = load i64, ptr %62, align 8, !tbaa !9
  store i64 %63, ptr %54, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %93

64:                                               ; preds = %.lr.ph39
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %65 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %43
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv43
  %69 = load i64, ptr %68, align 8, !tbaa !9
  %70 = add nsw i64 %69, %67
  store i64 %70, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %71 = getelementptr inbounds i8, ptr %65, i64 8
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = add nsw i64 %72, %69
  store i64 %73, ptr %5, align 8, !tbaa !9
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds [100010 x [3 x i64]], ptr @dp, i64 0, i64 %indvars.iv43
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  store i64 %75, ptr %77, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %78 = load i64, ptr %71, align 8, !tbaa !9
  %79 = load i64, ptr %68, align 8, !tbaa !9
  %80 = add nsw i64 %79, %78
  store i64 %80, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %81 = load i64, ptr %65, align 8, !tbaa !9
  %82 = sub nsw i64 %81, %79
  store i64 %82, ptr %7, align 8, !tbaa !9
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = getelementptr inbounds i8, ptr %76, i64 8
  store i64 %84, ptr %85, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %86 = load i64, ptr %71, align 8, !tbaa !9
  %87 = load i64, ptr %68, align 8, !tbaa !9
  %88 = add nsw i64 %87, %86
  store i64 %88, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %89 = load i64, ptr %65, align 8, !tbaa !9
  %90 = sub nsw i64 %89, %87
  store i64 %90, ptr %9, align 8, !tbaa !9
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %92 = load i64, ptr %91, align 8, !tbaa !9
  store i64 %92, ptr %76, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %93

93:                                               ; preds = %47, %64
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %94 = load i32, ptr @N, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next44, %95
  br i1 %96, label %.lr.ph39, label %._crit_edge40, !llvm.loop !18
}

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 #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 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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

; 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 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; 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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt3maxIxET_St16initializer_listIS0_E(ptr, i64) local_unnamed_addr #5

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

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


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