// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: legal_5_min5_reduction
static int
legal_5_min5_reduction(EDGE *e, EDGE *nf4cycleedges[], int numnf4cycleedges)

/* Checks whether the edge given is a legal reference edge for a 5-reduction
   in the minimum valency 5 connectivity 4 case, that is:

   (i) e->start has degree 5 (note that this way in case of both
        endpoints valency 5 the routine has to be called for e and
        e->invers due to the asymmetric behaviour of (iii)) 
   (ii) The two endpoints of e->next, e->prev have valency at least 6
   (iii) The two endpoints of e->next, e->prev have a common neighbour with
         valency 5 different from e->start, e->end, so especially
         e->next, e->prev, e->invers->next, e->invers->prev all are on
         nf-4-cycles.  
  (iv) after doing the 5-reduction e->next->next and e->prev->prev 
       will not be on 4-cycles

   Returns 1 in case it is a legal reduction, 0 otherwise. Assumes the
   non-existence of nf-3-cycles.  nf4cycleedges[0..numnf4cycleedges-1] 
   are the min forms of all edges on nf-4-cycles.
*/

{
  EDGE *dummy;

  if (degree[e->start]!=5) return 0;

  RESETMARKS;
  for (numnf4cycleedges--; numnf4cycleedges>=0; numnf4cycleedges--) 
    MARKLO(nf4cycleedges[numnf4cycleedges]);

  if (!ISMARKEDLO(e->next->min) || !ISMARKEDLO(e->prev->min)) return 0;
  dummy=e->invers;
  if (!ISMARKEDLO(dummy->next->min) || !ISMARKEDLO(dummy->prev->min)) return 0;
  if (!common_5_endpoint(e->next,e->prev)) return 0;
  if (will_be_on_nf4_5red(e)) return 0;

  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movslq (%rdi), %rax
leaq 0xf14c(%rip), %rcx      # 0x25be0
xorl %ebx, %ebx
cmpl $0x5, (%rcx,%rax,4)
jne 0x16c5f
movq %rdi, %r14
movl 0xd5d3(%rip), %ecx      # 0x2407c
leal 0x2(%rcx), %eax
movl %eax, 0xd5ca(%rip)      # 0x2407c
cmpl $0x752f, %ecx           # imm = 0x752F
jl 0x16ae4
movl $0x2, 0xd5b8(%rip)      # 0x2407c
pushq $0x30
popq %rcx
pushq $0x2
popq %rax
leaq 0x22bb3f(%rip), %rdi    # 0x242610
cmpq $0x46630, %rcx          # imm = 0x46630
je 0x16ae4
andl $0x0, (%rcx,%rdi)
addq $0x40, %rcx
jmp 0x16ad1
movl %edx, %ecx
testl %ecx, %ecx
jle 0x16af7
movq -0x8(%rsi,%rcx,8), %rdx
decq %rcx
movl %eax, 0x30(%rdx)
jmp 0x16ae6
movq 0x18(%r14), %rdi
movq 0x28(%rdi), %rcx
cmpl %eax, 0x30(%rcx)
jne 0x16c5f
movq 0x10(%r14), %rsi
movq 0x28(%rsi), %rcx
cmpl %eax, 0x30(%rcx)
jne 0x16c5f
movq 0x20(%r14), %rcx
movq 0x18(%rcx), %rdx
movq 0x28(%rdx), %rdx
cmpl %eax, 0x30(%rdx)
jne 0x16c5f
movq 0x10(%rcx), %rcx
movq 0x28(%rcx), %rcx
cmpl %eax, 0x30(%rcx)
jne 0x16c5f
callq 0x1613a
testl %eax, %eax
je 0x16c5f
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq 0x10(%rax), %rax
movq 0x20(%rax), %r8
movq 0x18(%rcx), %rax
movq 0x20(%rax), %rcx
movq 0x20(%r14), %rax
movl 0xd512(%rip), %edx      # 0x24080
leal 0x1(%rdx), %edi
movl %edi, 0xd509(%rip)      # 0x24080
cmpl $0x7530, %edx           # imm = 0x7530
jl 0x16ba8
movl $0x1, 0xd4f7(%rip)      # 0x24080
xorl %edx, %edx
pushq $0x1
popq %rdi
leaq 0x27208b(%rip), %rsi    # 0x288c20
cmpq $0x100, %rdx            # imm = 0x100
je 0x16ba8
andl $0x0, (%rdx,%rsi)
addq $0x4, %rdx
jmp 0x16b95
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
leaq 0x272069(%rip), %rax    # 0x288c20
movq %rdx, %r9
movq 0x18(%r9), %r9
movslq 0x4(%r9), %r10
movl %edi, (%rax,%r10,4)
cmpq %rsi, %r9
jne 0x16bba
movq 0x18(%r8), %r9
movq 0x18(%r9), %r9
movq 0x20(%r9), %r11
movq 0x18(%r11), %r10
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
je 0x16c5f
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
je 0x16c5f
movq 0x10(%r8), %r8
movq 0x10(%r8), %r8
movq 0x10(%r11), %r11
movq 0x10(%r11), %r11
cmpq %r11, %r10
je 0x16c1c
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
jne 0x16c07
jmp 0x16c5f
movq 0x18(%r9), %r9
movq 0x20(%r9), %r11
movq 0x18(%r11), %r10
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
je 0x16c5f
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
je 0x16c5f
movq 0x10(%r11), %r11
movq 0x10(%r11), %r11
cmpq %r11, %r10
je 0x16cae
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
jne 0x16c4c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x18(%r9), %r9
movq 0x20(%r9), %r11
movq 0x18(%r11), %r10
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
je 0x16c5f
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
je 0x16c5f
movq 0x10(%r11), %r11
movq 0x10(%r11), %r11
cmpq %r11, %r10
je 0x16cae
movq 0x18(%r10), %r10
movslq 0x4(%r10), %r14
cmpl %edi, (%rax,%r14,4)
jne 0x16c99
jmp 0x16c5f
cmpq %r8, %r9
jne 0x16c69
leal 0x1(%rdi), %r8d
movl %r8d, 0xd3c2(%rip)      # 0x24080
cmpl $0x7530, %edi           # imm = 0x7530
jl 0x16ce9
movl $0x1, 0xd3b0(%rip)      # 0x24080
xorl %edi, %edi
pushq $0x1
popq %r8
cmpq $0x100, %rdi            # imm = 0x100
je 0x16ce9
andl $0x0, (%rdi,%rax)
addq $0x4, %rdi
jmp 0x16cd6
movq 0x10(%rsi), %rsi
movslq 0x4(%rdx), %rdi
movl %r8d, (%rax,%rdi,4)
cmpq %rsi, %rdx
je 0x16d00
movq 0x18(%rdx), %rdx
jmp 0x16ced
movq 0x18(%rcx), %rdx
movq 0x18(%rdx), %rdx
movq 0x20(%rdx), %rdi
movq 0x18(%rdi), %rsi
movq 0x18(%rsi), %rsi
movslq 0x4(%rsi), %r9
cmpl %r8d, (%rax,%r9,4)
je 0x16c5f
movq 0x18(%rsi), %rsi
movslq 0x4(%rsi), %r9
cmpl %r8d, (%rax,%r9,4)
je 0x16c5f
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rdi), %rdi
movq 0x10(%rdi), %rdi
cmpq %rdi, %rsi
je 0x16d5c
movq 0x18(%rsi), %rsi
movslq 0x4(%rsi), %r9
cmpl %r8d, (%rax,%r9,4)
jne 0x16d44
jmp 0x16c5f
movq 0x18(%rdx), %rdx
movq 0x20(%rdx), %rdi
movq 0x18(%rdi), %rsi
movq 0x18(%rsi), %rsi
movslq 0x4(%rsi), %r9
cmpl %r8d, (%rax,%r9,4)
je 0x16c5f
movq 0x18(%rsi), %rsi
movslq 0x4(%rsi), %r9
cmpl %r8d, (%rax,%r9,4)
je 0x16c5f
movq 0x10(%rdi), %rdi
movq 0x10(%rdi), %rdi
cmpq %rdi, %rsi
je 0x16dac
movq 0x18(%rsi), %rsi
movslq 0x4(%rsi), %r9
cmpl %r8d, (%rax,%r9,4)
jne 0x16d94
jmp 0x16c5f
pushq $0x1
popq %rsi
cmpq %rcx, %rdx
je 0x16e04
movq 0x18(%rdx), %rdx
movq 0x20(%rdx), %r9
movq 0x18(%r9), %rdi
movq 0x18(%rdi), %rdi
movslq 0x4(%rdi), %r10
cmpl %r8d, (%rax,%r10,4)
je 0x16c5f
movq 0x18(%rdi), %rdi
movslq 0x4(%rdi), %r10
cmpl %r8d, (%rax,%r10,4)
je 0x16c5f
movq 0x10(%r9), %r9
movq 0x10(%r9), %r9
cmpq %r9, %rdi
je 0x16daf
movq 0x18(%rdi), %rdi
movslq 0x4(%rdi), %r10
cmpl %r8d, (%rax,%r10,4)
jne 0x16dec
jmp 0x16c5f
movl %esi, %ebx
jmp 0x16c5f