// File: mxy161610207[P]codesim/src/MyPaser.cpp
// Function: MyPaser::LCS(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
int MyPaser::LCS(vector<string>& a, vector<string>& b) {
	int na = a.size();
	int nb = b.size();

	int** dp = new int* [na+10];
	for (int i = 0; i < na+10; ++i)
	{
		dp[i] = new int[nb+10];
	}

	for (int i = 0; i <= na; i++) {
		for (int j = 0; j <= nb; j++) {
			dp[i][j] = 0;
		}
	}

	for (int i = 1; i <= na; i++) {
		for (int j = 1; j <= nb; j++) {
			if (a[i - 1] == b[j - 1]) {
				dp[i][j] = dp[i - 1][j - 1] + 1;
			}
			else {
				dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
			}
		}
	}

	int ans = dp[na][nb];

	for (int i = 0; i < na+10; ++i)
	{
		delete[] dp[i];
	}
	delete[] dp;

	/*
	for (auto& i : a) {
		cout << i << ",";
	}
	cout << endl;
	for (auto& i : b) {
		cout << i << ",";
	}
	cout << endl;
	cout << dp[na][nb] << endl;
	//*/

	return ans;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x45c0
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x45c0
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
addl $0xa, %eax
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x14(%rbp), %ecx
addl $0xa, %ecx
cmpl %ecx, %eax
jge 0x32ec
movl -0x18(%rbp), %eax
addl $0xa, %eax
cltq
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rdx
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x329c
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x3339
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0x332c
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3302
jmp 0x332e
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x32f3
movl $0x1, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x343f
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0x342f
movq -0x8(%rbp), %rdi
movl -0x30(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x48d0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x48d0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x4840
testb $0x1, %al
jne 0x3399
jmp 0x33ce
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x341f
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x34(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x34(%rbp), %eax
subl $0x1, %eax
cltq
shlq $0x2, %rax
addq %rax, %rsi
callq 0x48f0
movl (%rax), %edx
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x3421
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3353
jmp 0x3431
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3340
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x14(%rbp), %ecx
addl $0xa, %ecx
cmpl %ecx, %eax
jge 0x3495
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x3488
movq -0x50(%rbp), %rdi
callq 0x2310
jmp 0x348a
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x345c
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x34ac
movq -0x58(%rbp), %rdi
callq 0x2310
movl -0x38(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)