; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2016.03 (248)

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

@dp = external dso_local global [248 x [60 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, 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 ptr, align 8
  %4 = alloca i64, align 8
  %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 i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = load ptr, ptr @stdin, align 8, !tbaa !8
  %21 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %20)
  %22 = load ptr, ptr @stdout, align 8, !tbaa !8
  %23 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %22)
  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)
  %25 = load i32, ptr %2, align 4, !tbaa !11
  %26 = zext i32 %25 to i64
  %27 = call ptr @llvm.stacksave.p0()
  store ptr %27, ptr %3, align 8
  %28 = alloca i32, i64 %26, align 16
  store i64 %26, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %29

29:                                               ; preds = %39, %0
  %30 = load i32, ptr %5, align 4, !tbaa !11
  %31 = load i32, ptr %2, align 4, !tbaa !11
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %5, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i32, ptr %28, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %37)
  br label %39

39:                                               ; preds = %34
  %40 = load i32, ptr %5, align 4, !tbaa !11
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %5, align 4, !tbaa !11
  br label %29, !llvm.loop !13

42:                                               ; preds = %33
  %43 = load i32, ptr %2, align 4, !tbaa !11
  %44 = sub nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %45
  %47 = getelementptr inbounds [60 x i32], ptr %46, i64 0, i64 0
  %48 = getelementptr inbounds i32, ptr %47, i64 60
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 -1, ptr %6, align 4, !tbaa !11
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @dp, ptr noundef %48, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %49

49:                                               ; preds = %65, %42
  %50 = load i32, ptr %7, align 4, !tbaa !11
  %51 = load i32, ptr %2, align 4, !tbaa !11
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %68

54:                                               ; preds = %49
  %55 = load i32, ptr %7, align 4, !tbaa !11
  %56 = load i32, ptr %7, align 4, !tbaa !11
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %57
  %59 = load i32, ptr %7, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i32, ptr %28, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !11
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [60 x i32], ptr %58, i64 0, i64 %63
  store i32 %55, ptr %64, align 4, !tbaa !11
  br label %65

65:                                               ; preds = %54
  %66 = load i32, ptr %7, align 4, !tbaa !11
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %7, align 4, !tbaa !11
  br label %49, !llvm.loop !15

68:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %134, %68
  %70 = load i32, ptr %9, align 4, !tbaa !11
  %71 = icmp slt i32 %70, 60
  br i1 %71, label %73, label %72

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

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %74

74:                                               ; preds = %130, %73
  %75 = load i32, ptr %11, align 4, !tbaa !11
  %76 = load i32, ptr %2, align 4, !tbaa !11
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %133

79:                                               ; preds = %74
  %80 = load i32, ptr %11, align 4, !tbaa !11
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %28, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !11
  %84 = load i32, ptr %9, align 4, !tbaa !11
  %85 = icmp sge i32 %83, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %79
  br label %130

87:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %88 = load i32, ptr %11, align 4, !tbaa !11
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %89
  %91 = load i32, ptr %9, align 4, !tbaa !11
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [60 x i32], ptr %90, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !11
  store i32 %95, ptr %12, align 4, !tbaa !11
  %96 = load i32, ptr %12, align 4, !tbaa !11
  %97 = icmp eq i32 %96, -1
  br i1 %97, label %103, label %98

98:                                               ; preds = %87
  %99 = load i32, ptr %12, align 4, !tbaa !11
  %100 = load i32, ptr %2, align 4, !tbaa !11
  %101 = sub nsw i32 %100, 1
  %102 = icmp eq i32 %99, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %98, %87
  store i32 13, ptr %10, align 4
  br label %127

104:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %105 = load i32, ptr %12, align 4, !tbaa !11
  %106 = add nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %107
  %109 = load i32, ptr %9, align 4, !tbaa !11
  %110 = sub nsw i32 %109, 1
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [60 x i32], ptr %108, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !11
  store i32 %113, ptr %13, align 4, !tbaa !11
  %114 = load i32, ptr %13, align 4, !tbaa !11
  %115 = icmp eq i32 %114, -1
  br i1 %115, label %116, label %117

116:                                              ; preds = %104
  store i32 13, ptr %10, align 4
  br label %126

