// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq (%rax), %rcx
leaq 0x16e7f(%rip), %rax     # 0x3dc00
cmpl $0x5, (%rax,%rcx,4)
je 0x26d93
movl $0x0, -0x4(%rbp)
jmp 0x26ed6
movl 0x152eb(%rip), %eax     # 0x3c084
addl $0x2, %eax
movl %eax, 0x152e2(%rip)     # 0x3c084
cmpl $0x7530, %eax           # imm = 0x7530
jle 0x26de9
movl $0x2, 0x152d1(%rip)     # 0x3c084
movl $0x0, -0x2c(%rbp)
cmpl $0x1198, -0x2c(%rbp)    # imm = 0x1198
jge 0x26de7
movslq -0x2c(%rbp), %rcx
leaq 0x233862(%rip), %rax    # 0x25a630
shlq $0x6, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x26dba
jmp 0x26de9
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x26e18
movl 0x15286(%rip), %ecx     # 0x3c084
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x30(%rax)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x26df2
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl 0x30(%rax), %eax
cmpl 0x15257(%rip), %eax     # 0x3c084
jne 0x26e46
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movl 0x30(%rax), %eax
cmpl 0x15240(%rip), %eax     # 0x3c084
je 0x26e52
movl $0x0, -0x4(%rbp)
jmp 0x26ed6
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl 0x30(%rax), %eax
cmpl 0x15211(%rip), %eax     # 0x3c084
jne 0x26e8c
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movl 0x30(%rax), %eax
cmpl 0x151fa(%rip), %eax     # 0x3c084
je 0x26e95
movl $0x0, -0x4(%rbp)
jmp 0x26ed6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x25870
cmpl $0x0, %eax
jne 0x26eb8
movl $0x0, -0x4(%rbp)
jmp 0x26ed6
movq -0x10(%rbp), %rdi
callq 0x26ee0
cmpl $0x0, %eax
je 0x26ecf
movl $0x0, -0x4(%rbp)
jmp 0x26ed6
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop