// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbLoadIntegerObject
void *rdbLoadIntegerObject(rio *rdb, int enctype, int flags) {
    int plain = flags & RDB_LOAD_PLAIN;
    int encode = flags & RDB_LOAD_ENC;
    unsigned char enc[4];
    long long val;

    if (enctype == RDB_ENC_INT8) {
        if (rioRead(rdb,enc,1) == 0) return NULL;
        val = (signed char)enc[0];
    } else if (enctype == 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 == 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 */
        rdbExitReportCorruptRDB("Unknown RDB integer encoding type %d",enctype);
    }
    if (plain) {
        char buf[LONG_STR_SIZE], *p;
        int len = ll2string(buf,sizeof(buf),val);
        p = zmalloc(len);
        memcpy(p,buf,len);
        return p;
    } else if (encode) {
        return createStringObjectFromLongLong(val);
    } else {
        return createObject(OBJ_STRING,sdsfromlonglong(val));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rdi, %r15
cmpl $0x2, %esi
je 0x4807f
movl %esi, %edx
cmpl $0x1, %esi
je 0x48020
testl %edx, %edx
jne 0x4813f
leaq 0xc(%rsp), %r12
movl $0x1, %ebp
xorl %r14d, %r14d
movq 0x38(%r15), %rax
cmpq %rbp, %rax
movq %rbp, %r13
cmovbq %rax, %r13
testq %rax, %rax
cmoveq %rbp, %r13
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *(%r15)
testq %rax, %rax
je 0x4812d
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x48009
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *%rax
addq %r13, %r12
addq %r13, 0x30(%r15)
subq %r13, %rbp
jne 0x47fcb
movsbq 0xc(%rsp), %rdx
jmp 0x480d7
leaq 0xc(%rsp), %r12
movl $0x2, %ebp
xorl %r14d, %r14d
movq 0x38(%r15), %rax
cmpq %rbp, %rax
movq %rbp, %r13
cmovbq %rax, %r13
testq %rax, %rax
cmoveq %rbp, %r13
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *(%r15)
testq %rax, %rax
je 0x4812d
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x4806b
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *%rax
addq %r13, %r12
addq %r13, 0x30(%r15)
subq %r13, %rbp
jne 0x4802d
movswq 0xc(%rsp), %rdx
jmp 0x480d7
leaq 0xc(%rsp), %r12
movl $0x4, %ebp
xorl %r14d, %r14d
movq 0x38(%r15), %rax
cmpq %rbp, %rax
movq %rbp, %r13
cmovbq %rax, %r13
testq %rax, %rax
cmoveq %rbp, %r13
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *(%r15)
testq %rax, %rax
je 0x4812d
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x480c6
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *%rax
addq %r13, %r12
addq %r13, 0x30(%r15)
subq %r13, %rbp
jne 0x4808c
movslq 0xc(%rsp), %rdx
testb $0x2, %bl
jne 0x480f5
movq %rdx, %rdi
testb $0x1, %bl
jne 0x48125
callq 0x36e1a
xorl %edi, %edi
movq %rax, %rsi
callq 0x40650
jmp 0x4812a
leaq 0x10(%rsp), %rbx
movl $0x15, %esi
movq %rbx, %rdi
callq 0x3ff83
movslq %eax, %r15
movq %r15, %rdi
callq 0x382d1
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x26c50
jmp 0x4812d
callq 0x40753
movq %rax, %r14
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7a879(%rip), %rsi     # 0xc29bf
movl $0xdf, %edi
xorl %eax, %eax
callq 0x47948