117:                                              ; preds = %104
  %118 = load i32, ptr %13, align 4, !tbaa !11
  %119 = load i32, ptr %11, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %120
  %122 = load i32, ptr %9, align 4, !tbaa !11
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [60 x i32], ptr %121, i64 0, i64 %123
  store i32 %118, ptr %124, align 4, !tbaa !11
  %125 = load i32, ptr %9, align 4, !tbaa !11
  store i32 %125, ptr %8, align 4, !tbaa !11
  store i32 0, ptr %10, align 4
  br label %126

126:                                              ; preds = %117, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %127

127:                                              ; preds = %126, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %128 = load i32, ptr %10, align 4
  switch i32 %128, label %143 [
    i32 0, label %129
    i32 13, label %130
  ]

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129, %127, %86
  %131 = load i32, ptr %11, align 4, !tbaa !11
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %11, align 4, !tbaa !11
  br label %74, !llvm.loop !16

133:                                              ; preds = %78
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %9, align 4, !tbaa !11
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %9, align 4, !tbaa !11
  br label %69, !llvm.loop !17

137:                                              ; preds = %72
  %138 = load i32, ptr %8, align 4, !tbaa !11
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %138)
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %141 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %141)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %142 = load i32, ptr %1, align 4
  ret i32 %142

143:                                              ; preds = %127
  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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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
declare ptr @llvm.stacksave.p0() #4

; 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 dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
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 = { 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 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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

@dp = external dso_local global [248 x [60 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, 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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = load ptr, ptr @stdin, align 8, !tbaa !8
  %10 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %9)
  %11 = load ptr, ptr @stdout, align 8, !tbaa !8
  %12 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %13 = 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)
  %14 = load i32, ptr %1, align 4, !tbaa !11
  %15 = zext i32 %14 to i64
  %16 = call ptr @llvm.stacksave.p0()
  %17 = alloca i32, i64 %15, align 16
  %18 = load i32, ptr %1, align 4, !tbaa !11
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa37 = phi i32 [ %18, %0 ], [ %29, %.lr.ph ]
  %20 = add nsw i32 %.lcssa37, -1
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %21
  %23 = getelementptr inbounds i8, ptr %22, i64 240
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 -1, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @dp, ptr noundef nonnull %23, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %24 = load i32, ptr %1, align 4, !tbaa !11
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph41.preheader, label %.split.us

.lr.ph41.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %24 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %26 = icmp ult i32 %24, 4
  br i1 %26, label %.preheader36.unr-lcssa, label %.lr.ph41.preheader.new

.lr.ph41.preheader.new:                           ; preds = %.lr.ph41.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph41

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %27 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %1, align 4, !tbaa !11
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader36.unr-lcssa:                           ; preds = %.lr.ph41, %.lr.ph41.preheader
  %indvars.iv52.unr = phi i64 [ 0, %.lr.ph41.preheader ], [ %indvars.iv.next53.3, %.lr.ph41 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader36, label %.lr.ph41.epil

.lr.ph41.epil:                                    ; preds = %.preheader36.unr-lcssa, %.lr.ph41.epil
  %indvars.iv52.epil = phi i64 [ %indvars.iv.next53.epil, %.lr.ph41.epil ], [ %indvars.iv52.unr, %.preheader36.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph41.epil ], [ 0, %.preheader36.unr-lcssa ]
  %32 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv52.epil
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %indvars.iv52.epil, i64 %34
  %36 = trunc nuw nsw i64 %indvars.iv52.epil to i32
  store i32 %36, ptr %35, align 4, !tbaa !11
  %indvars.iv.next53.epil = add nuw nsw i64 %indvars.iv52.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 %.preheader36, label %.lr.ph41.epil, !llvm.loop !15

.preheader36:                                     ; preds = %.lr.ph41.epil, %.preheader36.unr-lcssa
  %37 = add nsw i32 %24, -1
  br i1 %25, label %.preheader.us.preheader, label %.split.us

.preheader.us.preheader:                          ; preds = %.preheader36
  %wide.trip.count58 = zext nneg i32 %24 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge46.us
  %indvars.iv60 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next61, %._crit_edge46.us ]
  %.02948.us = phi i32 [ 0, %.preheader.us.preheader ], [ %.4.us, %._crit_edge46.us ]
  %38 = add nsw i64 %indvars.iv60, -1
  %39 = trunc nuw nsw i64 %indvars.iv60 to i32
  br label %40

40:                                               ; preds = %.preheader.us, %57
  %indvars.iv55 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next56, %57 ]
  %.143.us = phi i32 [ %.02948.us, %.preheader.us ], [ %.4.us, %57 ]
  %41 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv55
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = sext i32 %42 to i64
  %.not.us = icmp sgt i64 %indvars.iv60, %43
  br i1 %.not.us, label %44, label %57

