// File: /workspace/github_cpp_makefile_star2_O1/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 0xed29
leaq -0x1a0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x1372a
leaq -0x1d0(%rbp), %rsi
leaq -0x1b0(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0xe8a6
movl %eax, %r15d
movq -0x1b0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe20c
callq 0x2220
leaq -0x1c0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe221
callq 0x2220
testb %r15b, %r15b
je 0xe42d
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 0x1372a
leaq -0x110(%rbp), %rdi
leaq -0x190(%rbp), %rdx
movq -0x30(%rbp), %rsi
xorl %ecx, %ecx
callq 0xed88
movq -0x190(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe291
callq 0x2220
cmpq $0x2, -0x108(%rbp)
je 0xe3c1
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 0xe308
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
jmp 0xe30e
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 0x1372a
movq -0x30(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
movq %r13, %rdx
callq 0xe8a6
movl %eax, %r12d
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xe37d
callq 0x2220
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe38e
callq 0x2220
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xe3a0
callq 0x2220
testb %r12b, %r12b
je 0xe4e0
addq $0x2, %r14
movq -0x108(%rbp), %rax
addq $-0x2, %rax
cmpq %rax, %r14
jb 0xe2b4
leaq -0x110(%rbp), %rsi
movq 0x8(%rsi), %rdx
addq $-0x2, %rdx
leaq -0x70(%rbp), %rdi
movq $-0x1, %rcx
callq 0x2270
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq -0x40(%rbp), %r12
leaq -0x140(%rbp), %r13
callq 0x22b0
leaq -0xc0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xe434
movq %rdx, -0xd0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc0(%rbp)
jmp 0xe43a
xorl %ebx, %ebx
jmp 0xe51a
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 0x1372a
leaq -0xd0(%rbp), %rsi
leaq -0x170(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0xe8a6
movl %eax, %r14d
movq -0x170(%rbp), %rdi
cmpq %r15, %rdi
je 0xe4a7
callq 0x2220
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe4b8
callq 0x2220
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe4ca
callq 0x2220
testb %r14b, %r14b
je 0xe4dc
movq -0x30(%rbp), %rdi
callq 0xfcf0
movl %eax, %ebx
jmp 0xe4ed
xorl %ebx, %ebx
jmp 0xe4ed
xorl %ebx, %ebx
leaq -0x40(%rbp), %r12
leaq -0x140(%rbp), %r13
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe502
callq 0x2220
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xe51a
callq 0x2220
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xe52f
callq 0x2220
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
je 0xe540
callq 0x2220
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0xe54e
callq 0x2220
movl %ebx, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe5f5
movq %rax, %r14
movq -0x170(%rbp), %rdi
cmpq %r15, %rdi
je 0xe580
callq 0x2220
jmp 0xe580
movq %rax, %r14
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe596
callq 0x2220
jmp 0xe596
movq %rax, %r14
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xe633
jmp 0xe5f5
movq %rax, %r14
movq -0x190(%rbp), %rdi
cmpq %rbx, %rdi
jne 0xe64d
jmp 0xe652
movq %rax, %r14
jmp 0xe652
movq %rax, %r14
movq -0x1b0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe5de
callq 0x2220
jmp 0xe5de
movq %rax, %r14
leaq -0x1c0(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xe660
movq %rax, %r14
jmp 0xe66a
movq %rax, %r14
jmp 0xe615
movq %rax, %r14
jmp 0xe63d
movq %rax, %r14
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xe615
callq 0x2220
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe62b
callq 0x2220
jmp 0xe62b
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xe63d
callq 0x2220
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe652
callq 0x2220
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xe66a
callq 0x2220
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xe67f
callq 0x2220
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0xe697
callq 0x2220
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe6a9
callq 0x2220
movq %r14, %rdi
callq 0x2400
nop