// File: Infinidat[P]slimfastq/usrs.cpp
// Function: UsrSave::get_record()
bool UsrSave::get_record() {

    load_check();

#define CHECK_OVERFLOW rarely_if (m_cur >= m_end) return mid_rec_msg()

    if (m_cur >= m_end) return m_valid = false;

    int currec = m_cur;
    expect('@');
    int sanity = MAX_ID_LLEN;
    while (--  sanity and m_buff[m_cur] != '\n')
        m_cur ++ ;
    rarely_if( not sanity)
        // croak("record %llu: rec line too long", g_record_count);
        return get_oversized_record(currec);

    mp.rec_end = &(m_buff[m_cur]);
    CHECK_OVERFLOW ;
    expect('\n');

    UCHAR update_solid_pf = 0;
    if (m_solid) {
        rarely_if (m_last.solid_pf_gen != m_buff[m_cur])
            update_solid_pf = m_buff[m_cur];
        m_cur++;
    }

    mp.gen = &(m_buff[m_cur]);
    const int gi = m_cur ;
    sanity = MAX_GN_LLEN;
    while (-- sanity and m_buff[m_cur] != '\n')
        m_cur ++;

    rarely_if( not sanity)
        return get_oversized_record(currec);

    rarely_if(update_solid_pf)  // update only after last potential get_oversized_record
        update(ET_SOLPF_GEN, update_solid_pf);

    CHECK_OVERFLOW;
    rarely_if(m_llen != m_cur-gi)
        update(ET_LLEN, m_cur-gi);

    expect('\n');
    expect('+' );
    for (sanity = MAX_ID_LLEN;
         --  sanity and m_buff[m_cur] != '\n';
         m_cur ++ );
    CHECK_OVERFLOW;
    rarely_if(not sanity)
        croak("wierd second id at record %llu", g_record_count);

    expect('\n');

    if (m_solid) {
        rarely_if (m_last.solid_pf_qlt != m_buff[m_cur])
            update(ET_SOLPF_QLT, m_buff[m_cur]);

        m_cur++;
    }

    mp.qlt = &(m_buff[m_cur]);
    // m_cur += m_llen;
    m_qlen = 0;
    for (sanity = MAX_GN_LLEN;
         -- sanity and m_buff[m_cur+m_qlen] != '\n';
         m_qlen++);

    rarely_if( not sanity)
        return get_oversized_record(currec);

    rarely_if( m_qlen != m_llen)
        update(ET_QLEN, m_qlen);

    m_cur += m_qlen;
    CHECK_OVERFLOW;

    expect('\n');

    mp.prev_rec = mp.rec;
    mp.prev_rec_end = mp.rec_end;
    mp.rec = &(m_buff[currec+1]);

    return true;

#undef  CHECK_OVERFLOW
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xf1c0
movq 0x10(%rsp), %rcx
movl 0x124048(%rcx), %eax
cmpl 0x12404c(%rcx), %eax
jl 0xdb8e
movq 0x10(%rsp), %rax
movb $0x0, 0x30(%rax)
movb $0x0, 0x37(%rsp)
jmp 0xe096
movq 0x10(%rsp), %rdi
movl 0x124048(%rdi), %eax
movl %eax, 0x24(%rsp)
movl $0x40, %esi
callq 0xf260
movl $0x2000, 0x20(%rsp)     # imm = 0x2000
movl 0x20(%rsp), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0xdbe0
movq 0x10(%rsp), %rax
movslq 0x124048(%rax), %rcx
movzbl 0x31(%rax,%rcx), %eax
cmpl $0xa, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xdbea
jmp 0xdc00
movq 0x10(%rsp), %rax
movl 0x124048(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x124048(%rax)
jmp 0xdbaf
cmpl $0x0, 0x20(%rsp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xdc10
jmp 0xdc2e
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
movl $0x1, %edx
callq 0xd8c0
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xe096
movq 0x10(%rsp), %rcx
movq %rcx, %rax
addq $0x31, %rax
movslq 0x124048(%rcx), %rdx
addq %rdx, %rax
movq %rax, 0x1240a8(%rcx)
movl 0x124048(%rcx), %eax
cmpl 0x12404c(%rcx), %eax
jl 0xdc6e
movq 0x10(%rsp), %rdi
callq 0xd8a0
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xe096
movq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0xf260
movq 0x10(%rsp), %rax
movb $0x0, 0x1f(%rsp)
testb $0x1, 0x124064(%rax)
je 0xdcd1
movq 0x10(%rsp), %rcx
movzbl 0x28(%rcx), %eax
movslq 0x124048(%rcx), %rdx
movzbl 0x31(%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0xdcbd
movq 0x10(%rsp), %rax
movslq 0x124048(%rax), %rcx
movb 0x31(%rax,%rcx), %al
movb %al, 0x1f(%rsp)
movq 0x10(%rsp), %rax
movl 0x124048(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x124048(%rax)
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x31, %rcx
movslq 0x124048(%rax), %rdx
addq %rdx, %rcx
movq %rcx, 0x1240c0(%rax)
movl 0x124048(%rax), %eax
movl %eax, 0x18(%rsp)
movl $0x10000, 0x20(%rsp)    # imm = 0x10000
movl 0x20(%rsp), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xe(%rsp)
je 0xdd31
movq 0x10(%rsp), %rax
movslq 0x124048(%rax), %rcx
movzbl 0x31(%rax,%rcx), %eax
cmpl $0xa, %eax
setne %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0xdd3b
jmp 0xdd51
movq 0x10(%rsp), %rax
movl 0x124048(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x124048(%rax)
jmp 0xdd00
cmpl $0x0, 0x20(%rsp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xdd61
jmp 0xdd7f
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
movl $0x1, %edx
callq 0xd8c0
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xe096
movzbl 0x1f(%rsp), %eax
cmpq $0x0, %rax
je 0xdda1
movq 0x10(%rsp), %rdi
movzbl 0x1f(%rsp), %eax
movl $0x2, %esi
movzwl %ax, %edx
callq 0xd6e0
movq 0x10(%rsp), %rcx
movl 0x124048(%rcx), %eax
cmpl 0x12404c(%rcx), %eax
jl 0xddc9
movq 0x10(%rsp), %rdi
callq 0xd8a0
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xe096
movq 0x10(%rsp), %rcx
movl 0x12405c(%rcx), %eax
movl 0x124048(%rcx), %ecx
subl 0x18(%rsp), %ecx
cmpl %ecx, %eax
je 0xddfb
movq 0x10(%rsp), %rdi
movl 0x124048(%rdi), %eax
subl 0x18(%rsp), %eax
xorl %esi, %esi
movzwl %ax, %edx
callq 0xd6e0
movq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0xf260
movq 0x10(%rsp), %rdi
movl $0x2b, %esi
callq 0xf260
movl $0x2000, 0x20(%rsp)     # imm = 0x2000
movl 0x20(%rsp), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xd(%rsp)
je 0xde52
movq 0x10(%rsp), %rax
movslq 0x124048(%rax), %rcx
movzbl 0x31(%rax,%rcx), %eax
cmpl $0xa, %eax
setne %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0xde5c
jmp 0xde74
jmp 0xde5e
movq 0x10(%rsp), %rax
movl 0x124048(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x124048(%rax)
jmp 0xde21
movq 0x10(%rsp), %rcx
movl 0x124048(%rcx), %eax
cmpl 0x12404c(%rcx), %eax
jl 0xde9c
movq 0x10(%rsp), %rdi
callq 0xd8a0
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xe096
cmpl $0x0, 0x20(%rsp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xdeac
jmp 0xdec4
leaq 0x83ad(%rip), %rax      # 0x16260
movq (%rax), %rsi
leaq 0x3627(%rip), %rdi      # 0x114e4
movb $0x0, %al
callq 0x3450
movq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0xf260
movq 0x10(%rsp), %rax
testb $0x1, 0x124064(%rax)
je 0xdf2c
movq 0x10(%rsp), %rcx
movzbl 0x29(%rcx), %eax
movslq 0x124048(%rcx), %rdx
movzbl 0x31(%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0xdf18
movq 0x10(%rsp), %rdi
movslq 0x124048(%rdi), %rax
movzbl 0x31(%rdi,%rax), %eax
movl $0x3, %esi
movzwl %ax, %edx
callq 0xd6e0
movq 0x10(%rsp), %rax
movl 0x124048(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x124048(%rax)
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x31, %rcx
movslq 0x124048(%rax), %rdx
addq %rdx, %rcx
movq %rcx, 0x1240c8(%rax)
movl $0x0, 0x124060(%rax)
movl $0x10000, 0x20(%rsp)    # imm = 0x10000
movl 0x20(%rsp), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xc(%rsp)
je 0xdf94
movq 0x10(%rsp), %rax
movl 0x124048(%rax), %ecx
addl 0x124060(%rax), %ecx
movslq %ecx, %rcx
movzbl 0x31(%rax,%rcx), %eax
cmpl $0xa, %eax
setne %al
movb %al, 0xc(%rsp)
movb 0xc(%rsp), %al
testb $0x1, %al
jne 0xdf9e
jmp 0xdfb6
jmp 0xdfa0
movq 0x10(%rsp), %rax
movl 0x124060(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x124060(%rax)
jmp 0xdf5b
cmpl $0x0, 0x20(%rsp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xdfc6
jmp 0xdfe4
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
movl $0x1, %edx
callq 0xd8c0
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xe096
movq 0x10(%rsp), %rcx
movl 0x124060(%rcx), %eax
cmpl 0x12405c(%rcx), %eax
je 0xe00f
movq 0x10(%rsp), %rdi
movl 0x124060(%rdi), %eax
movl $0x1, %esi
movzwl %ax, %edx
callq 0xd6e0
movq 0x10(%rsp), %rcx
movl 0x124060(%rcx), %eax
addl 0x124048(%rcx), %eax
movl %eax, 0x124048(%rcx)
movl 0x124048(%rcx), %eax
cmpl 0x12404c(%rcx), %eax
jl 0xe046
movq 0x10(%rsp), %rdi
callq 0xd8a0
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xe096
movq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0xf260
movq 0x10(%rsp), %rax
movq 0x1240a0(%rax), %rcx
movq %rcx, 0x1240b0(%rax)
movq 0x1240a8(%rax), %rcx
movq %rcx, 0x1240b8(%rax)
movq %rax, %rcx
addq $0x31, %rcx
movl 0x24(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, 0x1240a0(%rax)
movb $0x1, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)