// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistZiplistMerge
REDIS_STATIC quicklistNode *_quicklistZiplistMerge(quicklist *quicklist,
                                                   quicklistNode *a,
                                                   quicklistNode *b) {
    D("Requested merge (a,b) (%u, %u)", a->count, b->count);

    quicklistDecompressNode(a);
    quicklistDecompressNode(b);
    if ((ziplistMerge(&a->zl, &b->zl))) {
        /* We merged ziplists! Now remove the unused quicklistNode. */
        quicklistNode *keep = NULL, *nokeep = NULL;
        if (!a->zl) {
            nokeep = a;
            keep = b;
        } else if (!b->zl) {
            nokeep = b;
            keep = a;
        }
        keep->count = ziplistLen(keep->zl);
        quicklistNodeUpdateSz(keep);

        nokeep->count = 0;
        __quicklistDelNode(quicklist, nokeep);
        quicklistCompress(quicklist, keep);
        return keep;
    } else {
        /* else, the merge returned NULL and nothing changed. */
        return NULL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x28b26
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x10, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x28b26
movq -0x18(%rbp), %rdi
callq 0x27a80
jmp 0x28b28
jmp 0x28b2a
cmpq $0x0, -0x20(%rbp)
je 0x28b4c
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x10, %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x28b4c
movq -0x20(%rbp), %rdi
callq 0x27a80
jmp 0x28b4e
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
callq 0x40e20
cmpq $0x0, %rax
je 0x28c67
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x28b9a
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x28bb7
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x28bb5
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x28bb7
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x419c0
movl %eax, %edx
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %ecx
andl $0xffff, %edx           # imm = 0xFFFF
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl %edx, %ecx
movl %ecx, 0x1c(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x41a50
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x30(%rbp), %rax
movl 0x1c(%rax), %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl $0x0, %ecx
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x28540
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x14, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x28c4e
jmp 0x28c28
cmpq $0x0, -0x28(%rbp)
je 0x28c4a
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x10, %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0x28c4a
movq -0x28(%rbp), %rdi
callq 0x27980
jmp 0x28c4c
jmp 0x28c5b
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x27b50
jmp 0x28c5d
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x28c6f
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)