// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/redis-check-dump.c
// Function: loadEntry
entry loadEntry() {
    entry e = { NULL, -1, 0 };
    uint32_t length, offset[4];

    /* reset error container */
    errors.level = 0;

    offset[0] = CURR_OFFSET;
    if (!loadType(&e)) {
        return e;
    }

    offset[1] = CURR_OFFSET;
    if (e.type == REDIS_SELECTDB) {
        if ((length = loadLength(NULL)) == REDIS_RDB_LENERR) {
            SHIFT_ERROR(offset[1], "Error reading database number");
            return e;
        }
        if (length > 63) {
            SHIFT_ERROR(offset[1], "Database number out of range (%d)", length);
            return e;
        }
    } else if (e.type == REDIS_EOF) {
        if (positions[level].offset < positions[level].size) {
            SHIFT_ERROR(offset[0], "Unexpected EOF");
        } else {
            e.success = 1;
        }
        return e;
    } else {
        /* optionally consume expire */
        if (e.type == REDIS_EXPIRETIME || 
            e.type == REDIS_EXPIRETIME_MS) {
            if (!processTime(e.type)) return e;
            if (!loadType(&e)) return e;
        }

        offset[1] = CURR_OFFSET;
        if (!loadPair(&e)) {
            SHIFT_ERROR(offset[1], "Error for type %s", types[e.type]);
            return e;
        }
    }

    /* all entries are followed by a valid type:
     * e.g. a new entry, SELECTDB, EXPIRE, EOF */
    offset[2] = CURR_OFFSET;
    if (peekType() == -1) {
        SHIFT_ERROR(offset[2], "Followed by invalid type");
        SHIFT_ERROR(offset[0], "Error for type %s", types[e.type]);
        e.success = 0;
    } else {
        e.success = 1;
    }

    return e;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movups 0x1258(%rip), %xmm0     # 0x3498
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x8087(%rip) # 0xa2d8
movzbl 0x3ff8(%rip), %eax      # 0x6250
leaq (%rax,%rax,2), %rax
leaq 0x3e6d(%rip), %r14      # 0x60d0
movl 0x10(%r14,%rax,8), %ebx
callq 0x1792
testl %eax, %eax
je 0x24c0
movzbl 0x3fd4(%rip), %eax      # 0x6250
leaq (%rax,%rax,2), %rax
movq 0x10(%r14,%rax,8), %r15
movl 0x8(%rsp), %edi
cmpl $0xff, %edi
je 0x22f2
cmpl $0xfe, %edi
jne 0x233f
xorl %edi, %edi
callq 0x1949
cmpl $-0x1, %eax
je 0x239c
cmpl $0x40, %eax
jb 0x2388
leaq 0x3f9b(%rip), %rbx      # 0x6258
movq 0x8014(%rip), %rdi      # 0xa2d8
shlq $0xa, %rdi
addq %rbx, %rdi
leaq 0xf6f(%rip), %rsi       # 0x3241
movl %eax, %edx
xorl %eax, %eax
callq 0x1130
movl %r15d, %eax
movq 0x7ff3(%rip), %rcx      # 0xa2d8
movq %rax, 0x4000(%rbx,%rcx,8)
jmp 0x24b9
leaq (%r14,%rax,8), %rax
cmpq 0x8(%rax), %r15
jae 0x2392
leaq 0x3f51(%rip), %rax      # 0x6258
movq 0x7fca(%rip), %rcx      # 0xa2d8
movq %rcx, %rdx
shlq $0xa, %rdx
movabsq $0x464f4520646574, %rsi # imm = 0x464F4520646574
movq %rsi, 0x7(%rdx,%rax)
movabsq $0x7463657078656e55, %rsi # imm = 0x7463657078656E55
movq %rsi, (%rdx,%rax)
movq %rbx, 0x4000(%rax,%rcx,8)
jmp 0x24b9
movl %edi, %eax
andl $-0x2, %eax
cmpl $0xfc, %eax
jne 0x2368
callq 0x18bf
testl %eax, %eax
je 0x24c0
movq %rsp, %rdi
callq 0x1792
testl %eax, %eax
je 0x24c0
movzbl 0x3ee1(%rip), %eax      # 0x6250
leaq (%rax,%rax,2), %rax
movl 0x10(%r14,%rax,8), %r15d
movq %rsp, %rdi
callq 0x1f30
testl %eax, %eax
je 0x2474
callq 0x185f
cmpl $-0x1, %eax
je 0x23d8
movb $0x1, 0xc(%rsp)
jmp 0x24c0
leaq 0x3eb5(%rip), %rax      # 0x6258
movq 0x7f2e(%rip), %rcx      # 0xa2d8
movq %rcx, %rdx
shlq $0xa, %rdx
movups 0xe79(%rip), %xmm0      # 0x3231
movups %xmm0, 0xe(%rdx,%rax)
movups 0xe5f(%rip), %xmm0      # 0x3223
movups %xmm0, (%rdx,%rax)
movl %r15d, %edx
movq %rdx, 0x4000(%rax,%rcx,8)
jmp 0x24b9
movzbl 0x3e71(%rip), %eax      # 0x6250
leaq (%rax,%rax,2), %rax
movl 0x10(%r14,%rax,8), %eax
leaq 0x3e69(%rip), %r14      # 0x6258
movq 0x7ee2(%rip), %rcx      # 0xa2d8
movq %rcx, %rdx
shlq $0xa, %rdx
movups 0xe80(%rip), %xmm0      # 0x3284
movups %xmm0, (%rdx,%r14)
movups 0xe7d(%rip), %xmm0      # 0x328d
movups %xmm0, 0x9(%rdx,%r14)
movq %rax, 0x4000(%r14,%rcx,8)
movq 0x7eb3(%rip), %rdi      # 0xa2d8
incq %rdi
movq %rdi, 0x7ea9(%rip)      # 0xa2d8
shlq $0xa, %rdi
addq %r14, %rdi
movslq 0x8(%rsp), %rax
shlq $0x4, %rax
leaq 0x7eba(%rip), %rdx      # 0xa300
addq %rax, %rdx
leaq 0xe22(%rip), %rsi       # 0x3272
xorl %eax, %eax
callq 0x1130
movq 0x7e7a(%rip), %rax      # 0xa2d8
movq %rbx, 0x4000(%r14,%rax,8)
incq 0x7e6b(%rip)            # 0xa2d8
movb $0x0, 0xc(%rsp)
jmp 0x24c0
leaq 0x3ddd(%rip), %rbx      # 0x6258
movq 0x7e56(%rip), %rdi      # 0xa2d8
shlq $0xa, %rdi
addq %rbx, %rdi
movslq 0x8(%rsp), %rax
shlq $0x4, %rax
leaq 0x7e67(%rip), %rdx      # 0xa300
addq %rax, %rdx
leaq 0xdcf(%rip), %rsi       # 0x3272
xorl %eax, %eax
callq 0x1130
movq 0x7e27(%rip), %rax      # 0xa2d8
movq %r15, 0x4000(%rbx,%rax,8)
incq 0x7e18(%rip)            # 0xa2d8
movq (%rsp), %rax
movq 0x8(%rsp), %rdx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq