// File: FFY00[P]uicc/include/uicc.h
// Function: SIM::openFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool openFile(string filename) {
        string order(u8"\xa0\xa4\x00\x00\x02",5);
        // go to root directory (MF)
        string goToRoot (u8"\x3f\x00",2);
        string answerChangeDir(u8"\x9f\x17",2);

        if (!send_check(order+goToRoot, answerChangeDir))
            return false;

        string answer(u8"\x9f\x0f",2);
        string filenameBin=UICCFile(filename);

        for (size_t i=0; i<filenameBin.size()-2; i+=2)
            if (!send_check(order+filenameBin.substr(i,2), answerChangeDir))
                return false;

        if (! send_check(order+filenameBin.substr(filenameBin.size()-2), answer))
            return false;

        return readFileInfo();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rsi, -0x230(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x34d0
movq -0x220(%rbp), %rcx
leaq 0xee1a(%rip), %rsi      # 0x2326d
leaq -0x38(%rbp), %rdi
movl $0x5, %edx
callq 0x3330
jmp 0x14463
leaq -0x39(%rbp), %rdi
callq 0x3300
leaq -0x71(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x34d0
movq -0x238(%rbp), %rcx
leaq 0xede9(%rip), %rsi      # 0x23273
leaq -0x70(%rbp), %rdi
movl $0x2, %edx
callq 0x3330
jmp 0x1449a
leaq -0x71(%rbp), %rdi
callq 0x3300
leaq -0x99(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x34d0
movq -0x240(%rbp), %rcx
leaq 0x115f2(%rip), %rsi     # 0x25ab6
leaq -0x98(%rbp), %rdi
movl $0x2, %edx
callq 0x3330
jmp 0x144d7
leaq -0x99(%rbp), %rdi
callq 0x3300
leaq -0xc0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x154f0
jmp 0x144f9
leaq -0xe0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3120
jmp 0x1450e
movq -0x228(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x14f60
movb %al, -0x241(%rbp)
jmp 0x14530
movb -0x241(%rbp), %al
xorb $-0x1, %al
movb %al, -0x242(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x31a0
leaq -0xc0(%rbp), %rdi
callq 0x31a0
movb -0x242(%rbp), %al
testb $0x1, %al
jne 0x14565
jmp 0x14611
movb $0x0, -0x1(%rbp)
movl $0x1, -0xe4(%rbp)
jmp 0x149d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x3300
jmp 0x14a20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x71(%rbp), %rdi
callq 0x3300
jmp 0x14a17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x3300
jmp 0x14a0e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x14a02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x14600
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x31a0
leaq -0xc0(%rbp), %rdi
callq 0x31a0
jmp 0x14a02
leaq -0x109(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x34d0
movq -0x250(%rbp), %rcx
leaq 0x11487(%rip), %rsi     # 0x25ab9
leaq -0x108(%rbp), %rdi
movl $0x2, %edx
callq 0x3330
jmp 0x14645
leaq -0x109(%rbp), %rdi
callq 0x3300
movq -0x230(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x3120
jmp 0x14666
movq -0x228(%rbp), %rsi
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rdx
xorl %ecx, %ecx
callq 0x15570
jmp 0x14684
leaq -0x150(%rbp), %rdi
callq 0x31a0
movq $0x0, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x258(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movq -0x258(%rbp), %rax
subq $0x2, %rcx
cmpq %rcx, %rax
jae 0x14857
movq -0x158(%rbp), %rdx
leaq -0x198(%rbp), %rdi
leaq -0x130(%rbp), %rsi
movl $0x2, %ecx
callq 0x32c0
jmp 0x146ed
leaq -0x178(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0x16ff0
jmp 0x14706
leaq -0x1b8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3120
jmp 0x1471b
movq -0x228(%rbp), %rdi
leaq -0x178(%rbp), %rsi
leaq -0x1b8(%rbp), %rdx
callq 0x14f60
movb %al, -0x259(%rbp)
jmp 0x1473d
movb -0x259(%rbp), %al
xorb $-0x1, %al
movb %al, -0x25a(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
leaq -0x178(%rbp), %rdi
callq 0x31a0
leaq -0x198(%rbp), %rdi
callq 0x31a0
movb -0x25a(%rbp), %al
testb $0x1, %al
jne 0x1477e
jmp 0x1483e
movb $0x0, -0x1(%rbp)
movl $0x1, -0xe4(%rbp)
jmp 0x149a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x109(%rbp), %rdi
callq 0x3300
jmp 0x14a02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x149c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x31a0
jmp 0x149c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x149bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1482d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x14821
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
leaq -0x178(%rbp), %rdi
callq 0x31a0
leaq -0x198(%rbp), %rdi
callq 0x31a0
jmp 0x149bc
jmp 0x14840
movq -0x158(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x158(%rbp)
jmp 0x1469b
leaq -0x130(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x31f0
movq -0x268(%rbp), %rsi
movq %rax, %rdx
addq $-0x2, %rdx
leaq -0x1f8(%rbp), %rdi
movq $-0x1, %rcx
callq 0x32c0
jmp 0x1488d
leaq -0x1d8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x1f8(%rbp), %rdx
callq 0x16ff0
jmp 0x148a6
leaq -0x218(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x3120
jmp 0x148bb
movq -0x228(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
leaq -0x218(%rbp), %rdx
callq 0x14f60
movb %al, -0x269(%rbp)
jmp 0x148dd
movb -0x269(%rbp), %al
xorb $-0x1, %al
movb %al, -0x26a(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x31a0
leaq -0x1d8(%rbp), %rdi
callq 0x31a0
leaq -0x1f8(%rbp), %rdi
callq 0x31a0
movb -0x26a(%rbp), %al
testb $0x1, %al
jne 0x1491b
jmp 0x14979
movb $0x0, -0x1(%rbp)
movl $0x1, -0xe4(%rbp)
jmp 0x149a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1496b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1495f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x31a0
leaq -0x1d8(%rbp), %rdi
callq 0x31a0
leaq -0x1f8(%rbp), %rdi
callq 0x31a0
jmp 0x149bc
movq -0x228(%rbp), %rdi
callq 0x17040
movb %al, -0x26b(%rbp)
jmp 0x1498d
movb -0x26b(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0xe4(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x31a0
leaq -0x108(%rbp), %rdi
callq 0x31a0
jmp 0x149d6
leaq -0x130(%rbp), %rdi
callq 0x31a0
leaq -0x108(%rbp), %rdi
callq 0x31a0
jmp 0x14a02
leaq -0x98(%rbp), %rdi
callq 0x31a0
leaq -0x70(%rbp), %rdi
callq 0x31a0
leaq -0x38(%rbp), %rdi
callq 0x31a0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0x31a0
leaq -0x70(%rbp), %rdi
callq 0x31a0
leaq -0x38(%rbp), %rdi
callq 0x31a0
movq -0x48(%rbp), %rdi
callq 0x34b0
nopl (%rax)