// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/i18n/number.cpp
// Function: smooth::I18n::Number::GetLocalizedNumberString(long long)
S::String S::I18n::Number::GetLocalizedNumberString(Int64 number)
{
	/* Localize a number according to the current locale settings
	 */
	Int	 negFormat = 1;
	String	 sThousand = ".";
	String	 sGrouping = "3;0";

#ifdef __WIN32__
	wchar_t	 buffer[10];

	GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_INEGNUMBER, buffer, 2);
	negFormat = String(buffer).ToInt();

	GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, buffer, 4);
	sThousand = buffer;

	GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SGROUPING, buffer, 10);
	sGrouping = buffer;
#endif

	String	 nString = String::FromInt(number >= 0 ? number : -number);
	String	 retVal;

	/* Separate number blocks.
	 */
	const Array<String>	&groupSize = sGrouping.Explode(";");
	Int			 group	   = 0;
	Int			 count	   = 0;

	for (Int i = nString.Length() - 1; i >= 0; i--)
	{
		if (groupSize.Length() > group && groupSize.GetNth(group).ToInt() == count++)
		{
			retVal = String(sThousand).Append(retVal);

			count = 1;
			group++;

			if (groupSize.Length() > group && groupSize.GetNth(group).ToInt() == 0) group--;
		}

		retVal = String().FillN(nString[i], 1).Append(retVal);
	}

	/* Format negative numbers according to the locale.
	 */
	if (number < 0)
	{
		switch (negFormat)
		{
			case 0:		// (1.1)
				retVal = String("(").Append(retVal).Append(")");
				break;
			case 1:		// -1.1
				retVal = String("-").Append(retVal);
				break;
			case 2:		// - 1.1
				retVal = String("- ").Append(retVal);
				break;
			case 3:		// 1.1-
				retVal.Append("-");
				break;
			case 4:		// 1.1 -
				retVal.Append(" -");
				break;
		}
	}

	return retVal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x1d0(%rbp)
movq %rdi, %rax
movq %rax, -0x1c8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
leaq 0xdfbed(%rip), %rsi     # 0x1bd1ef
leaq -0x30(%rbp), %rdi
callq 0x5c1f0
leaq 0xadb5e(%rip), %rsi     # 0x18b170
leaq -0x48(%rbp), %rdi
callq 0x5c1f0
jmp 0xdd61d
cmpq $0x0, -0x10(%rbp)
jl 0xdd631
movq -0x10(%rbp), %rax
movq %rax, -0x1d8(%rbp)
jmp 0xdd63e
xorl %eax, %eax
subq -0x10(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq -0x1d8(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x5b290
jmp 0xdd650
movq -0x1d0(%rbp), %rdi
movb $0x0, -0x71(%rbp)
xorl %esi, %esi
callq 0x5da90
jmp 0xdd664
leaq 0xadb09(%rip), %rsi     # 0x18b174
leaq -0xf0(%rbp), %rdi
callq 0x5c1f0
jmp 0xdd679
leaq -0xd8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x5c820
jmp 0xdd692
leaq -0xf0(%rbp), %rdi
callq 0x5df00
leaq -0xd8(%rbp), %rax
movq %rax, -0x80(%rbp)
movl $0x0, -0xf4(%rbp)
movl $0x0, -0xf8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5b800
movl %eax, -0x1dc(%rbp)
jmp 0xdd6ce
movl -0x1dc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xfc(%rbp)
cmpl $0x0, -0xfc(%rbp)
jl 0xdd984
movq -0x80(%rbp), %rdi
callq 0x5c990
movl %eax, -0x1e0(%rbp)
jmp 0xdd6fb
movl -0x1e0(%rbp), %eax
cmpl -0xf4(%rbp), %eax
jle 0xdd8cb
movq -0x80(%rbp), %rdi
movl -0xf4(%rbp), %esi
callq 0x81b20
movq %rax, -0x1e8(%rbp)
jmp 0xdd725
movq -0x1e8(%rbp), %rdi
callq 0x5adc0
movq %rax, -0x1f0(%rbp)
jmp 0xdd73a
movq -0x1f0(%rbp), %rax
movl -0xf8(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xf8(%rbp)
movslq %ecx, %rcx
cmpq %rcx, %rax
jne 0xdd8cb
leaq -0x118(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5b6d0
jmp 0xdd770
movq -0x1d0(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x5a710
movq %rax, -0x1f8(%rbp)
jmp 0xdd78c
movq -0x1f8(%rbp), %rsi
movq -0x1d0(%rbp), %rdi
callq 0x59760
jmp 0xdd7a1
leaq -0x118(%rbp), %rdi
callq 0x5df00
movl $0x1, -0xf8(%rbp)
movl -0xf4(%rbp), %eax
incl %eax
movl %eax, -0xf4(%rbp)
movq -0x80(%rbp), %rdi
callq 0x5c990
movl %eax, -0x1fc(%rbp)
jmp 0xdd7d6
movl -0x1fc(%rbp), %eax
cmpl -0xf4(%rbp), %eax
jle 0xdd8c9
movq -0x80(%rbp), %rdi
movl -0xf4(%rbp), %esi
callq 0x81b20
movq %rax, -0x208(%rbp)
jmp 0xdd800
movq -0x208(%rbp), %rdi
callq 0x5adc0
movq %rax, -0x210(%rbp)
jmp 0xdd815
movq -0x210(%rbp), %rax
cmpq $0x0, %rax
jne 0xdd8c9
movl -0xf4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0xdd8c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xddc8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xddc85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xddc7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xddc70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x5df00
jmp 0xddc70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xddc2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x5df00
jmp 0xddc2b
jmp 0xdd8cb
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
jmp 0xdd8db
movl -0xfc(%rbp), %esi
leaq -0x70(%rbp), %rdi
callq 0x5d4e0
movq %rax, -0x218(%rbp)
jmp 0xdd8f3
movq -0x218(%rbp), %rax
movl (%rax), %esi
leaq -0x130(%rbp), %rdi
movl $0x1, %edx
callq 0x5c480
movq %rax, -0x220(%rbp)
jmp 0xdd916
movq -0x1d0(%rbp), %rsi
movq -0x220(%rbp), %rdi
callq 0x5a710
movq %rax, -0x228(%rbp)
jmp 0xdd932
movq -0x228(%rbp), %rsi
movq -0x1d0(%rbp), %rdi
callq 0x59760
jmp 0xdd947
leaq -0x130(%rbp), %rdi
callq 0x5df00
movl -0xfc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0xdd6dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x5df00
jmp 0xddc2b
cmpq $0x0, -0x10(%rbp)
jge 0xddc13
movl -0x14(%rbp), %eax
movq %rax, -0x230(%rbp)
subq $0x4, %rax
ja 0xddc11
movq -0x230(%rbp), %rax
leaq 0xad7ab(%rip), %rcx     # 0x18b15c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xad7b5(%rip), %rsi     # 0x18b176
leaq -0x148(%rbp), %rdi
callq 0x5c1f0
jmp 0xdd9cf
movq -0x1d0(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0x5a710
movq %rax, -0x238(%rbp)
jmp 0xdd9eb
leaq 0xdf6f1(%rip), %rsi     # 0x1bd0e3
leaq -0x160(%rbp), %rdi
callq 0x5c1f0
jmp 0xdda00
movq -0x238(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x5a710
movq %rax, -0x240(%rbp)
jmp 0xdda1c
movq -0x240(%rbp), %rsi
movq -0x1d0(%rbp), %rdi
callq 0x59760
jmp 0xdda31
leaq -0x160(%rbp), %rdi
callq 0x5df00
leaq -0x148(%rbp), %rdi
callq 0x5df00
jmp 0xddc11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xdda74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x5df00
leaq -0x148(%rbp), %rdi
callq 0x5df00
jmp 0xddc2b
leaq 0xad6f0(%rip), %rsi     # 0x18b17c
leaq -0x178(%rbp), %rdi
callq 0x5c1f0
jmp 0xdda9a
movq -0x1d0(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0x5a710
movq %rax, -0x248(%rbp)
jmp 0xddab6
movq -0x248(%rbp), %rsi
movq -0x1d0(%rbp), %rdi
callq 0x59760
jmp 0xddacb
leaq -0x178(%rbp), %rdi
callq 0x5df00
jmp 0xddc11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x5df00
jmp 0xddc2b
leaq 0xad678(%rip), %rsi     # 0x18b178
leaq -0x190(%rbp), %rdi
callq 0x5c1f0
jmp 0xddb0e
movq -0x1d0(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x5a710
movq %rax, -0x250(%rbp)
jmp 0xddb2a
movq -0x250(%rbp), %rsi
movq -0x1d0(%rbp), %rdi
callq 0x59760
jmp 0xddb3f
leaq -0x190(%rbp), %rdi
callq 0x5df00
jmp 0xddc11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x5df00
jmp 0xddc2b
leaq 0xad608(%rip), %rsi     # 0x18b17c
leaq -0x1a8(%rbp), %rdi
callq 0x5c1f0
jmp 0xddb82
movq -0x1d0(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x5a710
jmp 0xddb97
leaq -0x1a8(%rbp), %rdi
callq 0x5df00
jmp 0xddc11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x5df00
jmp 0xddc2b
leaq 0xad5b5(%rip), %rsi     # 0x18b17b
leaq -0x1c0(%rbp), %rdi
callq 0x5c1f0
jmp 0xddbd4
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x5a710
jmp 0xddbe9
leaq -0x1c0(%rbp), %rdi
callq 0x5df00
jmp 0xddc11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x5df00
jmp 0xddc2b
jmp 0xddc13
movb $0x1, -0x71(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x74690
testb $0x1, -0x71(%rbp)
jne 0xddc45
jmp 0xddc39
leaq -0xd8(%rbp), %rdi
callq 0x74690
jmp 0xddc70
movq -0x1d0(%rbp), %rdi
callq 0x5df00
leaq -0x70(%rbp), %rdi
callq 0x5df00
leaq -0x48(%rbp), %rdi
callq 0x5df00
leaq -0x30(%rbp), %rdi
callq 0x5df00
movq -0x1c8(%rbp), %rax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq -0x1d0(%rbp), %rdi
callq 0x5df00
leaq -0x70(%rbp), %rdi
callq 0x5df00
leaq -0x48(%rbp), %rdi
callq 0x5df00
leaq -0x30(%rbp), %rdi
callq 0x5df00
movq -0x50(%rbp), %rdi
callq 0x5b6b0