// File: /workspace/github_cpp_makefile_star2_O1/FFY00[P]uicc/include/uicc.h
// Function: SIM::readFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> readFile(string filename) {
        vector<string> content;

        if (!openFile(filename))
            return content;

        uint16_t size=ntohs(curFile.size);

        if (ntohs(curFile.structure)==0) { // binary (flat)
            Assert(size <= 256, "Not developped: read binary files > 256 bytes (%hu)", size);
            string command(u8"\xa0\xb0\x00\x00",4);
            string good(u8"\x90\x00",2);
            char s=size&0xFF;
            command+=string(&s,1);
            write(command);
            string answ=read(size+good.size());

            if ( answ.size()==(size_t)size+2 &&
                    answ.substr(answ.size()-2) == good )
                content.push_back(answ.substr(0,answ.size()-2));

            return content;
        } else { // records
            for (int i=0; i < size/curFile.record_length; i++ ) {
                string command(u8"\xa0\xb2\x00\x02",4);
                string good(u8"\x90\x00",2);
                command+=string((char *)&curFile.record_length,1);
                write(command);
                string answ=read(size+good.size());

                if ( answ.size()==(size_t)curFile.record_length+good.size() &&
                        answ.substr(answ.size()-2) == good )
                    content.push_back(answ.substr(0,answ.size()-good.size()));
            }

            return content;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x58(%rbp)
movq $0x0, 0x10(%rdi)
leaq -0x130(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x1372a
leaq -0x140(%rbp), %rsi
movq %r14, %rdi
callq 0xe130
movl %eax, %ebx
movq %r14, -0x50(%rbp)
movq -0x140(%rbp), %rdi
cmpq %r15, %rdi
je 0xaa94
callq 0x2220
testb %bl, %bl
je 0xaea3
movq -0x50(%rbp), %rax
movzwl 0xa(%rax), %edi
rolw $0x8, %di
cmpb $0x0, 0x15(%rax)
je 0xacd6
movzbl 0x16(%rax), %ecx
cmpw %cx, %di
jb 0xaea3
movzwl %di, %eax
movq %rax, -0xa0(%rbp)
leaq -0x88(%rbp), %rbx
leaq -0x68(%rbp), %r15
leaq -0x38(%rbp), %r12
xorl %r13d, %r13d
movq %rbx, -0x98(%rbp)
movl $0x200b2a0, -0x88(%rbp) # imm = 0x200B2A0
movq $0x4, -0x90(%rbp)
xorl %eax, %eax
movb %al, -0x84(%rbp)
movq %r15, -0x78(%rbp)
movw $0x90, -0x68(%rbp)
movq $0x2, -0x70(%rbp)
movb %al, -0x66(%rbp)
movq %r12, -0x48(%rbp)
movb %cl, -0x38(%rbp)
movq $0x1, -0x40(%rbp)
movb %al, -0x37(%rbp)
movl $0x1, %edx
leaq -0x98(%rbp), %rdi
movq %r12, %rsi
callq 0x20d0
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0xab48
callq 0x2220
leaq -0xf0(%rbp), %rbx
movq %rbx, -0x100(%rbp)
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %r15
movq %r15, %rdi
callq 0x1372a
movq -0x50(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xe6b2
movq -0x100(%rbp), %rdi
cmpq %rbx, %rdi
je 0xab96
callq 0x2220
movq -0x70(%rbp), %rdx
addq -0xa0(%rbp), %rdx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0xde7c
movq -0x40(%rbp), %rbx
movzbl 0x16(%r14), %r15d
addq -0x70(%rbp), %r15
cmpq %r15, %rbx
jne 0xac08
leaq -0x2(%rbx), %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movq $-0x1, %rcx
callq 0x2270
movq -0xd8(%rbp), %rdx
cmpq -0x70(%rbp), %rdx
jne 0xac08
testq %rdx, %rdx
je 0xacce
movq -0x78(%rbp), %rsi
movq -0xe0(%rbp), %rdi
callq 0x2260
testl %eax, %eax
sete %r12b
jmp 0xac0b
xorl %r12d, %r12d
cmpq %r15, %rbx
leaq -0x88(%rbp), %rbx
leaq -0x68(%rbp), %r15
jne 0xac33
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xac33
callq 0x2220
testb %r12b, %r12b
leaq -0x38(%rbp), %r12
je 0xac7d
movq -0x40(%rbp), %rcx
subq -0x70(%rbp), %rcx
leaq -0xc0(%rbp), %r14
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0x2270
movq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0x1385e
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xac7d
callq 0x2220
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0xac8b
callq 0x2220
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0xac99
callq 0x2220
movq -0x98(%rbp), %rdi
cmpq %rbx, %rdi
je 0xacaa
callq 0x2220
incl %r13d
movq -0x50(%rbp), %rax
movzbl 0x16(%rax), %ecx
movq -0xa0(%rbp), %rax
xorl %edx, %edx
divl %ecx
cmpl %eax, %r13d
jb 0xaadb
jmp 0xaea3
movb $0x1, %r12b
jmp 0xac0b
movzwl %di, %r13d
cmpl $0x101, %r13d           # imm = 0x101
jae 0xaec1
leaq -0x88(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movl $0xb0a0, (%rcx)         # imm = 0xB0A0
movq $0x4, -0x8(%rcx)
xorl %eax, %eax
movb %al, 0x4(%rcx)
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
movw $0x90, (%r12)
movq $0x2, -0x8(%r12)
movb %al, 0x2(%r12)
leaq -0x38(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movb %dil, (%rbx)
movq $0x1, -0x8(%rbx)
movb %al, 0x1(%rbx)
leaq -0x98(%rbp), %rdi
movl $0x1, %edx
movq %rbx, %rsi
callq 0x20d0
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
je 0xad5b
callq 0x2220
leaq -0x110(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x1372a
leaq -0x120(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0xe6b2
movq -0x120(%rbp), %rdi
cmpq %r15, %rdi
je 0xada4
callq 0x2220
movq -0x70(%rbp), %rdx
addq %r13, %rdx
leaq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xde7c
movq -0x40(%rbp), %r14
addq $0x2, %r13
cmpq %r13, %r14
jne 0xae0e
leaq -0x2(%r14), %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movq $-0x1, %rcx
callq 0x2270
movq -0xd8(%rbp), %rdx
cmpq -0x70(%rbp), %rdx
jne 0xae0e
testq %rdx, %rdx
je 0xaeb9
movq -0x78(%rbp), %rsi
movq -0xe0(%rbp), %rdi
callq 0x2260
testl %eax, %eax
sete %r15b
jmp 0xae11
xorl %r15d, %r15d
cmpq %r13, %r14
jne 0xae2b
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae2b
callq 0x2220
testb %r15b, %r15b
je 0xae6f
leaq -0x48(%rbp), %rsi
movq 0x8(%rsi), %rcx
addq $-0x2, %rcx
leaq -0xc0(%rbp), %rdi
xorl %edx, %edx
callq 0x2270
leaq -0xc0(%rbp), %rsi
movq -0x58(%rbp), %rdi
callq 0x1385e
leaq -0xb0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae6f
callq 0x2220
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
je 0xae7d
callq 0x2220
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0xae8b
callq 0x2220
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xaea3
callq 0x2220
movq -0x58(%rbp), %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %r15b
jmp 0xae11
callq 0x2632
movq %rax, %r14
leaq -0xb0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaeff
callq 0x2220
jmp 0xaeff
jmp 0xaefc
jmp 0xaefc
jmp 0xaef7
movq %rax, %r14
movq -0x120(%rbp), %rdi
cmpq %r15, %rdi
jne 0xaf08
jmp 0xaf0d
movq %rax, %r14
jmp 0xaf0d
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
je 0xaf0d
callq 0x2220
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
jne 0xafa6
jmp 0xafab
movq %rax, %r14
movq -0x140(%rbp), %rdi
cmpq %r15, %rdi
jne 0xafbe
jmp 0xafc3
movq %rax, %r14
jmp 0xafc3
jmp 0xaf41
movq %rax, %r14
jmp 0xaf61
movq %rax, %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xaf61
callq 0x2220
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
jne 0xaf8f
jmp 0xaf99
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
jne 0xaf8f
jmp 0xaf99
jmp 0xaf96
movq %rax, %r14
movq -0x100(%rbp), %rdi
cmpq %rbx, %rdi
je 0xaf99
callq 0x2220
jmp 0xaf99
movq %rax, %r14
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xafab
callq 0x2220
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xafc3
callq 0x2220
movq -0x58(%rbp), %rdi
callq 0xafd4
movq %r14, %rdi
callq 0x2400