// File: /workspace/github_cpp_makefile_star2_O1/FFY00[P]uicc/include/uicc.h
// Function: UICC::read[abi:cxx11](unsigned long)
string read(size_t s = 1024) {
        size_t got=0;
        string data="";

        while (got < s) {
            int ret;
            char buf;
            Assert( (ret=::read(fd, &buf, 1)) >= 0, "Error from read");

            switch (ret) {
            case 1:
                got++;
                data+=buf;
                break;

            case 0: // for time out: no more data
                if (debug)
                    dump_hex("Received", data);

                return data;
                break;

            default:
                fprintf(stderr,"Error from read > 1 char\n");
            }
        }

        if (debug)
            dump_hex("Received", data);

        return data;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, -0x40(%rbp)
movq %rax, (%rdi)
leaq 0xa507(%rip), %rdx      # 0x183b2
movq %rdx, %rsi
callq 0x137c4
movq $0x0, -0x48(%rbp)
leaq 0xa0b8(%rip), %r13      # 0x17f7a
xorl %r12d, %r12d
movq %rbx, -0x38(%rbp)
cmpq %r15, %r12
jae 0xdfe8
movl 0x4(%r14), %edi
movl $0x1, %edx
leaq -0x29(%rbp), %rsi
callq 0x2370
testl %eax, %eax
js 0xe0de
je 0xdf0d
cmpl $0x1, %eax
jne 0xdfde
movsbl -0x29(%rbp), %esi
movq %rbx, %rdi
callq 0x2200
incq %r12
movb $0x1, %al
jmp 0xdfd1
movb $0x1, %al
movq %rax, -0x48(%rbp)
cmpb $0x1, (%r14)
jne 0xdfcf
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x88(%rbp), %rdi
leaq 0xa701(%rip), %rsi      # 0x18637
leaq 0xa702(%rip), %rdx      # 0x1863f
callq 0x137c4
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x1372a
movq -0x88(%rbp), %rsi
leaq 0xae6d(%rip), %rdi      # 0x18dd8
xorl %eax, %eax
callq 0x2060
cmpq $0x0, -0x60(%rbp)
je 0xdf96
xorl %ebx, %ebx
movq -0x68(%rbp), %rax
movsbl (%rax,%rbx), %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x2060
incq %rbx
cmpq -0x60(%rbp), %rbx
jb 0xdf7b
movl $0xa, %edi
callq 0x2340
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xdfb2
callq 0x2220
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xdfc7
callq 0x2220
xorl %eax, %eax
movq -0x38(%rbp), %rbx
jmp 0xdfd1
xorl %eax, %eax
testb %al, %al
jne 0xdec9
jmp 0xe0af
callq 0x3b14
jmp 0xdf06
cmpb $0x1, (%r14)
jne 0xe0c9
leaq -0xb8(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xa633(%rip), %rsi      # 0x18637
leaq 0xa634(%rip), %rdx      # 0x1863f
leaq -0xc8(%rbp), %rdi
callq 0x137c4
leaq -0x98(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x1372a
movq -0xc8(%rbp), %rsi
leaq 0xad91(%rip), %rdi      # 0x18dd8
xorl %eax, %eax
callq 0x2060
cmpq $0x0, -0xa0(%rbp)
je 0xe082
leaq 0x9f1b(%rip), %r14      # 0x17f7a
xorl %ebx, %ebx
movq -0xa8(%rbp), %rax
movsbl (%rax,%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2060
incq %rbx
cmpq -0xa0(%rbp), %rbx
jb 0xe061
movl $0xa, %edi
callq 0x2340
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0xe09d
callq 0x2220
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
movq -0x38(%rbp), %rbx
jne 0xe0c4
jmp 0xe0c9
movq (%rbx), %rdi
cmpq -0x40(%rbp), %rdi
sete %al
movq -0x48(%rbp), %rcx
orb %al, %cl
testb $0x1, %cl
jne 0xe0c9
callq 0x2220
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3ab0
movq %rax, %r14
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
jne 0xe109
jmp 0xe115
jmp 0xe112
movq %rax, %r14
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xe115
callq 0x2220
jmp 0xe115
jmp 0xe112
movq %rax, %r14
movq -0x38(%rbp), %rax
movq (%rax), %rdi
cmpq -0x40(%rbp), %rdi
je 0xe127
callq 0x2220
movq %r14, %rdi
callq 0x2400
nop