// File: /workspace/github_c_makefile_star2_O0/meaning-matters[P]Except/List.c
// Function: ListConcat
List * ListConcat(
        List *      pListDst,       /* pointer to destination list */
        List *      pListAdd)       /* pointer to list to be added at tail */
    {
        assert(pListDst != NULL);
        assert(pListAdd != NULL);

        switch (((pListAdd->count > 0) << 1) | (pListDst->count > 0))
        {
        case 0:
            /* both lists empty */

            break;

        case 1:
            /* destination list not empty and add list empty */

            break;

        case 2:
            /* destination list empty and add list not empty */

            pListDst->pHead->pNext = pListAdd->pHead->pNext;
            pListDst->pHead->pNext->pPrev = pListDst->pHead;
            pListDst->pHead->pPrev = pListAdd->pHead->pPrev;
            pListDst->pHead->pPrev->pNext = pListDst->pHead;
            break;

        case 3:
            /* both lists not empty */

            pListAdd->pHead->pPrev->pNext = pListDst->pHead;
            pListDst->pHead->pPrev->pNext = pListAdd->pHead->pNext;
            pListAdd->pHead->pNext->pPrev = pListDst->pHead->pPrev;
            pListDst->pHead->pPrev = pListAdd->pHead->pPrev;
            break;
        }

        pListDst->pNodeLast = NULL;
        pListDst->count += pListAdd->count;

        free(pListAdd->pHead);
        free(pListAdd);

        return pListDst;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x4b39
jmp 0x4b5e
leaq 0x36f0(%rip), %rax      # 0x8230
movq (%rax), %rdi
xorl %esi, %esi
leaq 0x912(%rip), %rdx       # 0x545e
leaq 0x877(%rip), %rcx       # 0x53ca
movl $0x372, %r8d            # imm = 0x372
callq 0x2d10
cmpq $0x0, -0x10(%rbp)
je 0x4b67
jmp 0x4b8c
leaq 0x36c2(%rip), %rax      # 0x8230
movq (%rax), %rdi
xorl %esi, %esi
leaq 0x8f5(%rip), %rdx       # 0x546f
leaq 0x849(%rip), %rcx       # 0x53ca
movl $0x373, %r8d            # imm = 0x373
callq 0x2d10
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
testl %eax, %eax
setg %al
movzbl %al, %eax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
testl %ecx, %ecx
setg %cl
movzbl %cl, %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x3, %eax
ja 0x4c90
movq -0x18(%rbp), %rax
leaq 0x7e1(%rip), %rcx       # 0x53ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x4c90
jmp 0x4c90
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
jmp 0x4c90
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1040
movq -0x10(%rbp), %rdi
callq 0x1040
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq