// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movl $0xa4a0, (%r12)         # imm = 0xA4A0
movw $0x2, 0x4(%r12)
movq $0x5, -0x8(%r12)
leaq -0x140(%rbp), %r13
movq %r13, -0x10(%r13)
movw $0x3f, (%r13)
movl $0x2, %eax
movq %rax, -0x8(%r13)
xorl %ecx, %ecx
movb %cl, 0x2(%r13)
leaq -0x80(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movw $0x179f, (%rdx)         # imm = 0x179F
movq %rax, -0x8(%rdx)
movb %cl, 0x2(%rdx)
leaq -0x1d0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0xefb5
leaq -0x1a0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x1394e
leaq -0x1d0(%rbp), %rsi
leaq -0x1b0(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0xeb32
movl %eax, %r15d
movq -0x1b0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe4a0
callq 0x2220
leaq -0x1c0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe4b5
callq 0x2220
testb %r15b, %r15b
je 0xe532
leaq -0x120(%rbp), %rax
movq %rax, -0x10(%rax)
movw $0xf9f, (%rax)          # imm = 0xF9F
movq $0x2, -0x8(%rax)
movb $0x0, 0x2(%rax)
leaq -0x180(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x190(%rbp), %rdi
callq 0x1394e
leaq -0x110(%rbp), %rdi
leaq -0x190(%rbp), %rdx
movq -0x30(%rbp), %rsi
xorl %ecx, %ecx
callq 0xf014
movq -0x190(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe521
callq 0x2220
cmpq $0x2, -0x108(%rbp)
jne 0xe539
xorl %edx, %edx
jmp 0xe666
xorl %ebx, %ebx
jmp 0xe7a5
leaq -0xa0(%rbp), %rbx
xorl %r14d, %r14d
leaq -0x70(%rbp), %r15
leaq -0xf0(%rbp), %r13
movl $0x2, %ecx
movq %r15, %rdi
leaq -0x110(%rbp), %rsi
movq %r14, %rdx
callq 0x2270
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22b0
movq %rbx, -0xb0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xe5a2
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
jmp 0xe5a8
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0xa8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xe0(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x1394e
movq -0x30(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
movq %r13, %rdx
callq 0xeb32
movl %eax, %r12d
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xe617
callq 0x2220
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe628
callq 0x2220
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xe63a
callq 0x2220
testb %r12b, %r12b
je 0xe76b
addq $0x2, %r14
movq -0x108(%rbp), %rdx
addq $-0x2, %rdx
cmpq %rdx, %r14
jb 0xe54e
leaq -0x40(%rbp), %r12
leaq -0x140(%rbp), %r13
leaq -0x70(%rbp), %rdi
leaq -0x110(%rbp), %rsi
movq $-0x1, %rcx
callq 0x2270
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22b0
leaq -0xc0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xe6bf
movq %rdx, -0xd0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc0(%rbp)
jmp 0xe6c5
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0xc8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x160(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
addq %rsi, %rdx
leaq -0x170(%rbp), %rdi
callq 0x1394e
leaq -0xd0(%rbp), %rsi
leaq -0x170(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0xeb32
movl %eax, %r14d
movq -0x170(%rbp), %rdi
cmpq %r15, %rdi
je 0xe732
callq 0x2220
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe743
callq 0x2220
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe755
callq 0x2220
testb %r14b, %r14b
je 0xe767
movq -0x30(%rbp), %rdi
callq 0xff76
movl %eax, %ebx
jmp 0xe778
xorl %ebx, %ebx
jmp 0xe778
xorl %ebx, %ebx
leaq -0x40(%rbp), %r12
leaq -0x140(%rbp), %r13
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe78d
callq 0x2220
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xe7a5
callq 0x2220
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xe7ba
callq 0x2220
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
je 0xe7cb
callq 0x2220
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0xe7d9
callq 0x2220
movl %ebx, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe880
movq %rax, %r14
movq -0x170(%rbp), %rdi
cmpq %r15, %rdi
je 0xe80b
callq 0x2220
jmp 0xe80b
movq %rax, %r14
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe821
callq 0x2220
jmp 0xe821
movq %rax, %r14
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xe8be
jmp 0xe880
movq %rax, %r14
movq -0x190(%rbp), %rdi
cmpq %rbx, %rdi
jne 0xe8d8
jmp 0xe8dd
movq %rax, %r14
jmp 0xe8dd
movq %rax, %r14
movq -0x1b0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe869
callq 0x2220
jmp 0xe869
movq %rax, %r14
leaq -0x1c0(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xe8eb
movq %rax, %r14
jmp 0xe8f5
movq %rax, %r14
jmp 0xe8a0
movq %rax, %r14
jmp 0xe8c8
movq %rax, %r14
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xe8a0
callq 0x2220
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe8b6
callq 0x2220
jmp 0xe8b6
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xe8c8
callq 0x2220
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe8dd
callq 0x2220
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xe8f5
callq 0x2220
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xe90a
callq 0x2220
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0xe922
callq 0x2220
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe934
callq 0x2220
movq %r14, %rdi
callq 0x2400