// File: /workspace/github_cpp_makefile_star2_O1/FFY00[P]uicc/include/uicc.h
// Function: makeBcd(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, int)
static inline string makeBcd(string data, bool swap=true, int outputLength=0) {
    string tmp=data;
    string output;

    if (data.size()%2 == 1 )
        tmp+='f';

    if (swap)
        for(size_t i=0; i< tmp.size(); i+=2)
            output+=(char)( (mkDigit(tmp[i+1])<<4) + (mkDigit(tmp[i])) );
    else
        for(size_t i=0; i< tmp.size(); i+=2)
            output+=(char)( (mkDigit(tmp[i])<<4) + (mkDigit(tmp[i+1])) );

    for (int i=tmp.size()/2; i<outputLength; i++)
        output+='\xff';

    return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%rsi), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x1372a
leaq 0x10(%rbx), %rax
movq %rax, -0x58(%rbp)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movq %rbx, -0x30(%rbp)
movb $0x0, 0x10(%rbx)
testb $0x1, 0x8(%r12)
je 0x6cc4
leaq -0x50(%rbp), %rdi
movl $0x66, %esi
callq 0x2200
movq -0x48(%rbp), %rax
testb %r15b, %r15b
je 0x6d8a
testq %rax, %rax
je 0x6e3e
xorl %r13d, %r13d
movq -0x50(%rbp), %rax
movzbl 0x1(%rax,%r13), %r12d
movl %r12d, %edi
callq 0x2380
movzbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x6d00
leal -0x30(%rax), %r15d
jmp 0x6d22
addl $-0x61, %ecx
cmpl $0x5, %ecx
ja 0x6d0e
leal -0x57(%rax), %r15d
jmp 0x6d22
xorl %r15d, %r15d
leaq 0x11ffe(%rip), %rdi     # 0x18d16
movl %r12d, %esi
xorl %eax, %eax
callq 0x2060
movq -0x50(%rbp), %rax
movzbl (%rax,%r13), %r12d
movl %r12d, %edi
callq 0x2380
movzbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x6d43
leal -0x30(%rax), %ebx
jmp 0x6d63
addl $-0x61, %ecx
cmpl $0x5, %ecx
ja 0x6d50
leal -0x57(%rax), %ebx
jmp 0x6d63
xorl %ebx, %ebx
leaq 0x11fbd(%rip), %rdi     # 0x18d16
movl %r12d, %esi
xorl %eax, %eax
callq 0x2060
shlb $0x4, %r15b
addb %bl, %r15b
movsbl %r15b, %esi
movq -0x30(%rbp), %rdi
callq 0x2200
addq $0x2, %r13
cmpq -0x48(%rbp), %r13
jb 0x6cdd
jmp 0x6e3e
testq %rax, %rax
je 0x6e3e
xorl %r13d, %r13d
movq -0x50(%rbp), %rax
movzbl (%rax,%r13), %r12d
movl %r12d, %edi
callq 0x2380
movzbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x6db8
leal -0x30(%rax), %r15d
jmp 0x6dda
addl $-0x61, %ecx
cmpl $0x5, %ecx
ja 0x6dc6
leal -0x57(%rax), %r15d
jmp 0x6dda
xorl %r15d, %r15d
leaq 0x11f46(%rip), %rdi     # 0x18d16
movl %r12d, %esi
xorl %eax, %eax
callq 0x2060
movq -0x50(%rbp), %rax
movzbl 0x1(%rax,%r13), %r12d
movl %r12d, %edi
callq 0x2380
movzbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x6dfc
leal -0x30(%rax), %ebx
jmp 0x6e1c
addl $-0x61, %ecx
cmpl $0x5, %ecx
ja 0x6e09
leal -0x57(%rax), %ebx
jmp 0x6e1c
xorl %ebx, %ebx
leaq 0x11f04(%rip), %rdi     # 0x18d16
movl %r12d, %esi
xorl %eax, %eax
callq 0x2060
shlb $0x4, %r15b
addb %bl, %r15b
movsbl %r15b, %esi
movq -0x30(%rbp), %rdi
callq 0x2200
addq $0x2, %r13
cmpq -0x48(%rbp), %r13
jb 0x6d96
movq -0x48(%rbp), %rax
shrq %rax
subl %eax, %r14d
jle 0x6e5d
movq -0x30(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2200
decl %r14d
jne 0x6e4a
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x6e6f
callq 0x2220
movq -0x30(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6e88
jmp 0x6e88
jmp 0x6e88
movq %rax, %r14
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x58(%rbp), %rdi
je 0x6e9d
callq 0x2220
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x6eaf
callq 0x2220
movq %r14, %rdi
callq 0x2400