// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: prune_oriented_lists
static void
prune_oriented_lists(EDGE *good_or[], int *ngood_or, int *ngood_ref,
                     EDGE *good_mir[], int *ngood_mir, int *ngood_mir_ref)

/* Try to prune the edge lists (of the form required by
   canon_edge_oriented()) by using the degrees of a couple of
   extra vertices.  The result is returned in the same form.
   As always, if *ngood_ref==*ngood_mir_ref==0 on output
   (which must not be true on input), all else is undefined.
*/
{
    int i,k,kref;
    long code_or[MAXE],code_mir[MAXE],maxcode;
#define PRUNE_OR(e) ((degree[(e)->invers->prev->prev->end] << 10) \
		      + degree[(e)->next->invers->prev->end])
#define PRUNE_MIR(e) ((degree[(e)->invers->next->next->end] << 10) \
                      + degree[(e)->prev->invers->next->end])

    maxcode = 0;
    for (i = 0; i < *ngood_or; ++i)
    {
	code_or[i] = PRUNE_OR(good_or[i]);
	if (code_or[i] > maxcode) maxcode = code_or[i];
    }

    for (i = 0; i < *ngood_mir; ++i)
    {
        code_mir[i] = PRUNE_MIR(good_mir[i]);
        if (code_mir[i] > maxcode) maxcode = code_mir[i];
    }

    k = kref = 0;
    for (i = 0; i < *ngood_or; ++i)
        if (code_or[i] == maxcode)
	{
	    if (i < *ngood_ref) ++kref;
	    good_or[k++] = good_or[i];
	}
    *ngood_or = k;
    *ngood_ref = kref;

    k = kref = 0;
    for (i = 0; i < *ngood_mir; ++i)
        if (code_mir[i] == maxcode)
        {
            if (i < *ngood_mir_ref) ++kref;
            good_mir[k++] = good_mir[i];
        }
    *ngood_mir = k;
    *ngood_mir_ref = kref;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x16c0, %rsp           # imm = 0x16C0
movl (%rsi), %r10d
xorl %ebx, %ebx
testl %r10d, %r10d
cmovlel %ebx, %r10d
leaq 0x1886a(%rip), %r11     # 0x25be0
xorl %eax, %eax
cmpq %rbx, %r10
je 0xd3c6
movq (%rdi,%rbx,8), %r14
movq 0x18(%r14), %r15
movq 0x20(%r14), %r14
movq 0x10(%r14), %r14
movq 0x10(%r14), %r14
movslq 0x4(%r14), %r14
movl (%r11,%r14,4), %ebp
shll $0xa, %ebp
movq 0x20(%r15), %r14
movq 0x10(%r14), %r14
movslq 0x4(%r14), %r14
movslq (%r11,%r14,4), %r14
movslq %ebp, %r15
addq %r14, %r15
movq %r15, 0xb20(%rsp,%rbx,8)
cmpq %r15, %rax
cmovleq %r15, %rax
incq %rbx
jmp 0xd378
movl (%r8), %ebx
xorl %r14d, %r14d
testl %ebx, %ebx
cmovlel %r14d, %ebx
cmpq %r14, %rbx
je 0xd41e
movq (%rcx,%r14,8), %r15
movq 0x10(%r15), %r12
movq 0x20(%r15), %r15
movq 0x18(%r15), %r15
movq 0x18(%r15), %r15
movslq 0x4(%r15), %r15
movl (%r11,%r15,4), %ebp
shll $0xa, %ebp
movq 0x20(%r12), %r15
movq 0x18(%r15), %r15
movslq 0x4(%r15), %r15
movslq (%r11,%r15,4), %r15
movslq %ebp, %r12
addq %r15, %r12
movq %r12, -0x80(%rsp,%r14,8)
cmpq %r12, %rax
cmovleq %r12, %rax
incq %r14
jmp 0xd3d2
xorl %r11d, %r11d
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpq %r11, %r10
je 0xd456
cmpq %rax, 0xb20(%rsp,%r11,8)
jne 0xd451
movslq (%rdx), %r14
xorl %r15d, %r15d
cmpq %r14, %r11
setl %r15b
addl %r15d, %ebp
movq (%rdi,%r11,8), %r14
movslq %ebx, %r15
incl %ebx
movq %r14, (%rdi,%r15,8)
incq %r11
jmp 0xd425
movl %ebx, (%rsi)
movl %ebp, (%rdx)
movl (%r8), %edx
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
xorl %edi, %edi
xorl %r10d, %r10d
cmpq %rsi, %rdx
je 0xd495
cmpq %rax, -0x80(%rsp,%rsi,8)
jne 0xd490
movslq (%r9), %r11
xorl %ebx, %ebx
cmpq %r11, %rsi
setl %bl
addl %ebx, %r10d
movq (%rcx,%rsi,8), %r11
movslq %edi, %rbx
incl %edi
movq %r11, (%rcx,%rbx,8)
incq %rsi
jmp 0xd469
movl %edi, (%r8)
movl %r10d, (%r9)
addq $0x16c0, %rsp           # imm = 0x16C0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq