// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis-check-dump.c
// Function: loadPair
int loadPair(entry *e) {
    uint32_t offset = CURR_OFFSET;
    uint32_t i;

    /* read key first */
    char *key;
    if (processStringObject(&key)) {
        e->key = key;
    } else {
        SHIFT_ERROR(offset, "Error reading entry key");
        return 0;
    }

    uint32_t length = 0;
    if (e->type == REDIS_LIST ||
        e->type == REDIS_SET  ||
        e->type == REDIS_ZSET ||
        e->type == REDIS_HASH) {
        if ((length = loadLength(NULL)) == REDIS_RDB_LENERR) {
            SHIFT_ERROR(offset, "Error reading %s length", types[e->type]);
            return 0;
        }
    }

    switch(e->type) {
    case REDIS_STRING:
    case REDIS_HASH_ZIPMAP:
    case REDIS_LIST_ZIPLIST:
    case REDIS_SET_INTSET:
    case REDIS_ZSET_ZIPLIST:
    case REDIS_HASH_ZIPLIST:
        if (!processStringObject(NULL)) {
            SHIFT_ERROR(offset, "Error reading entry value");
            return 0;
        }
    break;
    case REDIS_LIST:
    case REDIS_SET:
        for (i = 0; i < length; i++) {
            offset = CURR_OFFSET;
            if (!processStringObject(NULL)) {
                SHIFT_ERROR(offset, "Error reading element at index %d (length: %d)", i, length);
                return 0;
            }
        }
    break;
    case REDIS_ZSET:
        for (i = 0; i < length; i++) {
            offset = CURR_OFFSET;
            if (!processStringObject(NULL)) {
                SHIFT_ERROR(offset, "Error reading element key at index %d (length: %d)", i, length);
                return 0;
            }
            offset = CURR_OFFSET;
            if (!processDoubleValue(NULL)) {
                SHIFT_ERROR(offset, "Error reading element value at index %d (length: %d)", i, length);
                return 0;
            }
        }
    break;
    case REDIS_HASH:
        for (i = 0; i < length; i++) {
            offset = CURR_OFFSET;
            if (!processStringObject(NULL)) {
                SHIFT_ERROR(offset, "Error reading element key at index %d (length: %d)", i, length);
                return 0;
            }
            offset = CURR_OFFSET;
            if (!processStringObject(NULL)) {
                SHIFT_ERROR(offset, "Error reading element value at index %d (length: %d)", i, length);
                return 0;
            }
        }
    break;
    default:
        SHIFT_ERROR(offset, "Type not implemented");
        return 0;
    }
    /* because we're done, we assume success */
    e->success = 1;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movzbl 0x540d(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x5284(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x14(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x1b40
cmpl $0x0, %eax
je 0x1e75
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1ed1
movq 0x945c(%rip), %rax      # 0xb2d8
leaq 0x53d5(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
leaq 0x22df(%rip), %rsi      # 0x4170
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x9434(%rip), %rcx      # 0xb2d8
leaq 0x53ad(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x941e(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x9413(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x8(%rax)
je 0x1f04
movq -0x10(%rbp), %rax
cmpl $0x2, 0x8(%rax)
je 0x1f04
movq -0x10(%rbp), %rax
cmpl $0x3, 0x8(%rax)
je 0x1f04
movq -0x10(%rbp), %rax
cmpl $0x4, 0x8(%rax)
jne 0x1f89
xorl %eax, %eax
movl %eax, %edi
callq 0x1690
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x1f87
movq 0x93bc(%rip), %rax      # 0xb2d8
leaq 0x5335(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movslq 0x8(%rax), %rax
leaq 0x93c7(%rip), %rdx      # 0xb300
shlq $0x4, %rax
addq %rax, %rdx
leaq 0x2241(%rip), %rsi      # 0x4188
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x937e(%rip), %rcx      # 0xb2d8
leaq 0x52f7(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x9368(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x935d(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
jmp 0x1f89
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x30(%rbp)
subq $0xd, %rax
ja 0x2359
movq -0x30(%rbp), %rax
leaq 0x205b(%rip), %rcx      # 0x4004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
movl %eax, %edi
callq 0x1b40
cmpl $0x0, %eax
jne 0x201c
movq 0x9311(%rip), %rax      # 0xb2d8
leaq 0x528a(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
leaq 0x21c4(%rip), %rsi      # 0x41a0
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x92e9(%rip), %rcx      # 0xb2d8
leaq 0x5262(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x92d3(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x92c8(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
jmp 0x23b2
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x20d2
movzbl 0x5215(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x508c(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x1b40
cmpl $0x0, %eax
jne 0x20c2
movq 0x9271(%rip), %rax      # 0xb2d8
leaq 0x51ea(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movl -0x18(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x2138(%rip), %rsi      # 0x41ba
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x9243(%rip), %rcx      # 0xb2d8
leaq 0x51bc(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x922d(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x9222(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
jmp 0x20c4
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2028
jmp 0x23b2
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x2216
movzbl 0x515f(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4fd6(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x1b40
cmpl $0x0, %eax
jne 0x2178
movq 0x91bb(%rip), %rax      # 0xb2d8
leaq 0x5134(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movl -0x18(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x20b1(%rip), %rsi      # 0x41e9
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x918d(%rip), %rcx      # 0xb2d8
leaq 0x5106(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x9177(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x916c(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
movzbl 0x50d1(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4f48(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x1d60
cmpl $0x0, %eax
jne 0x2206
movq 0x912d(%rip), %rax      # 0xb2d8
leaq 0x50a6(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movl -0x18(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x2056(%rip), %rsi      # 0x421c
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x90ff(%rip), %rcx      # 0xb2d8
leaq 0x5078(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x90e9(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x90de(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
jmp 0x2208
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x20de
jmp 0x23b2
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x2357
movzbl 0x501b(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4e92(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x1b40
cmpl $0x0, %eax
jne 0x22bc
movq 0x9077(%rip), %rax      # 0xb2d8
leaq 0x4ff0(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movl -0x18(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x1f6d(%rip), %rsi      # 0x41e9
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x9049(%rip), %rcx      # 0xb2d8
leaq 0x4fc2(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x9033(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x9028(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
movzbl 0x4f8d(%rip), %eax      # 0x7250
movl %eax, %ecx
leaq 0x4e04(%rip), %rax      # 0x70d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x1b40
cmpl $0x0, %eax
jne 0x2347
movq 0x8fe9(%rip), %rax      # 0xb2d8
leaq 0x4f62(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
movl -0x18(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x1f12(%rip), %rsi      # 0x421c
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x8fbb(%rip), %rcx      # 0xb2d8
leaq 0x4f34(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x8fa5(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x8f9a(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
jmp 0x2349
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2222
jmp 0x23b2
movq 0x8f78(%rip), %rax      # 0xb2d8
leaq 0x4ef1(%rip), %rdi      # 0x7258
shlq $0xa, %rax
addq %rax, %rdi
leaq 0x1edc(%rip), %rsi      # 0x4251
movb $0x0, %al
callq 0x1120
movl -0x14(%rbp), %eax
movl %eax, %edx
movq 0x8f50(%rip), %rcx      # 0xb2d8
leaq 0x4ec9(%rip), %rax      # 0x7258
movq %rdx, 0x4000(%rax,%rcx,8)
movq 0x8f3a(%rip), %rax      # 0xb2d8
addq $0x1, %rax
movq %rax, 0x8f2f(%rip)      # 0xb2d8
movl $0x0, -0x4(%rbp)
jmp 0x23c1
movq -0x10(%rbp), %rax
movb $0x1, 0xc(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)