// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/i18n/translator.cpp
// Function: smooth::I18n::Translator::AddLanguage(smooth::I18n::Language*)
S::Int S::I18n::Translator::AddLanguage(Language *language)
{
	/* Check arguments and return an error if they are not sane.
	 */
	if (language == NIL) return Error();

	const String	&langName = language->GetName();

	for (Int i = 0; i < languages.Length(); i++)
	{
		const String	&compName = languages.GetNth(i)->GetName();

		for (Int j = 0; j < Math::Max(langName.Length(), compName.Length()); j++)
		{
			if (langName == compName) return Error();

			if ((langName[j] < compName[j] && !(langName[j] == '(' && compName[j] == '/')) || (langName[j] == '/' && compName[j] == '('))
			{
				languages.InsertAtPos(i, language);

				return Success();
			}

			if ((langName[j] > compName[j] && !(langName[j] == '/' && compName[j] == '(')) || (langName[j] == '(' && compName[j] == '/')) break;
		}
	}

	languages.Add(language);

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xdf58f
leaq -0x28(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0xa0(%rbp), %rdi
callq 0x59680
movl %eax, -0x94(%rbp)
jmp 0xdf55e
movl -0x94(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xdf873
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xdf87f
movq -0x18(%rbp), %rdi
callq 0x5d530
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x90(%rbp), %rdi
movl -0x44(%rbp), %eax
movl %eax, -0xa4(%rbp)
addq $0x20, %rdi
callq 0x5c990
movl %eax, %ecx
movl -0xa4(%rbp), %eax
cmpl %ecx, %eax
jge 0xdf807
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
movl -0x44(%rbp), %esi
callq 0xe30c0
movq (%rax), %rdi
callq 0x5d530
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0xa8(%rbp)
movq -0x40(%rbp), %rdi
callq 0x5b800
movl %eax, -0xac(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5b800
movl -0xac(%rbp), %edi
movl %eax, %esi
callq 0x5aae0
movl %eax, %ecx
movl -0xa8(%rbp), %eax
cmpl %ecx, %eax
jge 0xdf7f7
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x59ac0
testb $0x1, %al
jne 0xdf643
jmp 0xdf69d
leaq -0x68(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0xb8(%rbp), %rdi
callq 0x59680
movl %eax, -0xb0(%rbp)
jmp 0xdf66c
movl -0xb0(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5b5b0
jmp 0xdf873
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5b5b0
jmp 0xdf87f
movq -0x40(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
movl %eax, -0xbc(%rbp)
movq -0x50(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
movl %eax, %ecx
movl -0xbc(%rbp), %eax
cmpl %ecx, %eax
jge 0xdf6e9
movq -0x40(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
cmpl $0x28, %eax
jne 0xdf70b
movq -0x50(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
cmpl $0x2f, %eax
jne 0xdf70b
movq -0x40(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
cmpl $0x2f, %eax
jne 0xdf777
movq -0x50(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
cmpl $0x28, %eax
jne 0xdf777
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
movl -0x44(%rbp), %esi
leaq -0x18(%rbp), %rdx
callq 0xe31a0
leaq -0x78(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x5ca80
movq -0xc8(%rbp), %rdi
callq 0x59680
movl %eax, -0xc0(%rbp)
jmp 0xdf746
movl -0xc0(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5a410
jmp 0xdf873
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5a410
jmp 0xdf87f
movq -0x40(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
movl %eax, -0xcc(%rbp)
movq -0x50(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
movl %eax, %ecx
movl -0xcc(%rbp), %eax
cmpl %ecx, %eax
jle 0xdf7c3
movq -0x40(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
cmpl $0x2f, %eax
jne 0xdf7e5
movq -0x50(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
cmpl $0x28, %eax
jne 0xdf7e5
movq -0x40(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
cmpl $0x28, %eax
jne 0xdf7e7
movq -0x50(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x5c900
cmpl $0x2f, %eax
jne 0xdf7e7
jmp 0xdf7f7
jmp 0xdf7e9
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xdf5f2
jmp 0xdf7f9
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xdf5a3
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
leaq -0x18(%rbp), %rsi
callq 0xe30f0
leaq -0x88(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x5ca80
movq -0xd8(%rbp), %rdi
callq 0x59680
movl %eax, -0xd0(%rbp)
jmp 0xdf842
movl -0xd0(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5a410
jmp 0xdf873
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5a410
jmp 0xdf87f
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopl (%rax,%rax)