// File: 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
subq $0x340, %rsp            # imm = 0x340
movq %rdx, -0x268(%rbp)
movq %rdi, -0x280(%rbp)
movq %rdi, %rax
movq %rax, -0x278(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x270(%rbp)
movb $0x0, -0x19(%rbp)
callq 0xec50
movq -0x268(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x3120
jmp 0xed95
movq -0x270(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x14410
movb %al, -0x281(%rbp)
jmp 0xedad
movb -0x281(%rbp), %al
xorb $-0x1, %al
movb %al, -0x282(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x31a0
movb -0x282(%rbp), %al
testb $0x1, %al
jne 0xedd0
jmp 0xee0b
movb $0x1, -0x19(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0xf64e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf670
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x31a0
jmp 0xf670
movq -0x270(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x34f0
movw %ax, %cx
movq -0x270(%rbp), %rax
movw %cx, -0x52(%rbp)
movzbl 0x15(%rax), %eax
movzwl %ax, %edi
callq 0x34f0
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0xf23a
jmp 0xee43
movzwl -0x52(%rbp), %eax
cmpl $0x100, %eax            # imm = 0x100
jle 0xeecc
movq 0x2017b(%rip), %rax     # 0x2efd0
movq (%rax), %rax
movq %rax, -0x290(%rbp)
callq 0x3040
movl (%rax), %edi
callq 0x30d0
movq -0x290(%rbp), %rdi
movq %rax, %r9
movzwl -0x52(%rbp), %ecx
movq %rsp, %rax
movl %ecx, (%rax)
leaq 0x16b8f(%rip), %rsi     # 0x25a14
leaq 0x16c21(%rip), %rdx     # 0x25aad
leaq 0x169d3(%rip), %rcx     # 0x25866
xorl %eax, %eax
movl $0x254, %r8d            # imm = 0x254
callq 0x3410
movq 0x200f9(%rip), %rax     # 0x2efa0
movq (%rax), %rdi
callq 0x3350
jmp 0xeeb1
movq 0x20118(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
callq 0x3350
jmp 0xeec2
movl $0x1, %edi
callq 0x3370
jmp 0xeece
jmp 0xeed0
leaq -0x79(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x34d0
movq -0x298(%rbp), %rcx
leaq 0x14372(%rip), %rsi     # 0x23260
leaq -0x78(%rbp), %rdi
movl $0x4, %edx
callq 0x3330
jmp 0xeefe
leaq -0x79(%rbp), %rdi
callq 0x3300
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x34d0
movq -0x2a0(%rbp), %rcx
leaq 0x1433d(%rip), %rsi     # 0x23265
leaq -0xa0(%rbp), %rdi
movl $0x2, %edx
callq 0x3330
jmp 0xef3b
leaq -0xa1(%rbp), %rdi
callq 0x3300
movb -0x52(%rbp), %al
movb %al, -0xa2(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x34d0
movq -0x2a8(%rbp), %rcx
leaq -0xc8(%rbp), %rdi
leaq -0xa2(%rbp), %rsi
movl $0x1, %edx
callq 0x3330
jmp 0xef84
leaq -0x78(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x33b0
jmp 0xef96
leaq -0xc8(%rbp), %rdi
callq 0x31a0
leaq -0xc9(%rbp), %rdi
callq 0x3300
leaq -0xf0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3120
jmp 0xefc0
movq -0x270(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x14a30
jmp 0xefd5
leaq -0xf0(%rbp), %rdi
callq 0x31a0
movzwl -0x52(%rbp), %eax
movq %rax, -0x2b0(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x31f0
movq -0x2b0(%rbp), %rdx
movq -0x270(%rbp), %rsi
addq %rax, %rdx
leaq -0x110(%rbp), %rdi
callq 0x13fd0
jmp 0xf017
leaq -0x110(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movzwl -0x52(%rbp), %eax
movl %eax, %edx
addq $0x2, %rdx
movb $0x0, -0x131(%rbp)
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x2b1(%rbp)
jne 0xf09a
leaq -0x110(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x31f0
movq -0x2c0(%rbp), %rsi
movq %rax, %rdx
addq $-0x2, %rdx
leaq -0x130(%rbp), %rdi
movq $-0x1, %rcx
callq 0x32c0
jmp 0xf07a
movb $0x1, -0x131(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x14ed0
movb %al, -0x2b1(%rbp)
movb -0x2b1(%rbp), %al
movb %al, -0x2c1(%rbp)
testb $0x1, -0x131(%rbp)
jne 0xf0b1
jmp 0xf0bd
leaq -0x130(%rbp), %rdi
callq 0x31a0
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0xf0cc
jmp 0xf1e3
leaq -0x110(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x31f0
movq -0x2d0(%rbp), %rsi
movq %rax, %rcx
addq $-0x2, %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x158(%rbp), %rdi
callq 0x32c0
jmp 0xf0ff
movq -0x280(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x11160
jmp 0xf114
leaq -0x158(%rbp), %rdi
callq 0x31a0
jmp 0xf1e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x3300
jmp 0xf670
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa1(%rbp), %rdi
callq 0x3300
jmp 0xf22c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf182
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x31a0
leaq -0xc9(%rbp), %rdi
callq 0x3300
jmp 0xf220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x31a0
jmp 0xf220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf214
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x31a0
jmp 0xf214
movb $0x1, -0x19(%rbp)
movl $0x1, -0x50(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x31a0
leaq -0xa0(%rbp), %rdi
callq 0x31a0
leaq -0x78(%rbp), %rdi
callq 0x31a0
jmp 0xf64e
leaq -0x110(%rbp), %rdi
callq 0x31a0
leaq -0xa0(%rbp), %rdi
callq 0x31a0
leaq -0x78(%rbp), %rdi
callq 0x31a0
jmp 0xf670
movl $0x0, -0x15c(%rbp)
movq -0x270(%rbp), %rcx
movl -0x15c(%rbp), %eax
movl %eax, -0x2d4(%rbp)
movzwl -0x52(%rbp), %eax
movzbl 0x16(%rcx), %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x2d4(%rbp), %eax
cmpl %ecx, %eax
jge 0xf643
leaq -0x181(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x34d0
movq -0x2e0(%rbp), %rcx
leaq 0x13fd5(%rip), %rsi     # 0x23268
leaq -0x180(%rbp), %rdi
movl $0x4, %edx
callq 0x3330
jmp 0xf2a6
leaq -0x181(%rbp), %rdi
callq 0x3300
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x34d0
movq -0x2e8(%rbp), %rcx
leaq 0x13f92(%rip), %rsi     # 0x23265
leaq -0x1a8(%rbp), %rdi
movl $0x2, %edx
callq 0x3330
jmp 0xf2e6
leaq -0x1a9(%rbp), %rdi
callq 0x3300
movq -0x270(%rbp), %rax
addq $0x16, %rax
movq %rax, -0x2f8(%rbp)
leaq -0x1d1(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x34d0
movq -0x2f8(%rbp), %rsi
movq -0x2f0(%rbp), %rcx
leaq -0x1d0(%rbp), %rdi
movl $0x1, %edx
callq 0x3330
jmp 0xf338
leaq -0x180(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x33b0
jmp 0xf34d
leaq -0x1d0(%rbp), %rdi
callq 0x31a0
leaq -0x1d1(%rbp), %rdi
callq 0x3300
leaq -0x1f8(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x3120
jmp 0xf37a
movq -0x270(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x14a30
jmp 0xf38f
leaq -0x1f8(%rbp), %rdi
callq 0x31a0
movzwl -0x52(%rbp), %eax
movq %rax, -0x300(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x31f0
movq -0x300(%rbp), %rdx
movq -0x270(%rbp), %rsi
addq %rax, %rdx
leaq -0x218(%rbp), %rdi
callq 0x13fd0
jmp 0xf3d1
leaq -0x218(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movq -0x270(%rbp), %rax
movq %rcx, -0x310(%rbp)
movzbl 0x16(%rax), %eax
movq %rax, -0x318(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x31f0
movq -0x318(%rbp), %rdx
movq -0x310(%rbp), %rcx
addq %rax, %rdx
movb $0x0, -0x239(%rbp)
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x301(%rbp)
jne 0xf480
leaq -0x218(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x31f0
movq -0x320(%rbp), %rsi
movq %rax, %rdx
addq $-0x2, %rdx
leaq -0x238(%rbp), %rdi
movq $-0x1, %rcx
callq 0x32c0
jmp 0xf460
movb $0x1, -0x239(%rbp)
leaq -0x238(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x14ed0
movb %al, -0x301(%rbp)
movb -0x301(%rbp), %al
movb %al, -0x321(%rbp)
testb $0x1, -0x239(%rbp)
jne 0xf497
jmp 0xf4a3
leaq -0x238(%rbp), %rdi
callq 0x31a0
movb -0x321(%rbp), %al
testb $0x1, %al
jne 0xf4b2
jmp 0xf5e5
leaq -0x218(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x31f0
movq %rax, -0x338(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x31f0
movq -0x338(%rbp), %rcx
movq -0x330(%rbp), %rsi
subq %rax, %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x260(%rbp), %rdi
callq 0x32c0
jmp 0xf4fb
movq -0x280(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x11160
jmp 0xf510
leaq -0x260(%rbp), %rdi
callq 0x31a0
jmp 0xf5e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x181(%rbp), %rdi
callq 0x3300
jmp 0xf670
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1a9(%rbp), %rdi
callq 0x3300
jmp 0xf635
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf581
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x31a0
leaq -0x1d1(%rbp), %rdi
callq 0x3300
jmp 0xf629
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf629
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x31a0
jmp 0xf629
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf61d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x31a0
jmp 0xf61d
leaq -0x218(%rbp), %rdi
callq 0x31a0
leaq -0x1a8(%rbp), %rdi
callq 0x31a0
leaq -0x180(%rbp), %rdi
callq 0x31a0
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0xf244
leaq -0x218(%rbp), %rdi
callq 0x31a0
leaq -0x1a8(%rbp), %rdi
callq 0x31a0
leaq -0x180(%rbp), %rdi
callq 0x31a0
jmp 0xf670
movb $0x1, -0x19(%rbp)
movl $0x1, -0x50(%rbp)
testb $0x1, -0x19(%rbp)
jne 0xf660
movq -0x280(%rbp), %rdi
callq 0xf6b0
movq -0x278(%rbp), %rax
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
movq -0x280(%rbp), %rdi
callq 0xf6b0
movq -0x48(%rbp), %rdi
callq 0x34b0
nopw %cs:(%rax,%rax)
nop