; LLVM IR from eyangch/competitive-programming :: Codeforces/1583 (f)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@ans = external dso_local global [1000 x [1000 x i64]], align 16
@col = external dso_local global [1000 x [20 x i64]], align 16
@cur = external dso_local global %"class.std::vector", align 8
@cnt = external dso_local global %"class.std::vector", align 8
@len = external dso_local global i64, align 8
@n = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addv() #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %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
  store i32 0, ptr %1, align 4
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = 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)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 1, ptr %2, align 8, !tbaa !8
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @cur, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 1, ptr %3, align 8, !tbaa !8
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 1, ptr %4, align 8, !tbaa !8
  br label %19

19:                                               ; preds = %91, %0
  %20 = load i64, ptr %4, align 8, !tbaa !8
  %21 = load i64, ptr @N, align 8, !tbaa !8
  %22 = icmp slt i64 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %25

25:                                               ; preds = %40, %24
  %26 = load i64, ptr %6, align 8, !tbaa !8
  %27 = load i64, ptr @len, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i64, ptr %6, align 8, !tbaa !8
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cnt, i64 noundef %31) #6
  %33 = load i64, ptr %32, align 8, !tbaa !8
  %34 = load i64, ptr %4, align 8, !tbaa !8
  %35 = getelementptr inbounds [1000 x [20 x i64]], ptr @col, i64 0, i64 %34
  %36 = load i64, ptr %6, align 8, !tbaa !8
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %36) #6
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = getelementptr inbounds [20 x i64], ptr %35, i64 0, i64 %38
  store i64 %33, ptr %39, align 8, !tbaa !8
  br label %40

40:                                               ; preds = %30
  %41 = load i64, ptr %6, align 8, !tbaa !8
  %42 = add nsw i64 %41, 1
  store i64 %42, ptr %6, align 8, !tbaa !8
  br label %25, !llvm.loop !11

43:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %44

44:                                               ; preds = %81, %43
  %45 = load i64, ptr %7, align 8, !tbaa !8
  %46 = load i64, ptr %4, align 8, !tbaa !8
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %50

50:                                               ; preds = %76, %49
  %51 = load i64, ptr %8, align 8, !tbaa !8
  %52 = load i64, ptr @len, align 8, !tbaa !8
  %53 = icmp slt i64 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 11, ptr %5, align 4
  br label %79

55:                                               ; preds = %50
  %56 = load i64, ptr %7, align 8, !tbaa !8
  %57 = getelementptr inbounds [1000 x [20 x i64]], ptr @col, i64 0, i64 %56
  %58 = load i64, ptr %8, align 8, !tbaa !8
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %58) #6
  %60 = load i64, ptr %59, align 8, !tbaa !8
  %61 = getelementptr inbounds [20 x i64], ptr %57, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !8
  %63 = load i64, ptr %8, align 8, !tbaa !8
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cnt, i64 noundef %63) #6
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = icmp slt i64 %62, %65
  br i1 %66, label %67, label %75

67:                                               ; preds = %55
  %68 = load i64, ptr %8, align 8, !tbaa !8
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %68) #6
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = load i64, ptr %7, align 8, !tbaa !8
  %72 = getelementptr inbounds [1000 x [1000 x i64]], ptr @ans, i64 0, i64 %71
  %73 = load i64, ptr %4, align 8, !tbaa !8
  %74 = getelementptr inbounds [1000 x i64], ptr %72, i64 0, i64 %73
  store i64 %70, ptr %74, align 8, !tbaa !8
  store i32 11, ptr %5, align 4
  br label %79

75:                                               ; preds = %55
  br label %76

76:                                               ; preds = %75
  %77 = load i64, ptr %8, align 8, !tbaa !8
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %8, align 8, !tbaa !8
  br label %50, !llvm.loop !13

79:                                               ; preds = %67, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  %82 = load i64, ptr %7, align 8, !tbaa !8
  %83 = add nsw i64 %82, 1
  store i64 %83, ptr %7, align 8, !tbaa !8
  br label %44, !llvm.loop !14

84:                                               ; preds = %48
  %85 = load i64, ptr %4, align 8, !tbaa !8
  %86 = load i64, ptr @N, align 8, !tbaa !8
  %87 = sub nsw i64 %86, 1
  %88 = icmp ne i64 %85, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %84
  call void @_Z3addv()
  br label %90

90:                                               ; preds = %89, %84
  br label %91

