// File: /workspace/github_cpp_makefile_star2_O2/lindorx[P]train/HelpInsPro.cpp
// Function: IntNum(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
long IntNum(const std::string& str,int num)
{
	using namespace std;
	int i, sum = 0, n = str.size();
	//�鿴�Ƿ���BYTE WORD�ȱ�ʶ��
	char c = FoundMathChar(str);//������������
	if (c>0){
		string ch[2];
		long k[2] = {0};
		ch[0] = str.substr(0,str.find(c));
		ch[1] = str.substr(str.find(c)+1,n - str.find(c)-1);
		//��ʱ��ch�ֱ𴢴������������ߵ������ַ���������IntNum����ת��Ϊ����
		k[0] = IntNum(ch[0], num);
		k[1] = IntNum(ch[1], num);
		switch (c){
		case '+':return k[0] + k[1];
		case '-':return k[0] - k[1];
		case '*':return k[0] * k[1];
		case '/':return k[0] / k[1];
		case '$':return num;
		}
	}
	if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')){
		for (i = 2; i<n; ++i){
			sum += (int)pow(16.0, (double)(n - 1 - i))*HexOct(str[i]);
		}
		return sum;
	}
	else if (IsHexNum(str)){
		//�������ַ���ת��Ϊ�ɹ������ĸ�ʽ
		for (i = 0; i < n; ++i){
			sum += (int)pow(10.0, (double)(n - i - 1))*HexOct(str[i]);
		}
		return sum;
	}
	else if (str == "$")return num;
	//�����Ǳ����ַ���
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq %rax, -0x38(%rbp)
callq 0x3f01
movl %eax, %r15d
movslq %r14d, %rax
movq %rax, -0x30(%rbp)
testb %r15b, %r15b
jle 0x40d9
pushq $0x10
popq %rax
leaq (%rax,%rbp), %rcx
addq $-0xa0, %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x3f86
movl %r14d, -0x3c(%rbp)
movsbl %r15b, %r12d
movq %rbx, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x2240
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x21f0
leaq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %r13
movq %r13, %rsi
callq 0x2220
movq %r13, %rdi
callq 0x2358
movq %rbx, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x2240
leaq 0x1(%rax), %r13
movslq -0x38(%rbp), %r14
movq %rbx, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x2240
notq %rax
addq %rax, %r14
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x21f0
leaq -0x80(%rbp), %r13
leaq -0x60(%rbp), %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x2358
leaq -0xa0(%rbp), %rdi
movl -0x3c(%rbp), %r14d
movl %r14d, %esi
callq 0x3f4c
movq %rax, %r12
movq %r13, %rdi
movl %r14d, %esi
callq 0x3f4c
movq %rax, %r14
movzbl %r15b, %eax
movb $0x1, %r15b
addl $-0x24, %eax
cmpl $0xb, %eax
ja 0x40b2
leaq 0x8fa9(%rip), %rcx      # 0xd020
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r15d, %r15d
movq -0x30(%rbp), %r14
jmp 0x40b2
addq %r12, %r14
jmp 0x4092
imulq %r12, %r14
xorl %r15d, %r15d
jmp 0x40b2
subq %r14, %r12
xorl %r15d, %r15d
movq %r12, %r14
jmp 0x40b2
movq %r12, %rax
cqto
idivq %r14
xorl %r15d, %r15d
movq %rax, %r14
jmp 0x40b2
pushq $0x20
popq %r12
leaq (%r12,%rbp), %rdi
addq $-0xa0, %rdi
callq 0x2358
addq $-0x20, %r12
cmpq $-0x20, %r12
jne 0x40b6
testb %r15b, %r15b
je 0x41cb
movq (%rbx), %rax
cmpb $0x30, (%rax)
jne 0x4142
movzbl 0x1(%rax), %eax
orl $0x20, %eax
cmpl $0x78, %eax
jne 0x4142
movq %rbx, -0x30(%rbp)
movq -0x38(%rbp), %rax
movslq %eax, %r14
leal -0x3(%rax), %r12d
xorl %r15d, %r15d
pushq $0x2
popq %r13
cmpq %r14, %r13
jge 0x41c8
cvtsi2sd %r12d, %xmm0
mulsd 0x8fdf(%rip), %xmm0     # 0xd0f8
callq 0x21a0
cvttsd2si %xmm0, %ebx
movq -0x30(%rbp), %rax
movq (%rax), %rax
movsbl (%rax,%r13), %edi
callq 0x3df3
cwtl
imull %ebx, %eax
addl %eax, %r15d
incq %r13
decl %r12d
jmp 0x4103
movq %rbx, %rdi
callq 0x3e3a
testb %al, %al
je 0x41a7
movq %rbx, -0x30(%rbp)
xorl %r14d, %r14d
movq -0x38(%rbp), %rax
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
leal -0x1(%rax), %r12d
xorl %r13d, %r13d
cmpq %r14, %r15
je 0x41c3
cvtsi2sd %r12d, %xmm1
movsd 0x8f82(%rip), %xmm0     # 0xd100
callq 0x22f0
cvttsd2si %xmm0, %ebx
movq -0x30(%rbp), %rax
movq (%rax), %rax
movsbl (%rax,%r14), %edi
callq 0x3df3
cwtl
imull %ebx, %eax
addl %eax, %r13d
incq %r14
decl %r12d
jmp 0x416c
leaq 0x9013(%rip), %rsi      # 0xd1c1
movq %rbx, %rdi
callq 0x5ad5
testb %al, %al
pushq $-0x1
popq %r14
cmovneq -0x30(%rbp), %r14
jmp 0x41cb
movslq %r13d, %r14
jmp 0x41cb
movslq %r15d, %r14
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x41e1
jmp 0x41e1
movq %rax, %rbx
pushq $0x20
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0xa0, %rdi
callq 0x2358
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x41e8
movq %rbx, %rdi
callq 0x2300