; LLVM IR from eyangch/competitive-programming :: Codeforces/1579 (g)

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

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local global [10000 x i64], align 16
@dp = external dso_local global [2001 x i64], align 16
@cdp = external dso_local global [2001 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca double, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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) @T)
  br label %17

17:                                               ; preds = %128, %0
  %18 = load i64, ptr @T, align 8, !tbaa !8
  %19 = add nsw i64 %18, -1
  store i64 %19, ptr @T, align 8, !tbaa !8
  %20 = icmp ne i64 %18, 0
  br i1 %20, label %21, label %133

21:                                               ; preds = %17
  %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) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %23

23:                                               ; preds = %32, %21
  %24 = load i64, ptr %2, align 8, !tbaa !8
  %25 = load i64, ptr @N, align 8, !tbaa !8
  %26 = icmp slt i64 %24, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %23
  %29 = load i64, ptr %2, align 8, !tbaa !8
  %30 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %29
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %30)
  br label %32

32:                                               ; preds = %28
  %33 = load i64, ptr %2, align 8, !tbaa !8
  %34 = add nsw i64 %33, 1
  store i64 %34, ptr %2, align 8, !tbaa !8
  br label %23, !llvm.loop !11

35:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store double 1.000000e+17, ptr %3, align 8, !tbaa !13
  call void @_ZSt4fillIPxdEvT_S1_RKT0_(ptr noundef @dp, ptr noundef getelementptr inbounds (i64, ptr @dp, i64 2001), ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  store i64 0, ptr @dp, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %36

36:                                               ; preds = %125, %35
  %37 = load i64, ptr %4, align 8, !tbaa !8
  %38 = load i64, ptr @N, align 8, !tbaa !8
  %39 = icmp slt i64 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store double 1.000000e+17, ptr %6, align 8, !tbaa !13
  call void @_ZSt4fillIPxdEvT_S1_RKT0_(ptr noundef @cdp, ptr noundef getelementptr inbounds (i64, ptr @cdp, i64 2001), ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %42

42:                                               ; preds = %120, %41
  %43 = load i64, ptr %7, align 8, !tbaa !8
  %44 = icmp slt i64 %43, 2001
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %123

46:                                               ; preds = %42
  %47 = load i64, ptr %7, align 8, !tbaa !8
  %48 = getelementptr inbounds [2001 x i64], ptr @dp, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = sitofp i64 %49 to double
  %51 = fcmp oeq double %50, 1.000000e+17
  br i1 %51, label %52, label %53

52:                                               ; preds = %46
  br label %120

53:                                               ; preds = %46
  %54 = load i64, ptr %7, align 8, !tbaa !8
  %55 = load i64, ptr %4, align 8, !tbaa !8
  %56 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !8
  %58 = add nsw i64 %54, %57
  %59 = icmp slt i64 %58, 2001
  br i1 %59, label %60, label %83

60:                                               ; preds = %53
  %61 = load i64, ptr %7, align 8, !tbaa !8
  %62 = load i64, ptr %4, align 8, !tbaa !8
  %63 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = add nsw i64 %61, %64
  %66 = getelementptr inbounds [2001 x i64], ptr @cdp, i64 0, i64 %65
  %67 = load i64, ptr %7, align 8, !tbaa !8
  %68 = getelementptr inbounds [2001 x i64], ptr @dp, i64 0, i64 %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %69 = load i64, ptr %7, align 8, !tbaa !8
  %70 = load i64, ptr %4, align 8, !tbaa !8
  %71 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = add nsw i64 %69, %72
  store i64 %73, ptr %8, align 8, !tbaa !8
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull align 8 dereferenceable(8) %74)
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = load i64, ptr %7, align 8, !tbaa !8
  %78 = load i64, ptr %4, align 8, !tbaa !8
  %79 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = add nsw i64 %77, %80
  %82 = getelementptr inbounds [2001 x i64], ptr @cdp, i64 0, i64 %81
  store i64 %76, ptr %82, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %83

83:                                               ; preds = %60, %53
  %84 = load i64, ptr %7, align 8, !tbaa !8
  %85 = load i64, ptr %4, align 8, !tbaa !8
  %86 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = sub nsw i64 %84, %87
  %89 = icmp sge i64 %88, 0
  br i1 %89, label %90, label %107

90:                                               ; preds = %83
  %91 = load i64, ptr %7, align 8, !tbaa !8
  %92 = load i64, ptr %4, align 8, !tbaa !8
  %93 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = sub nsw i64 %91, %94
  %96 = getelementptr inbounds [2001 x i64], ptr @cdp, i64 0, i64 %95
  %97 = load i64, ptr %7, align 8, !tbaa !8
  %98 = getelementptr inbounds [2001 x i64], ptr @dp, i64 0, i64 %97
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull align 8 dereferenceable(8) %98)
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = load i64, ptr %7, align 8, !tbaa !8
  %102 = load i64, ptr %4, align 8, !tbaa !8
  %103 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !8
  %105 = sub nsw i64 %101, %104
  %106 = getelementptr inbounds [2001 x i64], ptr @cdp, i64 0, i64 %105
  store i64 %100, ptr %106, align 8, !tbaa !8
  br label %119

107:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %108 = load i64, ptr %7, align 8, !tbaa !8
  %109 = getelementptr inbounds [2001 x i64], ptr @dp, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !8
  %111 = load i64, ptr %4, align 8, !tbaa !8
  %112 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = add nsw i64 %110, %113
  %115 = load i64, ptr %7, align 8, !tbaa !8
  %116 = sub nsw i64 %114, %115
  store i64 %116, ptr %9, align 8, !tbaa !8
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @cdp, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %118 = load i64, ptr %117, align 8, !tbaa !8
  store i64 %118, ptr @cdp, align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %119

119:                                              ; preds = %107, %90
  br label %120

120:                                              ; preds = %119, %52
  %121 = load i64, ptr %7, align 8, !tbaa !8
  %122 = add nsw i64 %121, 1
  store i64 %122, ptr %7, align 8, !tbaa !8
  br label %42, !llvm.loop !15

123:                                              ; preds = %45
  %124 = call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef @cdp, ptr noundef getelementptr inbounds (i64, ptr @cdp, i64 2001), ptr noundef @dp)
  br label %125

125:                                              ; preds = %123
  %126 = load i64, ptr %4, align 8, !tbaa !8
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %4, align 8, !tbaa !8
  br label %36, !llvm.loop !16

128:                                              ; preds = %40
  %129 = call noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef @dp, ptr noundef getelementptr inbounds (i64, ptr @dp, i64 2001))
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %130)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %131, i8 noundef signext 10)
  br label %17, !llvm.loop !17

133:                                              ; preds = %17
  %134 = load i32, ptr %1, align 4
  ret i32 %134
}

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

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

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

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

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

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

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

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

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

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

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

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

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

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local global [10000 x i64], align 16
@dp = external dso_local global [2001 x i64], align 16
@cdp = external dso_local global [2001 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 double, align 8
  %2 = alloca double, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = 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) @T)
  %12 = load i64, ptr @T, align 8, !tbaa !8
  %13 = add nsw i64 %12, -1
  store i64 %13, ptr @T, align 8, !tbaa !8
  %.not38 = icmp eq i64 %12, 0
  br i1 %.not38, label %._crit_edge41, label %.lr.ph40

.lr.ph40:                                         ; preds = %0, %._crit_edge37
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %15 = load i64, ptr @N, align 8, !tbaa !8
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store double 1.000000e+17, ptr %1, align 8, !tbaa !11
  call void @_ZSt4fillIPxdEvT_S1_RKT0_(ptr noundef nonnull @dp, ptr noundef nonnull getelementptr inbounds (i8, ptr @dp, i64 16008), ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr @dp, align 16, !tbaa !8
  %17 = load i64, ptr @N, align 8, !tbaa !8
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph36, label %._crit_edge37

.lr.ph:                                           ; preds = %.lr.ph40, %.lr.ph
  %.02932 = phi i64 [ %21, %.lr.ph ], [ 0, %.lr.ph40 ]
  %19 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %.02932
  %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) %19)
  %21 = add nuw nsw i64 %.02932, 1
  %22 = load i64, ptr @N, align 8, !tbaa !8
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge37:                                    ; preds = %31, %._crit_edge
  %24 = call noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef nonnull @dp, ptr noundef nonnull getelementptr inbounds (i8, ptr @dp, i64 16008))
  %25 = load i64, ptr %24, align 8, !tbaa !8
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %25)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %26, i8 noundef signext 10)
  %28 = load i64, ptr @T, align 8, !tbaa !8
  %29 = add nsw i64 %28, -1
  store i64 %29, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %28, 0
  br i1 %.not, label %._crit_edge41, label %.lr.ph40, !llvm.loop !15

.lr.ph36:                                         ; preds = %._crit_edge, %31
  %.02834 = phi i64 [ %33, %31 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store double 1.000000e+17, ptr %2, align 8, !tbaa !11
  call void @_ZSt4fillIPxdEvT_S1_RKT0_(ptr noundef nonnull @cdp, ptr noundef nonnull getelementptr inbounds (i8, ptr @cdp, i64 16008), ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %30 = getelementptr inbounds [10000 x i64], ptr @a, i64 0, i64 %.02834
  br label %36

31:                                               ; preds = %70
  %32 = call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef nonnull @cdp, ptr noundef nonnull getelementptr inbounds (i8, ptr @cdp, i64 16008), ptr noundef nonnull @dp)
  %33 = add nuw nsw i64 %.02834, 1
  %34 = load i64, ptr @N, align 8, !tbaa !8
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %.lr.ph36, label %._crit_edge37, !llvm.loop !16

36:                                               ; preds = %.lr.ph36, %70
  %.033 = phi i64 [ 0, %.lr.ph36 ], [ %71, %70 ]
  %37 = getelementptr inbounds [2001 x i64], ptr @dp, i64 0, i64 %.033
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = sitofp i64 %38 to double
  %40 = fcmp oeq double %39, 1.000000e+17
  br i1 %40, label %70, label %41

41:                                               ; preds = %36
  %42 = load i64, ptr %30, align 8, !tbaa !8
  %43 = add nsw i64 %42, %.033
  %44 = icmp slt i64 %43, 2001
  br i1 %44, label %45, label %53

45:                                               ; preds = %41
  %46 = getelementptr inbounds [2001 x i64], ptr @cdp, i64 0, i64 %43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 %43, ptr %3, align 8, !tbaa !8
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %47)
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = load i64, ptr %30, align 8, !tbaa !8
  %51 = add nsw i64 %50, %.033
  %52 = getelementptr inbounds [2001 x i64], ptr @cdp, i64 0, i64 %51
  store i64 %49, ptr %52, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %53

53:                                               ; preds = %45, %41
  %54 = phi i64 [ %50, %45 ], [ %42, %41 ]
  %55 = sub nsw i64 %.033, %54
  %56 = icmp sgt i64 %55, -1
  br i1 %56, label %57, label %64

57:                                               ; preds = %53
  %58 = getelementptr inbounds [2001 x i64], ptr @cdp, i64 0, i64 %55
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull align 8 dereferenceable(8) %37)
  %60 = load i64, ptr %59, align 8, !tbaa !8
  %61 = load i64, ptr %30, align 8, !tbaa !8
  %62 = sub nsw i64 %.033, %61
  %63 = getelementptr inbounds [2001 x i64], ptr @cdp, i64 0, i64 %62
  store i64 %60, ptr %63, align 8, !tbaa !8
  br label %70

64:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %65 = load i64, ptr %37, align 8, !tbaa !8
  %66 = sub i64 %54, %.033
  %67 = add i64 %66, %65
  store i64 %67, ptr %4, align 8, !tbaa !8
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @cdp, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %69 = load i64, ptr %68, align 8, !tbaa !8
  store i64 %69, ptr @cdp, align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %70

70:                                               ; preds = %57, %64, %36
  %71 = add nuw nsw i64 %.033, 1
  %exitcond.not = icmp eq i64 %71, 2001
  br i1 %exitcond.not, label %31, label %36, !llvm.loop !17

._crit_edge41:                                    ; preds = %._crit_edge37, %0
  ret i32 0
}

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #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 #3 align 2

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

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

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


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