// File: /workspace/github_cpp_makefile_star2_O3/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 $0xf8, %rsp
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x58(%rbp)
movq $0x0, 0x10(%rdi)
leaq -0x110(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x1394e
leaq -0x120(%rbp), %rsi
movq %r14, %rdi
callq 0xe3c4
movl %eax, %ebx
movq -0x120(%rbp), %rdi
cmpq %r15, %rdi
je 0xad78
callq 0x2220
testb %bl, %bl
je 0xb199
movzwl 0xa(%r14), %edi
rolw $0x8, %di
cmpb $0x0, 0x15(%r14)
je 0xafcb
movzbl 0x16(%r14), %ecx
cmpw %cx, %di
jb 0xb199
leaq -0x40(%rbp), %rsi
movzwl %di, %eax
movq %rax, -0x30(%rbp)
leaq -0xe0(%rbp), %r13
xorl %r15d, %r15d
movl %edi, -0xbc(%rbp)
movq %r13, %r12
movq %r14, %rbx
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x200b2a0, -0x88(%rbp) # imm = 0x200B2A0
movq $0x4, -0x90(%rbp)
xorl %eax, %eax
movb %al, -0x84(%rbp)
leaq -0x68(%rbp), %rdx
movq %rdx, -0x78(%rbp)
movw $0x90, -0x68(%rbp)
movq $0x2, -0x70(%rbp)
movb %al, -0x66(%rbp)
movq %rsi, -0x50(%rbp)
movb %cl, -0x40(%rbp)
movq $0x1, -0x48(%rbp)
movb %al, -0x3f(%rbp)
movl $0x1, %edx
leaq -0x98(%rbp), %rdi
movq %rsi, %r14
callq 0x20d0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0xae3b
callq 0x2220
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %r13
movq %r12, %rdi
callq 0x1394e
movq %rbx, %r14
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe93c
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xae8b
callq 0x2220
movq -0x70(%rbp), %rdx
addq -0x30(%rbp), %rdx
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0xe17e
movq -0x48(%rbp), %rdx
movzbl 0x16(%r14), %eax
addq -0x70(%rbp), %rax
cmpq %rax, %rdx
jne 0xaf65
addq $-0x2, %rdx
leaq -0xb8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq $-0x1, %rcx
callq 0x2270
movq -0xb0(%rbp), %rdx
cmpq -0x70(%rbp), %rdx
jne 0xaefc
movq -0xb8(%rbp), %r13
testq %rdx, %rdx
je 0xaf07
movq -0x78(%rbp), %rsi
movq %r13, %rdi
callq 0x2260
testl %eax, %eax
sete %bl
jmp 0xaf09
movq -0xb8(%rbp), %r13
xorl %ebx, %ebx
jmp 0xaf09
movb $0x1, %bl
leaq -0xa8(%rbp), %rax
cmpq %rax, %r13
je 0xaf1d
movq %r13, %rdi
callq 0x2220
testb %bl, %bl
movq %r12, %r13
je 0xaf65
movq -0x48(%rbp), %rcx
subq -0x70(%rbp), %rcx
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
xorl %edx, %edx
callq 0x2270
movq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x13a8a
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xaf65
callq 0x2220
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xaf77
callq 0x2220
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xaf89
callq 0x2220
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xafa1
callq 0x2220
incl %r15d
movzbl 0x16(%r14), %ecx
movl -0xbc(%rbp), %edi
movl %edi, %eax
xorl %edx, %edx
divw %cx
movzwl %ax, %eax
cmpl %eax, %r15d
leaq -0x40(%rbp), %rsi
jb 0xadbd
jmp 0xb199
movzwl %di, %r15d
cmpl $0x101, %r15d           # imm = 0x101
jae 0xb1af
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), %r13
movq %r13, -0x10(%r13)
movw $0x90, (%r13)
movq $0x2, -0x8(%r13)
movb %al, 0x2(%r13)
leaq -0x40(%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 -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb04d
callq 0x2220
leaq -0xf0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x1394e
leaq -0x100(%rbp), %rsi
movq %r14, %rdi
callq 0xe93c
movq -0x100(%rbp), %rdi
cmpq %r12, %rdi
je 0xb096
callq 0x2220
movq -0x70(%rbp), %rdx
addq %r15, %rdx
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0xe17e
movq -0x48(%rbp), %rdx
addq $0x2, %r15
cmpq %r15, %rdx
jne 0xb165
addq $-0x2, %rdx
leaq -0xb8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq $-0x1, %rcx
callq 0x2270
movq -0xb0(%rbp), %rdx
cmpq -0x70(%rbp), %rdx
jne 0xb102
movq -0xb8(%rbp), %r14
testq %rdx, %rdx
je 0xb10e
movq -0x78(%rbp), %rsi
movq %r14, %rdi
callq 0x2260
testl %eax, %eax
sete %r12b
jmp 0xb111
movq -0xb8(%rbp), %r14
xorl %r12d, %r12d
jmp 0xb111
movb $0x1, %r12b
leaq -0xa8(%rbp), %r15
cmpq %r15, %r14
je 0xb125
movq %r14, %rdi
callq 0x2220
testb %r12b, %r12b
je 0xb165
leaq -0x50(%rbp), %rsi
movq 0x8(%rsi), %rcx
addq $-0x2, %rcx
leaq -0xb8(%rbp), %rdi
xorl %edx, %edx
callq 0x2270
leaq -0xb8(%rbp), %rsi
movq -0x58(%rbp), %rdi
callq 0x13a8a
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0xb165
callq 0x2220
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb173
callq 0x2220
movq -0x78(%rbp), %rdi
cmpq %r13, %rdi
je 0xb181
callq 0x2220
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xb199
callq 0x2220
movq -0x58(%rbp), %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2632
movq %rax, -0x30(%rbp)
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0xb1ed
callq 0x2220
jmp 0xb1ed
jmp 0xb1e9
jmp 0xb1e9
jmp 0xb1e3
movq %rax, -0x30(%rbp)
movq -0x100(%rbp), %rdi
cmpq %r12, %rdi
jne 0xb1f6
jmp 0xb1fb
movq %rax, -0x30(%rbp)
jmp 0xb1fb
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb1fb
callq 0x2220
movq -0x78(%rbp), %rdi
cmpq %r13, %rdi
jne 0xb29d
jmp 0xb2a2
movq %rax, -0x30(%rbp)
movq -0x120(%rbp), %rdi
cmpq %r15, %rdi
jne 0xb2b5
jmp 0xb2ba
movq %rax, -0x30(%rbp)
jmp 0xb2ba
movq %rax, -0x30(%rbp)
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xb253
callq 0x2220
jmp 0xb253
jmp 0xb24f
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0xb280
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
jne 0xb285
jmp 0xb290
jmp 0xb28c
movq %rax, -0x30(%rbp)
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xb290
callq 0x2220
jmp 0xb290
movq %rax, -0x30(%rbp)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xb2a2
callq 0x2220
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xb2ba
callq 0x2220
movq -0x58(%rbp), %rdi
callq 0xb2cc
movq -0x30(%rbp), %rdi
callq 0x2400