// File: /workspace/github_cpp_makefile_star2_O2/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, 0x38(%rsp)
movl %edx, %ebx
movq %rdi, %r14
movq 0x8(%rdi), %r12
movq %rsi, 0x10(%rsp)
movq 0x8(%rsi), %rsi
incq %rsi
leaq 0x70(%rsp), %r13
leaq 0xb(%rsp), %rdx
movq %r13, %rdi
callq 0x3b98
incq %r12
leaq 0x58(%rsp), %rdi
leaq 0xa(%rsp), %rcx
movq %r12, %rsi
movq %r13, %rdx
callq 0x3bea
leaq 0x70(%rsp), %rdi
callq 0x55fc
movq 0x8(%r14), %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x30(%rsp)
incq %rcx
movq %rcx, 0x40(%rsp)
subq $0x1, %rcx
jb 0x38b1
movq (%rax), %rdx
andl $0x0, (%rdx)
addq $0x18, %rax
jmp 0x389f
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x58(%rsp), %rax
movq %rdx, 0x28(%rsp)
leaq 0x1(%rdx), %rcx
movq %rcx, 0x20(%rsp)
xorl %ecx, %ecx
cmpq %rcx, 0x20(%rsp)
je 0x38e2
movq (%rax), %rdx
andl $0x0, (%rdx,%rcx,4)
incq %rcx
jmp 0x38cf
movslq %ebx, %rdi
addl %ebx, %ebx
movl %ebx, 0xc(%rsp)
pushq $0x1
popq %r11
xorl %eax, %eax
movq $0x0, 0x18(%rsp)
movq 0x58(%rsp), %r12
cmpq 0x40(%rsp), %r11
je 0x39e6
imulq $0x18, %r11, %rcx
addq %r12, %rcx
movq %rcx, 0x50(%rsp)
movq %rax, 0x48(%rsp)
addq %rax, %r12
xorl %r15d, %r15d
pushq $0x1
popq %r8
cmpq 0x20(%rsp), %r8
je 0x39d0
movq 0x50(%rsp), %rcx
movq -0x18(%rcx), %rax
movq (%rcx), %rdx
movl (%rax,%r8,4), %eax
movl -0x4(%rdx,%r8,4), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
cmpl %r11d, %r8d
movq %r11, %r13
movl %r11d, %eax
cmovll %r8d, %eax
movl 0xc(%rsp), %r9d
cmpl %r9d, %eax
cmovgel %r9d, %eax
movl %ecx, (%rdx,%r8,4)
movq 0x10(%rsp), %r9
movq (%r9), %r9
cltq
movq %r14, %rsi
movq (%r14), %r14
addq 0x18(%rsp), %r14
movq %r15, %rbx
movq %r12, %r11
pushq $0x1
popq %r10
cmpq %rax, %r10
jg 0x39bc
movb (%r14), %bpl
cmpb (%r9,%rbx), %bpl
jne 0x39bc
cmpq %rdi, %r10
jl 0x39ad
movq (%r12), %rbp
movl (%rbp,%rbx,4), %ebp
addl %r10d, %ebp
cmpl %ebp, %ecx
cmovlel %ebp, %ecx
movl %ecx, (%rdx,%r8,4)
incq %r10
decq %r14
addq $-0x18, %r12
decq %rbx
jmp 0x3986
incq %r8
incq %r15
movq %rsi, %r14
movq %r11, %r12
movq %r13, %r11
jmp 0x3925
incq %r11
incq 0x18(%rsp)
movq 0x48(%rsp), %rax
addq $0x18, %rax
jmp 0x38fa
imulq $0x18, 0x30(%rsp), %rax
movq (%r12,%rax), %rax
movq 0x28(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x38(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x58(%rsp), %rdi
callq 0x3c40
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x55fc
movq %rbx, %rdi
callq 0x21f0