// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, %r12d
movl %ecx, %ebx
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x48(%rbp)
movq $0x0, 0x10(%rdi)
movq %rsi, %rdi
movl %edx, %esi
callq 0x3c1c
movq %rax, %r15
movw $0x0, -0x30(%rbp)
cmpl $0x78, %r12d
je 0xc691
cmpl $0x6f, %r12d
je 0xc661
cmpl $0x61, %r12d
jne 0xc747
movq %r14, -0x60(%rbp)
movb $0x20, -0x2d(%rbp)
movb $0x21, -0x2c(%rbp)
movb $0x24, -0x2a(%rbp)
movb $0x25, -0x2b(%rbp)
movb $-0x80, -0x29(%rbp)
movb $-0x7f, -0x30(%rbp)
leaq 0x4f85(%rip), %rax      # 0x115d9
movq %rax, -0x58(%rbp)
movb $0x20, %r14b
movb $0x21, -0x40(%rbp)
jmp 0xc6bf
movq %r14, -0x60(%rbp)
movb $0x8, -0x2d(%rbp)
movb $0x9, -0x2c(%rbp)
movb $0xc, -0x2a(%rbp)
movb $0xd, -0x2b(%rbp)
movb $-0x80, -0x29(%rbp)
movb $-0x7f, -0x30(%rbp)
leaq 0x4f5d(%rip), %rax      # 0x115e1
movq %rax, -0x58(%rbp)
movb $0x8, %r14b
movb $0x9, -0x40(%rbp)
jmp 0xc6bf
movq %r14, -0x60(%rbp)
movb $0x30, -0x2d(%rbp)
movb $0x31, -0x2c(%rbp)
movb $0x34, -0x2a(%rbp)
movb $0x35, -0x2b(%rbp)
movb $-0x80, -0x29(%rbp)
movb $-0x7f, -0x30(%rbp)
leaq 0x4f35(%rip), %rax      # 0x115e9
movq %rax, -0x58(%rbp)
movb $0x30, %r14b
movb $0x31, -0x40(%rbp)
movb $-0x7d, -0x2f(%rbp)
movq %r15, %rdi
movl $0x1, %esi
callq 0x3e24
movl %eax, %r13d
movb %al, -0x32(%rbp)
movq %r15, %rdi
movl $0x2, %esi
callq 0x3e24
movl %eax, %r12d
movb %al, -0x31(%rbp)
testb %r13b, %r13b
je 0xc715
movq -0x48(%rbp), %rdi
leaq 0x8(%rdi), %rbx
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xc7a6
movb %r14b, (%rsi)
movq (%rbx), %rsi
incq %rsi
movq %rsi, (%rbx)
jmp 0xc7b6
testb %r12b, %r12b
je 0xc7cd
movq -0x48(%rbp), %rdi
leaq 0x8(%rdi), %rbx
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xc8f3
movb -0x40(%rbp), %al
movb %al, (%rsi)
movq (%rbx), %rsi
incq %rsi
movq %rsi, (%rbx)
jmp 0xc903
movq 0x888a(%rip), %rdi      # 0x14fd8
leaq 0x4d98(%rip), %rsi      # 0x114ed
movl $0x1f, %edx
callq 0x2210
leaq -0x80(%rbp), %rsi
movb %r12b, (%rsi)
movq 0x886b(%rip), %rdi      # 0x14fd8
movl $0x1, %edx
callq 0x2210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
jmp 0xc91a
leaq -0x2d(%rbp), %rdx
callq 0x67cc
movq (%rbx), %rsi
movq -0x48(%rbp), %rdi
cmpq 0x10(%rdi), %rsi
je 0xc7c4
movb %r13b, (%rsi)
jmp 0xc90c
leaq -0x32(%rbp), %rdx
jmp 0xc915
movq %r15, %rdi
addq $0x20, %rdi
xorl %r12d, %r12d
xorl %r13d, %r13d
movl %ebx, %esi
callq 0x45f9
movq %rax, %rbx
movslq %ebx, %rsi
leaq -0x80(%rbp), %rdi
movl $0x2, %edx
callq 0x4523
movq -0x80(%rbp), %r12
movq -0x70(%rbp), %r13
cmpq %r12, -0x78(%rbp)
je 0xc930
movq %rbx, -0x68(%rbp)
movq %r13, -0x50(%rbp)
movq %r12, -0x40(%rbp)
movq 0x8(%r15), %r14
leaq 0x94d2(%rip), %rbx      # 0x15cf0
leaq 0x92d3(%rip), %r13      # 0x15af8
xorl %r12d, %r12d
cmpq (%r13), %r14
jne 0xc859
testq %r14, %r14
je 0xc9a1
movq -0x8(%r13), %rsi
movq (%r15), %rdi
movq %r14, %rdx
callq 0x21f0
testl %eax, %eax
je 0xc9a1
cmpq 0x8(%rbx), %r14
jne 0xc88f
movq %rbx, %rax
jmp 0xc879
cmpq 0x8(%rbx), %r14
jne 0xc88f
testq %r14, %r14
je 0xc9dc
movq %r12, %rax
shlq $0x5, %rax
leaq 0x947a(%rip), %rcx      # 0x15cf0
addq %rcx, %rax
movq (%rax), %rsi
movq (%r15), %rdi
movq %r14, %rdx
callq 0x21f0
testl %eax, %eax
je 0xc9dc
incq %r12
addq $0x20, %rbx
addq $0x20, %r13
cmpq $0x10, %r12
jne 0xc828
movq 0x8731(%rip), %rdi      # 0x14fd8
leaq 0x4c75(%rip), %rsi      # 0x11523
movl $0x15, %edx
movq -0x40(%rbp), %r12
movq -0x50(%rbp), %r13
callq 0x2210
movq -0x60(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8706(%rip), %rdi      # 0x14fd8
callq 0x2210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
jmp 0xc976
leaq -0x2c(%rbp), %rdx
callq 0x67cc
movq (%rbx), %rsi
movq -0x48(%rbp), %rdi
cmpq 0x10(%rdi), %rsi
je 0xc911
movb %r12b, (%rsi)
incq (%rbx)
jmp 0xc91a
leaq -0x31(%rbp), %rdx
callq 0x67cc
movq -0x48(%rbp), %rbx
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x86a1(%rip), %rdi      # 0x14fd8
leaq 0x4bcf(%rip), %rsi      # 0x1150d
movl $0x15, %edx
callq 0x2210
movq -0x60(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x867e(%rip), %rdi      # 0x14fd8
callq 0x2210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
testq %r12, %r12
je 0xc91a
subq %r12, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x21d0
jmp 0xc91a
testb $0x7, %r12b
je 0xca3c
leaq -0x29(%rbp), %rsi
movq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq -0x40(%rbp), %r14
movq -0x50(%rbp), %r15
callq 0x65d4
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
addl %r12d, %eax
cmpq $0x8, %r12
cmovbq %r12, %rax
movq -0x58(%rbp), %rsi
addq %rax, %rsi
jmp 0xca4c
testb $0x7, %r12b
je 0xca59
xorl %eax, %eax
cmpl $0x80, -0x68(%rbp)
setl %al
leaq (%rax,%rbp), %rsi
addq $-0x30, %rsi
movq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq -0x40(%rbp), %r14
movq -0x50(%rbp), %r15
callq 0x65d4
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
addl %r12d, %eax
cmpq $0x8, %r12
cmovbq %r12, %rax
movq -0x58(%rbp), %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x65d4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x65d4
cmpl $0x7c, -0x68(%rbp)
jge 0xca7c
jmp 0xca88
leaq -0x2a(%rbp), %rsi
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r14
movq -0x50(%rbp), %r15
movq %rbx, %rdi
callq 0x65d4
movq %r14, %rsi
jmp 0xca80
leaq -0x2b(%rbp), %rsi
movq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq -0x40(%rbp), %r14
movq -0x50(%rbp), %r15
callq 0x65d4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x65d4
leaq 0x1(%r14), %rsi
movq %rbx, %rdi
callq 0x65d4
testq %r14, %r14
je 0xc91e
subq %r14, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x21d0
jmp 0xc91e
jmp 0xcacc
jmp 0xcab0
movq %r13, -0x50(%rbp)
movq %r12, -0x40(%rbp)
movq %rax, %r14
cmpq $0x0, -0x40(%rbp)
je 0xcacf
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0xcacf
movq %rax, %r14
movq -0x48(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xcaeb
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x2300