// File: lindorx[P]train/InsPro.cpp
// Function: Logic(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, char)
std::vector<unsigned char>Logic(const std::string& str, int n, int num, char w_n)
{
	using namespace std;
	vector<unsigned char>data;
	string *ch = CS(str, n);
	unsigned char dt8 = 0, dt16 = 0, dt_ax = 0, dt_al = 0, dt8_num = 0, dt16_num[2] = {0};

	unsigned char a, b;
	const unsigned char *mm;
	if (w_n == 'a'){
		//�Ĵ���֮��
		dt8 = 0x20;
		dt16 = 0x21;
		//�Ĵ�������ֵ
		dt_al = 0x24;
		dt_ax = 0x25;
		dt8_num = 0x80;
		dt16_num[0] = 0x81;//������������0x80ʱ
		dt16_num[1] = 0x83;//��������С��0x80ʱ
		mm = logic_and;
	}
	else if (w_n == 'o'){
		//�Ĵ���֮��
		dt8 = 0x08;
		dt16 = 0x09;
		//�Ĵ�������ֵ
		dt_al = 0x0c;
		dt_ax = 0x0d;
		dt8_num = 0x80;
		dt16_num[0] = 0x81;//������������0x80ʱ
		dt16_num[1] = 0x83;//��������С��0x80ʱ
		mm = logic_or;
	}
	else if (w_n == 'x'){
		//�Ĵ���֮��
		dt8 = 0x30;
		dt16 = 0x31;
		//�Ĵ�������ֵ
		dt_al = 0x34;
		dt_ax = 0x35;
		dt8_num = 0x80;
		dt16_num[0] = 0x81;//������������0x80ʱ
		dt16_num[1] = 0x83;//��������С��0x80ʱ
		mm = logic_xor;
	}
	else{
		cout << "����-025��������login����������" << w_n << endl;
		return data;
	}
	a = TwoRegBin(ch, 1);//�����Ƿ���8λ�Ĵ���
	b = TwoRegBin(ch, 2);//�����Ƿ���16λ�Ĵ���
	if (a){
		data.push_back(dt8);
		data.push_back(a);
		return data;
	}
	if (b){
		data.push_back(dt16);
		data.push_back(b);
		return data;
	}
	vector<unsigned char>d;
	int k = IntNum(ch[1], num);
	d = NumToUc(k, 2);
	if (d.size() <= 0){
		cout << "����-023��������ָ��:" << str << endl;
		return data;
	}
	for (int i = 0; i < 16; ++i){
		if (ch[0] == reg_1[i]){
			if (i == 0 || i == 8){//�ж�Ϊal�Ĵ���
				data.push_back(dt_al);
				data.push_back(d[0]);
				return data;
			}
			data.push_back(dt8_num);
			if (i>7)data.push_back(mm[i - 8]);
			else data.push_back(mm[i]);
			data.push_back(d[0]);
			return data;
		}
		if (ch[0] == reg2[i]){
			if (i == 0 || i == 8){
				data.push_back(dt_ax);
				data.push_back(d[0]);
				data.push_back(d[1]);
				return data;
			}
			if (k > 0x7f) data.push_back(dt16_num[0]);
			else data.push_back(dt16_num[1]);
			if (i > 7)data.push_back(mm[i - 8]);
			else data.push_back(mm[i]);
			data.push_back(d[0]);
			if (k >0x7b)data.push_back(d[1]);
			return data;
		}
	}
	cout << "����-024��������ָ��:" << str << endl;
	return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0xa8(%rbp)
movb %r8b, %al
movq %rdi, %r8
movq %r8, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movb $0x0, -0x1a(%rbp)
callq 0xa8d0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x6a20
movq %rax, -0x98(%rbp)
jmp 0x146fe
movq -0x98(%rbp), %rax
movq %rax, -0x28(%rbp)
movb $0x0, -0x35(%rbp)
movb $0x0, -0x36(%rbp)
movb $0x0, -0x37(%rbp)
movb $0x0, -0x38(%rbp)
movb $0x0, -0x39(%rbp)
leaq -0x3b(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3130
movsbl -0x19(%rbp), %eax
cmpl $0x61, %eax
jne 0x14773
movb $0x20, -0x35(%rbp)
movb $0x21, -0x36(%rbp)
movb $0x24, -0x38(%rbp)
movb $0x25, -0x37(%rbp)
movb $-0x80, -0x39(%rbp)
movb $-0x7f, -0x3b(%rbp)
movb $-0x7d, -0x3a(%rbp)
leaq 0x6eea(%rip), %rax      # 0x1b643
movq %rax, -0x48(%rbp)
jmp 0x14838
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x14cdc
movsbl -0x19(%rbp), %eax
cmpl $0x6f, %eax
jne 0x147a8
movb $0x8, -0x35(%rbp)
movb $0x9, -0x36(%rbp)
movb $0xc, -0x38(%rbp)
movb $0xd, -0x37(%rbp)
movb $-0x80, -0x39(%rbp)
movb $-0x7f, -0x3b(%rbp)
movb $-0x7d, -0x3a(%rbp)
leaq 0x6eac(%rip), %rax      # 0x1b64b
movq %rax, -0x48(%rbp)
jmp 0x14836
movsbl -0x19(%rbp), %eax
cmpl $0x78, %eax
jne 0x147da
movb $0x30, -0x35(%rbp)
movb $0x31, -0x36(%rbp)
movb $0x34, -0x38(%rbp)
movb $0x35, -0x37(%rbp)
movb $-0x80, -0x39(%rbp)
movb $-0x7f, -0x3b(%rbp)
movb $-0x7d, -0x3a(%rbp)
leaq 0x6e7f(%rip), %rax      # 0x1b653
movq %rax, -0x48(%rbp)
jmp 0x14834
movq 0xc7f7(%rip), %rdi      # 0x20fd8
leaq 0x6d67(%rip), %rsi      # 0x1b54f
callq 0x31f0
movq %rax, -0xb0(%rbp)
jmp 0x147f6
movq -0xb0(%rbp), %rdi
movsbl -0x19(%rbp), %esi
callq 0x32a0
movq %rax, -0xb8(%rbp)
jmp 0x1480f
movq -0xb8(%rbp), %rdi
movq 0xc7a3(%rip), %rsi      # 0x20fc0
callq 0x3240
jmp 0x14824
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x14cba
jmp 0x14836
jmp 0x14838
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x6d30
movb %al, -0xb9(%rbp)
jmp 0x1484e
movb -0xb9(%rbp), %al
movb %al, -0x3c(%rbp)
movq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0x6d30
movb %al, -0xba(%rbp)
jmp 0x1486d
movb -0xba(%rbp), %al
movb %al, -0x3d(%rbp)
cmpb $0x0, -0x3c(%rbp)
je 0x148b0
movq -0xa8(%rbp), %rdi
leaq -0x35(%rbp), %rsi
callq 0xaa00
jmp 0x1488e
movq -0xa8(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0xaa00
jmp 0x148a0
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x14cba
cmpb $0x0, -0x3d(%rbp)
je 0x148ea
movq -0xa8(%rbp), %rdi
leaq -0x36(%rbp), %rsi
callq 0xaa00
jmp 0x148c8
movq -0xa8(%rbp), %rdi
leaq -0x3d(%rbp), %rsi
callq 0xaa00
jmp 0x148da
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x14cba
leaq -0x68(%rbp), %rdi
callq 0xa8d0
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
movl -0x18(%rbp), %esi
callq 0x7720
movq %rax, -0xc8(%rbp)
jmp 0x1490c
movq -0xc8(%rbp), %rax
movl %eax, -0x6c(%rbp)
movslq -0x6c(%rbp), %rsi
leaq -0x88(%rbp), %rdi
movl $0x2, %edx
callq 0x75f0
jmp 0x1492d
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xa9b0
leaq -0x88(%rbp), %rdi
callq 0xa920
leaq -0x68(%rbp), %rdi
callq 0xa9e0
cmpq $0x0, %rax
ja 0x149cc
movq 0xc679(%rip), %rdi      # 0x20fd8
leaq 0x6c09(%rip), %rsi      # 0x1b56f
callq 0x31f0
movq %rax, -0xd0(%rbp)
jmp 0x14974
movq -0xd0(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x31e0
movq %rax, -0xd8(%rbp)
jmp 0x1498d
movq -0xd8(%rbp), %rdi
movq 0xc625(%rip), %rsi      # 0x20fc0
callq 0x3240
jmp 0x149a2
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x14cb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xa920
jmp 0x14cdc
movl $0x0, -0x8c(%rbp)
cmpl $0x10, -0x8c(%rbp)
jge 0x14c5c
movq -0x28(%rbp), %rdi
movslq -0x8c(%rbp), %rax
leaq 0xd18b(%rip), %rsi      # 0x21b80
shlq $0x5, %rax
addq %rax, %rsi
callq 0xa810
testb $0x1, %al
jne 0x14a0a
jmp 0x14ae5
cmpl $0x0, -0x8c(%rbp)
je 0x14a1c
cmpl $0x8, -0x8c(%rbp)
jne 0x14a5c
movq -0xa8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xaa00
jmp 0x14a2e
xorl %eax, %eax
movl %eax, %esi
leaq -0x68(%rbp), %rdi
callq 0xaa70
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0xaa00
jmp 0x14a4c
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x14cb1
movq -0xa8(%rbp), %rdi
leaq -0x39(%rbp), %rsi
callq 0xaa00
jmp 0x14a6e
cmpl $0x7, -0x8c(%rbp)
jle 0x14a99
movq -0xa8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x8c(%rbp), %eax
addl $-0x8, %eax
cltq
addq %rax, %rsi
callq 0xaa00
jmp 0x14a97
jmp 0x14ab7
movq -0xa8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movslq -0x8c(%rbp), %rax
addq %rax, %rsi
callq 0xaa00
jmp 0x14ab5
jmp 0x14ab7
xorl %eax, %eax
movl %eax, %esi
leaq -0x68(%rbp), %rdi
callq 0xaa70
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0xaa00
jmp 0x14ad5
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x14cb1
movq -0x28(%rbp), %rdi
movslq -0x8c(%rbp), %rax
leaq 0xd289(%rip), %rsi      # 0x21d80
shlq $0x5, %rax
addq %rax, %rsi
callq 0xa810
testb $0x1, %al
jne 0x14b0c
jmp 0x14c46
cmpl $0x0, -0x8c(%rbp)
je 0x14b1e
cmpl $0x8, -0x8c(%rbp)
jne 0x14b7d
movq -0xa8(%rbp), %rdi
leaq -0x37(%rbp), %rsi
callq 0xaa00
jmp 0x14b30
xorl %eax, %eax
movl %eax, %esi
leaq -0x68(%rbp), %rdi
callq 0xaa70
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0xaa00
jmp 0x14b4e
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0xaa70
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0xaa00
jmp 0x14b6d
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x14cb1
cmpl $0x7f, -0x6c(%rbp)
jle 0x14b97
movq -0xa8(%rbp), %rdi
leaq -0x3b(%rbp), %rsi
callq 0xaa00
jmp 0x14b95
jmp 0x14bab
movq -0xa8(%rbp), %rdi
leaq -0x3a(%rbp), %rsi
callq 0xaa00
jmp 0x14ba9
jmp 0x14bab
cmpl $0x7, -0x8c(%rbp)
jle 0x14bd6
movq -0xa8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x8c(%rbp), %eax
addl $-0x8, %eax
cltq
addq %rax, %rsi
callq 0xaa00
jmp 0x14bd4
jmp 0x14bf4
movq -0xa8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movslq -0x8c(%rbp), %rax
addq %rax, %rsi
callq 0xaa00
jmp 0x14bf2
jmp 0x14bf4
xorl %eax, %eax
movl %eax, %esi
leaq -0x68(%rbp), %rdi
callq 0xaa70
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0xaa00
jmp 0x14c12
cmpl $0x7b, -0x6c(%rbp)
jle 0x14c39
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0xaa70
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0xaa00
jmp 0x14c37
jmp 0x14c39
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x14cb1
jmp 0x14c48
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x149d6
movq 0xc375(%rip), %rdi      # 0x20fd8
leaq 0x691b(%rip), %rsi      # 0x1b585
callq 0x31f0
movq %rax, -0xe0(%rbp)
jmp 0x14c78
movq -0xe0(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x31e0
movq %rax, -0xe8(%rbp)
jmp 0x14c91
movq -0xe8(%rbp), %rdi
movq 0xc321(%rip), %rsi      # 0x20fc0
callq 0x3240
jmp 0x14ca6
movb $0x1, -0x1a(%rbp)
movl $0x1, -0x4c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xa920
testb $0x1, -0x1a(%rbp)
jne 0x14ccc
movq -0xa8(%rbp), %rdi
callq 0xa920
movq -0xa0(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
movq -0xa8(%rbp), %rdi
callq 0xa920
movq -0x30(%rbp), %rdi
callq 0x33f0
nopw %cs:(%rax,%rax)