// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movl %r8d, %r15d
movl %ecx, %r13d
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %rdi
movl %edx, %esi
callq 0x36cf
movq %rax, %r12
andw $0x0, -0x30(%rbp)
movsbl %r15b, %r15d
cmpl $0x78, %r15d
je 0xa131
cmpl $0x6f, %r15d
je 0xa110
cmpl $0x61, %r15d
jne 0xa1af
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 0x34b2(%rip), %rax      # 0xd5c0
jmp 0xa150
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 0x3499(%rip), %rax      # 0xd5c8
jmp 0xa150
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 0x3480(%rip), %rax      # 0xd5d0
movq %rax, -0x40(%rbp)
movb $-0x7d, -0x2f(%rbp)
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0x38b4
movl %eax, %r15d
movb %al, -0x32(%rbp)
pushq $0x2
popq %rsi
movq %r12, %rdi
callq 0x38b4
movb %al, -0x31(%rbp)
testb %r15b, %r15b
je 0xa18e
leaq -0x2d(%rbp), %rsi
movq %rbx, %rdi
callq 0x5ae6
leaq -0x32(%rbp), %rsi
jmp 0xa1a2
testb %al, %al
je 0xa1da
leaq -0x2c(%rbp), %rsi
movq %rbx, %rdi
callq 0x5ae6
leaq -0x31(%rbp), %rsi
movq %rbx, %rdi
callq 0x5ae6
jmp 0xa392
movq 0x6e22(%rip), %rdi      # 0x10fd8
leaq 0x3317(%rip), %rsi      # 0xd4d4
callq 0x21b0
movq %rax, %rdi
movl %r15d, %esi
callq 0x2200
movq %rax, %rdi
callq 0x2100
jmp 0xa392
andq $0x0, -0x50(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq %r12, %rdi
addq $0x20, %rdi
movl %r13d, %esi
callq 0x3f4c
movq %rax, -0x70(%rbp)
movslq %eax, %rsi
leaq -0x88(%rbp), %rdi
pushq $0x2
popq %rdx
callq 0x3e87
leaq -0x60(%rbp), %r15
leaq -0x88(%rbp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x5d96
movq %r13, %rdi
callq 0x5be8
movq 0x8(%r15), %rax
cmpq (%r15), %rax
je 0xa27c
movq %r14, -0x68(%rbp)
leaq 0x7ab3(%rip), %r13      # 0x11cf0
leaq 0x78ac(%rip), %r15      # 0x11af0
xorl %r14d, %r14d
cmpq $-0x10, %r14
je 0xa285
movq %r12, %rdi
movq %r15, %rsi
callq 0x5aa9
testb %al, %al
jne 0xa2b4
movq %r12, %rdi
movq %r13, %rsi
callq 0x5aa9
testb %al, %al
jne 0xa2f1
decq %r14
addq $0x20, %r13
addq $0x20, %r15
jmp 0xa247
leaq 0x3271(%rip), %rsi      # 0xd4f4
jmp 0xa290
movq -0x68(%rbp), %r14
leaq 0x327a(%rip), %rsi      # 0xd50a
movq 0x6d41(%rip), %rdi      # 0x10fd8
callq 0x21b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x2100
jmp 0xa389
movq %r14, %r15
negq %r15
testb $0x7, %r15b
je 0xa350
leaq -0x29(%rbp), %rsi
movq %rbx, %rdi
callq 0x5ae6
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
subl %r14d, %eax
cmpq $0x8, %r15
cmovbq %r15, %rax
movq -0x40(%rbp), %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x5ae6
jmp 0xa35c
movq %r14, %r15
negq %r15
testb $0x7, %r15b
je 0xa362
xorl %eax, %eax
movq -0x70(%rbp), %r12
cmpl $0x80, %r12d
setl %al
leaq (%rax,%rbp), %rsi
addq $-0x30, %rsi
movq %rbx, %rdi
callq 0x5ae6
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
subl %r14d, %eax
cmpq $0x8, %r15
cmovbq %r15, %rax
movq -0x40(%rbp), %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x5ae6
movq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x5ae6
cmpl $0x7c, %r12d
jge 0xa37a
jmp 0xa389
leaq -0x2a(%rbp), %rsi
movq %rbx, %rdi
callq 0x5ae6
movq -0x60(%rbp), %rsi
jmp 0xa381
leaq -0x2b(%rbp), %rsi
movq %rbx, %rdi
callq 0x5ae6
movq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x5ae6
movq -0x60(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x5ae6
leaq -0x60(%rbp), %rdi
callq 0x5be8
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa3a8
jmp 0xa3a8
movq %rax, %r14
leaq -0x60(%rbp), %rdi
callq 0x5be8
jmp 0xa3bb
jmp 0xa3b8
movq %rax, %r14
movq %rbx, %rdi
callq 0x5be8
movq %r14, %rdi
callq 0x2300