// File: yanlinlin82[P]icpp/icpp.cpp
// Function: eval_number(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int eval_number(string s) // TODO: support long long and float/double
{
	int n = 0;
	bool minus = false;
	const char* p = s.c_str();
	if (*p == '-') { ++p; minus = true; }
	int base = 10;
	if (*p == '0') {
		++p; base = 8;
		if (*p == 'x') {
			++p; base = 16;
		}
	}
	for (; *p; ++p) {
		if (*p == '.') break;
		if (!((*p >= '0' && *p <= '9') || (*p >= 'A' && *p <= 'F') || (*p >= 'a' && *p <= 'f'))) {
			err("unexpected character '%c' in number '%s'!", *p, s.c_str());
		}
		int x = *p - (*p >= 'a' ? ('a' - 10) : (*p >= 'A' ? ('A' - 10) : '0'));
		if (x >= base) err("Invalid number '%s'!", s.c_str());
		n = n * base + x;
	}
	return (minus ? -n : n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movb $0x0, -0xd(%rbp)
callq 0x3110
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x6be0
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movb $0x1, -0xd(%rbp)
movl $0xa, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x6c27
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movl $0x8, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x78, %eax
jne 0x6c25
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movl $0x10, -0x1c(%rbp)
jmp 0x6c27
jmp 0x6c29
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6d3b
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x6c47
jmp 0x6d3b
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x6c5f
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0x6cb6
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0x6c77
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jle 0x6cb6
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x6c8f
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jle 0x6cb6
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
callq 0x3110
movl -0x2c(%rbp), %esi
movq %rax, %rdx
leaq 0x30783(%rip), %rdi     # 0x37432
movb $0x0, %al
callq 0x1a780
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x6cd6
movl $0x57, %eax
movl %eax, -0x34(%rbp)
jmp 0x6cf0
movq -0x18(%rbp), %rax
movsbl (%rax), %edx
movl $0x30, %eax
movl $0x37, %ecx
cmpl $0x41, %edx
cmovgel %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
movl -0x34(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x6d1d
movq -0x28(%rbp), %rdi
callq 0x3110
movq %rax, %rsi
leaq 0x30746(%rip), %rdi     # 0x3745c
movb $0x0, %al
callq 0x1a780
movl -0xc(%rbp), %eax
imull -0x1c(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x6c29
testb $0x1, -0xd(%rbp)
je 0x6d4b
xorl %eax, %eax
subl -0xc(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x6d51
movl -0xc(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)