// File: /workspace/github_cpp_makefile_star2_O3/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 0x1394e
leaq 0x10(%rbx), %r13
movq %r13, (%rbx)
movq $0x0, 0x8(%rbx)
movq %rbx, -0x30(%rbp)
movb $0x0, 0x10(%rbx)
testb $0x1, 0x8(%r12)
movq %r13, -0x58(%rbp)
je 0x6d04
leaq -0x50(%rbp), %rdi
movl $0x66, %esi
callq 0x2200
movq -0x48(%rbp), %rax
testb %r15b, %r15b
je 0x6dcd
testq %rax, %rax
je 0x6e86
xorl %r13d, %r13d
movq -0x50(%rbp), %rbx
movzbl 0x1(%rbx,%r13), %r12d
movl %r12d, %edi
callq 0x2380
movzbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x6d40
leal -0x30(%rax), %r15d
jmp 0x6d66
addl $-0x61, %ecx
cmpl $0x5, %ecx
ja 0x6d4e
leal -0x57(%rax), %r15d
jmp 0x6d66
xorl %r15d, %r15d
leaq 0x11fbe(%rip), %rdi     # 0x18d16
movl %r12d, %esi
xorl %eax, %eax
callq 0x2060
movq -0x50(%rbp), %rbx
movzbl (%rbx,%r13), %r12d
movl %r12d, %edi
callq 0x2380
movzbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x6d83
leal -0x30(%rax), %ebx
jmp 0x6da3
addl $-0x61, %ecx
cmpl $0x5, %ecx
ja 0x6d90
leal -0x57(%rax), %ebx
jmp 0x6da3
xorl %ebx, %ebx
leaq 0x11f7d(%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
movq -0x48(%rbp), %rax
cmpq %rax, %r13
jb 0x6d1d
jmp 0x6e88
testq %rax, %rax
je 0x6e86
xorl %r13d, %r13d
movq -0x50(%rbp), %rbx
movzbl (%rbx,%r13), %r12d
movl %r12d, %edi
callq 0x2380
movzbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x6dfb
leal -0x30(%rax), %r15d
jmp 0x6e21
addl $-0x61, %ecx
cmpl $0x5, %ecx
ja 0x6e09
leal -0x57(%rax), %r15d
jmp 0x6e21
xorl %r15d, %r15d
leaq 0x11f03(%rip), %rdi     # 0x18d16
movl %r12d, %esi
xorl %eax, %eax
callq 0x2060
movq -0x50(%rbp), %rbx
movzbl 0x1(%rbx,%r13), %r12d
movl %r12d, %edi
callq 0x2380
movzbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x6e3f
leal -0x30(%rax), %ebx
jmp 0x6e5f
addl $-0x61, %ecx
cmpl $0x5, %ecx
ja 0x6e4c
leal -0x57(%rax), %ebx
jmp 0x6e5f
xorl %ebx, %ebx
leaq 0x11ec1(%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
movq -0x48(%rbp), %rax
cmpq %rax, %r13
jb 0x6dd9
jmp 0x6e88
xorl %eax, %eax
shrq %rax
subl %eax, %r14d
jle 0x6ea3
movq -0x30(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2200
decl %r14d
jne 0x6e90
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x6eb5
callq 0x2220
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6eca
jmp 0x6eca
jmp 0x6eca
movq %rax, %r14
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x58(%rbp), %rdi
je 0x6edf
callq 0x2220
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x6ef1
callq 0x2220
movq %r14, %rdi
callq 0x2400