// File: /workspace/github_cpp_makefile_star2_O1/fpavetic[P]lcskpp/lcskpp.cpp
// Function: lcskpp_slow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int*)
void lcskpp_slow(const string& a, const string& b, const int K,
                 int* lcskpp_length) {
  vector<vector<int> > dp(a.size()+1, 
                          vector<int>(b.size()+1));

  for (int i = 0; i <= a.size(); ++i) dp[i][0] = 0;
  for (int j = 0; j <= b.size(); ++j) dp[0][j] = 0;

  for (int i = 1; i <= a.size(); ++i) {
    for (int j = 1; j <= b.size(); ++j) {
      dp[i][j] = max(dp[i-1][j], dp[i][j-1]);

      // 2*K is good enough limit because everything bigger is 
      // covered by some precedent matching interval.
      for (int k = 1; k <= min3(i, j, 2*K); ++k) {
        char aa = a[i-k];
        char bb = b[j-k];
        if (aa != bb) {
          break;
        }

        if (k >= K) {
          dp[i][j] = max(dp[i][j], dp[i-k][j-k]+k);
        }
      }
    }
  }

  *lcskpp_length = dp[a.size()][b.size()];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rdi, 0x10(%rsp)
movq 0x8(%rdi), %r12
movq %rsi, 0x18(%rsp)
movq 0x8(%rsi), %rsi
incq %rsi
leaq 0x70(%rsp), %r13
leaq 0x7(%rsp), %rdx
movq %r13, %rdi
callq 0x3f96
incq %r12
leaq 0x58(%rsp), %rdi
leaq 0x6(%rsp), %rcx
movq %r12, %rsi
movq %r13, %rdx
callq 0x4020
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3bf2
callq 0x2130
movq %rbx, 0x30(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rbx
movq $-0x1, %rax
movq 0x58(%rsp), %rcx
movq (%rcx), %rdx
movl $0x0, (%rdx)
incq %rax
addq $0x18, %rcx
cmpq %rax, %rbx
jne 0x3c0c
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movq %rcx, 0x8(%rsp)
leaq 0x4(,%rcx,4), %rdx
xorl %esi, %esi
callq 0x20a0
testq %rbx, %rbx
je 0x3d78
movq 0x58(%rsp), %rax
leaq -0x18(%rax), %rcx
movq %rcx, 0x38(%rsp)
movslq %ebp, %rdx
addl %ebp, %ebp
movl $0x1, %r8d
movq $0x0, 0x20(%rsp)
movq %rax, 0x40(%rsp)
movq %rax, 0x28(%rsp)
movq %rbx, 0x48(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x3d58
leaq (,%r8,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x38(%rsp), %rax
movq (%rax,%rcx), %r9
movq 0x40(%rsp), %rax
movq (%rax,%rcx), %r10
movq 0x18(%rsp), %rax
movq (%rax), %r11
movq 0x10(%rsp), %rax
movq (%rax), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
movl $0x1, %r15d
xorl %esi, %esi
movl (%r9,%r15,4), %ecx
movl -0x4(%r10,%r15,4), %edi
cmpl %edi, %ecx
cmovgl %ecx, %edi
movl %edi, (%r10,%r15,4)
cmpl %r8d, %r15d
movl %r8d, %ecx
cmovll %r15d, %ecx
cmpl %ebp, %ecx
cmovgel %ebp, %ecx
testl %ecx, %ecx
jle 0x3d43
movl %ecx, %ecx
movl $0x1, %r13d
movq 0x28(%rsp), %rdi
movq 0x50(%rsp), %rbx
movq %rsi, %r14
movb (%rbx), %r12b
cmpb (%r11,%r14), %r12b
jne 0x3d43
cmpq %rdx, %r13
jl 0x3d2d
movq (%rdi), %r12
movl (%r12,%r14,4), %r12d
addl %r13d, %r12d
movl (%r10,%r15,4), %eax
cmpl %r12d, %eax
cmovgl %eax, %r12d
movl %r12d, (%r10,%r15,4)
leaq 0x1(%r13), %rax
decq %r14
decq %rbx
addq $-0x18, %rdi
cmpq %rcx, %r13
movq %rax, %r13
jb 0x3d06
leaq 0x1(%r15), %rax
incq %rsi
cmpq 0x8(%rsp), %r15
movq %rax, %r15
jne 0x3ccc
leaq 0x1(%r8), %rcx
incq 0x20(%rsp)
addq $0x18, 0x28(%rsp)
movq 0x48(%rsp), %rbx
cmpq %rbx, %r8
movq %rcx, %r8
jne 0x3c80
leaq 0x58(%rsp), %rdi
movq (%rdi), %rax
leaq (%rbx,%rbx,2), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x30(%rsp), %rcx
movl %eax, (%rcx)
callq 0x40b0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3dc0
callq 0x2130
movq %rbx, %rdi
callq 0x21f0