// File: /workspace/github_c_makefile_star2_O0/mishun[P]plantri/plantri.c
// Function: nftlaststep
static void
nftlaststep(EDGE *ext4[], int *next4, EDGE *ext5[], int *next5,
            triangle nft[], int numnft)

/* Remove from ext4[0..*next4-1] and ext5[0..*next5-1] those extensions
   for which not all of nft[0..numnft-1] hit some chord. */
{
    int i,j,k;

    for (j = 0; j < numnft; ++j)
    {
        RESETMARKS;
        MARKLO(nft[j].e1); MARKLO(nft[j].e1->invers);
        MARKLO(nft[j].e2); MARKLO(nft[j].e2->invers);
        MARKLO(nft[j].e3); MARKLO(nft[j].e3->invers);
        
        k = 0;
        for (i = 0; i < *next4; ++i)
            if (ISMARKEDLO(ext4[i])) ext4[k++] = ext4[i];
        *next4 = k;

        k = 0;
        for (i = 0; i < *next5; ++i)
            if (ISMARKEDLO(ext5[i]) || ISMARKEDLO(ext5[i]->invers->prev))
                ext5[k++] = ext5[i];
        *next5 = k;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x36dd4
movl 0x54af(%rip), %eax      # 0x3c084
addl $0x2, %eax
movl %eax, 0x54a6(%rip)      # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0x36c25
movl $0x2, 0x5495(%rip)      # 0x3c084
movl $0x0, -0x3c(%rbp)
cmpl $0x1198, -0x3c(%rbp)    # imm = 0x1198
jge 0x36c23
movslq -0x3c(%rbp), %rcx
leaq 0x223a26(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x36bf6
jmp 0x36c25
movl 0x5459(%rip), %ecx      # 0x3c084
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rax), %rax
movl %ecx, 0x30(%rax)
movl 0x543e(%rip), %ecx      # 0x3c084
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x30(%rax)
movl 0x541f(%rip), %ecx      # 0x3c084
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x8(%rax), %rax
movl %ecx, 0x30(%rax)
movl 0x5403(%rip), %ecx      # 0x3c084
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x30(%rax)
movl 0x53e3(%rip), %ecx      # 0x3c084
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl %ecx, 0x30(%rax)
movl 0x53c7(%rip), %ecx      # 0x3c084
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movl %ecx, 0x30(%rax)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x36d36
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x30(%rax), %eax
cmpl 0x537f(%rip), %eax      # 0x3c084
jne 0x36d29
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movl -0x38(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x38(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x36d2b
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x36ce5
movl -0x38(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x36dbd
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x30(%rax), %eax
cmpl 0x5317(%rip), %eax      # 0x3c084
je 0x36d8e
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %eax
cmpl 0x52f8(%rip), %eax      # 0x3c084
jne 0x36db0
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x38(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x36db2
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x36d4d
movl -0x38(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x36bc3
popq %rbp
retq
nopw %cs:(%rax,%rax)