// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/i18n/translator.cpp
// Function: smooth::I18n::Translator::ActivateLanguage(smooth::String const&)
foreach (Language *language, languages)
	{
		if (language->magic != magic) continue;

		activeLanguage = language;

		/* Try to set application language for internal library strings.
		 */
		if (magic != "internal")
		{
			String	 code = magic.SubString(magic.Find("_") + 1, magic.Find(".xml") - magic.Find("_") - 1);
			String	 id   = String("smooth_").Append(code).Append(".xml");

			if (defaultTranslator->ActivateLanguage(id) != Success())
			{
				/* If failed, try the base language code if applicable.
				 */
				if (code.Contains("_"))
				{
					id = String("smooth_").Append(code.Head(code.Find("_"))).Append(".xml");

					defaultTranslator->ActivateLanguage(id);
				}
			}

			/* Activate user default language if setting the application language failed.
			 */
			if (defaultTranslator->GetActiveLanguageID() != id) defaultTranslator->SelectUserDefaultLanguage();
		}

		/* Activate internal language if application language is set to internal.
		 */
		if (magic == "internal" && defaultTranslator != NIL) defaultTranslator->ActivateLanguage(magic);

		/* Load actual language data.
		 */
		if (magic != "internal" && activeLanguage->strings.Length() == 0 && activeLanguage->sections.Length() == 0)
		{
			/* Check translation folders.
			 */
			const Array<Directory>	&dirs = GetTranslationFolders(appPrefix);

			foreach (const Directory &dir, dirs)
			{
				/* Load translation file.
				 */
				String		 file = String(dir).Append(Directory::GetDirectoryDelimiter()).Append(magic);
				XML::Document	 doc;

				if (doc.LoadFile(file) == Success() && LoadData(doc, activeLanguage) == Success()) break;
			}
		}

		return Success();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
leaq 0x20(%rdi), %r14
leaq 0x8(%rdi), %r15
xorl %ecx, %ecx
pushq $-0x1
popq %rbp
movl %ebp, %r12d
movq %rsi, 0x40(%rsp)
movq %rdi, 0x38(%rsp)
testl %ecx, %ecx
jne 0x99066
movl 0x28(%rdi), %eax
decl %eax
cmpl %eax, %r12d
jge 0x99066
incl %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x6180a
movq (%rax), %rbx
leaq 0x108(%rbx), %r13
movb $0x1, %dl
movl %ebp, %ecx
testb $0x1, %dl
je 0x98c70
movq %r13, %rdi
movq 0x40(%rsp), %rsi
callq 0x58150
xorl %edx, %edx
movl $0x0, %ecx
testb %al, %al
jne 0x98c51
jmp 0x98c77
movq 0x38(%rsp), %rdi
jmp 0x98c1f
movq 0x38(%rsp), %r13
movq %rbx, 0x78(%r13)
leaq 0x4e5eb(%rip), %rsi     # 0xe7272
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x5a420
testb %al, %al
je 0x98ed9
leaq 0x6b6c4(%rip), %rsi     # 0x104367
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x58c40
movq %rbx, %rdi
movq %r14, %rsi
callq 0x58830
movl %eax, %ebp
leaq 0x4e61d(%rip), %rsi     # 0xe72e1
movq %rsp, %rdi
callq 0x58c40
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x58830
movl %eax, %r14d
leaq 0x6b686(%rip), %rsi     # 0x104367
leaq 0x20(%rsp), %rdi
callq 0x58c40
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x58830
incl %ebp
notl %eax
addl %eax, %r14d
leaq 0xa0(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x5a2c0
leaq 0x20(%rsp), %rdi
callq 0x5a588
movq %rsp, %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
callq 0x5a588
leaq 0x4e5af(%rip), %rsi     # 0xe72e6
movq %rsp, %rdi
callq 0x58c40
movq %rsp, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x573e0
movq %rax, %r14
leaq 0x4e588(%rip), %rsi     # 0xe72e1
leaq 0x20(%rsp), %rdi
callq 0x58c40
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x573e0
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x58280
leaq 0x20(%rsp), %rdi
callq 0x5a588
movq %rsp, %rdi
callq 0x5a588
movq 0xc8652(%rip), %r12     # 0x1613e8
movq (%r12), %rdi
movq (%rdi), %rax
leaq 0x48(%rsp), %rsi
callq *0x10(%rax)
testl %eax, %eax
je 0x98e9e
leaq 0x6b5b3(%rip), %rsi     # 0x104367
movq %rsp, %rdi
callq 0x58c40
leaq 0xa0(%rsp), %rdi
movq %rsp, %rsi
callq 0x56180
movl %eax, %ebp
movq %rsp, %rdi
callq 0x5a588
testb %bpl, %bpl
je 0x98e9e
leaq 0x4e500(%rip), %rsi     # 0xe72e6
movq %rsp, %rdi
callq 0x58c40
leaq 0x6b572(%rip), %rsi     # 0x104367
leaq 0x88(%rsp), %rdi
callq 0x58c40
leaq 0xa0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x58830
leaq 0x20(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
movl %eax, %edx
callq 0x59e40
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x573e0
movq %rax, %r14
leaq 0x4e49f(%rip), %rsi     # 0xe72e1
leaq 0x70(%rsp), %rdi
callq 0x58c40
leaq 0x70(%rsp), %rsi
movq %r14, %rdi
callq 0x573e0
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x56630
leaq 0x70(%rsp), %rdi
callq 0x5a588
leaq 0x20(%rsp), %rdi
callq 0x5a588
leaq 0x88(%rsp), %rdi
callq 0x5a588
movq %rsp, %rdi
callq 0x5a588
movq (%r12), %rdi
movq (%rdi), %rax
leaq 0x48(%rsp), %rsi
callq *0x10(%rax)
movq (%r12), %rax
movl $0x108, %edi            # imm = 0x108
addq 0x78(%rax), %rdi
leaq 0x48(%rsp), %rsi
callq 0x58150
testb %al, %al
je 0x98ec2
movq (%r12), %rdi
callq 0x58630
leaq 0x48(%rsp), %rdi
callq 0x5a588
leaq 0xa0(%rsp), %rdi
callq 0x5a588
leaq 0x4e392(%rip), %rsi     # 0xe7272
movq %rbx, %rdi
callq 0x59180
movq 0xc84f9(%rip), %rcx     # 0x1613e8
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x98f08
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
leaq 0x4e363(%rip), %rsi     # 0xe7272
movq %rbx, %rdi
callq 0x5a420
xorl %ebp, %ebp
testb %al, %al
je 0x99066
movq 0x78(%r13), %rax
cmpl $0x0, 0x48(%rax)
jne 0x99066
cmpl $0x0, 0xa0(%rax)
jne 0x99066
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
callq 0x98493
pushq $-0x1
popq %rax
xorl %ebx, %ebx
leaq 0x48(%rsp), %r15
leaq 0x20(%rsp), %r13
movq %rsp, %rbp
movl %eax, 0x1c(%rsp)
testl %ebx, %ebx
movl 0x1c(%rsp), %esi
jne 0x99057
movl 0xa8(%rsp), %eax
decl %eax
cmpl %eax, %esi
jge 0x99057
incl %esi
leaq 0xa0(%rsp), %rdi
movl %esi, 0x1c(%rsp)
callq 0x992f0
movq %rax, %r14
movb $0x1, %al
pushq $-0x1
popq %rcx
movl %ecx, %ebx
testb $0x1, %al
je 0x98f62
movq %r15, %rdi
movq %r14, %rsi
callq 0x57f20
callq 0x563a0
movq %r13, %rdi
movq %rax, %rsi
callq 0x58c40
movq %r15, %rdi
movq %r13, %rsi
callq 0x573e0
movq %rax, %rdi
movq 0x40(%rsp), %rsi
callq 0x573e0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x58280
movq %r13, %rdi
callq 0x5a588
movq %r15, %rdi
callq 0x5a588
movq %r15, %rdi
callq 0x58e60
movq %r15, %rdi
movq %rbp, %rsi
callq 0x56560
testl %eax, %eax
je 0x9901e
movq %r15, %rdi
callq 0x56440
movq %rbp, %rdi
callq 0x5a588
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0x98f9a
movq 0x38(%rsp), %rax
movq 0x78(%rax), %rdx
movq %r15, %rsi
callq 0x56e70
movl %eax, %r12d
movq %r15, %rdi
callq 0x56440
movq %rbp, %rdi
callq 0x5a588
xorl %eax, %eax
movl $0x0, %ecx
testl %r12d, %r12d
jne 0x98f9a
jmp 0x98f62
leaq 0xa0(%rsp), %rdi
callq 0x5dd4a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9907c
movq %rax, %rbx
jmp 0x99095
jmp 0x990b3
jmp 0x9910c
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x5a588
leaq 0x20(%rsp), %rdi
callq 0x5a588
jmp 0x990a4
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x5a588
jmp 0x990b6
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5a588
jmp 0x9910f
jmp 0x9910c
jmp 0x990c4
movq %rax, %rbx
jmp 0x990e9
movq %rax, %rbx
jmp 0x99119
jmp 0x990d0
movq %rax, %rbx
jmp 0x990fb
jmp 0x990d7
movq %rax, %rbx
jmp 0x99103
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5a588
movq %rsp, %rdi
jmp 0x99114
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5a588
movq %rsp, %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
jmp 0x99121
jmp 0x9912f
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x5a588
leaq 0xa0(%rsp), %rdi
callq 0x5a588
jmp 0x9916f
jmp 0x99134
movq %rax, %rbx
jmp 0x99141
movq %rax, %rbx
jmp 0x99162
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x56440
movq %rsp, %rdi
jmp 0x9915d
movq %rax, %rbx
jmp 0x99158
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
callq 0x5a588
leaq 0xa0(%rsp), %rdi
callq 0x5dd4a
movq %rbx, %rdi
callq 0x58260
nop