// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
leaq -0x88(%rbp), %r12
movq %r12, -0x10(%r12)
movl $0xc0a0, (%r12)         # imm = 0xC0A0
movw $0xf, 0x4(%r12)
movq $0x5, -0x8(%r12)
leaq -0x83(%rbp), %rdx
leaq -0x48(%rbp), %r13
movq %r13, -0x10(%r13)
movw $0x90, (%r13)
movq $0x2, -0x8(%r13)
movb $0x0, 0x2(%r13)
leaq -0xc8(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq -0xd8(%rbp), %rdi
movq %r12, %rsi
callq 0x1394e
leaq -0xd8(%rbp), %rsi
movq %r14, %rdi
callq 0xe93c
movq -0xd8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x1000f
callq 0x2220
leaq -0x78(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
callq 0xe17e
leaq 0x8(%r14), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rbx
cmpq $0xf, %rbx
movl $0xf, %edx
cmovbq %rbx, %rdx
callq 0x21f0
cmpb $0x1, (%r14)
jne 0x101ad
movb 0xf492(%rip), %al       # 0x1f4e0
testb %al, %al
je 0x10261
leaq -0xe8(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movzwl 0xc(%r14), %eax
movw %ax, (%rbx)
movq $0x2, -0x8(%rbx)
movb $0x0, 0x2(%rbx)
leaq -0xb8(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
movq %r14, %rsi
movl $0x1, %ecx
callq 0xf014
movq -0xf8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x100a1
callq 0x2220
movq -0xb8(%rbp), %rbx
movb 0xe(%r14), %al
leaq -0x238(%rbp), %rsi
movb %al, (%rsi)
leaq 0xf3f4(%rip), %rdi      # 0x1f4b0
callq 0x110fc
movq (%rax), %rdx
leaq 0x8815(%rip), %rdi      # 0x188e0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2060
cmpb $0x4, 0xe(%r14)
jne 0x1018a
movb 0xf432(%rip), %al       # 0x1f518
testb %al, %al
je 0x1034f
movb 0xf45c(%rip), %al       # 0x1f550
testb %al, %al
je 0x104c3
movb 0x15(%r14), %al
leaq -0x238(%rbp), %rsi
movb %al, (%rsi)
leaq 0xf410(%rip), %rdi      # 0x1f520
callq 0x110fc
movq (%rax), %r15
movzbl 0x10(%r14), %r12d
shrl $0x4, %r12d
leaq -0x2a(%rbp), %rsi
movb %r12b, (%rsi)
leaq 0xf3b9(%rip), %rdi      # 0x1f4e8
callq 0x110fc
movq (%rax), %r13
movzbl 0x10(%r14), %ebx
andl $0xf, %ebx
leaq -0x29(%rbp), %rsi
movb %bl, (%rsi)
leaq 0xf39c(%rip), %rdi      # 0x1f4e8
callq 0x110fc
movq (%rax), %r9
movzwl 0xa(%r14), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, (%rsp)
leaq 0x87cc(%rip), %rdi      # 0x18936
movq %r15, %rsi
movl %r12d, %edx
movq %r13, %rcx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x2060
leaq -0x88(%rbp), %r12
leaq -0x48(%rbp), %r13
jmp 0x10194
movl $0xa, %edi
callq 0x2340
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x101a9
callq 0x2220
movq -0x70(%rbp), %rbx
addq $-0x2, %rbx
leaq -0x238(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movq %rbx, %rdx
movq $-0x1, %rcx
callq 0x2270
movq -0x230(%rbp), %rdx
cmpq -0x50(%rbp), %rdx
jne 0x101f8
movq -0x238(%rbp), %r15
testq %rdx, %rdx
je 0x10204
movq -0x58(%rbp), %rsi
movq %r15, %rdi
callq 0x2260
testl %eax, %eax
sete %r14b
jmp 0x10207
movq -0x238(%rbp), %r15
xorl %r14d, %r14d
jmp 0x10207
movb $0x1, %r14b
leaq -0x228(%rbp), %rax
cmpq %rax, %r15
je 0x1021b
movq %r15, %rdi
callq 0x2220
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1022d
callq 0x2220
movq -0x58(%rbp), %rdi
cmpq %r13, %rdi
je 0x1023b
callq 0x2220
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x1024c
callq 0x2220
movl %r14d, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf278(%rip), %rdi      # 0x1f4e0
callq 0x2430
testl %eax, %eax
je 0x10056
leaq -0xb8(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x863a(%rip), %rdx      # 0x188c0
leaq -0x238(%rbp), %r15
movq %r15, %rdi
callq 0x10fcc
leaq -0x210(%rbp), %r12
leaq -0x2a(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x8621(%rip), %rdx      # 0x188cb
movq %r12, %rdi
callq 0x11002
leaq -0x1e8(%rbp), %r12
leaq -0x29(%rbp), %rsi
movb $0x4, (%rsi)
leaq 0x860c(%rip), %rdx      # 0x188d3
movq %r12, %rdi
callq 0x11038
leaq 0xf1da(%rip), %rdi      # 0x1f4b0
leaq -0x238(%rbp), %rsi
leaq -0x2c(%rbp), %rcx
leaq -0x2b(%rbp), %r8
movl $0x3, %edx
callq 0x1106e
leaq -0x1d0(%rbp), %rbx
xorl %r15d, %r15d
movq -0x1e0(%rbp,%r15), %rdi
leaq (%rbx,%r15), %rax
cmpq %rdi, %rax
je 0x1030f
callq 0x2220
addq $-0x28, %r15
cmpq $-0x78, %r15
jne 0x102f9
leaq 0xdd2(%rip), %rdi       # 0x110f2
leaq 0xf189(%rip), %rsi      # 0x1f4b0
leaq 0xef1a(%rip), %rdx      # 0x1f248
callq 0x2210
leaq 0xf1a6(%rip), %rdi      # 0x1f4e0
callq 0x2180
leaq -0x88(%rbp), %r12
leaq -0x48(%rbp), %r13
jmp 0x10056
leaq 0xf1c2(%rip), %rdi      # 0x1f518
callq 0x2430
testl %eax, %eax
je 0x100ee
leaq -0x2a(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x8583(%rip), %rdx      # 0x188f4
leaq -0x238(%rbp), %r15
movq %r15, %rdi
callq 0x11164
leaq -0x210(%rbp), %r12
leaq -0x29(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x8566(%rip), %rdx      # 0x188fb
movq %r12, %rdi
callq 0x1119a
leaq -0x1e8(%rbp), %r12
leaq -0x2c(%rbp), %rsi
movb $0x2, (%rsi)
leaq 0x854e(%rip), %rdx      # 0x18900
movq %r12, %rdi
callq 0x1119a
leaq -0x1c0(%rbp), %r12
leaq -0x2b(%rbp), %rsi
movb $0x3, (%rsi)
leaq 0x8536(%rip), %rdx      # 0x18905
movq %r12, %rdi
callq 0x111d0
leaq -0x198(%rbp), %r12
leaq -0x2d(%rbp), %rsi
movb $0x4, (%rsi)
leaq 0x851d(%rip), %rdx      # 0x18909
movq %r12, %rdi
callq 0x111d0
leaq -0x170(%rbp), %r12
leaq -0x32(%rbp), %rsi
movb $0xe, (%rsi)
leaq 0x8500(%rip), %rdx      # 0x18909
movq %r12, %rdi
callq 0x111d0
leaq -0x148(%rbp), %r12
leaq -0x31(%rbp), %rsi
movb $0xf, (%rsi)
leaq 0x84e7(%rip), %rdx      # 0x1890d
movq %r12, %rdi
callq 0x11206
leaq -0x120(%rbp), %r12
leaq -0x30(%rbp), %rsi
movb $0xa, (%rsi)
leaq 0x84d0(%rip), %rdx      # 0x18913
movq %r12, %rdi
callq 0x1123c
leaq 0xf096(%rip), %rdi      # 0x1f4e8
leaq -0x238(%rbp), %rsi
leaq -0x2f(%rbp), %rcx
leaq -0x2e(%rbp), %r8
movl $0x8, %edx
callq 0x1106e
leaq -0x108(%rbp), %rbx
xorl %r15d, %r15d
movq -0x118(%rbp,%r15), %rdi
leaq (%rbx,%r15), %rax
cmpq %rdi, %rax
je 0x1048b
callq 0x2220
addq $-0x28, %r15
cmpq $-0x140, %r15           # imm = 0xFEC0
jne 0x10475
leaq 0xc53(%rip), %rdi       # 0x110f2
leaq 0xf042(%rip), %rsi      # 0x1f4e8
leaq 0xed9b(%rip), %rdx      # 0x1f248
callq 0x2210
leaq 0xf05f(%rip), %rdi      # 0x1f518
callq 0x2180
jmp 0x100ee
leaq 0xf086(%rip), %rdi      # 0x1f550
callq 0x2430
testl %eax, %eax
je 0x100fc
leaq -0x2a(%rbp), %rsi
movb $0x0, (%rsi)
leaq 0x8431(%rip), %rdx      # 0x18916
leaq -0x238(%rbp), %r15
movq %r15, %rdi
callq 0x11272
leaq -0x210(%rbp), %r12
leaq -0x29(%rbp), %rsi
movb $0x1, (%rsi)
leaq 0x8419(%rip), %rdx      # 0x18922
movq %r12, %rdi
callq 0x11038
leaq -0x1e8(%rbp), %r12
leaq -0x2c(%rbp), %rsi
movb $0x3, (%rsi)
leaq 0x8409(%rip), %rdx      # 0x1892f
movq %r12, %rdi
callq 0x11164
leaq 0xefeb(%rip), %rdi      # 0x1f520
leaq -0x238(%rbp), %rsi
leaq -0x2b(%rbp), %rcx
leaq -0x2d(%rbp), %r8
movl $0x3, %edx
callq 0x1106e
leaq -0x1d0(%rbp), %rbx
xorl %r15d, %r15d
movq -0x1e0(%rbp,%r15), %rdi
leaq (%rbx,%r15), %rax
cmpq %rdi, %rax
je 0x1056e
callq 0x2220
addq $-0x28, %r15
cmpq $-0x78, %r15
jne 0x10558
leaq 0xb73(%rip), %rdi       # 0x110f2
leaq 0xef9a(%rip), %rsi      # 0x1f520
leaq 0xecbb(%rip), %rdx      # 0x1f248
callq 0x2210
leaq 0xefb7(%rip), %rdi      # 0x1f550
callq 0x2180
jmp 0x100fc
movq %rax, %r14
movq $-0x78, %rbx
leaq -0x1d0(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x105c2
callq 0x2220
addq $-0x28, %r15
addq $0x28, %rbx
jne 0x105b4
jmp 0x105fc
jmp 0x105d0
movq %rax, %r14
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x105e6
callq 0x2220
leaq -0x28(%r12), %rax
addq $-0x18, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x105d7
jmp 0x105fc
movq %rax, %r14
leaq 0xef4d(%rip), %rdi      # 0x1f550
jmp 0x10681
movq %rax, %r14
movq $-0x140, %rbx           # imm = 0xFEC0
leaq -0x108(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x10624
callq 0x2220
addq $-0x28, %r13
addq $0x28, %rbx
jne 0x10616
movb $0x1, %al
jmp 0x10643
jmp 0x1063e
jmp 0x1063e
jmp 0x1063e
jmp 0x1063e
jmp 0x1063e
jmp 0x1063e
movq %rax, %r14
xorl %eax, %eax
cmpq %r12, %r15
sete %cl
testb %al, %al
jne 0x1067a
testb %cl, %cl
jne 0x1067a
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x10664
callq 0x2220
leaq -0x28(%r12), %rax
addq $-0x18, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x10655
jmp 0x1067a
movq %rax, %r14
leaq 0xee97(%rip), %rdi      # 0x1f518
callq 0x2170
jmp 0x106f8
movq %rax, %r14
movq $-0x78, %rbx
leaq -0x1d0(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x106a7
callq 0x2220
addq $-0x28, %r15
addq $0x28, %rbx
jne 0x10699
jmp 0x106e1
jmp 0x106b5
movq %rax, %r14
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x106cb
callq 0x2220
leaq -0x28(%r12), %rax
addq $-0x18, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x106bc
jmp 0x106e1
movq %rax, %r14
leaq 0xedf8(%rip), %rdi      # 0x1f4e0
callq 0x2170
jmp 0x10723
jmp 0x106f5
jmp 0x106f5
jmp 0x106f5
movq %rax, %r14
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x10719
jmp 0x10723
movq %rax, %r14
movq -0xf8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x10723
callq 0x2220
jmp 0x10723
movq %rax, %r14
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x10743
jmp 0x1074d
jmp 0x1074a
movq %rax, %r14
movq -0xd8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x1074d
callq 0x2220
jmp 0x1074d
movq %rax, %r14
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x1075f
callq 0x2220
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x10777
callq 0x2220
movq %r14, %rdi
callq 0x2400
nop