; LLVM IR from eyangch/competitive-programming :: Codeforces/1535 (e)

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

@Q = external dso_local global i64, align 8
@a = external dso_local global [300005 x i64], align 16
@c = external dso_local global [300005 x i64], align 16
@p = external dso_local global [300005 x i64], align 16
@up = external dso_local global [22 x [300005 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 i32, align 4
  %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
  store i32 0, ptr %1, align 4
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %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) @c)
  store i64 0, ptr @p, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %27

27:                                               ; preds = %35, %0
  %28 = load i64, ptr %4, align 8, !tbaa !8
  %29 = icmp slt i64 %28, 22
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %38

31:                                               ; preds = %27
  %32 = load i64, ptr %4, align 8, !tbaa !8
  %33 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 %32
  %34 = getelementptr inbounds [300005 x i64], ptr %33, i64 0, i64 0
  store i64 0, ptr %34, align 8, !tbaa !8
  br label %35

35:                                               ; preds = %31
  %36 = load i64, ptr %4, align 8, !tbaa !8
  %37 = add nsw i64 %36, 1
  store i64 %37, ptr %4, align 8, !tbaa !8
  br label %27, !llvm.loop !11

38:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 1, ptr %5, align 8, !tbaa !8
  br label %39

39:                                               ; preds = %178, %38
  %40 = load i64, ptr %5, align 8, !tbaa !8
  %41 = load i64, ptr @Q, align 8, !tbaa !8
  %42 = icmp sle i64 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %181

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %46 = load i64, ptr %7, align 8, !tbaa !8
  %47 = icmp eq i64 %46, 1
  br i1 %47, label %48, label %90

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %52 = load i64, ptr %8, align 8, !tbaa !8
  %53 = load i64, ptr %5, align 8, !tbaa !8
  %54 = getelementptr inbounds [300005 x i64], ptr @p, i64 0, i64 %53
  store i64 %52, ptr %54, align 8, !tbaa !8
  %55 = load i64, ptr %9, align 8, !tbaa !8
  %56 = load i64, ptr %5, align 8, !tbaa !8
  %57 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %56
  store i64 %55, ptr %57, align 8, !tbaa !8
  %58 = load i64, ptr %10, align 8, !tbaa !8
  %59 = load i64, ptr %5, align 8, !tbaa !8
  %60 = getelementptr inbounds [300005 x i64], ptr @c, i64 0, i64 %59
  store i64 %58, ptr %60, align 8, !tbaa !8
  %61 = load i64, ptr %5, align 8, !tbaa !8
  %62 = getelementptr inbounds [300005 x i64], ptr @p, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = load i64, ptr %5, align 8, !tbaa !8
  %65 = getelementptr inbounds [300005 x i64], ptr @up, i64 0, i64 %64
  store i64 %63, ptr %65, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 1, ptr %11, align 8, !tbaa !8
  br label %66

66:                                               ; preds = %86, %48
  %67 = load i64, ptr %11, align 8, !tbaa !8
  %68 = icmp slt i64 %67, 22
  br i1 %68, label %70, label %69

69:                                               ; preds = %66
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %89

70:                                               ; preds = %66
  %71 = load i64, ptr %11, align 8, !tbaa !8
  %72 = sub nsw i64 %71, 1
  %73 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 %72
  %74 = load i64, ptr %11, align 8, !tbaa !8
  %75 = sub nsw i64 %74, 1
  %76 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 %75
  %77 = load i64, ptr %5, align 8, !tbaa !8
  %78 = getelementptr inbounds [300005 x i64], ptr %76, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = getelementptr inbounds [300005 x i64], ptr %73, i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !8
  %82 = load i64, ptr %11, align 8, !tbaa !8
  %83 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 %82
  %84 = load i64, ptr %5, align 8, !tbaa !8
  %85 = getelementptr inbounds [300005 x i64], ptr %83, i64 0, i64 %84
  store i64 %81, ptr %85, align 8, !tbaa !8
  br label %86