91:                                               ; preds = %90
  %92 = load i64, ptr %4, align 8, !tbaa !8
  %93 = add nsw i64 %92, 1
  store i64 %93, ptr %4, align 8, !tbaa !8
  br label %19, !llvm.loop !15

94:                                               ; preds = %23
  %95 = load i64, ptr @n, align 8, !tbaa !8
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %95)
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %96, i8 noundef signext 10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %98

98:                                               ; preds = %123, %94
  %99 = load i64, ptr %9, align 8, !tbaa !8
  %100 = load i64, ptr @N, align 8, !tbaa !8
  %101 = icmp slt i64 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %126

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %104 = load i64, ptr %9, align 8, !tbaa !8
  %105 = add nsw i64 %104, 1
  store i64 %105, ptr %10, align 8, !tbaa !8
  br label %106

106:                                              ; preds = %119, %103
  %107 = load i64, ptr %10, align 8, !tbaa !8
  %108 = load i64, ptr @N, align 8, !tbaa !8
  %109 = icmp slt i64 %107, %108
  br i1 %109, label %111, label %110

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

111:                                              ; preds = %106
  %112 = load i64, ptr %9, align 8, !tbaa !8
  %113 = getelementptr inbounds [1000 x [1000 x i64]], ptr @ans, i64 0, i64 %112
  %114 = load i64, ptr %10, align 8, !tbaa !8
  %115 = getelementptr inbounds [1000 x i64], ptr %113, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %116)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %117, i8 noundef signext 32)
  br label %119

119:                                              ; preds = %111
  %120 = load i64, ptr %10, align 8, !tbaa !8
  %121 = add nsw i64 %120, 1
  store i64 %121, ptr %10, align 8, !tbaa !8
  br label %106, !llvm.loop !16

122:                                              ; preds = %110
  br label %123

123:                                              ; preds = %122
  %124 = load i64, ptr %9, align 8, !tbaa !8
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %9, align 8, !tbaa !8
  br label %98, !llvm.loop !17

126:                                              ; preds = %102
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %128 = load i32, ptr %1, align 4
  ret i32 %128
}

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

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 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) #5

; 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 = { 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 #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@ans = external dso_local local_unnamed_addr global [1000 x [1000 x i64]], align 16
@col = external dso_local local_unnamed_addr global [1000 x [20 x i64]], align 16
@cur = external dso_local global %"class.std::vector", align 8
@cnt = external dso_local global %"class.std::vector", align 8
@len = external dso_local local_unnamed_addr global i64, align 8
@n = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addv() local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = 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) @N)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 1, ptr %1, align 8, !tbaa !8
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @cur, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 1, ptr %2, align 8, !tbaa !8
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %11 = load i64, ptr @N, align 8, !tbaa !8
  %12 = icmp sgt i64 %11, 1
  br i1 %12, label %.preheader34.preheader, label %._crit_edge

.preheader34.preheader:                           ; preds = %0
  %.pre54 = load i64, ptr @len, align 8, !tbaa !8
  br label %.preheader34

.preheader34:                                     ; preds = %.preheader34.preheader, %52
  %13 = phi i64 [ %53, %52 ], [ %.pre54, %.preheader34.preheader ]
  %.03141 = phi i64 [ %55, %52 ], [ 1, %.preheader34.preheader ]
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %.split.us

._crit_edge:                                      ; preds = %52, %0
  %15 = load i64, ptr @n, align 8, !tbaa !8
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %15)
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %16, i8 noundef signext 10)
  %18 = load i64, ptr @N, align 8, !tbaa !8
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %.lr.ph47, label %._crit_edge48

.preheader33:                                     ; preds = %.lr.ph
  %20 = icmp sgt i64 %27, 0
  br i1 %20, label %.preheader, label %.split.us

.lr.ph:                                           ; preds = %.preheader34, %.lr.ph
  %.03036 = phi i64 [ %26, %.lr.ph ], [ 0, %.preheader34 ]
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cnt, i64 noundef %.03036) #6
  %22 = load i64, ptr %21, align 8, !tbaa !8
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %.03036) #6
  %24 = load i64, ptr %23, align 8, !tbaa !8
  %25 = getelementptr inbounds [1000 x [20 x i64]], ptr @col, i64 0, i64 %.03141, i64 %24
  store i64 %22, ptr %25, align 8, !tbaa !8
  %26 = add nuw nsw i64 %.03036, 1
  %27 = load i64, ptr @len, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %.preheader33, !llvm.loop !11

