// File: /workspace/github_cpp_makefile_star2_O3/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, 0x18(%rsp)
movq 0x8(%rdi), %r12
movq %rsi, 0x20(%rsp)
movq 0x8(%rsi), %rsi
incq %rsi
leaq 0x58(%rsp), %r13
leaq 0x7(%rsp), %rdx
movq %r13, %rdi
callq 0x3f90
incq %r12
leaq 0x70(%rsp), %rdi
leaq 0x6(%rsp), %rcx
movq %r12, %rsi
movq %r13, %rdx
callq 0x401c
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3bea
callq 0x2130
movq %rbx, 0x38(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rbx
movq $-0x1, %rax
movq 0x70(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq (%rcx), %rdx
movl $0x0, (%rdx)
incq %rax
addq $0x18, %rcx
cmpq %rax, %rbx
jne 0x3c09
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %rcx, 0x10(%rsp)
leaq 0x4(,%rcx,4), %rdx
xorl %esi, %esi
callq 0x20a0
testq %rbx, %rbx
je 0x3d6a
movq 0x8(%rsp), %rax
leaq -0x18(%rax), %rcx
movq %rcx, 0x40(%rsp)
movslq %ebp, %rcx
addl %ebp, %ebp
movl $0x1, %edi
movq $0x0, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq %rbx, 0x48(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x3d4a
leaq (,%rdi,8), %rax
leaq (%rax,%rax,2), %rax
movq 0x40(%rsp), %rdx
movq (%rdx,%rax), %r8
movq 0x8(%rsp), %rdx
movq (%rdx,%rax), %r9
movq 0x20(%rsp), %rax
movq (%rax), %r10
movq 0x18(%rsp), %rax
movq (%rax), %rax
addq 0x28(%rsp), %rax
movq %rax, 0x50(%rsp)
movl $0x1, %r15d
xorl %ebx, %ebx
movl (%r8,%r15,4), %edx
movl -0x4(%r9,%r15,4), %eax
cmpl %eax, %edx
cmovgl %edx, %eax
movl %eax, (%r9,%r15,4)
cmpl %edi, %r15d
movl %edi, %edx
cmovll %r15d, %edx
cmpl %ebp, %edx
cmovgel %ebp, %edx
testl %edx, %edx
jle 0x3d35
movl %edx, %r13d
movl $0x1, %edx
movq 0x30(%rsp), %rsi
movq 0x50(%rsp), %r11
movq %rbx, %r14
movb (%r11), %r12b
cmpb (%r10,%r14), %r12b
jne 0x3d35
cmpq %rcx, %rdx
jl 0x3d1f
movq (%rsi), %r12
movl (%r12,%r14,4), %r12d
addl %edx, %r12d
cmpl %r12d, %eax
cmovlel %r12d, %eax
movl %eax, (%r9,%r15,4)
leaq 0x1(%rdx), %r12
decq %r14
decq %r11
addq $-0x18, %rsi
cmpq %r13, %rdx
movq %r12, %rdx
jb 0x3cfc
leaq 0x1(%r15), %rax
incq %rbx
cmpq 0x10(%rsp), %r15
movq %rax, %r15
jne 0x3cc3
leaq 0x1(%rdi), %rax
incq 0x28(%rsp)
addq $0x18, 0x30(%rsp)
movq 0x48(%rsp), %rbx
cmpq %rbx, %rdi
movq %rax, %rdi
jne 0x3c77
leaq (%rbx,%rbx,2), %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x38(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x70(%rsp), %rdi
callq 0x40ac
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3db4
callq 0x2130
movq %rbx, %rdi
callq 0x21f0