// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x20d1(%rip), %rax      # 0x44b0
movq %rax, -0x10(%rbp)
movq 0x20ce(%rip), %rax      # 0x44b8
movq %rax, -0x8(%rbp)
movq $0x0, 0x8edf(%rip) # 0xb2d8
movzbl 0x4e50(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4cc7(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x30(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1460
cmpl $0x0, %eax
jne 0x242a
jmp 0x2778
movzbl 0x4e1f(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4c96(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x2c(%rbp)
cmpl $0xfe, -0x8(%rbp)
jne 0x251e
xorl %eax, %eax
movl %eax, %edi
callq 0x1690
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
jne 0x24bb
movq 0x8e6b(%rip), %rax      # 0xb2d8
leaq 0x4de4(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
leaq 0x1de4(%rip), %rsi      # 0x4266
movb $0x0, %al
callq 0x1120
movl -0x2c(%rbp), %eax
movl %eax, %edx
movq 0x8e43(%rip), %rcx      # 0xb2d8
leaq 0x4dbc(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x8e2d(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x8e22(%rip)      # 0xb2d8
jmp 0x2778
cmpl $0x3f, -0x14(%rbp)
jbe 0x2519
movq 0x8e10(%rip), %rax      # 0xb2d8
leaq 0x4d89(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movl -0x14(%rbp), %edx
leaq 0x1da4(%rip), %rsi      # 0x4284
movb $0x0, %al
callq 0x1120
movl -0x2c(%rbp), %eax
movl %eax, %edx
movq 0x8de5(%rip), %rcx      # 0xb2d8
leaq 0x4d5e(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x8dcf(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x8dc4(%rip)      # 0xb2d8
jmp 0x2778
jmp 0x268e
cmpl $0xff, -0x8(%rbp)
jne 0x25be
movzbl 0x4d1e(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4b95(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movzbl 0x4d03(%rip), %ecx      # 0x7250
movl %ecx, %edx
leaq 0x4b7a(%rip), %rcx      # 0x70d0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x25b5
movq 0x8d6e(%rip), %rax      # 0xb2d8
leaq 0x4ce7(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
leaq 0x1d27(%rip), %rsi      # 0x42a6
movb $0x0, %al
callq 0x1120
movl -0x30(%rbp), %eax
movl %eax, %edx
movq 0x8d46(%rip), %rcx      # 0xb2d8
leaq 0x4cbf(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x8d30(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x8d25(%rip)      # 0xb2d8
jmp 0x25b9
movb $0x1, -0x4(%rbp)
jmp 0x2778
cmpl $0xfd, -0x8(%rbp)
je 0x25d0
cmpl $0xfc, -0x8(%rbp)
jne 0x25f7
movl -0x8(%rbp), %edi
callq 0x15d0
cmpl $0x0, %eax
jne 0x25e2
jmp 0x2778
leaq -0x10(%rbp), %rdi
callq 0x1460
cmpl $0x0, %eax
jne 0x25f5
jmp 0x2778
jmp 0x25f7
movzbl 0x4c52(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4ac9(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x2c(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1e30
cmpl $0x0, %eax
jne 0x268a
movq 0x8cae(%rip), %rax      # 0xb2d8
leaq 0x4c27(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movslq -0x8(%rbp), %rax
leaq 0x8cbd(%rip), %rdx      # 0xb300
shlq $0x4, %rax
addq %rax, %rdx
leaq 0x1c64(%rip), %rsi      # 0x42b5
movb $0x0, %al
callq 0x1120
movl -0x2c(%rbp), %eax
movl %eax, %edx
movq 0x8c74(%rip), %rcx      # 0xb2d8
leaq 0x4bed(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x8c5e(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x8c53(%rip)      # 0xb2d8
jmp 0x2778
jmp 0x268c
jmp 0x268e
movzbl 0x4bbb(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4a32(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x28(%rbp)
callq 0x1580
cmpl $-0x1, %eax
jne 0x2772
movq 0x8c17(%rip), %rax      # 0xb2d8
leaq 0x4b90(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
leaq 0x1bf1(%rip), %rsi      # 0x42c7
movb $0x0, %al
callq 0x1120
movl -0x28(%rbp), %eax
movl %eax, %edx
movq 0x8bef(%rip), %rcx      # 0xb2d8
leaq 0x4b68(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x8bd9(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x8bce(%rip)      # 0xb2d8
movq 0x8bc7(%rip), %rax      # 0xb2d8
leaq 0x4b40(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movslq -0x8(%rbp), %rax
leaq 0x8bd6(%rip), %rdx      # 0xb300
shlq $0x4, %rax
addq %rax, %rdx
leaq 0x1b7d(%rip), %rsi      # 0x42b5
movb $0x0, %al
callq 0x1120
movl -0x30(%rbp), %eax
movl %eax, %edx
movq 0x8b8d(%rip), %rcx      # 0xb2d8
leaq 0x4b06(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x8b77(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x8b6c(%rip)      # 0xb2d8
movb $0x0, -0x4(%rbp)
jmp 0x2776
movb $0x1, -0x4(%rbp)
jmp 0x2778
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)