// File: /workspace/github_cpp_makefile_star2_O2/FFY00[P]uicc/include/uicc.h
// Function: SIM::readFileInfo()
bool readFileInfo() {
        string order(u8"\xa0\xc0\x00\x00\x0f",5);
        string good(u8"\x90\x00",2);
        write(order);
        string values=read();
        memcpy(&curFile,values.c_str(),
               min(values.size(),sizeof(curFile)) );

        if (debug) {
            static map<char, string> FileType= {{'\x01',"Master dir"}, {'\x02',"Sub dir"},{'\x04',"Element File"},};
            string fName=UICCFile(string((char *)&curFile.id,2),true);
            printf("File: %s, type: %s ",
                   fName.c_str(),
                   FileType[curFile.type].c_str());

            if ( curFile.type == 4 ) {
                static map<char, string> FileAccess= {{'\x00',"Always"},{'\x01',"Pin1"},{'\x02',"Pin2"},{'\x03',"RFU"},{'\x04',"ADM"},{'\x0e',"ADM"},{'\x0F',"Never"}, {'\x0a',"GR"}};
                static map<char, string> FileType= {{'\x00',"Transparent"},{'\x01',"Linear Fixed"},{'\x03',"Cyclic"}};
                printf("Type: %s, Access: read=%x (%s), update=%x (%s), size %hu\n",
                       FileType[curFile.structure].c_str(),
                       curFile.access[0]>>4,
                       FileAccess[curFile.access[0]>>4].c_str(),
                       curFile.access[0]&0xf,
                       FileAccess[curFile.access[0]&0xf].c_str(),
                       ntohs(curFile.size)
                      );
            } else
                printf("\n");
        }

        return values.substr(values.size()-2) == good;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
leaq -0xc8(%rbp), %rax
movq %rax, -0x10(%rax)
movl $0xc0a0, (%rax)         # imm = 0xC0A0
movw $0xf, 0x4(%rax)
movq $0x5, -0x8(%rax)
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
movw $0x90, (%rax)
movq $0x2, -0x8(%rax)
movb $0x0, 0x2(%rax)
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2330
leaq -0xb8(%rbp), %rsi
movq %rbx, %rdi
callq 0xb178
leaq -0xb8(%rbp), %rdi
callq 0x2120
leaq -0x58(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0xac6e
leaq 0x8(%rbx), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %r14
cmpq $0xf, %r14
pushq $0xf
popq %rdx
cmovbq %r14, %rdx
callq 0x21e0
cmpb $0x1, (%rbx)
jne 0xc613
movb 0xd014(%rip), %al       # 0x194f0
testb %al, %al
je 0xc683
leaq 0xc(%rbx), %rsi
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xe(%rbx), %r14
leaq -0x78(%rbp), %rdi
movq %r14, %rdx
callq 0xf120
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rdx
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq 0xb740
leaq -0x78(%rbp), %rdi
callq 0x2120
movq -0x98(%rbp), %r15
movb (%r14), %al
leaq -0x238(%rbp), %rsi
movb %al, (%rsi)
leaq 0xcf87(%rip), %rdi      # 0x194c0
callq 0xcfa4
movq (%rax), %rdx
leaq 0x7378(%rip), %rdi      # 0x138c0
movq %r15, %rsi
xorl %eax, %eax
callq 0x2050
cmpb $0x4, (%r14)
jne 0xc5fb
movb 0xcfc6(%rip), %al       # 0x19528
testb %al, %al
je 0xc758
movb 0xcff0(%rip), %al       # 0x19560
testb %al, %al
je 0xc8bd
movb 0x15(%rbx), %al
leaq -0x238(%rbp), %rsi
movb %al, (%rsi)
leaq 0xcfa5(%rip), %rdi      # 0x19530
callq 0xcfa4
movq (%rax), %r14
movzbl 0x10(%rbx), %r15d
shrl $0x4, %r15d
leaq -0x2a(%rbp), %rsi
movb %r15b, (%rsi)
leaq 0xcf4e(%rip), %rdi      # 0x194f8
callq 0xcfa4
movq (%rax), %r12
movzbl 0x10(%rbx), %r13d
andl $0xf, %r13d
leaq -0x29(%rbp), %rsi
movb %r13b, (%rsi)
leaq 0xcf2f(%rip), %rdi      # 0x194f8
callq 0xcfa4
movq (%rax), %r9
movzwl 0xa(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, (%rsp)
leaq 0x7330(%rip), %rdi      # 0x13916
movq %r14, %rsi
movl %r15d, %edx
movq %r12, %rcx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x2050
jmp 0xc603
pushq $0xa
popq %rdi
callq 0x2340
leaq -0x98(%rbp), %rdi
callq 0x2120
movq -0x50(%rbp), %r14
addq $-0x2, %r14
leaq -0x238(%rbp), %rdi
leaq -0x58(%rbp), %rsi
pushq $-0x1
popq %rcx
movq %r14, %rdx
callq 0x2260
leaq -0x238(%rbp), %rbx
leaq -0xf8(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb402
movl %eax, %r15d
movq %rbx, %rdi
callq 0x2120
leaq -0x58(%rbp), %rdi
callq 0x2120
movq %r14, %rdi
callq 0x2120
leaq -0xd8(%rbp), %rdi
callq 0x2120
movl %r15d, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xce66(%rip), %rdi      # 0x194f0
callq 0x2430
testl %eax, %eax
je 0xc4e4
leaq -0x98(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x71f8(%rip), %rdx      # 0x138a0
leaq -0x238(%rbp), %r14
movq %r14, %rdi
callq 0xcee0
leaq -0x210(%rbp), %r15
leaq -0x2a(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x71df(%rip), %rdx      # 0x138ab
movq %r15, %rdi
callq 0xcf06
leaq -0x1e8(%rbp), %r15
leaq -0x29(%rbp), %rsi
movb $0x4, (%rsi)
leaq 0x71ca(%rip), %rdx      # 0x138b3
movq %r15, %rdi
callq 0xcf2c
leaq 0xcdc8(%rip), %rdi      # 0x194c0
leaq -0x238(%rbp), %rsi
pushq $0x3
popq %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x2b(%rbp), %r8
callq 0xcf52
pushq $0x58
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0x238, %rdi           # imm = 0xFDC8
callq 0x2120
addq $-0x28, %r14
cmpq $-0x20, %r14
jne 0xc713
leaq 0x866(%rip), %rdi       # 0xcf9a
leaq 0xcd85(%rip), %rsi      # 0x194c0
leaq 0xcb16(%rip), %rdx      # 0x19258
callq 0x2200
leaq 0xcda2(%rip), %rdi      # 0x194f0
callq 0x2180
jmp 0xc4e4
leaq 0xcdc9(%rip), %rdi      # 0x19528
callq 0x2430
testl %eax, %eax
je 0xc56a
leaq -0x2a(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x715a(%rip), %rdx      # 0x138d4
leaq -0x238(%rbp), %r14
movq %r14, %rdi
callq 0xcff6
leaq -0x210(%rbp), %r15
leaq -0x29(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x713d(%rip), %rdx      # 0x138db
movq %r15, %rdi
callq 0xd01c
leaq -0x1e8(%rbp), %r15
leaq -0x2c(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x7125(%rip), %rdx      # 0x138e0
movq %r15, %rdi
callq 0xd01c
leaq -0x1c0(%rbp), %r15
leaq -0x2b(%rbp), %rsi
movb $0x3, (%rsi)
leaq 0x710d(%rip), %rdx      # 0x138e5
movq %r15, %rdi
callq 0xd042
leaq -0x198(%rbp), %r15
leaq -0x2d(%rbp), %rsi
movb $0x4, (%rsi)
leaq 0x70f4(%rip), %rdx      # 0x138e9
movq %r15, %rdi
callq 0xd042
leaq -0x170(%rbp), %r15
leaq -0x32(%rbp), %rsi
movb $0xe, (%rsi)
leaq 0x70d7(%rip), %rdx      # 0x138e9
movq %r15, %rdi
callq 0xd042
leaq -0x148(%rbp), %r15
leaq -0x31(%rbp), %rsi
movb $0xf, (%rsi)
leaq 0x70be(%rip), %rdx      # 0x138ed
movq %r15, %rdi
callq 0xd068
leaq -0x120(%rbp), %r15
leaq -0x30(%rbp), %rsi
movb $0xa, (%rsi)
leaq 0x70a7(%rip), %rdx      # 0x138f3
movq %r15, %rdi
callq 0xd08e
leaq 0xcc9d(%rip), %rdi      # 0x194f8
leaq -0x238(%rbp), %rsi
pushq $0x8
popq %rdx
leaq -0x2f(%rbp), %rcx
leaq -0x2e(%rbp), %r8
callq 0xcf52
movl $0x120, %r14d           # imm = 0x120
leaq (%r14,%rbp), %rdi
addq $-0x238, %rdi           # imm = 0xFDC8
callq 0x2120
addq $-0x28, %r14
cmpq $-0x20, %r14
jne 0xc878
leaq 0x701(%rip), %rdi       # 0xcf9a
leaq 0xcc58(%rip), %rsi      # 0x194f8
leaq 0xc9b1(%rip), %rdx      # 0x19258
callq 0x2200
leaq 0xcc75(%rip), %rdi      # 0x19528
callq 0x2180
jmp 0xc56a
leaq 0xcc9c(%rip), %rdi      # 0x19560
callq 0x2430
testl %eax, %eax
je 0xc578
leaq -0x2a(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x7017(%rip), %rdx      # 0x138f6
leaq -0x238(%rbp), %r14
movq %r14, %rdi
callq 0xd0b4
leaq -0x210(%rbp), %r15
leaq -0x29(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x6fff(%rip), %rdx      # 0x13902
movq %r15, %rdi
callq 0xcf2c
leaq -0x1e8(%rbp), %r15
leaq -0x2c(%rbp), %rsi
movb $0x3, (%rsi)
leaq 0x6fef(%rip), %rdx      # 0x1390f
movq %r15, %rdi
callq 0xcff6
pushq $0x58
popq %r14
leaq 0xcbfd(%rip), %rdi      # 0x19530
leaq -0x238(%rbp), %rsi
pushq $0x3
popq %rdx
leaq -0x2b(%rbp), %rcx
leaq -0x2d(%rbp), %r8
callq 0xcf52
leaq (%r14,%rbp), %rdi
addq $-0x238, %rdi           # imm = 0xFDC8
callq 0x2120
addq $-0x28, %r14
cmpq $-0x20, %r14
jne 0xc94a
leaq 0x62f(%rip), %rdi       # 0xcf9a
leaq 0xcbbe(%rip), %rsi      # 0x19530
leaq 0xc8df(%rip), %rdx      # 0x19258
callq 0x2200
leaq 0xcbdb(%rip), %rdi      # 0x19560
callq 0x2180
jmp 0xc578
movq %rax, %rbx
leaq (%r14,%rbp), %rdi
addq $-0x238, %rdi           # imm = 0xFDC8
callq 0x2120
addq $-0x28, %r14
cmpq $-0x20, %r14
jne 0xc992
jmp 0xc9d0
jmp 0xc9b0
movq %rax, %rbx
leaq -0x28(%r15), %r12
addq $-0x20, %r15
movq %r15, %rdi
callq 0x2120
movq %r12, %r15
cmpq %r14, %r12
jne 0xc9b3
jmp 0xc9d0
movq %rax, %rbx
leaq 0xcb89(%rip), %rdi      # 0x19560
jmp 0xca43
movq %rax, %rbx
movl $0x120, %r12d           # imm = 0x120
leaq (%r12,%rbp), %rdi
addq $-0x238, %rdi           # imm = 0xFDC8
callq 0x2120
addq $-0x28, %r12
cmpq $-0x20, %r12
jne 0xc9e2
movb $0x1, %al
jmp 0xca11
jmp 0xca0c
jmp 0xca0c
jmp 0xca0c
jmp 0xca0c
jmp 0xca0c
jmp 0xca0c
movq %rax, %rbx
xorl %eax, %eax
cmpq %r15, %r14
sete %cl
testb %al, %al
jne 0xca3c
testb %cl, %cl
jne 0xca3c
leaq -0x28(%r15), %r12
addq $-0x20, %r15
movq %r15, %rdi
callq 0x2120
movq %r12, %r15
cmpq %r14, %r12
jne 0xca1f
jmp 0xca3c
movq %rax, %rbx
leaq 0xcae5(%rip), %rdi      # 0x19528
callq 0x2170
jmp 0xcaa6
movq %rax, %rbx
pushq $0x58
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0x238, %rdi           # imm = 0xFDC8
callq 0x2120
addq $-0x28, %r14
cmpq $-0x20, %r14
jne 0xca51
jmp 0xca8f
jmp 0xca6f
movq %rax, %rbx
leaq -0x28(%r15), %r12
addq $-0x20, %r15
movq %r15, %rdi
callq 0x2120
movq %r12, %r15
cmpq %r14, %r12
jne 0xca72
jmp 0xca8f
movq %rax, %rbx
leaq 0xca5a(%rip), %rdi      # 0x194f0
callq 0x2170
jmp 0xcac2
jmp 0xcaa3
jmp 0xcaa3
jmp 0xcaa3
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0xcab6
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x2120
jmp 0xcac2
jmp 0xcabf
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0xcad4
jmp 0xcadb
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x2120
jmp 0xcade
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x2120
leaq -0xd8(%rbp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2400