// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0x2, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x531bd
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x1, %edx
callq 0x52c70
cmpq $0x0, %rax
jne 0x531af
movq $0x0, -0x8(%rbp)
jmp 0x532ec
movsbq -0x24(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x5327d
cmpl $0x1, -0x14(%rbp)
jne 0x53204
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x2, %edx
callq 0x52c70
cmpq $0x0, %rax
jne 0x531e8
movq $0x0, -0x8(%rbp)
jmp 0x532ec
movzbl -0x24(%rbp), %eax
movzbl -0x23(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movw %ax, -0x32(%rbp)
movswq -0x32(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x5327b
cmpl $0x2, -0x14(%rbp)
jne 0x5325b
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x4, %edx
callq 0x52c70
cmpq $0x0, %rax
jne 0x5322f
movq $0x0, -0x8(%rbp)
jmp 0x532ec
movzbl -0x24(%rbp), %eax
movzbl -0x23(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movzbl -0x22(%rbp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movzbl -0x21(%rbp), %ecx
shll $0x18, %ecx
orl %ecx, %eax
movl %eax, -0x38(%rbp)
movslq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x53279
movq $0x0, -0x30(%rbp)
movl -0x14(%rbp), %edx
movl $0xdf, %edi
leaq 0xe9ee0(%rip), %rsi     # 0x13d152
movb $0x0, %al
callq 0x52a50
jmp 0x5327b
jmp 0x5327d
cmpl $0x0, -0x1c(%rbp)
je 0x532c0
leaq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl $0x15, %esi
callq 0x477e0
movl %eax, -0x5c(%rbp)
movslq -0x5c(%rbp), %rdi
callq 0x3acd0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movslq -0x5c(%rbp), %rdx
callq 0x26c60
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x532ec
cmpl $0x0, -0x20(%rbp)
je 0x532d5
movq -0x30(%rbp), %rdi
callq 0x486f0
movq %rax, -0x8(%rbp)
jmp 0x532ec
movq -0x30(%rbp), %rdi
callq 0x393f0
movq %rax, %rsi
xorl %edi, %edi
callq 0x48480
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)