// File: /workspace/github_c_makefile_star2_O3/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 $0xe8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %r12
leaq 0x8(%rdi), %rax
movq %rax, 0x58(%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl 0x28(%r14), %eax
decl %eax
cmpl %eax, %r13d
jge 0x9d0d5
incl %r13d
movq %r12, %rdi
movl %r13d, %esi
callq 0x60a9a
movq (%rax), %r15
leaq 0x108(%r15), %rdi
movq %rbx, %rsi
callq 0x56fa0
testb %al, %al
jne 0x9cced
movq %r15, 0x78(%r14)
leaq 0x5a647(%rip), %rsi     # 0xf7372
movq %rbx, %rdi
callq 0x590a0
testb %al, %al
je 0x9cf6f
leaq 0x77795(%rip), %rsi     # 0x1144d7
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0x579f0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x57610
movl %eax, %ebp
leaq 0x5a67e(%rip), %rsi     # 0xf73e1
movq %rsp, %rdi
callq 0x579f0
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x57610
movl %eax, %r12d
leaq 0x77757(%rip), %rsi     # 0x1144d7
leaq 0x18(%rsp), %rdi
callq 0x579f0
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x57610
incl %ebp
notl %eax
addl %eax, %r12d
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %r12d, %ecx
callq 0x58f50
leaq 0x18(%rsp), %rdi
callq 0x59200
movq %rsp, %rdi
callq 0x59200
leaq 0x30(%rsp), %rdi
callq 0x59200
leaq 0x5a610(%rip), %rsi     # 0xf73e6
movq %rsp, %rdi
callq 0x579f0
movq %rsp, %rdi
leaq 0x90(%rsp), %rsi
callq 0x562f0
movq %rax, %r12
leaq 0x5a5e9(%rip), %rsi     # 0xf73e1
leaq 0x18(%rsp), %rdi
callq 0x579f0
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
callq 0x562f0
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x570b0
leaq 0x18(%rsp), %rdi
callq 0x59200
movq %rsp, %rdi
callq 0x59200
movq 0xce5b3(%rip), %r13     # 0x16b3e8
movq (%r13), %rdi
movq (%rdi), %rax
leaq 0x30(%rsp), %rsi
callq *0x10(%rax)
testl %eax, %eax
je 0x9cf34
leaq 0x77684(%rip), %rsi     # 0x1144d7
movq %rsp, %rdi
callq 0x579f0
leaq 0x90(%rsp), %rdi
movq %rsp, %rsi
callq 0x55180
movl %eax, %ebp
movq %rsp, %rdi
callq 0x59200
testb %bpl, %bpl
je 0x9cf34
leaq 0x5a561(%rip), %rsi     # 0xf73e6
movq %rsp, %rdi
callq 0x579f0
leaq 0x77643(%rip), %rsi     # 0x1144d7
leaq 0x78(%rsp), %rdi
callq 0x579f0
leaq 0x90(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x57610
leaq 0x18(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movl %eax, %edx
callq 0x58b00
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x562f0
movq %rax, %r12
leaq 0x5a506(%rip), %rsi     # 0xf73e1
leaq 0x60(%rsp), %rdi
callq 0x579f0
leaq 0x60(%rsp), %rsi
movq %r12, %rdi
callq 0x562f0
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x555f0
leaq 0x60(%rsp), %rdi
callq 0x59200
leaq 0x18(%rsp), %rdi
callq 0x59200
leaq 0x78(%rsp), %rdi
callq 0x59200
movq %rsp, %rdi
callq 0x59200
movq (%r13), %rdi
movq (%rdi), %rax
leaq 0x30(%rsp), %rsi
callq *0x10(%rax)
movq (%r13), %rax
movl $0x108, %edi            # imm = 0x108
addq 0x78(%rax), %rdi
leaq 0x30(%rsp), %rsi
callq 0x56fa0
testb %al, %al
je 0x9cf58
movq (%r13), %rdi
callq 0x57430
leaq 0x30(%rsp), %rdi
callq 0x59200
leaq 0x90(%rsp), %rdi
callq 0x59200
leaq 0x5a3fc(%rip), %rsi     # 0xf7372
movq %rbx, %rdi
callq 0x57ef0
movq 0xce463(%rip), %rcx     # 0x16b3e8
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x9cf9e
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
leaq 0x5a3cd(%rip), %rsi     # 0xf7372
movq %rbx, %rdi
callq 0x590a0
xorl %ebp, %ebp
testb %al, %al
je 0x9d0d5
movq 0x78(%r14), %rax
cmpl $0x0, 0x48(%rax)
jne 0x9d0d5
cmpl $0x0, 0xa0(%rax)
jne 0x9d0d5
leaq 0x90(%rsp), %r12
movq %r12, %rdi
movq 0x58(%rsp), %rsi
callq 0x9c53f
cmpl $0x0, 0x8(%r12)
jle 0x9d0c8
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x30(%rsp), %r13
incl %r15d
leaq 0x90(%rsp), %rdi
movl %r15d, %esi
callq 0x9d328
movq %r13, %rdi
movq %rax, %rsi
callq 0x56d90
callq 0x55370
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x579f0
movq %r13, %rdi
movq %r12, %rsi
callq 0x562f0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x562f0
movq %rsp, %rdi
movq %rax, %rsi
callq 0x570b0
leaq 0x18(%rsp), %rdi
callq 0x59200
movq %r13, %rdi
callq 0x59200
movq %r13, %rdi
callq 0x57be0
movq %r13, %rdi
movq %rsp, %rsi
callq 0x55520
testl %eax, %eax
je 0x9d08d
movq %r13, %rdi
callq 0x55400
movq %rsp, %rdi
callq 0x59200
jmp 0x9d0b6
movq 0x78(%r14), %rdx
movq %r13, %rsi
callq 0x55db0
movl %eax, %r12d
movq %r13, %rdi
callq 0x55400
movq %rsp, %rdi
callq 0x59200
testl %r12d, %r12d
movl $0x0, %ebp
je 0x9d0c8
movl 0x98(%rsp), %eax
decl %eax
cmpl %eax, %r15d
jl 0x9cffe
leaq 0x90(%rsp), %rdi
callq 0x5cd46
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9d0eb
movq %rax, %rbx
jmp 0x9d104
jmp 0x9d11f
jmp 0x9d196
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x59200
leaq 0x18(%rsp), %rdi
callq 0x59200
jmp 0x9d113
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x59200
jmp 0x9d122
movq %rax, %rbx
movq %rsp, %rdi
callq 0x59200
jmp 0x9d199
jmp 0x9d196
jmp 0x9d178
jmp 0x9d132
movq %rax, %rbx
jmp 0x9d157
movq %rax, %rbx
jmp 0x9d1a3
jmp 0x9d13e
movq %rax, %rbx
jmp 0x9d169
jmp 0x9d145
movq %rax, %rbx
jmp 0x9d171
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x59200
movq %rsp, %rdi
jmp 0x9d19e
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x59200
movq %rsp, %rdi
callq 0x59200
leaq 0x30(%rsp), %rdi
jmp 0x9d1ab
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x55400
jmp 0x9d18a
movq %rax, %rbx
movq %rsp, %rdi
jmp 0x9d1c9
jmp 0x9d191
movq %rax, %rbx
jmp 0x9d1ce
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x59200
leaq 0x90(%rsp), %rdi
callq 0x59200
jmp 0x9d1db
movq %rax, %rbx
jmp 0x9d1c4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x59200
leaq 0x30(%rsp), %rdi
callq 0x59200
leaq 0x90(%rsp), %rdi
callq 0x5cd46
movq %rbx, %rdi
callq 0x57090
nop