.preheader:                                       ; preds = %.preheader33, %.loopexit32
  %29 = phi i64 [ %49, %.loopexit32 ], [ %27, %.preheader33 ]
  %.02939 = phi i64 [ %50, %.loopexit32 ], [ 0, %.preheader33 ]
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %.lr.ph38, label %.loopexit32

.split.us:                                        ; preds = %.loopexit32, %.preheader34, %.preheader33
  %31 = phi i64 [ %27, %.preheader33 ], [ %13, %.preheader34 ], [ %49, %.loopexit32 ]
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = add nsw i64 %32, -1
  %.not = icmp eq i64 %.03141, %33
  br i1 %.not, label %52, label %51

.lr.ph38:                                         ; preds = %.preheader, %45
  %.02837 = phi i64 [ %46, %45 ], [ 0, %.preheader ]
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %.02837) #6
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = getelementptr inbounds [1000 x [20 x i64]], ptr @col, i64 0, i64 %.02939, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !8
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cnt, i64 noundef %.02837) #6
  %39 = load i64, ptr %38, align 8, !tbaa !8
  %40 = icmp slt i64 %37, %39
  br i1 %40, label %41, label %45

41:                                               ; preds = %.lr.ph38
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %.02837) #6
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = getelementptr inbounds [1000 x [1000 x i64]], ptr @ans, i64 0, i64 %.02939, i64 %.03141
  store i64 %43, ptr %44, align 8, !tbaa !8
  %.pre = load i64, ptr @len, align 8, !tbaa !8
  br label %.loopexit32

45:                                               ; preds = %.lr.ph38
  %46 = add nuw nsw i64 %.02837, 1
  %47 = load i64, ptr @len, align 8, !tbaa !8
  %48 = icmp slt i64 %46, %47
  br i1 %48, label %.lr.ph38, label %.loopexit32, !llvm.loop !13

.loopexit32:                                      ; preds = %45, %.preheader, %41
  %49 = phi i64 [ %29, %.preheader ], [ %.pre, %41 ], [ %47, %45 ]
  %50 = add nuw nsw i64 %.02939, 1
  %exitcond.not = icmp eq i64 %50, %.03141
  br i1 %exitcond.not, label %.split.us, label %.preheader, !llvm.loop !14

51:                                               ; preds = %.split.us
  call void @_Z3addv()
  %.pre52 = load i64, ptr @N, align 8, !tbaa !8
  %.pre53 = load i64, ptr @len, align 8, !tbaa !8
  br label %52

52:                                               ; preds = %.split.us, %51
  %53 = phi i64 [ %31, %.split.us ], [ %.pre53, %51 ]
  %54 = phi i64 [ %32, %.split.us ], [ %.pre52, %51 ]
  %55 = add nuw nsw i64 %.03141, 1
  %56 = icmp slt i64 %55, %54
  br i1 %56, label %.preheader34, label %._crit_edge, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph44, %.lr.ph47
  %57 = phi i64 [ %60, %.lr.ph47 ], [ %68, %.lr.ph44 ]
  %58 = icmp slt i64 %61, %57
  br i1 %58, label %.lr.ph47, label %._crit_edge48, !llvm.loop !17

._crit_edge48:                                    ; preds = %.loopexit, %._crit_edge
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  ret i32 0

.lr.ph47:                                         ; preds = %._crit_edge, %.loopexit
  %60 = phi i64 [ %57, %.loopexit ], [ %18, %._crit_edge ]
  %.02745 = phi i64 [ %61, %.loopexit ], [ 0, %._crit_edge ]
  %61 = add nuw nsw i64 %.02745, 1
  %62 = icmp slt i64 %61, %60
  br i1 %62, label %.lr.ph44, label %.loopexit

.lr.ph44:                                         ; preds = %.lr.ph47, %.lr.ph44
  %.042 = phi i64 [ %67, %.lr.ph44 ], [ %61, %.lr.ph47 ]
  %63 = getelementptr inbounds [1000 x [1000 x i64]], ptr @ans, i64 0, i64 %.02745, i64 %.042
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %64)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %65, i8 noundef signext 32)
  %67 = add nuw nsw i64 %.042, 1
  %68 = load i64, ptr @N, align 8, !tbaa !8
  %69 = icmp slt i64 %67, %68
  br i1 %69, label %.lr.ph44, label %.loopexit, !llvm.loop !18
}

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

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

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 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 #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 #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 = { 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 #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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