; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan (199)

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

@s = external dso_local global [510 x i32], align 16
@dp = external dso_local global [510 x [510 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

25:                                               ; preds = %42, %0
  %26 = load i32, ptr %3, align 4, !tbaa !8
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = icmp sle i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %45

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %32 = load i32, ptr %3, align 4, !tbaa !8
  %33 = sub nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [510 x i32], ptr @s, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !8
  %37 = load i32, ptr %4, align 4, !tbaa !8
  %38 = add nsw i32 %36, %37
  %39 = load i32, ptr %3, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [510 x i32], ptr @s, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %42

42:                                               ; preds = %30
  %43 = load i32, ptr %3, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %3, align 4, !tbaa !8
  br label %25, !llvm.loop !11

45:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %46

46:                                               ; preds = %58, %45
  %47 = load i32, ptr %5, align 4, !tbaa !8
  %48 = load i32, ptr %2, align 4, !tbaa !8
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %61

51:                                               ; preds = %46
  %52 = load i32, ptr %5, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %53
  %55 = load i32, ptr %5, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [510 x i64], ptr %54, i64 0, i64 %56
  store i64 0, ptr %57, align 8, !tbaa !13
  br label %58

58:                                               ; preds = %51
  %59 = load i32, ptr %5, align 4, !tbaa !8
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %5, align 4, !tbaa !8
  br label %46, !llvm.loop !15

61:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %62

62:                                               ; preds = %144, %61
  %63 = load i32, ptr %6, align 4, !tbaa !8
  %64 = load i32, ptr %2, align 4, !tbaa !8
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

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

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !8
  br label %68

68:                                               ; preds = %140, %67
  %69 = load i32, ptr %8, align 4, !tbaa !8
  %70 = load i32, ptr %2, align 4, !tbaa !8
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %143

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %74 = load i32, ptr %8, align 4, !tbaa !8
  store i32 %74, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %75 = load i32, ptr %8, align 4, !tbaa !8
  %76 = load i32, ptr %6, align 4, !tbaa !8
  %77 = add nsw i32 %75, %76
  store i32 %77, ptr %10, align 4, !tbaa !8
  %78 = load i32, ptr %10, align 4, !tbaa !8
  %79 = load i32, ptr %2, align 4, !tbaa !8
  %80 = icmp sgt i32 %78, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %73
  store i32 13, ptr %7, align 4
  br label %137

82:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %83 = load i32, ptr %9, align 4, !tbaa !8
  store i32 %83, ptr %11, align 4, !tbaa !8
  br label %84

84:                                               ; preds = %133, %82
  %85 = load i32, ptr %11, align 4, !tbaa !8
  %86 = load i32, ptr %10, align 4, !tbaa !8
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %136

89:                                               ; preds = %84
  %90 = load i32, ptr %9, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %91
  %93 = load i32, ptr %10, align 4, !tbaa !8
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [510 x i64], ptr %92, i64 0, i64 %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %96 = load i32, ptr %9, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %97
  %99 = load i32, ptr %11, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [510 x i64], ptr %98, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !13
  %103 = load i32, ptr %11, align 4, !tbaa !8
  %104 = add nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %105
  %107 = load i32, ptr %10, align 4, !tbaa !8
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [510 x i64], ptr %106, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !13
  %111 = add nsw i64 %102, %110
  %112 = load i32, ptr %10, align 4, !tbaa !8
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [510 x i32], ptr @s, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !8
  %116 = sext i32 %115 to i64
  %117 = add nsw i64 %111, %116
  %118 = load i32, ptr %9, align 4, !tbaa !8
  %119 = sub nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [510 x i32], ptr @s, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = sub nsw i64 %117, %123
  store i64 %124, ptr %12, align 8, !tbaa !13
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %126 = load i64, ptr %125, align 8, !tbaa !13
  %127 = load i32, ptr %9, align 4, !tbaa !8
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %128
  %130 = load i32, ptr %10, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [510 x i64], ptr %129, i64 0, i64 %131
  store i64 %126, ptr %132, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %133

133:                                              ; preds = %89
  %134 = load i32, ptr %11, align 4, !tbaa !8
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %11, align 4, !tbaa !8
  br label %84, !llvm.loop !16

136:                                              ; preds = %88
  store i32 0, ptr %7, align 4
  br label %137

137:                                              ; preds = %136, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %138 = load i32, ptr %7, align 4
  switch i32 %138, label %154 [
    i32 0, label %139
    i32 13, label %140
  ]

139:                                              ; preds = %137
  br label %140

140:                                              ; preds = %139, %137
  %141 = load i32, ptr %8, align 4, !tbaa !8
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %8, align 4, !tbaa !8
  br label %68, !llvm.loop !17

143:                                              ; preds = %72
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %6, align 4, !tbaa !8
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %6, align 4, !tbaa !8
  br label %62, !llvm.loop !18

147:                                              ; preds = %66
  %148 = load i32, ptr %2, align 4, !tbaa !8
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [510 x i64], ptr getelementptr inbounds ([510 x [510 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !13
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %151)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %153 = load i32, ptr %1, align 4
  ret i32 %153

154:                                              ; preds = %137
  unreachable
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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

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

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

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

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

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

@s = external dso_local local_unnamed_addr global [510 x i32], align 16
@dp = external dso_local global [510 x [510 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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2080800) @dp, i8 63, i64 2080800, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %16 = load i32, ptr %1, align 4, !tbaa !8
  %.not44 = icmp slt i32 %16, 1
  br i1 %.not44, label %._crit_edge54, label %.lr.ph

.preheader42:                                     ; preds = %.lr.ph
  %.not3846 = icmp slt i32 %26, 1
  br i1 %.not3846, label %._crit_edge54, label %.lr.ph48.preheader

.lr.ph48.preheader:                               ; preds = %.preheader42
  %17 = zext nneg i32 %26 to i64
  %xtraiter = and i64 %17, 3
  %18 = icmp ult i32 %26, 4
  br i1 %18, label %.preheader41.unr-lcssa, label %.lr.ph48.preheader.new

.lr.ph48.preheader.new:                           ; preds = %.lr.ph48.preheader
  %unroll_iter = and i64 %17, 2147483644
  br label %.lr.ph48

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %20 = add nsw i64 %indvars.iv, -1
  %21 = getelementptr inbounds [510 x i32], ptr @s, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !8
  %23 = load i32, ptr %2, align 4, !tbaa !8
  %24 = add nsw i32 %23, %22
  %25 = getelementptr inbounds [510 x i32], ptr @s, i64 0, i64 %indvars.iv
  store i32 %24, ptr %25, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr %1, align 4, !tbaa !8
  %27 = sext i32 %26 to i64
  %.not.not = icmp slt i64 %indvars.iv, %27
  br i1 %.not.not, label %.lr.ph, label %.preheader42, !llvm.loop !11

.preheader41.unr-lcssa:                           ; preds = %.lr.ph48, %.lr.ph48.preheader
  %indvars.iv60.unr = phi i64 [ 1, %.lr.ph48.preheader ], [ %indvars.iv.next61.3, %.lr.ph48 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader41, label %.lr.ph48.epil

.lr.ph48.epil:                                    ; preds = %.preheader41.unr-lcssa, %.lr.ph48.epil
  %indvars.iv60.epil = phi i64 [ %indvars.iv.next61.epil, %.lr.ph48.epil ], [ %indvars.iv60.unr, %.preheader41.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph48.epil ], [ 0, %.preheader41.unr-lcssa ]
  %28 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %indvars.iv60.epil, i64 %indvars.iv60.epil
  store i64 0, ptr %28, align 8, !tbaa !13
  %indvars.iv.next61.epil = add nuw nsw i64 %indvars.iv60.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader41, label %.lr.ph48.epil, !llvm.loop !15

.preheader41:                                     ; preds = %.lr.ph48.epil, %.preheader41.unr-lcssa
  %.not = icmp eq i32 %26, 1
  br i1 %.not, label %._crit_edge54, label %.preheader40

.lr.ph48:                                         ; preds = %.lr.ph48, %.lr.ph48.preheader.new
  %indvars.iv60 = phi i64 [ 1, %.lr.ph48.preheader.new ], [ %indvars.iv.next61.3, %.lr.ph48 ]
  %niter = phi i64 [ 0, %.lr.ph48.preheader.new ], [ %niter.next.3, %.lr.ph48 ]
  %29 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %indvars.iv60, i64 %indvars.iv60
  store i64 0, ptr %29, align 8, !tbaa !13
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %30 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next61, i64 %indvars.iv.next61
  store i64 0, ptr %30, align 8, !tbaa !13
  %indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60, 2
  %31 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next61.1, i64 %indvars.iv.next61.1
  store i64 0, ptr %31, align 8, !tbaa !13
  %indvars.iv.next61.2 = add nuw nsw i64 %indvars.iv60, 3
  %32 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next61.2, i64 %indvars.iv.next61.2
  store i64 0, ptr %32, align 8, !tbaa !13
  %indvars.iv.next61.3 = add nuw nsw i64 %indvars.iv60, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader41.unr-lcssa, label %.lr.ph48, !llvm.loop !17

.preheader40:                                     ; preds = %.preheader41, %._crit_edge
  %33 = phi i32 [ %38, %._crit_edge ], [ %26, %.preheader41 ]
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %._crit_edge ], [ 1, %.preheader41 ]
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %._crit_edge ], [ 2, %.preheader41 ]
  %.not3950 = icmp slt i32 %33, 1
  br i1 %.not3950, label %._crit_edge, label %.lr.ph52

._crit_edge54:                                    ; preds = %._crit_edge, %0, %.preheader42, %.preheader41
  %.lcssa = phi i32 [ %26, %.preheader41 ], [ %26, %.preheader42 ], [ %16, %0 ], [ %38, %._crit_edge ]
  %34 = sext i32 %.lcssa to i64
  %35 = getelementptr inbounds [510 x i64], ptr getelementptr inbounds (i8, ptr @dp, i64 4080), i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !13
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %36)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

._crit_edge:                                      ; preds = %.loopexit, %.preheader40
  %38 = phi i32 [ %33, %.preheader40 ], [ %64, %.loopexit ]
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv.next82, %39
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  br i1 %40, label %.preheader40, label %._crit_edge54, !llvm.loop !18

.lr.ph52:                                         ; preds = %.preheader40, %.loopexit
  %41 = phi i32 [ %64, %.loopexit ], [ %33, %.preheader40 ]
  %42 = phi i32 [ %65, %.loopexit ], [ %33, %.preheader40 ]
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %.loopexit ], [ %indvars.iv74, %.preheader40 ]
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.loopexit ], [ 1, %.preheader40 ]
  %43 = add nuw nsw i64 %indvars.iv63, %indvars.iv81
  %44 = sext i32 %42 to i64
  %45 = icmp sgt i64 %43, %44
  br i1 %45, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.lr.ph52
  %46 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %indvars.iv63, i64 %43
  %47 = getelementptr inbounds [510 x i32], ptr @s, i64 0, i64 %43
  %48 = add nsw i64 %indvars.iv63, -1
  %49 = getelementptr inbounds [510 x i32], ptr @s, i64 0, i64 %48
  br label %50

50:                                               ; preds = %.preheader, %50
  %indvars.iv65 = phi i64 [ %indvars.iv63, %.preheader ], [ %indvars.iv.next66, %50 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %51 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %indvars.iv63, i64 %indvars.iv65
  %52 = load i64, ptr %51, align 8, !tbaa !13
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %53 = getelementptr inbounds [510 x [510 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next66, i64 %43
  %54 = load i64, ptr %53, align 8, !tbaa !13
  %55 = add nsw i64 %54, %52
  %56 = load i32, ptr %47, align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = add nsw i64 %55, %57
  %59 = load i32, ptr %49, align 4, !tbaa !8
  %60 = sext i32 %59 to i64
  %61 = sub i64 %58, %60
  store i64 %61, ptr %3, align 8, !tbaa !13
  %62 = 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) %3)
  %63 = load i64, ptr %62, align 8, !tbaa !13
  store i64 %63, ptr %46, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %exitcond73.not = icmp eq i64 %indvars.iv.next66, %indvars.iv76
  br i1 %exitcond73.not, label %.loopexit.loopexit, label %50, !llvm.loop !20

.loopexit.loopexit:                               ; preds = %50
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph52
  %64 = phi i32 [ %.pre, %.loopexit.loopexit ], [ %41, %.lr.ph52 ]
  %65 = phi i32 [ %.pre, %.loopexit.loopexit ], [ %42, %.lr.ph52 ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %66 = sext i32 %65 to i64
  %.not39.not = icmp slt i64 %indvars.iv63, %66
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  br i1 %.not39.not, label %.lr.ph52, label %._crit_edge, !llvm.loop !21
}

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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

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

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

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

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

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


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