// File: /workspace/github_cpp_makefile_star2_O3/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 $0x98, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, -0x38(%rbp)
movq %rax, (%rdi)
leaq 0xa205(%rip), %rdx      # 0x183b2
movq %rdx, %rsi
callq 0x139ec
testq %r15, %r15
je 0xe204
xorl %r13d, %r13d
leaq -0x29(%rbp), %r12
movl 0x4(%r14), %edi
movl $0x1, %edx
movq %r12, %rsi
callq 0x2370
testl %eax, %eax
js 0xe380
cmpl $0x1, %eax
jne 0xe1f5
movsbl -0x29(%rbp), %esi
movq %rbx, %rdi
callq 0x2200
incq %r13
cmpq %r15, %r13
jb 0xe1c1
jmp 0xe204
testl %eax, %eax
je 0xe2b5
callq 0x3b14
jmp 0xe1ee
cmpb $0x1, (%r14)
jne 0xe36b
leaq -0x88(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xa417(%rip), %rsi      # 0x18637
leaq 0xa418(%rip), %rdx      # 0x1863f
leaq -0x98(%rbp), %rdi
callq 0x139ec
leaq -0x48(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0x1394e
movq -0x98(%rbp), %rsi
leaq 0xab7b(%rip), %rdi      # 0x18dd8
xorl %eax, %eax
callq 0x2060
cmpq $0x0, -0x50(%rbp)
je 0xe291
leaq 0x9d08(%rip), %r14      # 0x17f7a
xorl %r13d, %r13d
movq -0x58(%rbp), %rax
movsbl (%rax,%r13), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2060
incq %r13
cmpq -0x50(%rbp), %r13
jb 0xe275
movl $0xa, %edi
callq 0x2340
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0xe2a9
callq 0x2220
movq -0x98(%rbp), %rdi
jmp 0xe361
cmpb $0x1, (%r14)
jne 0xe36b
leaq -0xa8(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xa366(%rip), %rsi      # 0x18637
leaq 0xa367(%rip), %rdx      # 0x1863f
leaq -0xb8(%rbp), %rdi
callq 0x139ec
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x1394e
movq -0xb8(%rbp), %rsi
leaq 0xaaca(%rip), %rdi      # 0x18dd8
xorl %eax, %eax
callq 0x2060
cmpq $0x0, -0x70(%rbp)
je 0xe342
leaq 0x9c57(%rip), %r14      # 0x17f7a
xorl %r13d, %r13d
movq -0x78(%rbp), %rax
movsbl (%rax,%r13), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2060
incq %r13
cmpq -0x70(%rbp), %r13
jb 0xe326
movl $0xa, %edi
callq 0x2340
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0xe35a
callq 0x2220
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0xe36b
callq 0x2220
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3ab0
movq %rax, %r14
movq -0xb8(%rbp), %rdi
jmp 0xe39d
jmp 0xe3ab
movq %rax, %r14
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0xe3ae
callq 0x2220
jmp 0xe3ae
jmp 0xe3ab
movq %rax, %r14
movq (%rbx), %rdi
cmpq -0x38(%rbp), %rdi
je 0xe3bc
callq 0x2220
movq %r14, %rdi
callq 0x2400