// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/misc/number.cpp
// Function: smooth::Number::ToHexString(int) const
S::String S::Number::ToHexString(Int length) const
{
	String	 string;
	Int	 stringPos = 0;

	for (Int i = 0; i < 16; i++)
	{
		if	(((intValue >> (4 * (15 - i))) & 15) >= 10) string[stringPos++] = 'a' + ((intValue >> (4 * (15 - i))) & 15) - 10;
		else if (((intValue >> (4 * (15 - i))) & 15) >=  1) string[stringPos++] = '0' + ((intValue >> (4 * (15 - i))) & 15);
		else if (stringPos			     >   0) string[stringPos++] = '0';
	}

	if (length != -1)
	{
		/* Add leading zeros if necessary.
		 */
		if (string.Length() < length) string = String().FillN('0', length - string.Length()).Append(string);

		/* Cut string if too long.
		 */
		if (string.Length() > length) string = string.Tail(length);
	}

	return string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movb $0x0, -0x15(%rbp)
xorl %esi, %esi
callq 0x5da90
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0x10, -0x20(%rbp)
jge 0xf2169
movq -0x68(%rbp), %rax
movq (%rax), %rax
movl $0xf, %ecx
subl -0x20(%rbp), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
sarq %cl, %rax
andq $0xf, %rax
cmpq $0xa, %rax
jl 0xf20b8
movq -0x78(%rbp), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rax
movb -0x20(%rbp), %dl
movb $0xf, %cl
subb %dl, %cl
shlb $0x2, %cl
sarq %cl, %rax
andl $0xf, %eax
addl $0x57, %eax
movl %eax, -0x84(%rbp)
movl -0x1c(%rbp), %esi
movl %esi, %eax
incl %eax
movl %eax, -0x1c(%rbp)
callq 0x5d4e0
movq %rax, -0x80(%rbp)
jmp 0xf2096
movq -0x80(%rbp), %rax
movl -0x84(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xf2159
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xf22b0
movq -0x68(%rbp), %rax
movq (%rax), %rax
movl $0xf, %ecx
subl -0x20(%rbp), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
sarq %cl, %rax
andq $0xf, %rax
cmpq $0x1, %rax
jl 0xf2126
movq -0x78(%rbp), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rax
movb -0x20(%rbp), %dl
movb $0xf, %cl
subb %dl, %cl
shlb $0x2, %cl
sarq %cl, %rax
andl $0xf, %eax
orl $0x30, %eax
movl %eax, -0x94(%rbp)
movl -0x1c(%rbp), %esi
movl %esi, %eax
incl %eax
movl %eax, -0x1c(%rbp)
callq 0x5d4e0
movq %rax, -0x90(%rbp)
jmp 0xf2115
movq -0x90(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xf2157
cmpl $0x0, -0x1c(%rbp)
jle 0xf2155
movq -0x78(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl %esi, %eax
incl %eax
movl %eax, -0x1c(%rbp)
callq 0x5d4e0
movq %rax, -0xa0(%rbp)
jmp 0xf2148
movq -0xa0(%rbp), %rax
movl $0x30, (%rax)
jmp 0xf2157
jmp 0xf2159
jmp 0xf215b
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xf2032
cmpl $-0x1, -0x14(%rbp)
je 0xf2290
movq -0x78(%rbp), %rdi
callq 0x5b800
movl %eax, -0xa4(%rbp)
jmp 0xf2184
movl -0xa4(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xf222f
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
jmp 0xf21a0
movq -0x78(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0xac(%rbp)
callq 0x5b800
movl %eax, -0xa8(%rbp)
jmp 0xf21ba
movl -0xa8(%rbp), %eax
movl -0xac(%rbp), %edx
subl %eax, %edx
leaq -0x48(%rbp), %rdi
movl $0x30, %esi
callq 0x5c480
movq %rax, -0xb8(%rbp)
jmp 0xf21df
movq -0x78(%rbp), %rsi
movq -0xb8(%rbp), %rdi
callq 0x5a710
movq %rax, -0xc0(%rbp)
jmp 0xf21f8
movq -0xc0(%rbp), %rsi
movq -0x78(%rbp), %rdi
callq 0x59760
jmp 0xf220a
leaq -0x48(%rbp), %rdi
callq 0x5df00
jmp 0xf222f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5df00
jmp 0xf22b0
movq -0x78(%rbp), %rdi
callq 0x5b800
movl %eax, -0xc4(%rbp)
jmp 0xf2240
movl -0xc4(%rbp), %eax
cmpl -0x14(%rbp), %eax
jle 0xf228e
movq -0x78(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq -0x60(%rbp), %rdi
callq 0x5c8a0
jmp 0xf225d
movq -0x78(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x59760
jmp 0xf226c
leaq -0x60(%rbp), %rdi
callq 0x5df00
jmp 0xf228e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5df00
jmp 0xf22b0
jmp 0xf2290
movb $0x1, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
jne 0xf22a3
movq -0x78(%rbp), %rdi
callq 0x5df00
movq -0x70(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x5df00
movq -0x28(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)
nopl (%rax)