// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/rdb.c
// Function: rdbLoadIntegerObject
robj *rdbLoadIntegerObject(rio *rdb, int enctype, int encode) {
    unsigned char enc[4];
    long long val;

    // 整数编码
    if (enctype == REDIS_RDB_ENC_INT8) {
        if (rioRead(rdb,enc,1) == 0) return NULL;
        val = (signed char)enc[0];
    } else if (enctype == REDIS_RDB_ENC_INT16) {
        uint16_t v;
        if (rioRead(rdb,enc,2) == 0) return NULL;
        v = enc[0]|(enc[1]<<8);
        val = (int16_t)v;
    } else if (enctype == REDIS_RDB_ENC_INT32) {
        uint32_t v;
        if (rioRead(rdb,enc,4) == 0) return NULL;
        v = enc[0]|(enc[1]<<8)|(enc[2]<<16)|(enc[3]<<24);
        val = (int32_t)v;
    } else {
        val = 0; /* anti-warning */
        redisPanic("Unknown RDB integer encoding type");
    }

    
    if (encode)
        // 整数编码的字符串
        return createStringObjectFromLongLong(val);
    else
        // 未编码
        return createObject(REDIS_STRING,sdsfromlonglong(val));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
cmpl $0x2, %esi
je 0x363e7
cmpl $0x1, %esi
je 0x36362
testl %esi, %esi
jne 0x36489
movl $0x1, %eax
leaq 0x4(%rsp), %r15
testq %rax, %rax
je 0x36357
movq %rax, %rbp
movq 0x30(%r14), %rax
cmpq %rbp, %rax
movq %rbp, %r12
cmovbq %rax, %r12
testq %rax, %rax
cmoveq %rbp, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *(%r14)
movq %rax, %r13
testq %rax, %rax
je 0x36346
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x36337
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *%rax
addq %r12, %r15
movq %rbp, %rax
subq %r12, %rax
addq %r12, 0x28(%r14)
jmp 0x36349
movq %rbp, %rax
testq %r13, %r13
jne 0x362f2
testq %rbp, %rbp
jne 0x3645c
movsbq 0x4(%rsp), %rdi
jmp 0x36460
movl $0x2, %eax
leaq 0x4(%rsp), %r15
movq %rax, %rbp
testq %rax, %rax
je 0x363d1
movq 0x30(%r14), %rax
cmpq %rbp, %rax
movq %rbp, %r12
cmovbq %rax, %r12
testq %rax, %rax
cmoveq %rbp, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *(%r14)
movq %rax, %r13
testq %rax, %rax
je 0x363c0
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x363b1
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *%rax
addq %r12, %r15
movq %rbp, %rax
subq %r12, %rax
addq %r12, 0x28(%r14)
jmp 0x363c3
movq %rbp, %rax
testq %r13, %r13
jne 0x3636c
testq %rbp, %rbp
jne 0x36457
movzbl 0x4(%rsp), %eax
movzbl 0x5(%rsp), %ecx
shll $0x8, %ecx
movswq %cx, %rdi
orq %rax, %rdi
jmp 0x36457
movl $0x4, %eax
leaq 0x4(%rsp), %r15
movq %rax, %rbp
testq %rax, %rax
je 0x36452
movq 0x30(%r14), %rax
cmpq %rbp, %rax
movq %rbp, %r12
cmovbq %rax, %r12
testq %rax, %rax
cmoveq %rbp, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *(%r14)
movq %rax, %r13
testq %rax, %rax
je 0x36445
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x36436
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *%rax
addq %r12, %r15
movq %rbp, %rax
subq %r12, %rax
addq %r12, 0x28(%r14)
jmp 0x36448
movq %rbp, %rax
testq %r13, %r13
jne 0x363f1
testq %rbp, %rbp
jne 0x36457
movslq 0x4(%rsp), %rdi
testq %rbp, %rbp
je 0x36460
xorl %eax, %eax
jmp 0x3647a
testl %ebx, %ebx
je 0x3646b
callq 0x303c6
jmp 0x3647a
callq 0x2861d
xorl %edi, %edi
movq %rax, %rsi
callq 0x302c4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x62588(%rip), %rdi     # 0x98a18
leaq 0x625a5(%rip), %rsi     # 0x98a3c
movl $0x101, %edx            # imm = 0x101
callq 0x4d0e5
movl $0x1, %edi
callq 0x1f3b0