// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterSendAck
void clusterSendAck(clusterNode *node, uint32_t revision, const sds name) {
    unsigned char buf[sizeof(clusterMsg) + 64], *payload;
    clusterMsg *hdr = (clusterMsg*) buf;
    uint32_t totlen;

    if (node->link == NULL) return;

    totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
    totlen += sizeof(clusterMsgDataAck) - sizeof(hdr->data.ack.about.name);
    totlen += sdslen(name);

    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_ACK);
    hdr->totlen = htonl(totlen);

    hdr->data.ack.about.revision    = intrev32ifbe(revision);
    hdr->data.ack.about.name_length = intrev16ifbe(sdslen(name));

    if (totlen < sizeof(buf)) {
        payload = buf;
    } else {
        payload = zmalloc(totlen);
        memcpy(payload,buf,sizeof(clusterMsg));
        hdr = (clusterMsg*) payload;

        serverLog(LL_DEBUG,"Need to resize payload buffer to %u bytes for ack for %s",
            totlen, name);
    }

    memcpy(hdr->data.ack.about.name, name, sdslen(name));

    clusterSendMessage(node->link,payload,totlen);

    if (totlen >= sizeof(buf)) {
        zfree(payload);
    }
}

// Assembly:
cmpq $0x0, 0x88(%rdi)
je 0x2ef8a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r14
movl %esi, %ebp
movzbl -0x1(%rdx), %edx
movl %edx, %r13d
andl $0x7, %r13d
cmpl $0x4, %r13d
movq %rdi, 0x8(%rsp)
movq %rdx, (%rsp)
ja 0x2edf2
leaq 0x27c02(%rip), %rax     # 0x569c8
movslq (%rax,%r13,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rdx, %r15
shrl $0x3, %r15d
jmp 0x2edf5
movq -0x11(%r14), %r15
jmp 0x2edf5
movzwl -0x5(%r14), %r15d
jmp 0x2edf5
movl -0x9(%r14), %r15d
jmp 0x2edf5
movzbl -0x3(%r14), %r15d
jmp 0x2edf5
xorl %r15d, %r15d
addl $0x66, %r15d
leaq 0x10(%rsp), %r12
xorl %ebx, %ebx
movl $0xc8, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x12380
movl $0x5a756244, (%r12)     # imm = 0x5A756244
movw $0x500, 0xc(%r12)       # imm = 0x500
movq 0x5477a(%rip), %rax     # 0x835a0
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm0, 0x10(%r12)
movaps %xmm1, 0x20(%r12)
movq 0x20(%rax), %rcx
movq %rcx, 0x30(%r12)
leaq 0x4023f(%rip), %rcx     # 0x6f088
movzwl 0xb4(%rcx), %edx
rolw $0x8, %dx
movw %dx, 0x58(%r12)
movzwl 0x30(%rax), %eax
rolw $0x8, %ax
movw %ax, 0x5a(%r12)
movq 0x668(%rcx), %rax
movb 0x8(%rax), %al
movb %al, 0x5c(%r12)
movl %r15d, %eax
bswapl %eax
movl %eax, 0x4(%r12)
movl %ebp, 0x60(%r12)
cmpl $0x4, %r13d
ja 0x2eec0
movl %r13d, %eax
leaq 0x27b46(%rip), %rcx     # 0x569dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rsp), %rbx
shrl $0x3, %ebx
jmp 0x2eec0
movq -0x11(%r14), %rbx
jmp 0x2eec0
movzwl -0x5(%r14), %ebx
jmp 0x2eec0
movl -0x9(%r14), %ebx
jmp 0x2eec0
movzbl -0x3(%r14), %ebx
movw %bx, 0x74(%rsp)
movl %r15d, %r13d
cmpl $0x108, %r15d           # imm = 0x108
jb 0x2ef04
movq %r13, %rdi
callq 0x1fea5
movq %rax, %r12
leaq 0x10(%rsp), %rsi
movl $0xc8, %edx
movq %rax, %rdi
callq 0x12520
leaq 0x284bf(%rip), %rsi     # 0x573b4
xorl %edi, %edi
movl %r15d, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x19fb1
leaq 0x66(%r12), %rdi
movzbl -0x1(%r14), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x2ef47
leaq 0x27ad1(%rip), %rcx     # 0x569f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x2ef49
movq -0x11(%r14), %rdx
jmp 0x2ef49
movzwl -0x5(%r14), %edx
jmp 0x2ef49
movl -0x9(%r14), %edx
jmp 0x2ef49
movzbl -0x3(%r14), %edx
jmp 0x2ef49
xorl %edx, %edx
movq %r14, %rsi
callq 0x12520
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2dec0
cmpl $0x108, %r15d           # imm = 0x108
jb 0x2ef79
movq %r12, %rdi
callq 0x1ffff
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq