LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveLen
int rdbSaveLen(rio *rdb, uint32_t len) {
    unsigned char buf[2];
    size_t nwritten;

    if (len < (1<<6)) {
        /* Save a 6 bit len */
        buf[0] = (len&0xFF)|(RDB_6BITLEN<<6);
        if (rdbWriteRaw(rdb,buf,1) == -1) return -1;
        nwritten = 1;
    } else if (len < (1<<14)) {
        /* Save a 14 bit len */
        buf[0] = ((len>>8)&0xFF)|(RDB_14BITLEN<<6);
        buf[1] = len&0xFF;
        if (rdbWriteRaw(rdb,buf,2) == -1) return -1;
        nwritten = 2;
    } else {
        /* Save a 32 bit len */
        buf[0] = (RDB_32BITLEN<<6);
        if (rdbWriteRaw(rdb,buf,1) == -1) return -1;
        len = htonl(len);
        if (rdbWriteRaw(rdb,&len,4) == -1) return -1;
        nwritten = 1+4;
    }
    return nwritten;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x3f, %esi
ja 0x405a4
leaq 0xa(%rsp), %rsi
movb %r14b, (%rsi)
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x40450
cmpl $-0x1, %eax
je 0x405d4
pushq $0x1
jmp 0x40610
cmpl $0x3fff, %r14d          # imm = 0x3FFF
ja 0x405d8
movl %r14d, %eax
shrl $0x8, %eax
orb $0x40, %al
leaq 0xa(%rsp), %rsi
movb %al, (%rsi)
movb %r14b, 0x1(%rsi)
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0x40450
cmpl $-0x1, %eax
je 0x405d4
pushq $0x2
jmp 0x40610
pushq $-0x1
jmp 0x40610
leaq 0xa(%rsp), %rsi
movb $-0x80, (%rsi)
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x40450
pushq $-0x1
popq %rbp
cmpl $-0x1, %eax
je 0x40611
bswapl %r14d
leaq 0xc(%rsp), %rsi
movl %r14d, (%rsi)
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x40450
cmpl $-0x1, %eax
je 0x40611
pushq $0x5
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbLoadLen
uint32_t rdbLoadLen(rio *rdb, int *isencoded) {
    unsigned char buf[2];
    uint32_t len;
    int type;

    if (isencoded) *isencoded = 0;
    if (rioRead(rdb,buf,1) == 0) return RDB_LENERR;
    type = (buf[0]&0xC0)>>6;
    if (type == RDB_ENCVAL) {
        /* Read a 6 bit encoding type. */
        if (isencoded) *isencoded = 1;
        return buf[0]&0x3F;
    } else if (type == RDB_6BITLEN) {
        /* Read a 6 bit len. */
        return buf[0]&0x3F;
    } else if (type == RDB_14BITLEN) {
        /* Read a 14 bit len. */
        if (rioRead(rdb,buf+1,1) == 0) return RDB_LENERR;
        return ((buf[0]&0x3F)<<8)|buf[1];
    } else if (type == RDB_32BITLEN) {
        /* Read a 32 bit len. */
        if (rioRead(rdb,&len,4) == 0) return RDB_LENERR;
        return ntohl(len);
    } else {
        rdbExitReportCorruptRDB(
            "Unknown length encoding %d in rdbLoadLen()",type);
        return -1; /* Never reached. */
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x40633
andl $0x0, (%r14)
leaq 0xa(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x40497
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x4066b
movzbl 0xa(%rsp), %eax
movl %eax, %ecx
shrl $0x6, %ecx
cmpl $0x3, %ecx
jne 0x4066f
testq %r14, %r14
je 0x40666
movl $0x1, (%r14)
andl $0x3f, %eax
jmp 0x406c6
movl %ebp, %eax
jmp 0x406c6
cmpb $0x40, %al
jb 0x406c6
cmpl $0x1, %ecx
jne 0x406a6
leaq 0xb(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x40497
movq %rax, %rcx
movl %ebp, %eax
testq %rcx, %rcx
je 0x406c6
movzbl 0xa(%rsp), %ecx
andl $0x3f, %ecx
shll $0x8, %ecx
movzbl 0xb(%rsp), %eax
orl %ecx, %eax
jmp 0x406c6
leaq 0xc(%rsp), %rsi
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x40497
movq %rax, %rcx
movl %ebp, %eax
testq %rcx, %rcx
je 0x406c6
movl 0xc(%rsp), %eax
bswapl %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbEncodeInteger
int rdbEncodeInteger(long long value, unsigned char *enc) {
    if (value >= -(1<<7) && value <= (1<<7)-1) {
        enc[0] = (RDB_ENCVAL<<6)|RDB_ENC_INT8;
        enc[1] = value&0xFF;
        return 2;
    } else if (value >= -(1<<15) && value <= (1<<15)-1) {
        enc[0] = (RDB_ENCVAL<<6)|RDB_ENC_INT16;
        enc[1] = value&0xFF;
        enc[2] = (value>>8)&0xFF;
        return 3;
    } else if (value >= -((long long)1<<31) && value <= ((long long)1<<31)-1) {
        enc[0] = (RDB_ENCVAL<<6)|RDB_ENC_INT32;
        enc[1] = value&0xFF;
        enc[2] = (value>>8)&0xFF;
        enc[3] = (value>>16)&0xFF;
        enc[4] = (value>>24)&0xFF;
        return 5;
    } else {
        return 0;
    }
}

// Assembly:
movq %rdi, %rcx
movsbq %cl, %rax
cmpq %rdi, %rax
jne 0x406e5
movb $-0x40, (%rsi)
pushq $0x2
popq %rax
pushq $0x1
jmp 0x40723
movswq %cx, %rax
cmpq %rcx, %rax
jne 0x406ff
movb $-0x3f, (%rsi)
movb %cl, 0x1(%rsi)
shrq $0x8, %rcx
pushq $0x3
popq %rax
pushq $0x2
jmp 0x40723
movslq %ecx, %rdx
xorl %eax, %eax
cmpq %rcx, %rdx
jne 0x40727
movb $-0x3e, (%rsi)
movb %cl, 0x1(%rsi)
movb %ch, 0x2(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x3(%rsi)
shrq $0x18, %rcx
pushq $0x5
popq %rax
pushq $0x4
popq %rdx
movb %cl, (%rsi,%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebx
cmpl $0x2, %esi
je 0x4077b
movl %esi, %edx
cmpl $0x1, %esi
je 0x40761
testl %edx, %edx
jne 0x407f7
leaq 0xc(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x40497
testq %rax, %rax
je 0x407b0
movsbq 0xc(%rsp), %rdx
jmp 0x40792
leaq 0xc(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x40497
testq %rax, %rax
je 0x407b0
movswq 0xc(%rsp), %rdx
jmp 0x40792
leaq 0xc(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x40497
testq %rax, %rax
je 0x407b0
movslq 0xc(%rsp), %rdx
testb $0x2, %bl
jne 0x407b4
movq %rdx, %rdi
testb $0x1, %bl
jne 0x407e2
callq 0x31930
xorl %edi, %edi
movq %rax, %rsi
callq 0x39d58
jmp 0x407e7
xorl %ebx, %ebx
jmp 0x407ea
leaq 0x10(%rsp), %r14
pushq $0x15
popq %rsi
movq %r14, %rdi
callq 0x39796
movslq %eax, %r15
movq %r15, %rdi
callq 0x327b9
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x26c50
jmp 0x407ea
callq 0x39e38
movq %rax, %rbx
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x73881(%rip), %rsi     # 0xb407f
movl $0xdf, %edi
xorl %eax, %eax
callq 0x40308
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbTryIntegerEncoding
int rdbTryIntegerEncoding(char *s, size_t len, unsigned char *enc) {
    long long value;
    char *endptr, buf[32];

    /* Check if it's possible to encode this value as a number */
    value = strtoll(s, &endptr, 10);
    if (endptr[0] != '\0') return 0;
    ll2string(buf,32,value);

    /* If the number converted back into a string is not identical
     * then it's not possible to encode the string as integer */
    if (strlen(buf) != len || memcmp(buf,s,len)) return 0;

    return rdbEncodeInteger(value,enc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rsp), %r13
pushq $0xa
popq %rdx
movq %r13, %rsi
callq 0x26af0
movq %rax, %r14
movq (%r13), %rax
xorl %ebp, %ebp
cmpb $0x0, (%rax)
jne 0x40880
leaq 0x10(%rsp), %r13
pushq $0x20
popq %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x39796
movq %r13, %rdi
callq 0x26500
cmpq %r15, %rax
jne 0x40880
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x266f0
testl %eax, %eax
jne 0x40880
movq %r14, %rdi
movq %rbx, %rsi
callq 0x406cf
movl %eax, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveLzfBlob
ssize_t rdbSaveLzfBlob(rio *rdb, void *data, size_t compress_len,
                       size_t original_len) {
    unsigned char byte;
    ssize_t n, nwritten = 0;

    /* Data compressed! Let's save it on disk */
    byte = (RDB_ENCVAL<<6)|RDB_ENC_LZF;
    if ((n = rdbWriteRaw(rdb,&byte,1)) == -1) goto writeerr;
    nwritten += n;

    if ((n = rdbSaveLen(rdb,compress_len)) == -1) goto writeerr;
    nwritten += n;

    if ((n = rdbSaveLen(rdb,original_len)) == -1) goto writeerr;
    nwritten += n;

    if ((n = rdbWriteRaw(rdb,data,compress_len)) == -1) goto writeerr;
    nwritten += n;

    return nwritten;

writeerr:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0xf(%rsp), %rsi
movb $-0x3d, (%rsi)
pushq $0x1
popq %rdx
callq 0x40450
pushq $-0x1
popq %rbx
cmpl $-0x1, %eax
je 0x40919
movl %eax, %ebp
movq %r15, 0x10(%rsp)
movq %r12, %rdi
movl %r14d, %esi
callq 0x40575
cmpl $-0x1, %eax
je 0x40919
movl %eax, %r15d
movq %r12, %rdi
movl %r13d, %esi
callq 0x40575
cmpl $-0x1, %eax
je 0x40919
movl %eax, %r13d
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x40450
cmpl $-0x1, %eax
je 0x40919
movslq %ebp, %rcx
cltq
movl %r15d, %edx
movl %r13d, %ebx
addq %rdx, %rbx
addq %rcx, %rbx
addq %rax, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveLzfStringObject
ssize_t rdbSaveLzfStringObject(rio *rdb, unsigned char *s, size_t len) {
    size_t comprlen, outlen;
    void *out;

    /* We require at least four bytes compression for this to be worth it */
    if (len <= 4) return 0;
    outlen = len-4;
    if ((out = zmalloc(outlen+1)) == NULL) return 0;
    comprlen = lzf_compress(s, len, out, outlen);
    if (comprlen == 0) {
        zfree(out);
        return 0;
    }
    ssize_t nwritten = rdbSaveLzfBlob(rdb, out, comprlen, len);
    zfree(out);
    return nwritten;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x5, %rdx
jb 0x4097e
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq -0x3(%rdx), %rdi
callq 0x327b9
testq %rax, %rax
je 0x4097e
movq %rax, %rbx
leal -0x4(%r14), %ecx
movq %r12, %rdi
movl %r14d, %esi
movq %rax, %rdx
callq 0x32be0
testl %eax, %eax
je 0x40983
movl %eax, %edx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x40891
movq %rax, %r14
jmp 0x40986
xorl %r14d, %r14d
jmp 0x4098e
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x328f9
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbLoadLzfStringObject
void *rdbLoadLzfStringObject(rio *rdb, int flags) {
    int plain = flags & RDB_LOAD_PLAIN;
    unsigned int len, clen;
    unsigned char *c = NULL;
    sds val = NULL;

    if ((clen = rdbLoadLen(rdb,NULL)) == RDB_LENERR) return NULL;
    if ((len = rdbLoadLen(rdb,NULL)) == RDB_LENERR) return NULL;
    if ((c = zmalloc(clen)) == NULL) goto err;

    /* Allocate our target according to the uncompressed size. */
    if (plain) {
        val = zmalloc(len);
    } else {
        if ((val = sdsnewlen(NULL,len)) == NULL) goto err;
    }

    /* Load the compressed representation and uncompress it to target. */
    if (rioRead(rdb,c,clen) == 0) goto err;
    if (lzf_decompress(c,clen,val,len) == 0) {
        if (rdbCheckMode) rdbCheckSetError("Invalid LZF compressed string");
        goto err;
    }
    zfree(c);

    if (plain)
        return val;
    else
        return createObject(OBJ_STRING,val);
err:
    zfree(c);
    if (plain)
        zfree(val);
    else
        sdsfree(val);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r12
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x4061c
cmpl $-0x1, %eax
je 0x40ac6
movl %eax, %ebp
xorl %r14d, %r14d
movq %r12, %rdi
xorl %esi, %esi
callq 0x4061c
cmpl $-0x1, %eax
je 0x40ac6
movl %eax, %r13d
movl %ebx, 0xc(%rsp)
movl %ebp, %ebx
movq %rbx, %rdi
callq 0x327b9
movq %rax, %r15
testq %rax, %rax
je 0x40a1b
movl %r13d, %esi
testb $0x2, 0xc(%rsp)
jne 0x40a26
movq $0x0, 0x10(%rsp)
xorl %edi, %edi
callq 0x31018
movq %rax, %r14
testq %rax, %rax
jne 0x40a31
jmp 0x40a9e
movq $0x0, 0x10(%rsp)
jmp 0x40a9e
movq %rsi, %rdi
callq 0x327b9
movq %rax, %r14
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x40497
testq %rax, %rax
je 0x40a99
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
movl %r13d, %ecx
callq 0x33010
testl %eax, %eax
je 0x40a7f
movq %r15, %rdi
callq 0x328f9
testb $0x2, 0xc(%rsp)
jne 0x40ac6
xorl %edi, %edi
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x39d58
leaq 0xcdf0a(%rip), %rax     # 0x10e990
cmpl $0x0, (%rax)
je 0x40a99
leaq 0x73612(%rip), %rdi     # 0xb40a4
xorl %eax, %eax
callq 0x732ad
movq %r14, 0x10(%rsp)
movq %r15, %rdi
callq 0x328f9
testb $0x2, 0xc(%rsp)
jne 0x40ab9
movq 0x10(%rsp), %rdi
callq 0x311c8
jmp 0x40ac3
movq 0x10(%rsp), %rdi
callq 0x328f9
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveRawString
ssize_t rdbSaveRawString(rio *rdb, unsigned char *s, size_t len) {
    int enclen;
    ssize_t n, nwritten = 0;

    /* Try integer encoding */
    if (len <= 11) {
        unsigned char buf[5];
        if ((enclen = rdbTryIntegerEncoding((char*)s,len,buf)) > 0) {
            if (rdbWriteRaw(rdb,buf,enclen) == -1) return -1;
            return enclen;
        }
    }

    /* Try LZF compression - under 20 bytes it's unable to compress even
     * aaaaaaaaaaaaaaaaaa so skip it */
    if (server.rdb_compression && len > 20) {
        n = rdbSaveLzfStringObject(rdb,s,len);
        if (n == -1) return -1;
        if (n > 0) return n;
        /* Return value of 0 means data can't be compressed, save the old way */
    }

    /* Store verbatim */
    if ((n = rdbSaveLen(rdb,len)) == -1) return -1;
    nwritten += n;
    if (len > 0) {
        if (rdbWriteRaw(rdb,s,len) == -1) return -1;
        nwritten += len;
    }
    return nwritten;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpq $0xb, %rdx
ja 0x40b27
leaq 0xb(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4080a
testl %eax, %eax
je 0x40b27
movl %eax, %ebx
leaq 0xb(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x40450
cmpl $-0x1, %eax
pushq $-0x1
popq %r12
cmovneq %rbx, %r12
jmp 0x40b97
pushq $-0x1
popq %r13
cmpq $0x15, %rbx
jb 0x40b5d
leaq 0xb8d70(%rip), %rax     # 0xf98a8
cmpl $0x0, 0x750(%rax)
je 0x40b5d
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4092b
cmpq $-0x1, %rax
je 0x40b94
movq %rax, %r12
testq %rax, %rax
jg 0x40b97
movq %r14, %rdi
movl %ebx, %esi
callq 0x40575
movq %r13, %r12
cmpl $-0x1, %eax
je 0x40b97
movslq %eax, %r12
testq %rbx, %rbx
je 0x40b97
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x40450
addq %rbx, %r12
cmpl $-0x1, %eax
pushq $-0x1
popq %rax
cmoveq %rax, %r12
jmp 0x40b97
movq %r13, %r12
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveLongLongAsStringObject
ssize_t rdbSaveLongLongAsStringObject(rio *rdb, long long value) {
    unsigned char buf[32];
    ssize_t n, nwritten = 0;
    int enclen = rdbEncodeInteger(value,buf);
    if (enclen > 0) {
        return rdbWriteRaw(rdb,buf,enclen);
    } else {
        /* Encode as string */
        enclen = ll2string((char*)buf,32,value);
        serverAssert(enclen < 32);
        if ((n = rdbSaveLen(rdb,enclen)) == -1) return -1;
        nwritten += n;
        if ((n = rdbWriteRaw(rdb,buf,enclen)) == -1) return -1;
        nwritten += n;
    }
    return nwritten;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rsi
movq %r14, %rdi
callq 0x406cf
testl %eax, %eax
je 0x40be5
movl %eax, %edx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x40450
movslq %eax, %r14
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
pushq $0x20
popq %rsi
movq %r14, %rdx
callq 0x39796
cmpl $0x20, %eax
jge 0x40c2e
movl %eax, %r15d
movq %rbx, %rdi
movl %eax, %esi
callq 0x40575
pushq $-0x1
popq %r14
cmpl $-0x1, %eax
je 0x40bd7
movl %eax, %ebp
movslq %r15d, %rdx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x40450
cmpl $-0x1, %eax
je 0x40bd7
movslq %ebp, %rcx
movslq %eax, %r14
addq %rcx, %r14
jmp 0x40bd7
leaq 0x7348d(%rip), %rdi     # 0xb40c2
leaq 0x73492(%rip), %rsi     # 0xb40ce
movl $0x181, %edx            # imm = 0x181
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveStringObject
int rdbSaveStringObject(rio *rdb, robj *obj) {
    /* Avoid to decode the object, then encode it again, if the
     * object is already integer encoded. */
    if (obj->encoding == OBJ_ENCODING_INT) {
        return rdbSaveLongLongAsStringObject(rdb,(long)obj->ptr);
    } else {
        serverAssertWithInfo(NULL,obj,sdsEncodedObject(obj));
        return rdbSaveRawString(rdb,obj->ptr,sdslen(obj->ptr));
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rsi), %eax
shrl $0x4, %eax
andl $0xf, %eax
je 0x40c77
cmpl $0x8, %eax
je 0x40c77
cmpl $0x1, %eax
jne 0x40c99
movq 0x8(%rsi), %rsi
movq %rbx, %rdi
callq 0x40ba8
jmp 0x40c91
movq 0x8(%rsi), %r14
movq %r14, %rdi
callq 0x40cbc
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x40ad8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x73434(%rip), %rdx     # 0xb40d4
leaq 0x73427(%rip), %rcx     # 0xb40ce
xorl %edi, %edi
movl $0x191, %r8d            # imm = 0x191
callq 0x588a4
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbGenericLoadStringObject
void *rdbGenericLoadStringObject(rio *rdb, int flags) {
    int encode = flags & RDB_LOAD_ENC;
    int plain = flags & RDB_LOAD_PLAIN;
    int isencoded;
    uint32_t len;

    len = rdbLoadLen(rdb,&isencoded);
    if (isencoded) {
        switch(len) {
        case RDB_ENC_INT8:
        case RDB_ENC_INT16:
        case RDB_ENC_INT32:
            return rdbLoadIntegerObject(rdb,len,flags);
        case RDB_ENC_LZF:
            return rdbLoadLzfStringObject(rdb,flags);
        default:
            rdbExitReportCorruptRDB("Unknown RDB string encoding type %d",len);
        }
    }

    if (len == RDB_LENERR) return NULL;
    if (!plain) {
        robj *o = encode ? createStringObject(NULL,len) :
                           createRawStringObject(NULL,len);
        if (len && rioRead(rdb,o->ptr,len) == 0) {
            decrRefCount(o);
            return NULL;
        }
        return o;
    } else {
        void *buf = zmalloc(len);
        if (len && rioRead(rdb,buf,len) == 0) {
            zfree(buf);
            return NULL;
        }
        return buf;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x4(%rsp), %r15
movq %r15, %rsi
callq 0x4061c
movl %eax, %ebp
cmpl $0x0, (%r15)
je 0x40d2a
cmpl $0x3, %ebp
jae 0x40d4e
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %edx
callq 0x40728
jmp 0x40d5b
cmpl $-0x1, %ebp
je 0x40db4
movl %ebp, %r15d
testb $0x2, %r14b
jne 0x40d60
xorl %edi, %edi
movq %r15, %rsi
testb $0x1, %r14b
jne 0x40d8c
callq 0x39d91
jmp 0x40d91
jne 0x40dc5
movq %rbx, %rdi
movl %r14d, %esi
callq 0x4099d
movq %rax, %r14
jmp 0x40db7
movq %r15, %rdi
callq 0x327b9
movq %rax, %r14
testl %ebp, %ebp
je 0x40db7
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x40497
testq %rax, %rax
jne 0x40db7
movq %r14, %rdi
callq 0x328f9
jmp 0x40db4
callq 0x39e29
movq %rax, %r14
testl %ebp, %ebp
je 0x40db7
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x40497
testq %rax, %rax
jne 0x40db7
movq %r14, %rdi
callq 0x3a265
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7331e(%rip), %rsi     # 0xb40ea
movl $0x1b1, %edi            # imm = 0x1B1
movl %ebp, %edx
xorl %eax, %eax
callq 0x40308
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveDoubleValue
int rdbSaveDoubleValue(rio *rdb, double val) {
    unsigned char buf[128];
    int len;

    if (isnan(val)) {
        buf[0] = 253;
        len = 1;
    } else if (!isfinite(val)) {
        len = 1;
        buf[0] = (val < 0) ? 255 : 254;
    } else {
#if (DBL_MANT_DIG >= 52) && (LLONG_MAX == 0x7fffffffffffffffLL)
        /* Check if the float is in a safe range to be casted into a
         * long long. We are assuming that long long is 64 bit here.
         * Also we are assuming that there are no implementations around where
         * double has precision < 52 bit.
         *
         * Under this assumptions we test if a double is inside an interval
         * where casting to long long is safe. Then using two castings we
         * make sure the decimal part is zero. If all this is true we use
         * integer printing function that is much faster. */
        double min = -4503599627370495; /* (2^52)-1 */
        double max = 4503599627370496; /* -(2^52) */
        if (val > min && val < max && val == ((double)((long long)val)))
            ll2string((char*)buf+1,sizeof(buf)-1,(long long)val);
        else
#endif
            snprintf((char*)buf+1,sizeof(buf)-1,"%.17g",val);
        buf[0] = strlen((char*)buf+1);
        len = buf[0]+1;
    }
    return rdbWriteRaw(rdb,buf,len);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
ucomisd %xmm0, %xmm0
jp 0x40e6b
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jl 0x40e2a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
seta %al
orb $-0x2, %al
movb %al, (%rsp)
pushq $0x1
popq %rdx
jmp 0x40e55
leaq 0x1(%rsp), %r14
leaq 0x70b1d(%rip), %rdx     # 0xb1953
pushq $0x7f
popq %rsi
movq %r14, %rdi
movb $0x1, %al
callq 0x26120
movq %r14, %rdi
callq 0x26500
movb %al, -0x1(%r14)
movzbl %al, %edx
incq %rdx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x40450
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movb $-0x3, (%rsp)
jmp 0x40e25
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbLoadDoubleValue
int rdbLoadDoubleValue(rio *rdb, double *val) {
    char buf[256];
    unsigned char len;

    if (rioRead(rdb,&len,1) == 0) return -1;
    switch(len) {
    case 255: *val = R_NegInf; return 0;
    case 254: *val = R_PosInf; return 0;
    case 253: *val = R_Nan; return 0;
    default:
        if (rioRead(rdb,buf,len) == 0) return -1;
        buf[len] = '\0';
        sscanf(buf, "%lg", val);
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x40497
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x40ed7
movzbl 0xf(%rsp), %edx
cmpl $0xfd, %edx
je 0x40ec6
cmpl $0xfe, %edx
je 0x40ebd
cmpl $0xff, %edx
jne 0x40ee5
leaq 0xcd095(%rip), %rax     # 0x10df50
jmp 0x40ecd
leaq 0xcd084(%rip), %rax     # 0x10df48
jmp 0x40ecd
leaq 0xcd08b(%rip), %rax     # 0x10df58
movsd (%rax), %xmm0
movsd %xmm0, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x40497
testq %rax, %rax
je 0x40ed7
movzbl 0xf(%rsp), %eax
movb $0x0, 0x10(%rsp,%rax)
leaq 0x73206(%rip), %rsi     # 0xb410e
xorl %ebp, %ebp
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x26290
jmp 0x40ed7
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveObjectType
int rdbSaveObjectType(rio *rdb, robj *o) {
    switch (o->type) {
    case OBJ_STRING:
        return rdbSaveType(rdb,RDB_TYPE_STRING);
    case OBJ_LIST:
        if (o->encoding == OBJ_ENCODING_QUICKLIST)
            return rdbSaveType(rdb,RDB_TYPE_LIST_QUICKLIST);
        else
            serverPanic("Unknown list encoding");
    case OBJ_SET:
        if (o->encoding == OBJ_ENCODING_INTSET)
            return rdbSaveType(rdb,RDB_TYPE_SET_INTSET);
        else if (o->encoding == OBJ_ENCODING_HT)
            return rdbSaveType(rdb,RDB_TYPE_SET);
        else
            serverPanic("Unknown set encoding");
    case OBJ_ZSET:
        if (o->encoding == OBJ_ENCODING_ZIPLIST)
            return rdbSaveType(rdb,RDB_TYPE_ZSET_ZIPLIST);
        else if (o->encoding == OBJ_ENCODING_SKIPLIST)
            return rdbSaveType(rdb,RDB_TYPE_ZSET);
        else
            serverPanic("Unknown sorted set encoding");
    case OBJ_HASH:
        if (o->encoding == OBJ_ENCODING_ZIPLIST)
            return rdbSaveType(rdb,RDB_TYPE_HASH_ZIPLIST);
        else if (o->encoding == OBJ_ENCODING_HT)
            return rdbSaveType(rdb,RDB_TYPE_HASH);
        else
            serverPanic("Unknown hash encoding");
    default:
        serverPanic("Unknown object type");
    }
    return -1; /* avoid warning */
}

// Assembly:
pushq %rax
movl (%rsi), %eax
movl %eax, %ecx
andl $0xf, %ecx
cmpl $0x4, %ecx
ja 0x40fae
leaq 0x7301d(%rip), %rdx     # 0xb3f50
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
xorl %ecx, %ecx
jmp 0x40f90
shrl $0x4, %eax
andl $0xf, %eax
movb $0xd, %cl
cmpl $0x5, %eax
je 0x40f90
cmpl $0x2, %eax
jne 0x40fc3
movb $0x4, %cl
jmp 0x40f90
shrl $0x4, %eax
andl $0xf, %eax
movb $0xb, %cl
cmpl $0x6, %eax
je 0x40f90
cmpl $0x2, %eax
jne 0x40fd8
movb $0x2, %cl
jmp 0x40f90
shrl $0x4, %eax
andl $0xf, %eax
movb $0xc, %cl
cmpl $0x5, %eax
je 0x40f90
cmpl $0x7, %eax
jne 0x40fed
movb $0x3, %cl
jmp 0x40f90
andl $0xf0, %eax
movb $0xe, %cl
cmpl $0x90, %eax
jne 0x40f99
movzbl %cl, %esi
popq %rax
jmp 0x4043a
leaq 0x73172(%rip), %rdi     # 0xb4112
leaq 0x73127(%rip), %rsi     # 0xb40ce
movl $0x215, %edx            # imm = 0x215
jmp 0x41000
leaq 0x71649(%rip), %rdi     # 0xb25fe
leaq 0x73112(%rip), %rsi     # 0xb40ce
movl $0x22c, %edx            # imm = 0x22C
jmp 0x41000
leaq 0x73177(%rip), %rdi     # 0xb4141
leaq 0x730fd(%rip), %rsi     # 0xb40ce
movl $0x22a, %edx            # imm = 0x22A
jmp 0x41000
leaq 0x7314b(%rip), %rdi     # 0xb412a
leaq 0x730e8(%rip), %rsi     # 0xb40ce
movl $0x21c, %edx            # imm = 0x21C
jmp 0x41000
leaq 0x715aa(%rip), %rdi     # 0xb259e
leaq 0x730d3(%rip), %rsi     # 0xb40ce
movl $0x223, %edx            # imm = 0x223
callq 0x57b45
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveKeyValuePair
int rdbSaveKeyValuePair(rio *rdb, robj *key, robj *val,
                        long long expiretime, long long now)
{
    /* Save the expire time */
    if (expiretime != -1) {
        /* If this key is already expired skip it */
        if (expiretime < now) return 0;
        if (rdbSaveType(rdb,RDB_OPCODE_EXPIRETIME_MS) == -1) return -1;
        if (rdbSaveMillisecondTime(rdb,expiretime) == -1) return -1;
    }

    /* Save type, key, value */
    if (rdbSaveObjectType(rdb,val) == -1) return -1;
    if (rdbSaveStringObject(rdb,key) == -1) return -1;
    if (rdbSaveObject(rdb,val) == -1) return -1;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
pushq $-0x1
popq %rbp
cmpq $-0x1, %rcx
je 0x413e7
movq %rcx, %r12
xorl %eax, %eax
cmpq %r8, %rcx
jl 0x4142a
movq %r14, %rdi
movl $0xfc, %esi
callq 0x4043a
cmpl $-0x1, %eax
je 0x41428
movq %r14, %rdi
movq %r12, %rsi
callq 0x40537
cmpl $-0x1, %eax
je 0x41428
movq %r14, %rdi
movq %rbx, %rsi
callq 0x40f1b
cmpl $-0x1, %eax
je 0x41428
movq %r14, %rdi
movq %r15, %rsi
callq 0x40c4e
movl %eax, %ecx
movl %ebp, %eax
cmpl $-0x1, %ecx
je 0x4142a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4102b
xorl %ecx, %ecx
cmpq $-0x1, %rax
setne %cl
leal -0x1(,%rcx,2), %eax
jmp 0x4142a
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveAuxField
int rdbSaveAuxField(rio *rdb, void *key, size_t keylen, void *val, size_t vallen) {
    if (rdbSaveType(rdb,RDB_OPCODE_AUX) == -1) return -1;
    if (rdbSaveRawString(rdb,key,keylen) == -1) return -1;
    if (rdbSaveRawString(rdb,val,vallen) == -1) return -1;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movl $0xfa, %esi
callq 0x4043a
pushq $-0x1
popq %rbp
cmpl $-0x1, %eax
je 0x41491
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x40ad8
cmpq $-0x1, %rax
je 0x41491
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x40ad8
xorl %ecx, %ecx
cmpq $-0x1, %rax
setne %cl
leal -0x1(,%rcx,2), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveInfoAuxFields
int rdbSaveInfoAuxFields(rio *rdb) {
    int redis_bits = (sizeof(void*) == 8) ? 64 : 32;

    /* Add a few fields about the state when the RDB was created. */
    if (rdbSaveAuxFieldStrStr(rdb,"redis-ver",REDIS_VERSION) == -1) return -1;
    if (rdbSaveAuxFieldStrInt(rdb,"redis-bits",redis_bits) == -1) return -1;
    if (rdbSaveAuxFieldStrInt(rdb,"ctime",time(NULL)) == -1) return -1;
    if (rdbSaveAuxFieldStrInt(rdb,"used-mem",zmalloc_used_memory()) == -1) return -1;
    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x72c2a(%rip), %rsi     # 0xb4163
leaq 0x6fc99(%rip), %rdx     # 0xb11d9
callq 0x414a2
pushq $-0x1
popq %rbp
cmpl $-0x1, %eax
je 0x415a8
leaq 0x72c19(%rip), %rsi     # 0xb416d
pushq $0x40
popq %rdx
movq %rbx, %rdi
callq 0x414e5
cmpl $-0x1, %eax
je 0x415a8
xorl %edi, %edi
callq 0x26cd0
leaq 0x72c06(%rip), %rsi     # 0xb4178
movq %rbx, %rdi
movq %rax, %rdx
callq 0x414e5
cmpl $-0x1, %eax
je 0x415a8
callq 0x32960
leaq 0x72bf0(%rip), %rsi     # 0xb417e
movq %rbx, %rdi
movq %rax, %rdx
callq 0x414e5
xorl %ecx, %ecx
cmpl $-0x1, %eax
setne %cl
leal -0x1(,%rcx,2), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/./rio.h
// Function: rioWrite
static inline size_t rioWrite(rio *r, const void *buf, size_t len) {
    while (len) {
        size_t bytes_to_write = (r->max_processing_chunk && r->max_processing_chunk < len) ? r->max_processing_chunk : len;
        if (r->update_cksum) r->update_cksum(r,buf,bytes_to_write);
        if (r->write(r,buf,bytes_to_write) == 0)
            return 0;
        buf = (char*)buf + bytes_to_write;
        len -= bytes_to_write;
        r->processed_bytes += bytes_to_write;
    }
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x418a0
movq 0x20(%r12), %rax
movq 0x38(%r12), %rcx
cmpq %r14, %rcx
movq %r14, %r13
cmovbq %rcx, %r13
testq %rcx, %rcx
cmoveq %r14, %r13
testq %rax, %rax
je 0x4187e
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *%rax
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *0x8(%r12)
testq %rax, %rax
je 0x4189e
addq %r13, %r15
subq %r13, %r14
addq %r13, 0x30(%r12)
jmp 0x4184e
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveRioWithEOFMark
int rdbSaveRioWithEOFMark(rio *rdb, int *error) {
    char eofmark[RDB_EOF_MARK_SIZE];

    getRandomHexChars(eofmark,RDB_EOF_MARK_SIZE);
    if (error) *error = 0;
    if (rioWrite(rdb,"$EOF:",5) == 0) goto werr;
    if (rioWrite(rdb,eofmark,RDB_EOF_MARK_SIZE) == 0) goto werr;
    if (rioWrite(rdb,"\r\n",2) == 0) goto werr;
    if (rdbSaveRio(rdb,error) == C_ERR) goto werr;
    if (rioWrite(rdb,eofmark,RDB_EOF_MARK_SIZE) == 0) goto werr;
    return C_OK;

werr: /* Write error. */
    /* Set 'error' only if not already set by rdbSaveRio() call. */
    if (error && *error == 0) *error = errno;
    return C_ERR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rdi
pushq $0x28
popq %rsi
callq 0x39a57
testq %rbx, %rbx
je 0x418d0
andl $0x0, (%rbx)
leaq 0x728ba(%rip), %rsi     # 0xb4191
pushq $0x5
popq %rdx
movq %r14, %rdi
callq 0x41839
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x41951
movq %rsp, %rsi
pushq $0x28
popq %rdx
movq %r14, %rdi
callq 0x41839
testq %rax, %rax
je 0x41951
leaq 0x7388c(%rip), %rsi     # 0xb5190
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0x41839
testq %rax, %rax
je 0x41951
movq %r14, %rdi
movq %rbx, %rsi
callq 0x415b1
cmpl $-0x1, %eax
je 0x41951
testq %rbx, %rbx
sete %r15b
movq %rsp, %rsi
pushq $0x28
popq %rdx
movq %r14, %rdi
callq 0x41839
xorl %ecx, %ecx
testq %rax, %rax
sete %al
setne %dl
orb %r15b, %dl
je 0x41956
movb %al, %cl
negl %ecx
movl %ecx, %ebp
jmp 0x41964
testq %rbx, %rbx
je 0x41964
cmpl $0x0, (%rbx)
jne 0x41964
callq 0x26880
movl (%rax), %eax
movl %eax, (%rbx)
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: startLoading
void startLoading(FILE *fp) {
    struct stat sb;

    /* Load the DB */
    server.loading = 1;
    server.loading_start_time = time(NULL);
    server.loading_loaded_bytes = 0;
    if (fstat(fileno(fp), &sb) == -1) {
        server.loading_total_bytes = 0;
    } else {
        server.loading_total_bytes = sb.st_size;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
leaq 0xb7404(%rip), %r14     # 0xf98a8
movl $0x1, 0x31c(%r14)
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x26cd0
movq %rax, 0x330(%r14)
andq $0x0, 0x328(%r14)
movq %rbx, %rdi
callq 0x26070
movq %rsp, %rsi
movl %eax, %edi
callq 0x266e0
cmpl $-0x1, %eax
je 0x424e4
movq 0x30(%rsp), %r15
movq %r15, 0x320(%r14)
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbLoadProgressCallback
void rdbLoadProgressCallback(rio *r, const void *buf, size_t len) {
    if (server.rdb_checksum)
        rioGenericUpdateChecksum(r, buf, len);
    if (server.loading_process_events_interval_bytes &&
        (r->processed_bytes + len)/server.loading_process_events_interval_bytes > r->processed_bytes/server.loading_process_events_interval_bytes)
    {
        /* The DB can take some non trivial amount of time to load. Update
         * our cached time since it is used to create and update the last
         * interaction time with clients and for other important things. */
        updateCachedTime();
        if (server.masterhost && server.repl_state == REPL_STATE_TRANSFER)
            replicationSendNewlineToMaster();
        loadingProgress(r->processed_bytes);
        processEventsWhileBlocked();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
leaq 0xb7358(%rip), %r15     # 0xf98a8
cmpl $0x0, 0x754(%r15)
je 0x42565
movq %rbx, %rdi
movq %r14, %rdx
callq 0x66b7c
movq 0x338(%r15), %rdi
testq %rdi, %rdi
je 0x425c1
movq 0x30(%rbx), %rcx
addq %rcx, %r14
movq %r14, %rax
xorl %edx, %edx
divq %rdi
movq %rax, %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
cmpq %rax, %rsi
jbe 0x425c1
callq 0x2c1ab
cmpq $0x0, 0x828(%r15)
je 0x425ae
cmpl $0xe, 0x84c(%r15)
jne 0x425ae
callq 0x3e2aa
movq 0x30(%rbx), %rdi
callq 0x424f8
popq %rbx
popq %r14
popq %r15
jmp 0x39254
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: backgroundSaveDoneHandlerDisk
void backgroundSaveDoneHandlerDisk(int exitcode, int bysignal) {
    if (!bysignal && exitcode == 0) {
        serverLog(LL_NOTICE,
            "Background saving terminated with success");
        server.dirty = server.dirty - server.dirty_before_bgsave;
        server.lastsave = time(NULL);
        server.lastbgsave_status = C_OK;
    } else if (!bysignal && exitcode != 0) {
        serverLog(LL_WARNING, "Background saving error");
        server.lastbgsave_status = C_ERR;
    } else {
        mstime_t latency;

        serverLog(LL_WARNING,
            "Background saving terminated by signal %d", bysignal);
        latencyStartMonitor(latency);
        rdbRemoveTempFile(server.rdb_child_pid);
        latencyEndMonitor(latency);
        latencyAddSampleIfNeeded("rdb-unlink-temp-file",latency);
        /* SIGUSR1 is whitelisted, so we have a way to kill a child without
         * tirggering an error conditon. */
        if (bysignal != SIGUSR1)
            server.lastbgsave_status = C_ERR;
    }
    server.rdb_child_pid = -1;
    server.rdb_child_type = RDB_CHILD_TYPE_NONE;
    server.rdb_save_time_last = time(NULL)-server.rdb_save_time_start;
    server.rdb_save_time_start = -1;
    /* Possibly there are slaves waiting for a BGSAVE in order to be served
     * (the first stage of SYNC is a bulk transfer of dump.rdb) */
    updateSlavesWaitingBgsave((!bysignal && exitcode == 0) ? C_OK : C_ERR, RDB_CHILD_TYPE_DISK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
orl %edi, %ebp
je 0x42a06
movl %esi, %ebx
testl %esi, %esi
setne %al
testl %edi, %edi
sete %cl
orb %al, %cl
jne 0x42a3e
leaq 0x71b55(%rip), %rsi     # 0xb454c
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x2b699
jmp 0x42ab6
leaq 0x71b15(%rip), %rsi     # 0xb4522
xorl %ebx, %ebx
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x2b699
leaq 0xb6e88(%rip), %r14     # 0xf98a8
movq 0x728(%r14), %rax
subq %rax, 0x720(%r14)
xorl %edi, %edi
callq 0x26cd0
movq %rax, 0x758(%r14)
jmp 0x42ab9
leaq 0x71b1f(%rip), %rsi     # 0xb4564
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2b699
leaq 0xb6e4d(%rip), %r15     # 0xf98a8
cmpq $0x0, 0xa18(%r15)
je 0x42a6d
callq 0x2b8ae
movq %rax, %r14
movl 0x730(%r15), %edi
callq 0x41d27
cmpq $0x0, 0xa18(%r15)
je 0x42ab1
callq 0x2b8ae
subq %r14, %rax
movq 0xa18(%r15), %rcx
testq %rcx, %rcx
sete %dl
cmpq %rcx, %rax
setl %cl
orb %dl, %cl
jne 0x42ab1
leaq 0x71ae5(%rip), %rdi     # 0xb458e
movq %rax, %rsi
callq 0x71e85
cmpl $0xa, %ebx
je 0x42ac6
pushq $-0x1
popq %rbx
leaq 0xb6de8(%rip), %rax     # 0xf98a8
movl %ebx, 0x780(%rax)
leaq 0xb6ddb(%rip), %r14     # 0xf98a8
orl $-0x1, 0x730(%r14)
andl $0x0, 0x77c(%r14)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x26cd0
subq 0x770(%r14), %rax
movq %rax, 0x768(%r14)
orq $-0x1, 0x770(%r14)
negl %ebp
sbbl %ebx, %ebx
pushq $0x1
popq %rsi
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3e097
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: backgroundSaveDoneHandler
void backgroundSaveDoneHandler(int exitcode, int bysignal) {
    switch(server.rdb_child_type) {
    case RDB_CHILD_TYPE_DISK:
        backgroundSaveDoneHandlerDisk(exitcode,bysignal);
        break;
    case RDB_CHILD_TYPE_SOCKET:
        backgroundSaveDoneHandlerSocket(exitcode,bysignal);
        break;
    default:
        serverPanic("Unknown RDB child type.");
        break;
    }
}

// Assembly:
leaq 0xb6b82(%rip), %rax     # 0xf98a8
movl 0x77c(%rax), %eax
cmpl $0x2, %eax
je 0x42b14
cmpl $0x1, %eax
jne 0x42d3f
jmp 0x429d3
pushq %rax
leaq 0x71957(%rip), %rdi     # 0xb469e
leaq 0x71380(%rip), %rsi     # 0xb40ce
movl $0x624, %edx            # imm = 0x624
callq 0x57b45
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: saveCommand
void saveCommand(client *c) {
    if (server.rdb_child_pid != -1) {
        addReplyError(c,"Background save already in progress");
        return;
    }
    if (rdbSave(server.rdb_filename) == C_OK) {
        addReply(c,shared.ok);
    } else {
        addReply(c,shared.err);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xb6773(%rip), %rax     # 0xf98a8
cmpl $-0x1, 0x730(%rax)
je 0x4314e
leaq 0x715b1(%rip), %rsi     # 0xb46f6
movq %rbx, %rdi
popq %rbx
jmp 0x36b6f
movq 0x748(%rax), %rdi
callq 0x41971
testl %eax, %eax
je 0x4316b
leaq 0xb71ab(%rip), %rax     # 0xfa310
movq 0x10(%rax), %rsi
jmp 0x43176
leaq 0xb719e(%rip), %rax     # 0xfa310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x36987
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/rdb.c
// Function: bgsaveCommand
void bgsaveCommand(client *c) {
    int schedule = 0;

    /* The SCHEDULE option changes the behavior of BGSAVE when an AOF rewrite
     * is in progress. Instead of returning an error a BGSAVE gets scheduled. */
    if (c->argc > 1) {
        if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"schedule")) {
            schedule = 1;
        } else {
            addReply(c,shared.syntaxerr);
            return;
        }
    }

    if (server.rdb_child_pid != -1) {
        addReplyError(c,"Background save already in progress");
    } else if (server.aof_child_pid != -1) {
        if (schedule) {
            server.rdb_bgsave_scheduled = 1;
            addReplyStatus(c,"Background saving scheduled");
        } else {
            addReplyError(c,
                "An AOF log rewriting in progress: can't BGSAVE right now. "
                "Use BGSAVE SCHEDULE in order to schedule a BGSAVE whenver "
                "possible.");
        }
    } else if (rdbSaveBackground(server.rdb_filename) == C_OK) {
        addReplyStatus(c,"Background saving started");
    } else {
        addReply(c,shared.err);
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x38(%rdi), %ebp
cmpl $0x2, %ebp
jge 0x431b2
leaq 0xb6714(%rip), %rax     # 0xf98a8
cmpl $-0x1, 0x730(%rax)
je 0x431ec
leaq 0x71552(%rip), %rsi     # 0xb46f6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x36b6f
jne 0x431d0
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x71553(%rip), %rsi     # 0xb471a
callq 0x262f0
testl %eax, %eax
je 0x4318d
leaq 0xb7139(%rip), %rax     # 0xfa310
movq 0x80(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x36987
cmpl $-0x1, 0x69c(%rax)
je 0x43203
cmpl $0x2, %ebp
jge 0x43220
leaq 0x7153e(%rip), %rsi     # 0xb473f
jmp 0x431a4
movq 0x748(%rax), %rdi
callq 0x41b62
testl %eax, %eax
je 0x43233
leaq 0xb70f6(%rip), %rax     # 0xfa310
movq 0x10(%rax), %rsi
jmp 0x431de
movl $0x1, 0x778(%rax)
leaq 0x714f2(%rip), %rsi     # 0xb4723
jmp 0x4323a
leaq 0x71583(%rip), %rsi     # 0xb47bd
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x36cc3
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/t_string.c
// Function: setGenericCommand
void setGenericCommand(client *c, int flags, robj *key, robj *val, robj *expire, int unit, robj *ok_reply, robj *abort_reply) {
    long long milliseconds = 0; /* initialized to avoid any harmness warning */

    if (expire) {
        if (getLongLongFromObjectOrReply(c, expire, &milliseconds, NULL) != C_OK)
            return;
        if (milliseconds <= 0) {
            addReplyErrorFormat(c,"invalid expire time in %s",c->cmd->name);
            return;
        }
        if (unit == UNIT_SECONDS) milliseconds *= 1000;
    }

    if ((flags & OBJ_SET_NX && lookupKeyWrite(c->db,key) != NULL) ||
        (flags & OBJ_SET_XX && lookupKeyWrite(c->db,key) == NULL))
    {
        addReply(c, abort_reply ? abort_reply : shared.nullbulk);
        return;
    }
    setKey(c->db,key,val);
    server.dirty++;
    if (expire) setExpire(c->db,key,mstime()+milliseconds);
    notifyKeyspaceEvent(NOTIFY_STRING,"set",key,c->db->id);
    if (expire) notifyKeyspaceEvent(NOTIFY_GENERIC,
        "expire",key,c->db->id);
    addReply(c, ok_reply ? ok_reply : shared.ok);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
andq $0x0, (%rsp)
testq %r8, %r8
je 0x432a3
movl %r9d, %r13d
movq %rsp, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x3ab03
testl %eax, %eax
jne 0x4338e
movq (%rsp), %rax
testq %rax, %rax
jle 0x4339d
testl %r13d, %r13d
jne 0x432a3
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, (%rsp)
testb $0x1, %bpl
je 0x432be
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x3aec2
testq %rax, %rax
jne 0x43342
testb $0x2, %bpl
je 0x432d5
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x3aec2
testq %rax, %rax
je 0x43342
movq 0x40(%rsp), %r13
movq 0x10(%rbx), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3b076
leaq 0xb65b8(%rip), %rax     # 0xf98a8
incq 0x720(%rax)
movq 0x10(%rbx), %r12
testq %r15, %r15
je 0x4335c
callq 0x2b8ae
addq (%rsp), %rax
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3c14f
movq 0x10(%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0x6c490(%rip), %rsi     # 0xaf7b5
pushq $0x8
popq %rdi
movq %r14, %rdx
callq 0x6fb58
movq 0x10(%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0x7cb95(%rip), %rsi     # 0xbfed3
pushq $0x4
jmp 0x4336a
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
jne 0x43357
leaq 0xb6fbd(%rip), %rax     # 0xfa310
movq 0x50(%rax), %rsi
movq %rbx, %rdi
jmp 0x43389
movl 0x30(%r12), %ecx
leaq 0x6c44d(%rip), %rsi     # 0xaf7b5
pushq $0x8
popq %rdi
movq %r14, %rdx
callq 0x6fb58
testq %r13, %r13
jne 0x43383
leaq 0xb6f91(%rip), %rax     # 0xfa310
movq 0x8(%rax), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x36987
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rbx), %rax
movq (%rax), %rdx
leaq 0x71441(%rip), %rsi     # 0xb47ec
movq %rbx, %rdi
xorl %eax, %eax
callq 0x36b96
jmp 0x4338e
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/t_string.c
// Function: getGenericCommand
int getGenericCommand(client *c) {
    robj *o;

    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL)
        return C_OK;

    if (o->type != OBJ_STRING) {
        addReply(c,shared.wrongtypeerr);
        return C_ERR;
    } else {
        addReplyBulk(c,o);
        return C_OK;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0xb6c95(%rip), %r14     # 0xfa310
movq 0x50(%r14), %rdx
callq 0x3aee5
xorl %ebp, %ebp
testq %rax, %rax
je 0x436ac
testb $0xf, (%rax)
je 0x436a1
movq 0x70(%r14), %rsi
movq %rbx, %rdi
callq 0x36987
pushq $-0x1
popq %rbp
jmp 0x436ac
movq %rbx, %rdi
movq %rax, %rsi
callq 0x36fd9
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/t_string.c
// Function: getsetCommand
void getsetCommand(client *c) {
    if (getGenericCommand(c) == C_ERR) return;
    c->argv[2] = tryObjectEncoding(c->argv[2]);
    setKey(c->db,c->argv[1],c->argv[2]);
    notifyKeyspaceEvent(NOTIFY_STRING,"set",c->argv[1],c->db->id);
    server.dirty++;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x43665
cmpl $-0x1, %eax
je 0x4371c
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x3a3ad
movq 0x40(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x3b076
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x6c0af(%rip), %rsi     # 0xaf7b5
pushq $0x8
popq %rdi
callq 0x6fb58
leaq 0xb6193(%rip), %rax     # 0xf98a8
incq 0x720(%rax)
popq %rbx
retq