86:                                               ; preds = %70
  %87 = load i64, ptr %11, align 8, !tbaa !8
  %88 = add nsw i64 %87, 1
  store i64 %88, ptr %11, align 8, !tbaa !8
  br label %66, !llvm.loop !13

89:                                               ; preds = %69
  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.end.p0(i64 8, ptr %8) #6
  br label %176

90:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %91 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %91, ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %93 = load i64, ptr %13, align 8, !tbaa !8
  store i64 %93, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %94 = load i64, ptr %12, align 8, !tbaa !8
  store i64 %94, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !8
  br label %95

95:                                               ; preds = %165, %90
  %96 = load i64, ptr %13, align 8, !tbaa !8
  %97 = icmp ne i64 %96, 0
  br i1 %97, label %98, label %103

98:                                               ; preds = %95
  %99 = load i64, ptr %12, align 8, !tbaa !8
  %100 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !8
  %102 = icmp ne i64 %101, 0
  br label %103

103:                                              ; preds = %98, %95
  %104 = phi i1 [ false, %95 ], [ %102, %98 ]
  br i1 %104, label %105, label %167

105:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 21, ptr %17, align 8, !tbaa !8
  br label %106

106:                                              ; preds = %126, %105
  %107 = load i64, ptr %17, align 8, !tbaa !8
  %108 = icmp sge i64 %107, 0
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  store i32 13, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %129

110:                                              ; preds = %106
  %111 = load i64, ptr %17, align 8, !tbaa !8
  %112 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 %111
  %113 = load i64, ptr %12, align 8, !tbaa !8
  %114 = getelementptr inbounds [300005 x i64], ptr %112, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !8
  %116 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %118 = icmp ne i64 %117, 0
  br i1 %118, label %119, label %125

119:                                              ; preds = %110
  %120 = load i64, ptr %17, align 8, !tbaa !8
  %121 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 %120
  %122 = load i64, ptr %12, align 8, !tbaa !8
  %123 = getelementptr inbounds [300005 x i64], ptr %121, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !8
  store i64 %124, ptr %12, align 8, !tbaa !8
  br label %125

125:                                              ; preds = %119, %110
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %17, align 8, !tbaa !8
  %128 = add nsw i64 %127, -1
  store i64 %128, ptr %17, align 8, !tbaa !8
  br label %106, !llvm.loop !14

129:                                              ; preds = %109
  %130 = load i64, ptr %12, align 8, !tbaa !8
  %131 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = load i64, ptr %13, align 8, !tbaa !8
  %134 = icmp sgt i64 %132, %133
  br i1 %134, label %135, label %148

135:                                              ; preds = %129
  %136 = load i64, ptr %13, align 8, !tbaa !8
  %137 = load i64, ptr %12, align 8, !tbaa !8
  %138 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %137
  %139 = load i64, ptr %138, align 8, !tbaa !8
  %140 = sub nsw i64 %139, %136
  store i64 %140, ptr %138, align 8, !tbaa !8
  %141 = load i64, ptr %13, align 8, !tbaa !8
  %142 = load i64, ptr %12, align 8, !tbaa !8
  %143 = getelementptr inbounds [300005 x i64], ptr @c, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !8
  %145 = mul nsw i64 %141, %144
  %146 = load i64, ptr %16, align 8, !tbaa !8
  %147 = add nsw i64 %146, %145
  store i64 %147, ptr %16, align 8, !tbaa !8
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %165

148:                                              ; preds = %129
  %149 = load i64, ptr %12, align 8, !tbaa !8
  %150 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !8
  %152 = load i64, ptr %12, align 8, !tbaa !8
  %153 = getelementptr inbounds [300005 x i64], ptr @c, i64 0, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !8
  %155 = mul nsw i64 %151, %154
  %156 = load i64, ptr %16, align 8, !tbaa !8
  %157 = add nsw i64 %156, %155
  store i64 %157, ptr %16, align 8, !tbaa !8
  %158 = load i64, ptr %12, align 8, !tbaa !8
  %159 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !8
  %161 = load i64, ptr %13, align 8, !tbaa !8
  %162 = sub nsw i64 %161, %160
  store i64 %162, ptr %13, align 8, !tbaa !8
  %163 = load i64, ptr %12, align 8, !tbaa !8
  %164 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %163
  store i64 0, ptr %164, align 8, !tbaa !8
  br label %165

