// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/misc/encoding/urlencode.cpp
// Function: smooth::Encoding::URLEncode::Decode(smooth::String const&)
S::String S::Encoding::URLEncode::Decode(const String &encoded)
{
	/* Decode URL encoded string to UTF-8.
	 */
	String	 utf8;
	Int	 length = encoded.Length();

	for (Int i = 0, d = 0; i < length; i++)
	{
		if (encoded[i] == '%')
		{
			utf8[d++] = (Int64) Number::FromHexString(encoded.SubString(i + 1, 2));

			i += 2;
		}
		else
		{
			utf8[d++] = encoded[i];
		}
	}

	/* Import string from UTF-8.
	 */
	String	 string;

	string.ImportFrom("UTF-8", utf8.ConvertTo("ISO-8859-1"));

	return string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x88(%rbp)
movq %rdi, %rax
movq %rax, -0x80(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
movq -0x10(%rbp), %rdi
callq 0x5b800
movl %eax, -0x78(%rbp)
jmp 0xfd50a
movl -0x78(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xfd670
movq -0x10(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x5c900
movl %eax, -0x8c(%rbp)
jmp 0xfd53e
movl -0x8c(%rbp), %eax
cmpl $0x25, %eax
jne 0xfd621
movq -0x10(%rbp), %rsi
movl -0x40(%rbp), %edx
incl %edx
leaq -0x70(%rbp), %rdi
movl $0x2, %ecx
callq 0x5dc20
jmp 0xfd566
leaq -0x58(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x59c40
jmp 0xfd575
leaq -0x58(%rbp), %rdi
callq 0x5dbe0
movq %rax, -0x98(%rbp)
jmp 0xfd587
movq -0x98(%rbp), %rax
movl %eax, -0xa4(%rbp)
movl -0x44(%rbp), %esi
movl %esi, %eax
incl %eax
movl %eax, -0x44(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5d4e0
movq %rax, -0xa0(%rbp)
jmp 0xfd5b0
movq -0xa0(%rbp), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x5d990
leaq -0x70(%rbp), %rdi
callq 0x5df00
movl -0x40(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x40(%rbp)
jmp 0xfd660
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xfd701
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xfd613
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5d990
leaq -0x70(%rbp), %rdi
callq 0x5df00
jmp 0xfd701
movq -0x10(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x5c900
movl %eax, -0xa8(%rbp)
jmp 0xfd635
movl -0x44(%rbp), %esi
movl %esi, %eax
incl %eax
movl %eax, -0x44(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5d4e0
movq %rax, -0xb0(%rbp)
jmp 0xfd651
movq -0xb0(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xfd662
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xfd51e
movq -0x88(%rbp), %rdi
movb $0x0, -0x71(%rbp)
xorl %esi, %esi
callq 0x5da90
jmp 0xfd684
leaq 0xa840f(%rip), %rsi     # 0x1a5a9a
leaq -0x28(%rbp), %rdi
callq 0x5c120
movq %rax, -0xb8(%rbp)
jmp 0xfd69d
movq -0xb8(%rbp), %rdx
movq -0x88(%rbp), %rdi
leaq 0xa8534(%rip), %rsi     # 0x1a5be6
callq 0x5ae70
jmp 0xfd6b9
movb $0x1, -0x71(%rbp)
testb $0x1, -0x71(%rbp)
jne 0xfd6eb
jmp 0xfd6df
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x5df00
jmp 0xfd701
movq -0x88(%rbp), %rdi
callq 0x5df00
leaq -0x28(%rbp), %rdi
callq 0x5df00
movq -0x80(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x5df00
movq -0x38(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)
nopl (%rax)