; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf1787_C.ll (Z5solvev)

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

@a = external dso_local global [200010 x i64], align 16
@mx = external dso_local global [200010 x i64], align 16
@mn = external dso_local global [200010 x i64], align 16
@dp = external dso_local global [200010 x [2 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 uwtable
define dso_local void @_Z5solvev() #0 {
  %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 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  %12 = 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)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store i64 1, ptr %3, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %23, %0
  %15 = load i64, ptr %3, align 8, !tbaa !5
  %16 = load i64, ptr %1, align 8, !tbaa !5
  %17 = icmp sle i64 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %26

19:                                               ; preds = %14
  %20 = load i64, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %20
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  br label %23

23:                                               ; preds = %19
  %24 = load i64, ptr %3, align 8, !tbaa !5
  %25 = add nsw i64 %24, 1
  store i64 %25, ptr %3, align 8, !tbaa !5
  br label %14, !llvm.loop !9

26:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %77, %26
  %28 = load i64, ptr %4, align 8, !tbaa !5
  %29 = load i64, ptr %1, align 8, !tbaa !5
  %30 = icmp sle i64 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = load i64, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = load i64, ptr %2, align 8, !tbaa !5
  %37 = mul nsw i64 2, %36
  %38 = icmp sge i64 %35, %37
  br i1 %38, label %39, label %50

39:                                               ; preds = %32
  %40 = load i64, ptr %2, align 8, !tbaa !5
  %41 = load i64, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %41
  store i64 %40, ptr %42, align 8, !tbaa !5
  %43 = load i64, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = load i64, ptr %2, align 8, !tbaa !5
  %47 = sub nsw i64 %45, %46
  %48 = load i64, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %48
  store i64 %47, ptr %49, align 8, !tbaa !5
  br label %76

50:                                               ; preds = %32
  %51 = load i64, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = load i64, ptr %2, align 8, !tbaa !5
  %55 = icmp sge i64 %53, %54
  br i1 %55, label %56, label %67

56:                                               ; preds = %50
  %57 = load i64, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = load i64, ptr %2, align 8, !tbaa !5
  %61 = sub nsw i64 %59, %60
  %62 = load i64, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %62
  store i64 %61, ptr %63, align 8, !tbaa !5
  %64 = load i64, ptr %2, align 8, !tbaa !5
  %65 = load i64, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %65
  store i64 %64, ptr %66, align 8, !tbaa !5
  br label %75

67:                                               ; preds = %50
  %68 = load i64, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = load i64, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %71
  store i64 %70, ptr %72, align 8, !tbaa !5
  %73 = load i64, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %73
  store i64 0, ptr %74, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %67, %56
  br label %76

76:                                               ; preds = %75, %39
  br label %77

77:                                               ; preds = %76
  %78 = load i64, ptr %4, align 8, !tbaa !5
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %4, align 8, !tbaa !5
  br label %27, !llvm.loop !11

80:                                               ; preds = %31
  %81 = load i64, ptr getelementptr inbounds ([200010 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !5
  %82 = load i64, ptr getelementptr inbounds ([200010 x i64], ptr @mx, i64 0, i64 2), align 16, !tbaa !5
  %83 = mul nsw i64 %81, %82
  store i64 %83, ptr getelementptr inbounds ([200010 x [2 x i64]], ptr @dp, i64 0, i64 2), align 16, !tbaa !5
  %84 = load i64, ptr getelementptr inbounds ([200010 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !5
  %85 = load i64, ptr getelementptr inbounds ([200010 x i64], ptr @mn, i64 0, i64 2), align 16, !tbaa !5
  %86 = mul nsw i64 %84, %85
  store i64 %86, ptr getelementptr inbounds ([2 x i64], ptr getelementptr inbounds ([200010 x [2 x i64]], ptr @dp, i64 0, i64 2), i64 0, i64 1), align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 3, ptr %5, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %159, %80
  %88 = load i64, ptr %5, align 8, !tbaa !5
  %89 = load i64, ptr %1, align 8, !tbaa !5
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %162

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %93 = load i64, ptr %5, align 8, !tbaa !5
  %94 = sub nsw i64 %93, 1
  %95 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %94
  %96 = getelementptr inbounds [2 x i64], ptr %95, i64 0, i64 0
  %97 = load i64, ptr %96, align 16, !tbaa !5
  %98 = load i64, ptr %5, align 8, !tbaa !5
  %99 = sub nsw i64 %98, 1
  %100 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !5
  %102 = load i64, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !5
  %105 = mul nsw i64 %101, %104
  %106 = add nsw i64 %97, %105
  store i64 %106, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %107 = load i64, ptr %5, align 8, !tbaa !5
  %108 = sub nsw i64 %107, 1
  %109 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %108
  %110 = getelementptr inbounds [2 x i64], ptr %109, i64 0, i64 1
  %111 = load i64, ptr %110, align 8, !tbaa !5
  %112 = load i64, ptr %5, align 8, !tbaa !5
  %113 = sub nsw i64 %112, 1
  %114 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = load i64, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !5
  %119 = mul nsw i64 %115, %118
  %120 = add nsw i64 %111, %119
  store i64 %120, ptr %7, align 8, !tbaa !5
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %122 = load i64, ptr %121, align 8, !tbaa !5
  %123 = load i64, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %123
  %125 = getelementptr inbounds [2 x i64], ptr %124, i64 0, i64 0
  store i64 %122, ptr %125, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %126 = load i64, ptr %5, align 8, !tbaa !5
  %127 = sub nsw i64 %126, 1
  %128 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %127
  %129 = getelementptr inbounds [2 x i64], ptr %128, i64 0, i64 0
  %130 = load i64, ptr %129, align 16, !tbaa !5
  %131 = load i64, ptr %5, align 8, !tbaa !5
  %132 = sub nsw i64 %131, 1
  %133 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !5
  %135 = load i64, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !5
  %138 = mul nsw i64 %134, %137
  %139 = add nsw i64 %130, %138
  store i64 %139, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %140 = load i64, ptr %5, align 8, !tbaa !5
  %141 = sub nsw i64 %140, 1
  %142 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %141
  %143 = getelementptr inbounds [2 x i64], ptr %142, i64 0, i64 1
  %144 = load i64, ptr %143, align 8, !tbaa !5
  %145 = load i64, ptr %5, align 8, !tbaa !5
  %146 = sub nsw i64 %145, 1
  %147 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !5
  %149 = load i64, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !5
  %152 = mul nsw i64 %148, %151
  %153 = add nsw i64 %144, %152
  store i64 %153, ptr %9, align 8, !tbaa !5
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %155 = load i64, ptr %154, align 8, !tbaa !5
  %156 = load i64, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %156
  %158 = getelementptr inbounds [2 x i64], ptr %157, i64 0, i64 1
  store i64 %155, ptr %158, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %159

159:                                              ; preds = %92
  %160 = load i64, ptr %5, align 8, !tbaa !5
  %161 = add nsw i64 %160, 1
  store i64 %161, ptr %5, align 8, !tbaa !5
  br label %87, !llvm.loop !12

162:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %163 = load i64, ptr %1, align 8, !tbaa !5
  %164 = sub nsw i64 %163, 1
  %165 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %164
  %166 = getelementptr inbounds [2 x i64], ptr %165, i64 0, i64 0
  %167 = load i64, ptr %166, align 16, !tbaa !5
  %168 = load i64, ptr %1, align 8, !tbaa !5
  %169 = sub nsw i64 %168, 1
  %170 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !5
  %172 = load i64, ptr %1, align 8, !tbaa !5
  %173 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %172
  %174 = load i64, ptr %173, align 8, !tbaa !5
  %175 = mul nsw i64 %171, %174
  %176 = add nsw i64 %167, %175
  store i64 %176, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %177 = load i64, ptr %1, align 8, !tbaa !5
  %178 = sub nsw i64 %177, 1
  %179 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %178
  %180 = getelementptr inbounds [2 x i64], ptr %179, i64 0, i64 1
  %181 = load i64, ptr %180, align 8, !tbaa !5
  %182 = load i64, ptr %1, align 8, !tbaa !5
  %183 = sub nsw i64 %182, 1
  %184 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %183
  %185 = load i64, ptr %184, align 8, !tbaa !5
  %186 = load i64, ptr %1, align 8, !tbaa !5
  %187 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %186
  %188 = load i64, ptr %187, align 8, !tbaa !5
  %189 = mul nsw i64 %185, %188
  %190 = add nsw i64 %181, %189
  store i64 %190, ptr %11, align 8, !tbaa !5
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %192 = load i64, ptr %191, align 8, !tbaa !5
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %192)
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %193, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

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

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

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nounwind }

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

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


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

%"class.std::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" }

@a = external dso_local global [200010 x i64], align 16
@mx = external dso_local local_unnamed_addr global [200010 x i64], align 16
@mn = external dso_local local_unnamed_addr global [200010 x i64], align 16
@dp = external dso_local local_unnamed_addr global [200010 x [2 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 uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %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 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %9 = 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)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %11 = load i64, ptr %1, align 8, !tbaa !5
  %.not40 = icmp slt i64 %11, 1
  br i1 %.not40, label %._crit_edge, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph
  %.not3642 = icmp slt i64 %17, 1
  br i1 %.not3642, label %._crit_edge, label %.lr.ph44

.lr.ph44:                                         ; preds = %.preheader
  %12 = load i64, ptr %2, align 8, !tbaa !5
  %13 = shl nsw i64 %12, 1
  br label %25

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03341 = phi i64 [ %16, %.lr.ph ], [ 1, %0 ]
  %14 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %.03341
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %16 = add nuw nsw i64 %.03341, 1
  %17 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not = icmp slt i64 %.03341, %17
  br i1 %.not.not, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %37, %0, %.preheader
  %18 = phi i64 [ %17, %.preheader ], [ %11, %0 ], [ %17, %37 ]
  %19 = load i64, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !5
  %20 = load i64, ptr getelementptr inbounds (i8, ptr @mx, i64 16), align 16, !tbaa !5
  %21 = mul nsw i64 %20, %19
  store i64 %21, ptr getelementptr inbounds (i8, ptr @dp, i64 32), align 16, !tbaa !5
  %22 = load i64, ptr getelementptr inbounds (i8, ptr @mn, i64 16), align 16, !tbaa !5
  %23 = mul nsw i64 %22, %19
  store i64 %23, ptr getelementptr inbounds (i8, ptr @dp, i64 40), align 8, !tbaa !5
  %24 = icmp sgt i64 %18, 3
  br i1 %24, label %.lr.ph47, label %._crit_edge48

25:                                               ; preds = %.lr.ph44, %37
  %.03243 = phi i64 [ 1, %.lr.ph44 ], [ %39, %37 ]
  %26 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %.03243
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %.not37 = icmp slt i64 %27, %13
  br i1 %.not37, label %31, label %28

28:                                               ; preds = %25
  %29 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %.03243
  store i64 %12, ptr %29, align 8, !tbaa !5
  %30 = sub nsw i64 %27, %12
  br label %37

31:                                               ; preds = %25
  %.not38 = icmp slt i64 %27, %12
  br i1 %.not38, label %35, label %32

32:                                               ; preds = %31
  %33 = sub nsw i64 %27, %12
  %34 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %.03243
  store i64 %33, ptr %34, align 8, !tbaa !5
  br label %37

35:                                               ; preds = %31
  %36 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %.03243
  store i64 %27, ptr %36, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %28, %35, %32
  %mx.sink = phi ptr [ @mx, %28 ], [ @mn, %35 ], [ @mx, %32 ]
  %.sink = phi i64 [ %30, %28 ], [ 0, %35 ], [ %12, %32 ]
  %38 = getelementptr inbounds [200010 x i64], ptr %mx.sink, i64 0, i64 %.03243
  store i64 %.sink, ptr %38, align 8, !tbaa !5
  %39 = add nuw i64 %.03243, 1
  %exitcond.not = icmp eq i64 %.03243, %17
  br i1 %exitcond.not, label %._crit_edge, label %25, !llvm.loop !11

._crit_edge48:                                    ; preds = %.lr.ph47, %._crit_edge
  %.lcssa = phi i64 [ %18, %._crit_edge ], [ %91, %.lr.ph47 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %40 = add nsw i64 %.lcssa, -1
  %41 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %40
  %42 = load i64, ptr %41, align 16, !tbaa !5
  %43 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %40
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %.lcssa
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = mul nsw i64 %46, %44
  %48 = add nsw i64 %47, %42
  store i64 %48, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %49 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %40, i64 1
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %40
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = mul nsw i64 %52, %46
  %54 = add nsw i64 %53, %50
  store i64 %54, ptr %8, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %56)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %57, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret void

.lr.ph47:                                         ; preds = %._crit_edge, %.lr.ph47
  %59 = phi i64 [ %88, %.lr.ph47 ], [ %23, %._crit_edge ]
  %.045 = phi i64 [ %90, %.lr.ph47 ], [ 3, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %60 = add nsw i64 %.045, -1
  %61 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %60
  %62 = load i64, ptr %61, align 16, !tbaa !5
  %63 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %60
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %.045
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = mul nsw i64 %66, %64
  %68 = add nsw i64 %67, %62
  store i64 %68, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %69 = getelementptr inbounds i8, ptr %61, i64 8
  %70 = getelementptr inbounds [200010 x i64], ptr @mx, i64 0, i64 %60
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %72 = mul nsw i64 %71, %66
  %73 = add nsw i64 %72, %59
  store i64 %73, ptr %4, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = getelementptr inbounds [200010 x [2 x i64]], ptr @dp, i64 0, i64 %.045
  store i64 %75, ptr %76, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %77 = load i64, ptr %61, align 16, !tbaa !5
  %78 = load i64, ptr %63, align 8, !tbaa !5
  %79 = getelementptr inbounds [200010 x i64], ptr @mn, i64 0, i64 %.045
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = mul nsw i64 %80, %78
  %82 = add nsw i64 %81, %77
  store i64 %82, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %83 = load i64, ptr %69, align 8, !tbaa !5
  %84 = load i64, ptr %70, align 8, !tbaa !5
  %85 = mul nsw i64 %84, %80
  %86 = add nsw i64 %85, %83
  store i64 %86, ptr %6, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %76, i64 8
  store i64 %88, ptr %89, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %90 = add nuw nsw i64 %.045, 1
  %91 = load i64, ptr %1, align 8, !tbaa !5
  %92 = icmp slt i64 %90, %91
  br i1 %92, label %.lr.ph47, label %._crit_edge48, !llvm.loop !12
}

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

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

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nounwind }

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

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


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