165:                                              ; preds = %148, %135
  %166 = load i64, ptr %15, align 8, !tbaa !8
  store i64 %166, ptr %12, align 8, !tbaa !8
  br label %95, !llvm.loop !15

167:                                              ; preds = %103
  %168 = load i64, ptr %14, align 8, !tbaa !8
  %169 = load i64, ptr %13, align 8, !tbaa !8
  %170 = sub nsw i64 %168, %169
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %170)
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %171, ptr noundef @.str)
  %173 = load i64, ptr %16, align 8, !tbaa !8
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %172, i64 noundef %173)
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %174, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %176

176:                                              ; preds = %167, %89
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %178

178:                                              ; preds = %176
  %179 = load i64, ptr %5, align 8, !tbaa !8
  %180 = add nsw i64 %179, 1
  store i64 %180, ptr %5, align 8, !tbaa !8
  br label %39, !llvm.loop !16

181:                                              ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %182 = load i32, ptr %1, align 4
  ret i32 %182
}

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{!"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}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !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" }

@Q = external dso_local global i64, align 8
@a = external dso_local global [300005 x i64], align 16
@c = external dso_local global [300005 x i64], align 16
@p = external dso_local local_unnamed_addr global [300005 x i64], align 16
@up = external dso_local local_unnamed_addr global [22 x [300005 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader38:
  %0 = alloca i64, align 8
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = 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) @Q)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @c)
  store i64 0, ptr @p, align 16, !tbaa !8
  store i64 0, ptr @up, align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 2400040), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 4800080), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 7200120), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 9600160), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 12000200), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 14400240), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 16800280), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 19200320), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 21600360), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 24000400), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 26400440), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 28800480), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 31200520), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 33600560), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 36000600), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 38400640), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 40800680), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 43200720), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 45600760), align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 48000800), align 16, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @up, i64 50400840), align 8, !tbaa !8
  %15 = load i64, ptr @Q, align 8, !tbaa !8
  %.not53 = icmp slt i64 %15, 1
  br i1 %.not53, label %._crit_edge, label %.lr.ph55

._crit_edge:                                      ; preds = %228, %.preheader38
  ret i32 0

.lr.ph55:                                         ; preds = %.preheader38, %228
  %.02954 = phi i64 [ %230, %228 ], [ 1, %.preheader38 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #6
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %0)
  %17 = load i64, ptr %0, align 8, !tbaa !8
  %18 = icmp eq i64 %17, 1
  br i1 %18, label %19, label %93

