// File: lindorx[P]train/HelpInsPro.cpp
// Function: TwoRegBin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, int)
unsigned char TwoRegBin(std::string *ch, int n)
{
	using namespace std;
	int i, j;
	int num1=16, num2=16;//����������С
	int a, b;
	const string *m1,*m2;
	string ch0 = ch[0];
	string ch1 = ch[1];
	if (n == 1 ){
		m1 = reg_1;
		m2 = reg_1;
	}
	else if (n == 2){
		m1 = reg2;
		m2 = reg2;
	}
	else if (n == 3){
		num2 = 8;
		m1 = reg2;
		m2 = reg3;
	}
	else if (n == 4){
		ch0 = ch[1];
		ch1 = ch[0];
		num2 = 8;
		m1 = reg2;
		m2 = reg3;
	}
	else{
		std::cout << "TwoRegBin��������������error-002��\n";
		return 0;
	}
	a = num1 / 2 - 1;
	b = num2 / 2 - 1;
	for (i = 0; i<num1; i++)
	for (j = 0; j<num2; j++){
		if (ch0 == m1[i] && ch1 == m2[j]){
			if (i>a && j>b)return 0xc0 + i - a - 1 + (j - b - 1) * 8;
			if (i > a)return 0xc0 + (i - a - 1) + j * 8;
			if (j > b)return 0xc0 + i + (j - b - 1) * 8;
			return 0xc0 + i+j*8;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x10, -0x20(%rbp)
movl $0x10, -0x24(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x30f0
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
leaq -0x80(%rbp), %rdi
callq 0x30f0
jmp 0x6d70
cmpl $0x1, -0x14(%rbp)
jne 0x6da8
leaq 0x1a6f3(%rip), %rax     # 0x21470
movq %rax, -0x38(%rbp)
leaq 0x1a6e8(%rip), %rax     # 0x21470
movq %rax, -0x40(%rbp)
jmp 0x6e86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7013
cmpl $0x2, -0x14(%rbp)
jne 0x6dc9
leaq 0x1a8bb(%rip), %rax     # 0x21670
movq %rax, -0x38(%rbp)
leaq 0x1a8b0(%rip), %rax     # 0x21670
movq %rax, -0x40(%rbp)
jmp 0x6e84
cmpl $0x3, -0x14(%rbp)
jne 0x6df1
movl $0x8, -0x24(%rbp)
leaq 0x1a893(%rip), %rax     # 0x21670
movq %rax, -0x38(%rbp)
leaq 0x1aa88(%rip), %rax     # 0x21870
movq %rax, -0x40(%rbp)
jmp 0x6e82
cmpl $0x4, -0x14(%rbp)
jne 0x6e58
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
leaq -0x60(%rbp), %rdi
callq 0x3050
jmp 0x6e0a
movq -0x10(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3050
jmp 0x6e19
movl $0x8, -0x24(%rbp)
leaq 0x1a849(%rip), %rax     # 0x21670
movq %rax, -0x38(%rbp)
leaq 0x1aa3e(%rip), %rax     # 0x21870
movq %rax, -0x40(%rbp)
jmp 0x6e80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3468
jmp 0x7013
movq 0x1a179(%rip), %rdi     # 0x20fd8
leaq 0x1438a(%rip), %rsi     # 0x1b1f0
callq 0x31f0
jmp 0x6e6d
movb $0x0, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x6ff5
jmp 0x6e82
jmp 0x6e84
jmp 0x6e86
movl -0x20(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
subl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x6fe7
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x6fd7
movq -0x38(%rbp), %rsi
movslq -0x18(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0xa810
testb $0x1, %al
jne 0x6eef
jmp 0x6fc7
movq -0x40(%rbp), %rsi
movslq -0x1c(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0xa810
testb $0x1, %al
jne 0x6f10
jmp 0x6fc7
movl -0x18(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x6f4e
movl -0x1c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jle 0x6f4e
movl -0x18(%rbp), %eax
addl $0xc0, %eax
subl -0x28(%rbp), %eax
subl $0x1, %eax
movl -0x1c(%rbp), %ecx
subl -0x2c(%rbp), %ecx
subl $0x1, %ecx
shll $0x3, %ecx
addl %ecx, %eax
movb %al, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x6ff5
movl -0x18(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x6f7b
movl -0x18(%rbp), %eax
subl -0x28(%rbp), %eax
subl $0x1, %eax
addl $0xc0, %eax
movl -0x1c(%rbp), %ecx
shll $0x3, %ecx
addl %ecx, %eax
movb %al, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x6ff5
movl -0x1c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jle 0x6fa8
movl -0x18(%rbp), %eax
addl $0xc0, %eax
movl -0x1c(%rbp), %ecx
subl -0x2c(%rbp), %ecx
subl $0x1, %ecx
shll $0x3, %ecx
addl %ecx, %eax
movb %al, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x6ff5
movl -0x18(%rbp), %eax
addl $0xc0, %eax
movl -0x1c(%rbp), %ecx
shll $0x3, %ecx
addl %ecx, %eax
movb %al, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x6ff5
jmp 0x6fc9
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6ec2
jmp 0x6fd9
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6eaf
movb $0x0, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3468
leaq -0x60(%rbp), %rdi
callq 0x3468
movb -0x1(%rbp), %al
addq $0x90, %rsp
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0x3468
movq -0x88(%rbp), %rdi
callq 0x33f0
nopl (%rax,%rax)