// File: /workspace/github_cpp_makefile_star2_O3/FFY00[P]uicc/include/uicc.h
// Function: USIM::writeFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, bool, bool)
bool writeFile(string filename, vector<string> content, bool fillIt=false, bool records=false) {
        if (!openFile(filename))
            return false;

        int size=content[0].size();

        if (fileDesc.size() <= 2) { // binary (flat)
            Assert(size <= 256, "Not developped: write binary files > 256 bytes");
            string command(u8"\x00\xd6\x00\x00",4);
            string good(u8"\x90\x00",2);
            unsigned char x=(char) size;

            if (fillIt)
                command+=(unsigned char)fileSize;
            else
                command+=x;

            command+=content[0];

            if (fillIt)
                for (int j=content[0].size();
                        j< (unsigned char) fileSize ;
                        j++)
                    command+=u8"\xff";

            write(command);
            string answ=read(good.size());

            if (answ == good)
                return true;
            else
                return false;
        } else { // records
            for (size_t i=0; i < content.size(); i++ ) {
                string command(u8"\x00\xdc",2);
                string good(u8"\x90\x00",2);
                command+=(unsigned char) i+1;
                command+='\x04';
                command+=fileDesc.substr(3,1); //record lenght;
                command+=content[i];

                for (int j=content[i].size();
                        j< (unsigned char) fileDesc[3] ;
                        j++)
                    command+=u8"\xff";

                write(command);
                string answ=read(good.size());

                if ( answ != good )
                    return false;
            }
        }

        return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %ecx, %ebx
movq %rdx, %r13
movq %rdi, %r12
leaq -0xf0(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq -0x100(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x1394e
movq %r12, -0x30(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x1168e
movl %eax, %r14d
movq -0x100(%rbp), %rdi
cmpq %r15, %rdi
je 0xcbc2
callq 0x2220
testb %r14b, %r14b
je 0xcd20
movq (%r13), %rax
movq -0x30(%rbp), %rcx
cmpq $0x3, 0x30(%rcx)
jae 0xcd27
movq 0x8(%rax), %rax
cmpl $0x101, %eax            # imm = 0x101
jge 0xcf88
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
movl $0xd600, (%r15)         # imm = 0xD600
movq $0x4, -0x8(%r15)
xorl %ecx, %ecx
movb %cl, 0x4(%r15)
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
movw $0x90, (%r12)
movq $0x2, -0x8(%r12)
movb %cl, 0x2(%r12)
testb %bl, %bl
je 0xcc33
movq -0x30(%rbp), %rax
movl 0x48(%rax), %eax
movsbl %al, %esi
leaq -0x58(%rbp), %rdi
callq 0x2200
movq (%r13), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq -0x58(%rbp), %rdi
callq 0x20d0
testb %bl, %bl
je 0xcc92
movq (%r13), %rax
movl 0x8(%rax), %r13d
movq -0x30(%rbp), %rax
movzbl 0x48(%rax), %eax
cmpl %r13d, %eax
jle 0xcc92
leaq 0xc0a1(%rip), %rbx      # 0x18d14
leaq -0x58(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2450
incl %r13d
movq -0x30(%rbp), %rax
movzbl 0x48(%rax), %eax
cmpl %eax, %r13d
jl 0xcc77
leaq -0xd0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x1394e
leaq -0xe0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0xe93c
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
je 0xccd5
callq 0x2220
movq -0x70(%rbp), %rdx
leaq -0x98(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xe17e
movq -0x90(%rbp), %rdx
cmpq -0x70(%rbp), %rdx
jne 0xcf33
movq -0x98(%rbp), %r14
testq %rdx, %rdx
je 0xcf42
movq -0x78(%rbp), %rsi
movq %r14, %rdi
callq 0x2260
testl %eax, %eax
sete %bl
jmp 0xcf44
xorl %eax, %eax
jmp 0xcf76
cmpq %rax, 0x8(%r13)
je 0xcf3e
movq %r13, -0xa0(%rbp)
movq -0x30(%rbp), %rax
leaq 0x28(%rax), %r15
leaq -0x48(%rbp), %r14
leaq -0x58(%rbp), %r12
leaq 0xbfc5(%rip), %r13      # 0x18d14
xorl %ebx, %ebx
movq %r14, -0x58(%rbp)
movw $0xdc00, -0x48(%rbp)    # imm = 0xDC00
movl $0x2, %edx
movq %rdx, -0x50(%rbp)
xorl %ecx, %ecx
movb %cl, -0x46(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movw $0x90, -0x68(%rbp)
movq %rdx, -0x70(%rbp)
movb %cl, -0x66(%rbp)
leal 0x1(%rbx), %eax
movsbl %al, %esi
movq %r12, %rdi
callq 0x2200
movq %r12, %rdi
movl $0x4, %esi
callq 0x2200
movl $0x3, %edx
movl $0x1, %ecx
leaq -0x98(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %r12, %rdi
callq 0x20d0
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xcde0
callq 0x2220
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq %rbx, %r14
shlq $0x5, %r14
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
movq %r12, %rdi
callq 0x20d0
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax,%r14), %r14d
movq (%r15), %rax
movzbl 0x3(%rax), %eax
cmpl %eax, %r14d
jge 0xce2d
movq %r12, %rdi
movq %r13, %rsi
callq 0x2450
incl %r14d
jmp 0xce11
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x1394e
movq -0x30(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xe93c
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xce7a
callq 0x2220
movq -0x70(%rbp), %rdx
leaq -0x98(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xe17e
movq -0x90(%rbp), %rdx
cmpq -0x70(%rbp), %rdx
jne 0xcebd
movq -0x98(%rbp), %r14
testq %rdx, %rdx
je 0xcecb
movq -0x78(%rbp), %rsi
movq %r14, %rdi
callq 0x2260
testl %eax, %eax
setne %al
movl %eax, -0x34(%rbp)
jmp 0xced2
movb $0x1, %al
movl %eax, -0x34(%rbp)
movq -0x98(%rbp), %r14
jmp 0xced2
movl $0x0, -0x34(%rbp)
leaq -0x88(%rbp), %rax
cmpq %rax, %r14
je 0xcee6
movq %r14, %rdi
callq 0x2220
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xcef8
callq 0x2220
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %r14
cmpq %r14, %rdi
je 0xcf0a
callq 0x2220
movl -0x34(%rbp), %eax
testb %al, %al
jne 0xcf2f
incq %rbx
movq -0xa0(%rbp), %rcx
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
sarq $0x5, %rdx
cmpq %rdx, %rbx
jb 0xcd51
xorb $0x1, %al
jmp 0xcf76
movq -0x98(%rbp), %r14
xorl %ebx, %ebx
jmp 0xcf44
movb $0x1, %al
jmp 0xcf76
movb $0x1, %bl
leaq -0x88(%rbp), %rax
cmpq %rax, %r14
je 0xcf58
movq %r14, %rdi
callq 0x2220
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0xcf66
callq 0x2220
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0xcf74
callq 0x2220
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x37ea
jmp 0xcfb3
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
je 0xcfb6
callq 0x2220
jmp 0xcfb6
jmp 0xcfb3
movq %rax, %rbx
movq -0x100(%rbp), %rdi
jmp 0xcfc8
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0xcfc4
callq 0x2220
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
jne 0xd027
jmp 0xd02c
jmp 0xd005
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
jmp 0xcff5
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xd008
callq 0x2220
jmp 0xd008
jmp 0xd005
jmp 0xd005
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xd01a
callq 0x2220
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xd02c
callq 0x2220
movq %rbx, %rdi
callq 0x2400