19:                                               ; preds = %.lr.ph55
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %23 = load i64, ptr %1, align 8, !tbaa !8
  %24 = getelementptr inbounds [300005 x i64], ptr @p, i64 0, i64 %.02954
  store i64 %23, ptr %24, align 8, !tbaa !8
  %25 = load i64, ptr %2, align 8, !tbaa !8
  %26 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %.02954
  store i64 %25, ptr %26, align 8, !tbaa !8
  %27 = load i64, ptr %3, align 8, !tbaa !8
  %28 = getelementptr inbounds [300005 x i64], ptr @c, i64 0, i64 %.02954
  store i64 %27, ptr %28, align 8, !tbaa !8
  %29 = getelementptr inbounds [300005 x i64], ptr @up, i64 0, i64 %.02954
  store i64 %23, ptr %29, align 8, !tbaa !8
  %30 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 0, i64 %23
  %31 = load i64, ptr %30, align 8, !tbaa !8
  %32 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 1, i64 %.02954
  store i64 %31, ptr %32, align 8, !tbaa !8
  %33 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 1, i64 %31
  %34 = load i64, ptr %33, align 8, !tbaa !8
  %35 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 2, i64 %.02954
  store i64 %34, ptr %35, align 8, !tbaa !8
  %36 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 2, i64 %34
  %37 = load i64, ptr %36, align 8, !tbaa !8
  %38 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 3, i64 %.02954
  store i64 %37, ptr %38, align 8, !tbaa !8
  %39 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 3, i64 %37
  %40 = load i64, ptr %39, align 8, !tbaa !8
  %41 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 4, i64 %.02954
  store i64 %40, ptr %41, align 8, !tbaa !8
  %42 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 4, i64 %40
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 5, i64 %.02954
  store i64 %43, ptr %44, align 8, !tbaa !8
  %45 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 5, i64 %43
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 6, i64 %.02954
  store i64 %46, ptr %47, align 8, !tbaa !8
  %48 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 6, i64 %46
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 7, i64 %.02954
  store i64 %49, ptr %50, align 8, !tbaa !8
  %51 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 7, i64 %49
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 8, i64 %.02954
  store i64 %52, ptr %53, align 8, !tbaa !8
  %54 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 8, i64 %52
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 9, i64 %.02954
  store i64 %55, ptr %56, align 8, !tbaa !8
  %57 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 9, i64 %55
  %58 = load i64, ptr %57, align 8, !tbaa !8
  %59 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 10, i64 %.02954
  store i64 %58, ptr %59, align 8, !tbaa !8
  %60 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 10, i64 %58
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 11, i64 %.02954
  store i64 %61, ptr %62, align 8, !tbaa !8
  %63 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 11, i64 %61
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 12, i64 %.02954
  store i64 %64, ptr %65, align 8, !tbaa !8
  %66 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 12, i64 %64
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 13, i64 %.02954
  store i64 %67, ptr %68, align 8, !tbaa !8
  %69 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 13, i64 %67
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 14, i64 %.02954
  store i64 %70, ptr %71, align 8, !tbaa !8
  %72 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 14, i64 %70
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 15, i64 %.02954
  store i64 %73, ptr %74, align 8, !tbaa !8
  %75 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 15, i64 %73
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 16, i64 %.02954
  store i64 %76, ptr %77, align 8, !tbaa !8
  %78 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 16, i64 %76
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 17, i64 %.02954
  store i64 %79, ptr %80, align 8, !tbaa !8
  %81 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 17, i64 %79
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 18, i64 %.02954
  store i64 %82, ptr %83, align 8, !tbaa !8
  %84 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 18, i64 %82
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 19, i64 %.02954
  store i64 %85, ptr %86, align 8, !tbaa !8
  %87 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 19, i64 %85
  %88 = load i64, ptr %87, align 8, !tbaa !8
  %89 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 20, i64 %.02954
  store i64 %88, ptr %89, align 8, !tbaa !8
  %90 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 20, i64 %88
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 21, i64 %.02954
  store i64 %91, ptr %92, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  br label %228

93:                                               ; preds = %.lr.ph55
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %94 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %96 = load i64, ptr %5, align 8, !tbaa !8
  %97 = load i64, ptr %4, align 8, !tbaa !8
  %.not3545 = icmp eq i64 %96, 0
  br i1 %.not3545, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %93
  %98 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %97
  %99 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 21, i64 %97
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %218
  %.02747 = phi i64 [ %.1, %218 ], [ 0, %.lr.ph.preheader ]
  %100 = phi i64 [ %222, %218 ], [ %96, %.lr.ph.preheader ]
  %101 = load i64, ptr %98, align 8, !tbaa !8
  %.not36 = icmp eq i64 %101, 0
  br i1 %.not36, label %.critedge, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.lr.ph
  %102 = load i64, ptr %99, align 8, !tbaa !8
  %103 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !8
  %.not37 = icmp eq i64 %104, 0
  br i1 %.not37, label %.preheader.1, label %105

105:                                              ; preds = %.preheader.preheader
  store i64 %102, ptr %4, align 8, !tbaa !8
  br label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.preheader, %105
  %106 = phi i64 [ %97, %.preheader.preheader ], [ %102, %105 ]
  %107 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 20, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !8
  %109 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !8
  %.not37.1 = icmp eq i64 %110, 0
  %spec.select = select i1 %.not37.1, i64 %106, i64 %108
  %111 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 19, i64 %spec.select
  %112 = load i64, ptr %111, align 8, !tbaa !8
  %113 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %.not37.2 = icmp eq i64 %114, 0
  %115 = select i1 %.not37.2, i64 %spec.select, i64 %112
  %116 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 18, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %118 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %.not37.3 = icmp eq i64 %119, 0
  br i1 %.not37.3, label %.preheader.4, label %120

