// File: FFY00[P]uicc/src/program_uicc.c
// Function: makeBin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
static inline int makeBin(string in, string &out) {
    out="";

    if ( in.size() %2 == 1)
        return -1;

    for (size_t i=0; i<in.size(); i++) {
        uint8_t tmp=255;

        if (in[i] >= '0' && in[i]<= '9')
            tmp=in[i]-'0';

        if (in[i] >= 'a' && in[i]<= 'f')
            tmp=in[i]-'a'+10;

        if (in[i] >= 'A' && in[i]<= 'F')
            tmp=in[i]-'A'+10;

        if (tmp == 255)
            return -1;

        i++;

        if (in[i] >= '0' && in[i] <= '9') {
            out+=(unsigned char) ((in[i]-'0') | tmp <<4);
            continue;
        }

        if (in[i] >= 'a' && in[i] <= 'f') {
            out+=(unsigned char) ((in[i]-'a'+10) | tmp <<4);
            continue;
        }

        if (in[i] >= 'A' && in[i] <= 'F') {
            out+=(unsigned char) ((in[i]-'A'+10) | tmp <<4);
            continue;
        }

        return -1;
    }

    return in.size()/2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x19cb5(%rip), %rsi     # 0x25c64
callq 0x33d0
movq -0x30(%rbp), %rdi
callq 0x31f0
andq $0x1, %rax
cmpq $0x1, %rax
jne 0xbfd3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc217
movq $0x0, -0x20(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x31f0
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0xc208
movq -0x30(%rbp), %rdi
movb $-0x1, -0x21(%rbp)
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0xc040
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0xc040
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
subl $0x30, %eax
movb %al, -0x21(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0xc083
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x66, %eax
jg 0xc083
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
subl $0x61, %eax
addl $0xa, %eax
movb %al, -0x21(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0xc0c6
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x46, %eax
jg 0xc0c6
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
subl $0x41, %eax
addl $0xa, %eax
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0xff, %eax
jne 0xc0dd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc217
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0xc140
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0xc140
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
subl $0x30, %eax
movzbl -0x21(%rbp), %ecx
shll $0x4, %ecx
orl %ecx, %eax
movq -0x18(%rbp), %rdi
movsbl %al, %esi
callq 0x31b0
jmp 0xc1f7
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0xc197
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x66, %eax
jg 0xc197
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
subl $0x61, %eax
addl $0xa, %eax
movzbl -0x21(%rbp), %ecx
shll $0x4, %ecx
orl %ecx, %eax
movq -0x18(%rbp), %rdi
movsbl %al, %esi
callq 0x31b0
jmp 0xc1f7
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0xc1ee
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
cmpl $0x46, %eax
jg 0xc1ee
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movsbl (%rax), %eax
subl $0x41, %eax
addl $0xa, %eax
movzbl -0x21(%rbp), %ecx
shll $0x4, %ecx
orl %ecx, %eax
movq -0x18(%rbp), %rdi
movsbl %al, %esi
callq 0x31b0
jmp 0xc1f7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc217
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xbfdb
movq -0x30(%rbp), %rdi
callq 0x31f0
shrq %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq