// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/misc/number.cpp
// Function: smooth::Number::FromHexString(smooth::String const&)
S::Number S::Number::FromHexString(const String &string)
{
	Int	 first  = string[0];
	Int	 second = string[1];
	Int	 skip	= 0;

	if (first == '0' && (second == 'x' || second == 'X')) skip = 2;

	Int	 length = string.Length();
	Int	 digits = 0;

	for (Int i = skip; i < length; i++)
	{
		Int	 digit = string[i];

		if ((digit >= '0' && digit <= '9') ||
		    (digit >= 'A' && digit <= 'F') ||
		    (digit >= 'a' && digit <= 'f')) digits++;
		else				    break;
	}

	Int64	 value = 0;

	for (Int i = 0; i < digits; i++)
	{
		Int	 digit = string[skip + i];

		if	(digit >= '0' && digit <= '9') value += (Int64(digit - '0')	 << ((digits - i - 1) * 4));
		else if (digit >= 'A' && digit <= 'F') value += (Int64(digit - 'A' + 10) << ((digits - i - 1) * 4));
		else if (digit >= 'a' && digit <= 'f') value += (Int64(digit - 'a' + 10) << ((digits - i - 1) * 4));
	}

	return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x50(%rbp)
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x5c900
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x5c900
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x30, -0x14(%rbp)
jne 0xf177a
cmpl $0x78, -0x18(%rbp)
je 0xf1773
cmpl $0x58, -0x18(%rbp)
jne 0xf177a
movl $0x2, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5b800
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0xf17e8
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x5c900
movl %eax, -0x2c(%rbp)
cmpl $0x30, -0x2c(%rbp)
jl 0xf17b6
cmpl $0x39, -0x2c(%rbp)
jle 0xf17ce
cmpl $0x41, -0x2c(%rbp)
jl 0xf17c2
cmpl $0x46, -0x2c(%rbp)
jle 0xf17ce
cmpl $0x61, -0x2c(%rbp)
jl 0xf17d9
cmpl $0x66, -0x2c(%rbp)
jg 0xf17d9
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf17db
jmp 0xf17e8
jmp 0xf17dd
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xf1793
movq $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0xf18ba
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
addl -0x3c(%rbp), %esi
callq 0x5c900
movl %eax, -0x40(%rbp)
cmpl $0x30, -0x40(%rbp)
jl 0xf1844
cmpl $0x39, -0x40(%rbp)
jg 0xf1844
movl -0x40(%rbp), %eax
subl $0x30, %eax
cltq
movl -0x24(%rbp), %ecx
subl -0x3c(%rbp), %ecx
subl $0x1, %ecx
shll $0x2, %ecx
movl %ecx, %ecx
shlq %cl, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xf18aa
cmpl $0x41, -0x40(%rbp)
jl 0xf1876
cmpl $0x46, -0x40(%rbp)
jg 0xf1876
movl -0x40(%rbp), %eax
subl $0x41, %eax
addl $0xa, %eax
cltq
movl -0x24(%rbp), %ecx
subl -0x3c(%rbp), %ecx
subl $0x1, %ecx
shll $0x2, %ecx
movl %ecx, %ecx
shlq %cl, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xf18a8
cmpl $0x61, -0x40(%rbp)
jl 0xf18a6
cmpl $0x66, -0x40(%rbp)
jg 0xf18a6
movl -0x40(%rbp), %eax
subl $0x61, %eax
addl $0xa, %eax
cltq
movl -0x24(%rbp), %ecx
subl -0x3c(%rbp), %ecx
subl $0x1, %ecx
shll $0x2, %ecx
movl %ecx, %ecx
shlq %cl, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xf18a8
jmp 0xf18aa
jmp 0xf18ac
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xf17f7
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x5dd30
movq -0x48(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)