120:                                              ; preds = %.preheader.1
  store i64 %117, ptr %4, align 8, !tbaa !8
  br label %.preheader.4

.preheader.4:                                     ; preds = %120, %.preheader.1
  %121 = phi i64 [ %115, %.preheader.1 ], [ %117, %120 ]
  %122 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 17, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !8
  %124 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %.not37.4 = icmp eq i64 %125, 0
  %spec.select69 = select i1 %.not37.4, i64 %121, i64 %123
  %126 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 16, i64 %spec.select69
  %127 = load i64, ptr %126, align 8, !tbaa !8
  %128 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !8
  %.not37.5 = icmp eq i64 %129, 0
  %130 = select i1 %.not37.5, i64 %spec.select69, i64 %127
  %131 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 15, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !8
  %.not37.6 = icmp eq i64 %134, 0
  br i1 %.not37.6, label %.preheader.7, label %135

135:                                              ; preds = %.preheader.4
  store i64 %132, ptr %4, align 8, !tbaa !8
  br label %.preheader.7

.preheader.7:                                     ; preds = %135, %.preheader.4
  %136 = phi i64 [ %130, %.preheader.4 ], [ %132, %135 ]
  %137 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 14, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !8
  %139 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !8
  %.not37.7 = icmp eq i64 %140, 0
  %spec.select70 = select i1 %.not37.7, i64 %136, i64 %138
  %141 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 13, i64 %spec.select70
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !8
  %.not37.8 = icmp eq i64 %144, 0
  %145 = select i1 %.not37.8, i64 %spec.select70, i64 %142
  %146 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 12, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !8
  %148 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %.not37.9 = icmp eq i64 %149, 0
  %150 = select i1 %.not37.9, i64 %145, i64 %147
  %151 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 11, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !8
  %153 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !8
  %.not37.10 = icmp eq i64 %154, 0
  br i1 %.not37.10, label %.preheader.11, label %155

155:                                              ; preds = %.preheader.7
  store i64 %152, ptr %4, align 8, !tbaa !8
  br label %.preheader.11

.preheader.11:                                    ; preds = %155, %.preheader.7
  %156 = phi i64 [ %150, %.preheader.7 ], [ %152, %155 ]
  %157 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 10, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !8
  %159 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !8
  %.not37.11 = icmp eq i64 %160, 0
  %spec.select71 = select i1 %.not37.11, i64 %156, i64 %158
  %161 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 9, i64 %spec.select71
  %162 = load i64, ptr %161, align 8, !tbaa !8
  %163 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !8
  %.not37.12 = icmp eq i64 %164, 0
  %165 = select i1 %.not37.12, i64 %spec.select71, i64 %162
  %166 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 8, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !8
  %168 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !8
  %.not37.13 = icmp eq i64 %169, 0
  %170 = select i1 %.not37.13, i64 %165, i64 %167
  %171 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 7, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !8
  %173 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %172
  %174 = load i64, ptr %173, align 8, !tbaa !8
  %.not37.14 = icmp eq i64 %174, 0
  %175 = select i1 %.not37.14, i64 %170, i64 %172
  %176 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 6, i64 %175
  %177 = load i64, ptr %176, align 8, !tbaa !8
  %178 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !8
  %.not37.15 = icmp eq i64 %179, 0
  %180 = select i1 %.not37.15, i64 %175, i64 %177
  %181 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 5, i64 %180
  %182 = load i64, ptr %181, align 8, !tbaa !8
  %183 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %182
  %184 = load i64, ptr %183, align 8, !tbaa !8
  %.not37.16 = icmp eq i64 %184, 0
  %185 = select i1 %.not37.16, i64 %180, i64 %182
  %186 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 4, i64 %185
  %187 = load i64, ptr %186, align 8, !tbaa !8
  %188 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %187
  %189 = load i64, ptr %188, align 8, !tbaa !8
  %.not37.17 = icmp eq i64 %189, 0
  %190 = select i1 %.not37.17, i64 %185, i64 %187
  %191 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 3, i64 %190
  %192 = load i64, ptr %191, align 8, !tbaa !8
  %193 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %192
  %194 = load i64, ptr %193, align 8, !tbaa !8
  %.not37.18 = icmp eq i64 %194, 0
  %195 = select i1 %.not37.18, i64 %190, i64 %192
  %196 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 2, i64 %195
  %197 = load i64, ptr %196, align 8, !tbaa !8
  %198 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %197
  %199 = load i64, ptr %198, align 8, !tbaa !8
  %.not37.19 = icmp eq i64 %199, 0
  %200 = select i1 %.not37.19, i64 %195, i64 %197
  %201 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 1, i64 %200
  %202 = load i64, ptr %201, align 8, !tbaa !8
  %203 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %202
  %204 = load i64, ptr %203, align 8, !tbaa !8
  %.not37.20 = icmp eq i64 %204, 0
  %205 = select i1 %.not37.20, i64 %200, i64 %202
  %206 = getelementptr inbounds [22 x [300005 x i64]], ptr @up, i64 0, i64 0, i64 %205
  %207 = load i64, ptr %206, align 8, !tbaa !8
  %208 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %207
  %209 = load i64, ptr %208, align 8, !tbaa !8
  %.not37.21 = icmp eq i64 %209, 0
  %210 = select i1 %.not37.21, i64 %205, i64 %207
  %211 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %210
  %212 = load i64, ptr %211, align 8, !tbaa !8
  %213 = icmp sgt i64 %212, %100
  br i1 %213, label %.thread, label %218

.thread:                                          ; preds = %.preheader.11
  %214 = sub nsw i64 %212, %100
  %215 = getelementptr inbounds [300005 x i64], ptr @c, i64 0, i64 %210
  %216 = load i64, ptr %215, align 8, !tbaa !8
  %217 = mul nsw i64 %216, %100
  store i64 %214, ptr %211, align 8
  store i64 0, ptr %5, align 8
  %.161 = add nsw i64 %217, %.02747
  store i64 %97, ptr %4, align 8, !tbaa !8
  br label %.critedge

218:                                              ; preds = %.preheader.11
  %219 = getelementptr inbounds [300005 x i64], ptr @c, i64 0, i64 %210
  %220 = load i64, ptr %219, align 8, !tbaa !8
  %221 = mul nsw i64 %220, %212
  %222 = sub nsw i64 %100, %212
  store i64 0, ptr %211, align 8
  store i64 %222, ptr %5, align 8
  %.1 = add nsw i64 %221, %.02747
  store i64 %97, ptr %4, align 8, !tbaa !8
  %.not35 = icmp eq i64 %222, 0
  br i1 %.not35, label %.critedge, label %.lr.ph, !llvm.loop !11

.critedge:                                        ; preds = %.lr.ph, %218, %.thread, %93
  %.lcssa = phi i64 [ 0, %93 ], [ 0, %.thread ], [ 0, %218 ], [ %100, %.lr.ph ]
  %.027.lcssa = phi i64 [ 0, %93 ], [ %.161, %.thread ], [ %.1, %218 ], [ %.02747, %.lr.ph ]
  %223 = sub nsw i64 %96, %.lcssa
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %223)
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %224, ptr noundef nonnull @.str)
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %225, i64 noundef %.027.lcssa)
  %227 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %226, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %228

228:                                              ; preds = %.critedge, %19
  %229 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #6
  %230 = add nuw nsw i64 %.02954, 1
  %231 = load i64, ptr @Q, align 8, !tbaa !8
  %.not.not = icmp slt i64 %.02954, %231
  br i1 %.not.not, label %.lr.ph55, label %._crit_edge, !llvm.loop !13
}

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

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

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

; Function Attrs: 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 #5

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{!"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}


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