44:                                               ; preds = %40
  %45 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %indvars.iv55, i64 %38
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = icmp eq i32 %46, -1
  %48 = icmp eq i32 %46, %37
  %or.cond.us = select i1 %47, i1 true, i1 %48
  br i1 %or.cond.us, label %57, label %49

49:                                               ; preds = %44
  %50 = add nuw nsw i32 %46, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %51, i64 %38
  %53 = load i32, ptr %52, align 4, !tbaa !11
  %54 = icmp eq i32 %53, -1
  br i1 %54, label %57, label %55

55:                                               ; preds = %49
  %56 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %indvars.iv55, i64 %indvars.iv60
  store i32 %53, ptr %56, align 4, !tbaa !11
  br label %57

57:                                               ; preds = %55, %49, %44, %40
  %.4.us = phi i32 [ %.143.us, %40 ], [ %.143.us, %44 ], [ %39, %55 ], [ %.143.us, %49 ]
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond59.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count58
  br i1 %exitcond59.not, label %._crit_edge46.us, label %40, !llvm.loop !17

._crit_edge46.us:                                 ; preds = %57
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next61, 60
  br i1 %exitcond63.not, label %.split.us, label %.preheader.us, !llvm.loop !18

.lr.ph41:                                         ; preds = %.lr.ph41, %.lr.ph41.preheader.new
  %indvars.iv52 = phi i64 [ 0, %.lr.ph41.preheader.new ], [ %indvars.iv.next53.3, %.lr.ph41 ]
  %niter = phi i64 [ 0, %.lr.ph41.preheader.new ], [ %niter.next.3, %.lr.ph41 ]
  %58 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv52
  %59 = load i32, ptr %58, align 16, !tbaa !11
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %indvars.iv52, i64 %60
  %62 = trunc nuw nsw i64 %indvars.iv52 to i32
  store i32 %62, ptr %61, align 4, !tbaa !11
  %indvars.iv.next53 = or disjoint i64 %indvars.iv52, 1
  %63 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next53
  %64 = load i32, ptr %63, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next53, i64 %65
  %67 = trunc nuw nsw i64 %indvars.iv.next53 to i32
  store i32 %67, ptr %66, align 4, !tbaa !11
  %indvars.iv.next53.1 = or disjoint i64 %indvars.iv52, 2
  %68 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next53.1
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next53.1, i64 %70
  %72 = trunc nuw nsw i64 %indvars.iv.next53.1 to i32
  store i32 %72, ptr %71, align 4, !tbaa !11
  %indvars.iv.next53.2 = or disjoint i64 %indvars.iv52, 3
  %73 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next53.2
  %74 = load i32, ptr %73, align 4, !tbaa !11
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [248 x [60 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next53.2, i64 %75
  %77 = trunc nuw nsw i64 %indvars.iv.next53.2 to i32
  store i32 %77, ptr %76, align 4, !tbaa !11
  %indvars.iv.next53.3 = add nuw nsw i64 %indvars.iv52, 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 %.preheader36.unr-lcssa, label %.lr.ph41, !llvm.loop !19

.split.us:                                        ; preds = %._crit_edge46.us, %._crit_edge, %.preheader36
  %.us-phi = phi i32 [ 0, %.preheader36 ], [ 0, %._crit_edge ], [ %.4.us, %._crit_edge46.us ]
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.us-phi)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %78, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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
declare ptr @llvm.stacksave.p0() #4

; 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 dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { 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 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass