// File: jovermann[P]streplace/src/MiscUtils.cpp
// Function: ut1::toNfd(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string toNfd(const std::string& s)
{
    // This only works for german umlauts so far.
    std::string r;
    for (size_t i = 0; i < s.length(); i++)
    {
        if ((s[i] == '\xc3') && (i < s.length() - 1))
        {
            switch (s[i + 1])
            {
            case '\x84': r += "A\xcc\x88"; i++; continue;
            case '\x96': r += "O\xcc\x88"; i++; continue;
            case '\x9c': r += "U\xcc\x88"; i++; continue;
            case '\xa4': r += "a\xcc\x88"; i++; continue;
            case '\xb6': r += "o\xcc\x88"; i++; continue;
            case '\xbc': r += "u\xcc\x88"; i++; continue;
            }
        }
        r += s[i];
    }
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x7860
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x78e0
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x12cb4
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x76a0
movsbl (%rax), %eax
cmpl $-0x3d, %eax
jne 0x12c86
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x78e0
movq %rax, %rcx
movq -0x50(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x12c86
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x76a0
movsbl (%rax), %eax
addl $0x7c, %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0x38, %eax
ja 0x12c84
movq -0x58(%rbp), %rax
leaq 0x37a11(%rip), %rcx     # 0x4a5ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x40(%rbp), %rdi
leaq 0x37b7f(%rip), %rsi     # 0x4a72e
callq 0x75b0
jmp 0x12bb6
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12ca3
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x73c0
jmp 0x12cd1
movq -0x40(%rbp), %rdi
leaq 0x37b46(%rip), %rsi     # 0x4a732
callq 0x75b0
jmp 0x12bf3
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12ca3
movq -0x40(%rbp), %rdi
leaq 0x37b27(%rip), %rsi     # 0x4a736
callq 0x75b0
jmp 0x12c16
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12ca3
movq -0x40(%rbp), %rdi
leaq 0x37b0b(%rip), %rsi     # 0x4a73a
callq 0x75b0
jmp 0x12c36
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12ca3
movq -0x40(%rbp), %rdi
leaq 0x37aef(%rip), %rsi     # 0x4a73e
callq 0x75b0
jmp 0x12c56
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12ca3
movq -0x40(%rbp), %rdi
leaq 0x37ad3(%rip), %rsi     # 0x4a742
callq 0x75b0
jmp 0x12c76
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12ca3
jmp 0x12c86
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x76a0
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x73f0
jmp 0x12ca1
jmp 0x12ca3
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12b0c
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x12cc7
movq -0x40(%rbp), %rdi
callq 0x73c0
movq -0x38(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x7a30
nopw (%rax,%rax)