LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: persistCommand
void persistCommand(client *c) {
    if (lookupKeyWrite(c->db,c->argv[1])) {
        if (removeExpire(c->db,c->argv[1])) {
            addReply(c,shared.cone);
            server.dirty++;
        } else {
            addReply(c,shared.czero);
        }
    } else {
        addReply(c,shared.czero);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4a6f0
cmpq $0x0, %rax
je 0x4cd65
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4a9e0
cmpl $0x0, %eax
je 0x4cd4f
movq -0x8(%rbp), %rdi
leaq 0x12bf1c(%rip), %rax    # 0x178c40
movq 0x28(%rax), %rsi
callq 0x42cc0
leaq 0x12b4a4(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x12b492(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
jmp 0x4cd63
movq -0x8(%rbp), %rdi
leaq 0x12bee6(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rsi
callq 0x42cc0
jmp 0x4cd79
movq -0x8(%rbp), %rdi
leaq 0x12bed0(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rsi
callq 0x42cc0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: touchCommand
void touchCommand(client *c) {
    int touched = 0;
    for (int j = 1; j < c->argc; j++)
        if (lookupKeyRead(c->db,c->argv[j]) != NULL) touched++;
    addReplyLongLong(c,touched);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x1, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x4cddf
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x4a6c0
cmpq $0x0, %rax
je 0x4cdd2
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4cdd4
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4cd9a
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x43780
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: getKeysUsingCommandTable
int *getKeysUsingCommandTable(struct redisCommand *cmd,robj **argv, int argc, int *numkeys) {
    int j, i = 0, last, *keys;
    UNUSED(argv);

    if (cmd->firstkey == 0) {
        *numkeys = 0;
        return NULL;
    }
    last = cmd->lastkey;
    if (last < 0) last = argc+last;
    keys = zmalloc(sizeof(int)*((last - cmd->firstkey)+1));
    for (j = cmd->firstkey; j <= last; j += cmd->keystep) {
        serverAssert(j < argc);
        keys[i++] = j;
    }
    *numkeys = i;
    return keys;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x4ce3f
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x4ceeb
movq -0x10(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x4ce58
movl -0x1c(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
subl 0x30(%rcx), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x3acd0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jg 0x4ceda
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x4ce91
jmp 0x4ceb3
leaq 0xeebb8(%rip), %rdi     # 0x13ba50
leaq 0xf0303(%rip), %rsi     # 0x13d1a2
movl $0x432, %edx            # imm = 0x432
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movl -0x2c(%rbp), %edx
movq -0x40(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x4ce7f
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: getKeysFromCommand
int *getKeysFromCommand(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    if (cmd->getkeys_proc) {
        return cmd->getkeys_proc(cmd,argv,argc,numkeys);
    } else {
        return getKeysUsingCommandTable(cmd,argv,argc,numkeys);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x4cf41
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq *%rax
movq %rax, -0x8(%rbp)
jmp 0x4cf59
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0x4ce00
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: zunionInterGetKeys
int *zunionInterGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, *keys;
    UNUSED(cmd);

    num = atoi(argv[2]->ptr);
    /* Sanity check. Don't return any key if the command is going to
     * reply with syntax error. */
    if (num > (argc-3)) {
        *numkeys = 0;
        return NULL;
    }

    /* Keys in z{union,inter}store come from two places:
     * argv[1] = storage key,
     * argv[3...n] = keys to intersect */
    keys = zmalloc(sizeof(int)*(num+1));

    /* Add all key positions for argv[3...n] to keys[] */
    for (i = 0; i < num; i++) keys[i] = 3+i;

    /* Finally add the argv[1] key position (the storage key target). */
    keys[num] = 1;
    *numkeys = num+1;  /* Total keys = {union,inter} keys + storage key */
    return keys;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x26760
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jle 0x4cfdc
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x4d040
movl -0x30(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x3acd0
movq %rax, -0x38(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x4d01d
movl -0x2c(%rbp), %edx
addl $0x3, %edx
movq -0x38(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4cff9
movq -0x38(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: evalGetKeys
int *evalGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, *keys;
    UNUSED(cmd);

    num = atoi(argv[2]->ptr);
    /* Sanity check. Don't return any key if the command is going to
     * reply with syntax error. */
    if (num > (argc-3)) {
        *numkeys = 0;
        return NULL;
    }

    keys = zmalloc(sizeof(int)*num);
    *numkeys = num;

    /* Add all key positions for argv[3...n] to keys[] */
    for (i = 0; i < num; i++) keys[i] = 3+i;

    return keys;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x26760
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jle 0x4d09c
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x4d0e9
movslq -0x30(%rbp), %rdi
shlq $0x2, %rdi
callq 0x3acd0
movq %rax, -0x38(%rbp)
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x4d0e1
movl -0x2c(%rbp), %edx
addl $0x3, %edx
movq -0x38(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4d0bd
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: migrateGetKeys
int *migrateGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, first, *keys;
    UNUSED(cmd);

    /* Assume the obvious form. */
    first = 3;
    num = 1;

    /* But check for the extended one with the KEYS option. */
    if (argc > 6) {
        for (i = 6; i < argc; i++) {
            if (!strcasecmp(argv[i]->ptr,"keys") &&
                sdslen(argv[3]->ptr) == 0)
            {
                first = i+1;
                num = argc-first;
                break;
            }
        }
    }

    keys = zmalloc(sizeof(int)*num);
    for (i = 0; i < num; i++) keys[i] = first+i;
    *numkeys = num;
    return keys;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x3, -0x2c(%rbp)
movl $0x1, -0x28(%rbp)
cmpl $0x6, -0x14(%rbp)
jle 0x4d2f5
movl $0x6, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4d2f3
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xf5979(%rip), %rsi     # 0x142c2a
callq 0x26300
cmpl $0x0, %eax
jne 0x4d2e6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x4ab80
cmpq $0x0, %rax
jne 0x4d2e6
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x14(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x4d2f3
jmp 0x4d2e8
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4d292
jmp 0x4d2f5
movslq -0x28(%rbp), %rdi
shlq $0x2, %rdi
callq 0x3acd0
movq %rax, -0x38(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x4d331
movl -0x2c(%rbp), %edx
addl -0x24(%rbp), %edx
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4d30d
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: georadiusGetKeys
int *georadiusGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, *keys;
    UNUSED(cmd);

    /* Check for the presence of the stored key in the command */
    int stored_key = -1;
    for (i = 5; i < argc; i++) {
        char *arg = argv[i]->ptr;
        /* For the case when user specifies both "store" and "storedist" options, the
         * second key specified would override the first key. This behavior is kept 
         * the same as in georadiusCommand method.
         */
        if ((!strcasecmp(arg, "store") || !strcasecmp(arg, "storedist")) && ((i+1) < argc)) {
            stored_key = i+1;
            i++;
        }
    }
    num = 1 + (stored_key == -1 ? 0 : 1);

    /* Keys in the command come from two places:
     * argv[1] = key,
     * argv[5...n] = stored key if present
     */
    keys = zmalloc(sizeof(int) * num);

    /* Add all key positions to keys[] */
    keys[0] = 1;
    if(num > 1) {
         keys[1] = stored_key;
    }
    *numkeys = num; 
    return keys;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl $0x5, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4d3e5
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq 0xea4d2(%rip), %rsi     # 0x13786e
callq 0x26300
cmpl $0x0, %eax
je 0x4d3bb
movq -0x40(%rbp), %rdi
leaq 0xee6a8(%rip), %rsi     # 0x13ba59
callq 0x26300
cmpl $0x0, %eax
jne 0x4d3d8
movl -0x24(%rbp), %eax
addl $0x1, %eax
cmpl -0x14(%rbp), %eax
jge 0x4d3d8
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4d3da
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4d375
movl -0x34(%rbp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $-0x1, %edx
cmovel %ecx, %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movslq -0x28(%rbp), %rdi
shlq $0x2, %rdi
callq 0x3acd0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
cmpl $0x1, -0x28(%rbp)
jle 0x4d426
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: getKeysInSlot
unsigned int getKeysInSlot(unsigned int hashslot, robj **keys, unsigned int count) {
    zskiplistNode *n;
    zrangespec range;
    int j = 0;

    range.min = range.max = hashslot;
    range.minex = range.maxex = 0;

    n = zslFirstInRange(server.cluster->slots_to_keys, &range);
    while(n && n->score == hashslot && count--) {
        keys[j++] = n->obj;
        n = n->level[0].forward;
    }
    return j;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x4(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
leaq 0x12ad58(%rip), %rax    # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x60028(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5eb90
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x3d(%rbp)
je 0x4d4d9
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
movl -0x4(%rbp), %eax
cvtsi2sd %rax, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x3d(%rbp)
jne 0x4d4d9
jp 0x4d4d9
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
testb $0x1, %al
jne 0x4d4e2
jmp 0x4d50d
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x3c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x4d49b
movl -0x3c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: delKeysInSlot
unsigned int delKeysInSlot(unsigned int hashslot) {
    zskiplistNode *n;
    zrangespec range;
    int j = 0;

    range.min = range.max = hashslot;
    range.minex = range.maxex = 0;

    n = zslFirstInRange(server.cluster->slots_to_keys, &range);
    while(n && n->score == hashslot) {
        robj *key = n->obj;
        n = n->level[0].forward; /* Go to the next item before freeing it. */
        incrRefCount(key); /* Protect the object while freeing it. */
        dbDelete(&server.db[0],key);
        decrRefCount(key);
        j++;
    }
    return j;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x4(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
leaq 0x12ac7f(%rip), %rax    # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x60028(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5eb90
movq %rax, -0x10(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x39(%rbp)
je 0x4d5a0
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movl -0x4(%rbp), %eax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
sete %al
setnp %cl
andb %cl, %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x4d5a9
jmp 0x4d5f1
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rdi
callq 0x487b0
leaq 0x12ac08(%rip), %rax    # 0x1781d8
movq 0x28(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x4ac10
movq -0x38(%rbp), %rdi
callq 0x48f70
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4d574
movl -0x2c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/db.c
// Function: countKeysInSlot
unsigned int countKeysInSlot(unsigned int hashslot) {
    zskiplist *zsl = server.cluster->slots_to_keys;
    zskiplistNode *zn;
    zrangespec range;
    int rank, count = 0;

    range.min = range.max = hashslot;
    range.minex = range.maxex = 0;

    /* Find first element in range */
    zn = zslFirstInRange(zsl, &range);

    /* Use rank of first element, if any, to determine preliminary count */
    if (zn != NULL) {
        rank = zslGetRank(zsl, zn->score, zn->obj);
        count = (zsl->length - (rank - 1));

        /* Find last element in range */
        zn = zslLastInRange(zsl, &range);

        /* Use rank of last element, if any, to determine the actual count */
        if (zn != NULL) {
            rank = zslGetRank(zsl, zn->score, zn->obj);
            count -= (zsl->length - rank);
        }
    }
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
leaq 0x12abc6(%rip), %rax    # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x60028(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x4(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd %xmm0, -0x30(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5eb90
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4d6e9
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x5f590
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
subq %rcx, %rax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5ecd0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4d6e7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x5f590
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x34(%rbp), %rax
subq %rax, %rcx
movslq -0x38(%rbp), %rax
subq %rcx, %rax
movl %eax, -0x38(%rbp)
jmp 0x4d6e9
movl -0x38(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationGetSlaveName
char *replicationGetSlaveName(client *c) {
    static char buf[NET_PEER_ID_LEN];
    char ip[NET_IP_STR_LEN];

    ip[0] = '\0';
    buf[0] = '\0';
    if (c->slave_ip[0] != '\0' ||
        anetPeerToString(c->fd,ip,sizeof(ip),NULL) != -1)
    {
        /* Note that the 'ip' buffer is always larger than 'c->slave_ip' */
        if (c->slave_ip[0] != '\0') memcpy(ip,c->slave_ip,sizeof(c->slave_ip));

        if (c->slave_listening_port)
            anetFormatAddr(buf,sizeof(buf),ip,c->slave_listening_port);
        else
            snprintf(buf,sizeof(buf),"%s:<unknown-slave-port>",ip);
    } else {
        snprintf(buf,sizeof(buf),"client id #%llu",
            (unsigned long long) c->id);
    }
    return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x40(%rbp)
movb $0x0, 0x13f379(%rip)    # 0x18ca90
movq -0x8(%rbp), %rax
movsbl 0x118(%rax), %eax
cmpl $0x0, %eax
jne 0x4d745
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edi
leaq -0x40(%rbp), %rsi
movl $0x2e, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x2cbf0
cmpl $-0x1, %eax
je 0x4d7bc
movq -0x8(%rbp), %rax
movsbl 0x118(%rax), %eax
cmpl $0x0, %eax
je 0x4d76e
leaq -0x40(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x118, %rsi            # imm = 0x118
movl $0x2e, %edx
callq 0x26c60
movq -0x8(%rbp), %rax
cmpl $0x0, 0x114(%rax)
je 0x4d79c
leaq -0x40(%rbp), %rdx
movq -0x8(%rbp), %rax
movl 0x114(%rax), %ecx
leaq 0x13f300(%rip), %rdi    # 0x18ca90
movl $0x4e, %esi
callq 0x2cdc0
jmp 0x4d7ba
leaq -0x40(%rbp), %rcx
leaq 0x13f2e9(%rip), %rdi    # 0x18ca90
movl $0x4e, %esi
leaq 0xee305(%rip), %rdx     # 0x13bab8
movb $0x0, %al
callq 0x26120
jmp 0x4d7dd
movq -0x8(%rbp), %rax
movq (%rax), %rcx
leaq 0x13f2c6(%rip), %rdi    # 0x18ca90
movl $0x4e, %esi
leaq 0xee2fa(%rip), %rdx     # 0x13bad0
movb $0x0, %al
callq 0x26120
leaq 0x13f2ac(%rip), %rax    # 0x18ca90
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: createReplicationBacklog
void createReplicationBacklog(void) {
    serverAssert(server.repl_backlog == NULL);
    server.repl_backlog = zmalloc(server.repl_backlog_size);
    server.repl_backlog_histlen = 0;
    server.repl_backlog_idx = 0;
    /* When a new backlog buffer is created, we increment the replication
     * offset by one to make sure we'll not be able to PSYNC with any
     * previous slave. This is needed because we avoid incrementing the
     * master_repl_offset if no backlog exists nor slaves are attached. */
    server.master_repl_offset++;

    /* We don't have any data inside our buffer, but virtually the first
     * byte we have is the next byte that will be generated for the
     * replication stream. */
    server.repl_backlog_off = server.master_repl_offset+1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x12a9dd(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x7d0(%rax)
jne 0x4d807
jmp 0x4d829
leaq 0xee2d2(%rip), %rdi     # 0x13bae0
leaq 0xee2e7(%rip), %rsi     # 0x13bafc
movl $0x4e, %edx
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
leaq 0x12a9a8(%rip), %rax    # 0x1781d8
movq 0x7d8(%rax), %rdi
callq 0x3acd0
movq %rax, %rcx
leaq 0x12a992(%rip), %rax    # 0x1781d8
movq %rcx, 0x7d0(%rax)
leaq 0x12a984(%rip), %rax    # 0x1781d8
movq $0x0, 0x7e0(%rax)
leaq 0x12a972(%rip), %rax    # 0x1781d8
movq $0x0, 0x7e8(%rax)
leaq 0x12a960(%rip), %rax    # 0x1781d8
movq 0x7c0(%rax), %rcx
addq $0x1, %rcx
leaq 0x12a94e(%rip), %rax    # 0x1781d8
movq %rcx, 0x7c0(%rax)
leaq 0x12a940(%rip), %rax    # 0x1781d8
movq 0x7c0(%rax), %rcx
addq $0x1, %rcx
leaq 0x12a92e(%rip), %rax    # 0x1781d8
movq %rcx, 0x7f0(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: resizeReplicationBacklog
void resizeReplicationBacklog(long long newsize) {
    if (newsize < CONFIG_REPL_BACKLOG_MIN_SIZE)
        newsize = CONFIG_REPL_BACKLOG_MIN_SIZE;
    if (server.repl_backlog_size == newsize) return;

    server.repl_backlog_size = newsize;
    if (server.repl_backlog != NULL) {
        /* What we actually do is to flush the old buffer and realloc a new
         * empty one. It will refill with new data incrementally.
         * The reason is that copying a few gigabytes adds latency and even
         * worse often we need to alloc additional space before freeing the
         * old buffer. */
        zfree(server.repl_backlog);
        server.repl_backlog = zmalloc(server.repl_backlog_size);
        server.repl_backlog_histlen = 0;
        server.repl_backlog_idx = 0;
        /* Next byte we have is... the next since the buffer is empty. */
        server.repl_backlog_off = server.master_repl_offset+1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x4000, -0x8(%rbp)     # imm = 0x4000
jge 0x4d8de
movq $0x4000, -0x8(%rbp)     # imm = 0x4000
leaq 0x12a8f3(%rip), %rax    # 0x1781d8
movq 0x7d8(%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x4d8f7
jmp 0x4d995
movq -0x8(%rbp), %rcx
leaq 0x12a8d6(%rip), %rax    # 0x1781d8
movq %rcx, 0x7d8(%rax)
leaq 0x12a8c8(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x7d0(%rax)
je 0x4d995
leaq 0x12a8b7(%rip), %rax    # 0x1781d8
movq 0x7d0(%rax), %rdi
callq 0x3afa0
leaq 0x12a8a4(%rip), %rax    # 0x1781d8
movq 0x7d8(%rax), %rdi
callq 0x3acd0
movq %rax, %rcx
leaq 0x12a88e(%rip), %rax    # 0x1781d8
movq %rcx, 0x7d0(%rax)
leaq 0x12a880(%rip), %rax    # 0x1781d8
movq $0x0, 0x7e0(%rax)
leaq 0x12a86e(%rip), %rax    # 0x1781d8
movq $0x0, 0x7e8(%rax)
leaq 0x12a85c(%rip), %rax    # 0x1781d8
movq 0x7c0(%rax), %rcx
addq $0x1, %rcx
leaq 0x12a84a(%rip), %rax    # 0x1781d8
movq %rcx, 0x7f0(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: feedReplicationBacklog
void feedReplicationBacklog(void *ptr, size_t len) {
    unsigned char *p = ptr;

    server.master_repl_offset += len;

    /* This is a circular buffer, so write as much data we can at every
     * iteration and rewind the "idx" index if we reach the limit. */
    while(len) {
        size_t thislen = server.repl_backlog_size - server.repl_backlog_idx;
        if (thislen > len) thislen = len;
        memcpy(server.repl_backlog+server.repl_backlog_idx,p,thislen);
        server.repl_backlog_idx += thislen;
        if (server.repl_backlog_idx == server.repl_backlog_size)
            server.repl_backlog_idx = 0;
        len -= thislen;
        p += thislen;
        server.repl_backlog_histlen += thislen;
    }
    if (server.repl_backlog_histlen > server.repl_backlog_size)
        server.repl_backlog_histlen = server.repl_backlog_size;
    /* Set the offset of the first byte we have in the backlog. */
    server.repl_backlog_off = server.master_repl_offset -
                              server.repl_backlog_histlen + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
leaq 0x12a7a5(%rip), %rax    # 0x1781d8
addq 0x7c0(%rax), %rcx
leaq 0x12a797(%rip), %rax    # 0x1781d8
movq %rcx, 0x7c0(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x4db3e
leaq 0x12a77e(%rip), %rax    # 0x1781d8
movq 0x7d8(%rax), %rax
leaq 0x12a770(%rip), %rcx    # 0x1781d8
subq 0x7e8(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jbe 0x4da85
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x12a74c(%rip), %rax    # 0x1781d8
movq 0x7d0(%rax), %rdi
leaq 0x12a73e(%rip), %rax    # 0x1781d8
addq 0x7e8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x26c60
movq -0x20(%rbp), %rcx
leaq 0x12a71f(%rip), %rax    # 0x1781d8
addq 0x7e8(%rax), %rcx
leaq 0x12a711(%rip), %rax    # 0x1781d8
movq %rcx, 0x7e8(%rax)
leaq 0x12a703(%rip), %rax    # 0x1781d8
movq 0x7e8(%rax), %rax
leaq 0x12a6f5(%rip), %rcx    # 0x1781d8
cmpq 0x7d8(%rcx), %rax
jne 0x4dafe
leaq 0x12a6e5(%rip), %rax    # 0x1781d8
movq $0x0, 0x7e8(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rcx
leaq 0x12a6b4(%rip), %rax    # 0x1781d8
addq 0x7e0(%rax), %rcx
leaq 0x12a6a6(%rip), %rax    # 0x1781d8
movq %rcx, 0x7e0(%rax)
jmp 0x4da48
leaq 0x12a693(%rip), %rax    # 0x1781d8
movq 0x7e0(%rax), %rax
leaq 0x12a685(%rip), %rcx    # 0x1781d8
cmpq 0x7d8(%rcx), %rax
jle 0x4db78
leaq 0x12a675(%rip), %rax    # 0x1781d8
movq 0x7d8(%rax), %rcx
leaq 0x12a667(%rip), %rax    # 0x1781d8
movq %rcx, 0x7e0(%rax)
leaq 0x12a659(%rip), %rax    # 0x1781d8
movq 0x7c0(%rax), %rcx
leaq 0x12a64b(%rip), %rax    # 0x1781d8
subq 0x7e0(%rax), %rcx
addq $0x1, %rcx
leaq 0x12a639(%rip), %rax    # 0x1781d8
movq %rcx, 0x7f0(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: feedReplicationBacklogWithObject
void feedReplicationBacklogWithObject(robj *o) {
    char llstr[LONG_STR_SIZE];
    void *p;
    size_t len;

    if (o->encoding == OBJ_ENCODING_INT) {
        len = ll2string(llstr,sizeof(llstr),(long)o->ptr);
        p = llstr;
    } else {
        len = sdslen(o->ptr);
        p = o->ptr;
    }
    feedReplicationBacklog(p,len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x4dbf3
leaq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x15, %esi
callq 0x477e0
cltq
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x4dc10
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4dc30
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x4da10
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: getPsyncInitialOffset
long long getPsyncInitialOffset(void) {
    long long psync_offset = server.master_repl_offset;
    /* Add 1 to psync_offset if it the replication backlog does not exists
     * as when it will be created later we'll increment the offset by one. */
    if (server.repl_backlog == NULL) psync_offset++;
    return psync_offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x129d0d(%rip), %rax    # 0x1781d8
movq 0x7c0(%rax), %rax
movq %rax, -0x8(%rbp)
leaq 0x129cfb(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x7d0(%rax)
jne 0x4e4f3
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationSetupSlaveForFullResync
int replicationSetupSlaveForFullResync(client *slave, long long offset) {
    char buf[128];
    int buflen;

    slave->psync_initial_offset = offset;
    slave->replstate = SLAVE_STATE_WAIT_BGSAVE_END;
    /* We are going to accumulate the incremental changes for this
     * slave as well. Set slaveseldb to -1 in order to force to re-emit
     * a SLEECT statement in the replication stream. */
    server.slaveseldb = -1;

    /* Don't send this reply to slaves that approached us with
     * the old SYNC command. */
    if (!(slave->flags & CLIENT_PRE_PSYNC)) {
        buflen = snprintf(buf,sizeof(buf),"+FULLRESYNC %s %lld\r\n",
                          server.runid,offset);
        if (write(slave->fd,buf,buflen) != buflen) {
            freeClientAsync(slave);
            return C_ERR;
        }
    }
    return C_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xe0(%rax)
movq -0x10(%rbp), %rax
movl $0x7, 0xa0(%rax)
leaq 0x129ca1(%rip), %rax    # 0x1781d8
movl $0xffffffff, 0x7bc(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
jne 0x4e5be
leaq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %r8
movl $0x80, %esi
leaq 0xed754(%rip), %rdx     # 0x13bcc0
leaq 0x129c65(%rip), %rcx    # 0x1781d8
addq $0x70, %rcx
movb $0x0, %al
callq 0x26120
movl %eax, -0xa4(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
leaq -0xa0(%rbp), %rsi
movslq -0xa4(%rbp), %rdx
callq 0x26bc0
movslq -0xa4(%rbp), %rcx
cmpq %rcx, %rax
je 0x4e5bc
movq -0x10(%rbp), %rdi
callq 0x44460
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4e5c5
jmp 0x4e5be
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: refreshGoodSlavesCount
void refreshGoodSlavesCount(void) {
    listIter li;
    listNode *ln;
    int good = 0;

    if (!server.repl_min_slaves_to_write ||
        !server.repl_min_slaves_max_lag) return;

    listRewind(server.slaves,&li);
    while((ln = listNext(&li))) {
        client *slave = ln->value;
        time_t lag = server.unixtime - slave->repl_ack_time;

        if (slave->replstate == SLAVE_STATE_ONLINE &&
            lag <= server.repl_min_slaves_max_lag) good++;
    }
    server.repl_good_slaves_count = good;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x1c(%rbp)
leaq 0x129972(%rip), %rax    # 0x1781d8
cmpl $0x0, 0x808(%rax)
je 0x4e87f
leaq 0x129962(%rip), %rax    # 0x1781d8
cmpl $0x0, 0x80c(%rax)
jne 0x4e884
jmp 0x4e916
leaq 0x12994d(%rip), %rax    # 0x1781d8
movq 0x1e0(%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x27320
leaq -0x10(%rbp), %rdi
callq 0x27380
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x4e906
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
leaq 0x129917(%rip), %rax    # 0x1781d8
movq 0x978(%rax), %rax
movq -0x28(%rbp), %rcx
subq 0xd8(%rcx), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x9, 0xa0(%rax)
jne 0x4e904
movq -0x30(%rbp), %rax
leaq 0x1298e9(%rip), %rcx    # 0x1781d8
movslq 0x80c(%rcx), %rcx
cmpq %rcx, %rax
jg 0x4e904
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4e89b
movl -0x1c(%rbp), %ecx
leaq 0x1298c8(%rip), %rax    # 0x1781d8
movl %ecx, 0x810(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: putSlaveOnline
void putSlaveOnline(client *slave) {
    slave->replstate = SLAVE_STATE_ONLINE;
    slave->repl_put_online_on_ack = 0;
    slave->repl_ack_time = server.unixtime; /* Prevent false timeout. */
    if (aeCreateFileEvent(server.el, slave->fd, AE_WRITABLE,
        sendReplyToClient, slave) == AE_ERR) {
        serverLog(LL_WARNING,"Unable to register writable event for slave bulk transfer: %s", strerror(errno));
        freeClient(slave);
        return;
    }
    refreshGoodSlavesCount();
    serverLog(LL_NOTICE,"Synchronization with slave %s succeeded",
        replicationGetSlaveName(slave));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x9, 0xa0(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xa4(%rax)
leaq 0x128f79(%rip), %rax    # 0x1781d8
movq 0x978(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xd8(%rax)
leaq 0x128f60(%rip), %rax    # 0x1781d8
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x8(%rbp), %r8
movl $0x2, %edx
leaq -0xaa13(%rip), %rcx     # 0x44880
callq 0x2a8f0
cmpl $-0x1, %eax
jne 0x4f2ca
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq %rax, %rdx
movl $0x3, %edi
leaq 0xece93(%rip), %rsi     # 0x13c14b
movb $0x0, %al
callq 0x2fc60
movq -0x8(%rbp), %rdi
callq 0x43ea0
jmp 0x4f2ee
callq 0x4e850
movq -0x8(%rbp), %rdi
callq 0x4d700
movq %rax, %rdx
movl $0x2, %edi
leaq 0xecea2(%rip), %rsi     # 0x13c189
movb $0x0, %al
callq 0x2fc60
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationSendAck
void replicationSendAck(void) {
    client *c = server.master;

    if (c != NULL) {
        c->flags |= CLIENT_MASTER_FORCE_REPLY;
        addReplyMultiBulkLen(c,3);
        addReplyBulkCString(c,"REPLCONF");
        addReplyBulkCString(c,"ACK");
        addReplyBulkLongLong(c,c->reploff);
        c->flags &= ~CLIENT_MASTER_FORCE_REPLY;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x128ec9(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x4f38f
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
orl $0x2000, %ecx           # imm = 0x2000
movl %ecx, 0x98(%rax)
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x437f0
movq -0x8(%rbp), %rdi
leaq 0xe880b(%rip), %rsi     # 0x137b5b
callq 0x43580
movq -0x8(%rbp), %rdi
leaq 0xe8807(%rip), %rsi     # 0x137b67
callq 0x43580
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rsi
callq 0x439f0
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
andl $0xffffdfff, %ecx       # imm = 0xFFFFDFFF
movl %ecx, 0x98(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationSendNewlineToMaster
void replicationSendNewlineToMaster(void) {
    static time_t newline_sent;
    if (time(NULL) != newline_sent) {
        newline_sent = time(NULL);
        if (write(server.repl_transfer_s,"\n",1) == -1) {
            /* Pinging back in this stage is best-effort. */
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movl %eax, %edi
callq 0x26ce0
cmpq 0x13d18c(%rip), %rax    # 0x18cae0
je 0x4f98e
xorl %eax, %eax
movl %eax, %edi
callq 0x26ce0
movq %rax, 0x13d17a(%rip)    # 0x18cae0
leaq 0x12886b(%rip), %rax    # 0x1781d8
movl 0x868(%rax), %edi
leaq 0xea4bf(%rip), %rsi     # 0x139e39
movl $0x1, %edx
callq 0x26bc0
cmpq $-0x1, %rax
jne 0x4f98c
jmp 0x4f98c
jmp 0x4f98e
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationCreateMasterClient
void replicationCreateMasterClient(int fd) {
    server.master = createClient(fd);
    server.master->flags |= CLIENT_MASTER;
    server.master->authenticated = 1;
    server.repl_state = REPL_STATE_CONNECTED;
    server.master->reploff = server.repl_master_initial_offset;
    memcpy(server.master->replrunid, server.repl_master_runid,
        sizeof(server.repl_master_runid));
    /* If master offset is set to -1, this master is old and is not
     * PSYNC capable, so we flag it accordingly. */
    if (server.master->reploff == -1)
        server.master->flags |= CLIENT_PRE_PSYNC;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x41d90
movq %rax, %rcx
leaq 0x12880b(%rip), %rax    # 0x1781d8
movq %rcx, 0x838(%rax)
leaq 0x1287fd(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rax
movl 0x98(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x98(%rax)
leaq 0x1287e0(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rax
movl $0x1, 0x9c(%rax)
leaq 0x1287c8(%rip), %rax    # 0x1781d8
movl $0xf, 0x84c(%rax)
leaq 0x1287b7(%rip), %rax    # 0x1781d8
movq 0x8d8(%rax), %rcx
leaq 0x1287a9(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rax
movq %rcx, 0xc8(%rax)
leaq 0x128794(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rdi
addq $0xe8, %rdi
leaq 0x12877f(%rip), %rsi    # 0x1781d8
addq $0x8a8, %rsi            # imm = 0x8A8
movl $0x29, %edx
callq 0x26c60
leaq 0x128767(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rax
cmpq $-0x1, 0xc8(%rax)
jne 0x4faa2
leaq 0x12874f(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rax
movl 0x98(%rax), %ecx
orl $0x10000, %ecx          # imm = 0x10000
movl %ecx, 0x98(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: cancelReplicationHandshake
int cancelReplicationHandshake(void) {
    if (server.repl_state == REPL_STATE_TRANSFER) {
        replicationAbortSyncTransfer();
        server.repl_state = REPL_STATE_CONNECT;
    } else if (server.repl_state == REPL_STATE_CONNECTING ||
               slaveIsInHandshakeState())
    {
        undoConnectWithMaster();
        server.repl_state = REPL_STATE_CONNECT;
    } else {
        return 0;
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x127f89(%rip), %rax    # 0x1781d8
cmpl $0xe, 0x84c(%rax)
jne 0x50270
callq 0x51710
leaq 0x127f74(%rip), %rax    # 0x1781d8
movl $0x1, 0x84c(%rax)
jmp 0x502ad
leaq 0x127f61(%rip), %rax    # 0x1781d8
cmpl $0x2, 0x84c(%rax)
je 0x5028a
callq 0x4f900
cmpl $0x0, %eax
je 0x502a2
callq 0x516c0
leaq 0x127f42(%rip), %rax    # 0x1781d8
movl $0x1, 0x84c(%rax)
jmp 0x502ab
movl $0x0, -0x4(%rbp)
jmp 0x502b4
jmp 0x502ad
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationDiscardCachedMaster
void replicationDiscardCachedMaster(void) {
    if (server.cached_master == NULL) return;

    serverLog(LL_NOTICE,"Discarding previously cached master state.");
    server.cached_master->flags &= ~CLIENT_MASTER;
    freeClient(server.cached_master);
    server.cached_master = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x12787d(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x840(%rax)
jne 0x50967
jmp 0x509bc
movl $0x2, %edi
leaq 0xec4ec(%rip), %rsi     # 0x13ce5f
movb $0x0, %al
callq 0x2fc60
leaq 0x127857(%rip), %rax    # 0x1781d8
movq 0x840(%rax), %rax
movl 0x98(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x98(%rax)
leaq 0x12783a(%rip), %rax    # 0x1781d8
movq 0x840(%rax), %rdi
callq 0x43ea0
leaq 0x127827(%rip), %rax    # 0x1781d8
movq $0x0, 0x840(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: connectWithMaster
int connectWithMaster(void) {
    int fd;

    fd = anetTcpNonBlockBestEffortBindConnect(NULL,
        server.masterhost,server.masterport,NET_FIRST_BIND_ADDR);
    if (fd == -1) {
        serverLog(LL_WARNING,"Unable to connect to MASTER: %s",
            strerror(errno));
        return C_ERR;
    }

    if (aeCreateFileEvent(server.el,fd,AE_READABLE|AE_WRITABLE,syncWithMaster,NULL) ==
            AE_ERR)
    {
        close(fd);
        serverLog(LL_WARNING,"Can't create readable event for SYNC");
        return C_ERR;
    }

    server.repl_transfer_lastio = server.unixtime;
    server.repl_transfer_s = fd;
    server.repl_state = REPL_STATE_CONNECTING;
    return C_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x126c49(%rip), %rax    # 0x1781d8
movq 0x828(%rax), %rax
movq %rax, -0x18(%rbp)
leaq 0x126c37(%rip), %rax    # 0x1781d8
movl 0x830(%rax), %eax
movl %eax, -0xc(%rbp)
leaq 0x126c27(%rip), %rax    # 0x1781d8
cmpl $0x0, 0x128(%rax)
je 0x515ce
leaq 0x126c17(%rip), %rax    # 0x1781d8
movq 0xa8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x515d6
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x515d6
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edi
callq 0x2c2a0
movl %eax, -0x8(%rbp)
cmpl $-0x1, -0x8(%rbp)
jne 0x51621
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq %rax, %rdx
movl $0x3, %edi
leaq 0xeb649(%rip), %rsi     # 0x13cc57
movb $0x0, %al
callq 0x2fc60
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x516b2
leaq 0x126bb0(%rip), %rax    # 0x1781d8
movq 0x40(%rax), %rdi
movl -0x8(%rbp), %esi
movl $0x3, %edx
leaq -0xaab(%rip), %rcx      # 0x50b90
xorl %eax, %eax
movl %eax, %r8d
callq 0x2a8f0
cmpl $-0x1, %eax
jne 0x5166e
movl -0x8(%rbp), %edi
callq 0x26180
movl $0x3, %edi
leaq 0xeb619(%rip), %rsi     # 0x13cc77
movb $0x0, %al
callq 0x2fc60
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x516b2
leaq 0x126b63(%rip), %rax    # 0x1781d8
movq 0x978(%rax), %rcx
leaq 0x126b55(%rip), %rax    # 0x1781d8
movq %rcx, 0x878(%rax)
movl -0x8(%rbp), %ecx
leaq 0x126b44(%rip), %rax    # 0x1781d8
movl %ecx, 0x868(%rax)
leaq 0x126b37(%rip), %rax    # 0x1781d8
movl $0x2, 0x84c(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: undoConnectWithMaster
void undoConnectWithMaster(void) {
    int fd = server.repl_transfer_s;

    aeDeleteFileEvent(server.el,fd,AE_READABLE|AE_WRITABLE);
    close(fd);
    server.repl_transfer_s = -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x126b09(%rip), %rax    # 0x1781d8
movl 0x868(%rax), %eax
movl %eax, -0x4(%rbp)
leaq 0x126af9(%rip), %rax    # 0x1781d8
movq 0x40(%rax), %rdi
movl -0x4(%rbp), %esi
movl $0x3, %edx
callq 0x2aab0
movl -0x4(%rbp), %edi
callq 0x26180
leaq 0x126ad9(%rip), %rax    # 0x1781d8
movl $0xffffffff, 0x868(%rax) # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationAbortSyncTransfer
void replicationAbortSyncTransfer(void) {
    serverAssert(server.repl_state == REPL_STATE_TRANSFER);
    undoConnectWithMaster();
    close(server.repl_transfer_fd);
    unlink(server.repl_transfer_tmpfile);
    zfree(server.repl_transfer_tmpfile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x126abd(%rip), %rax    # 0x1781d8
cmpl $0xe, 0x84c(%rax)
jne 0x51726
jmp 0x51748
leaq 0xeb56f(%rip), %rdi     # 0x13cc9c
leaq 0xea3c8(%rip), %rsi     # 0x13bafc
movl $0x6a0, %edx            # imm = 0x6A0
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
callq 0x516c0
leaq 0x126a84(%rip), %rax    # 0x1781d8
movl 0x86c(%rax), %edi
callq 0x26180
leaq 0x126a72(%rip), %rax    # 0x1781d8
movq 0x870(%rax), %rdi
callq 0x263b0
leaq 0x126a5f(%rip), %rax    # 0x1781d8
movq 0x870(%rax), %rdi
callq 0x3afa0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationSetMaster
void replicationSetMaster(char *ip, int port) {
    sdsfree(server.masterhost);
    server.masterhost = sdsnew(ip);
    server.masterport = port;
    if (server.master) freeClient(server.master);
    disconnectAllBlockedClients(); /* Clients blocked in master, now slave. */
    disconnectSlaves(); /* Force our slaves to resync with us as well. */
    replicationDiscardCachedMaster(); /* Don't try a PSYNC. */
    freeReplicationBacklog(); /* Don't allow our chained slaves to PSYNC. */
    cancelReplicationHandshake();
    server.repl_state = REPL_STATE_CONNECT;
    server.master_repl_offset = 0;
    server.repl_down_since = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0x126a32(%rip), %rax    # 0x1781d8
movq 0x828(%rax), %rdi
callq 0x38620
movq -0x8(%rbp), %rdi
callq 0x38510
movq %rax, %rcx
leaq 0x126a13(%rip), %rax    # 0x1781d8
movq %rcx, 0x828(%rax)
movl -0xc(%rbp), %ecx
leaq 0x126a02(%rip), %rax    # 0x1781d8
movl %ecx, 0x830(%rax)
leaq 0x1269f5(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x838(%rax)
je 0x51800
leaq 0x1269e4(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rdi
callq 0x43ea0
callq 0x9dab0
callq 0x43e50
callq 0x50950
callq 0x4d9a0
callq 0x50240
leaq 0x1269b8(%rip), %rax    # 0x1781d8
movl $0x1, 0x84c(%rax)
leaq 0x1269a7(%rip), %rax    # 0x1781d8
movq $0x0, 0x7c0(%rax)
leaq 0x126995(%rip), %rax    # 0x1781d8
movq $0x0, 0x888(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationUnsetMaster
void replicationUnsetMaster(void) {
    if (server.masterhost == NULL) return; /* Nothing to do. */
    sdsfree(server.masterhost);
    server.masterhost = NULL;
    if (server.master) {
        if (listLength(server.slaves) == 0) {
            /* If this instance is turned into a master and there are no
             * slaves, it inherits the replication offset from the master.
             * Under certain conditions this makes replicas comparable by
             * replication offset to understand what is the most updated. */
            server.master_repl_offset = server.master->reploff;
            freeReplicationBacklog();
        }
        freeClient(server.master);
    }
    replicationDiscardCachedMaster();
    cancelReplicationHandshake();
    server.repl_state = REPL_STATE_NONE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x12696d(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x828(%rax)
jne 0x5187a
jmp 0x5191b
leaq 0x126957(%rip), %rax    # 0x1781d8
movq 0x828(%rax), %rdi
callq 0x38620
leaq 0x126944(%rip), %rax    # 0x1781d8
movq $0x0, 0x828(%rax)
leaq 0x126932(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x838(%rax)
je 0x51900
leaq 0x126921(%rip), %rax    # 0x1781d8
movq 0x1e0(%rax), %rax
cmpq $0x0, 0x28(%rax)
jne 0x518ed
leaq 0x12690c(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rax
movq 0xc8(%rax), %rcx
leaq 0x1268f7(%rip), %rax    # 0x1781d8
movq %rcx, 0x7c0(%rax)
callq 0x4d9a0
leaq 0x1268e4(%rip), %rax    # 0x1781d8
movq 0x838(%rax), %rdi
callq 0x43ea0
callq 0x50950
callq 0x50240
leaq 0x1268c7(%rip), %rax    # 0x1781d8
movl $0x0, 0x84c(%rax)
popq %rbp
retq
nopl (%rax)