// File: /workspace/github_cpp_makefile_star2_O2/stevedonovan[P]outstreams/instream.cpp
// Function: stream::Reader::formatted_read(char const*, char const*, char const*, ...)
Reader& Reader::formatted_read(const char *ctype, const char *def, const char *fmt, ...) {
    if (fail()) return *this;
    va_list ap;
    va_start(ap,fmt);
    if (fmt == nullptr) {
         fmt = def;
    }
    int res = read_fmt(fmt,ap);
    if (res == EOF) {
        if (errno != 0) { // we remain in hope
            set_error(strerror(errno),errno);
        } else { // but invariably it just means EOF
            set_error("EOF reading " + std::string(ctype),EOF);
        }
    } else
    if (res != 1 && *ctype != 'S') {
         std::string chars;
         (*this)(chars,"%5s");
         set_error("error reading " + std::string(ctype) + " at '" + chars + "'",1);
    }
    pos += fpos;
    va_end(ap);
    return *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
movq %r9, 0x118(%rsp)
testb %al, %al
je 0x2ad0
movaps %xmm0, 0x120(%rsp)
movaps %xmm1, 0x130(%rsp)
movaps %xmm2, 0x140(%rsp)
movaps %xmm3, 0x150(%rsp)
movaps %xmm4, 0x160(%rsp)
movaps %xmm5, 0x170(%rsp)
movaps %xmm6, 0x180(%rsp)
movaps %xmm7, 0x190(%rsp)
movq %r8, 0x110(%rsp)
cmpl $0x0, 0x1c(%rdi)
jne 0x2cc3
movq %rsi, %r14
leaq 0xf0(%rsp), %rsi
leaq 0xd0(%rsp), %rax
movq %rsi, 0x10(%rax)
leaq 0x1d0(%rsp), %rsi
movq %rsi, 0x8(%rax)
movabsq $0x3000000020, %rsi     # imm = 0x3000000020
movq %rsi, (%rax)
testq %rcx, %rcx
cmovneq %rcx, %rdx
movq (%rbx), %rcx
movq %rbx, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq *0x8(%rcx)
cmpl $0x1, %eax
je 0x2cbd
cmpl $-0x1, %eax
jne 0x2b78
callq 0x2040
movl (%rax), %edi
testl %edi, %edi
je 0x2c6f
movq %rax, %r15
callq 0x2090
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq %rax, %rsi
callq 0x271e
movl (%r15), %ebp
leaq 0x20(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20c0
movl %ebp, 0x1c(%rbx)
jmp 0x2c68
cmpb $0x53, (%r14)
je 0x2cbd
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1533(%rip), %rdx      # 0x40cd
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x2d5e
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0x271e
leaq 0x1511(%rip), %rsi      # 0x40d1
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x3550
leaq 0x1507(%rip), %rdx      # 0x40e0
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x3574
leaq 0x50(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x3593
leaq 0x14d8(%rip), %rdx      # 0x40e4
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x3574
leaq 0x20(%rbx), %rdi
leaq 0x30(%rsp), %rsi
callq 0x20c0
movl $0x1, 0x1c(%rbx)
leaq 0x30(%rsp), %rdi
callq 0x2288
leaq 0x50(%rsp), %rdi
callq 0x2288
leaq 0xb0(%rsp), %rdi
callq 0x2288
leaq 0x90(%rsp), %rdi
callq 0x2288
leaq 0x70(%rsp), %rdi
callq 0x2288
leaq 0x10(%rsp), %rdi
jmp 0x2cb8
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %r14, %rsi
callq 0x271e
leaq 0x1438(%rip), %rsi      # 0x40c0
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x3550
leaq 0x20(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20c0
orl $-0x1, 0x1c(%rbx)
leaq 0x10(%rsp), %rdi
callq 0x2288
leaq 0x30(%rsp), %rdi
callq 0x2288
movl 0x14(%rbx), %eax
addl %eax, 0x18(%rbx)
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2288
jmp 0x2ce6
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x2d4c
jmp 0x2d59
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2288
jmp 0x2d01
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x2288
jmp 0x2d10
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2288
jmp 0x2d22
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2288
jmp 0x2d34
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2288
jmp 0x2d47
jmp 0x2d44
jmp 0x2d44
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2288
movq %rbx, %rdi
callq 0x2220
movq %rax, %rbx
jmp 0x2d51