// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/tre/lib/tre-compile.c
// Function: tre_match_empty
static reg_errcode_t
tre_match_empty(tre_stack_t *stack, tre_ast_node_t *node, int *tags,
		int *assertions, int *params, int *num_tags_seen,
		int *params_seen)
{
  tre_literal_t *lit;
  tre_union_t *uni;
  tre_catenation_t *cat;
  tre_iteration_t *iter;
  int i;
  int bottom = tre_stack_num_objects(stack);
  reg_errcode_t status = REG_OK;
  if (num_tags_seen)
    *num_tags_seen = 0;
  if (params_seen)
    *params_seen = 0;

  status = tre_stack_push_voidptr(stack, node);

  /* Walk through the tree recursively. */
  while (status == REG_OK && tre_stack_num_objects(stack) > bottom)
    {
      node = tre_stack_pop_voidptr(stack);

      switch (node->type)
	{
	case LITERAL:
	  lit = (tre_literal_t *)node->obj;
	  switch (lit->code_min)
	    {
	    case TAG:
	      if (lit->code_max >= 0)
		{
		  if (tags != NULL)
		    {
		      /* Add the tag to `tags'. */
		      for (i = 0; tags[i] >= 0; i++)
			if (tags[i] == lit->code_max)
			  break;
		      if (tags[i] < 0)
			{
			  tags[i] = lit->code_max;
			  tags[i + 1] = -1;
			}
		    }
		  if (num_tags_seen)
		    (*num_tags_seen)++;
		}
	      break;
	    case ASSERTION:
	      assert(lit->code_max >= 1
		     || lit->code_max <= ASSERT_LAST);
	      if (assertions != NULL)
		*assertions |= lit->code_max;
	      break;
	    case PARAMETER:
	      if (params != NULL)
		for (i = 0; i < TRE_PARAM_LAST; i++)
		  params[i] = lit->u.params[i];
	      if (params_seen != NULL)
		*params_seen = 1;
	      break;
	    case EMPTY:
	      break;
	    default:
	      assert(0);
	      break;
	    }
	  break;

	case UNION:
	  /* Subexpressions starting earlier take priority over ones
	     starting later, so we prefer the left subexpression over the
	     right subexpression. */
	  uni = (tre_union_t *)node->obj;
	  if (uni->left->nullable)
	    STACK_PUSHX(stack, voidptr, uni->left)
	  else if (uni->right->nullable)
	    STACK_PUSHX(stack, voidptr, uni->right)
	  else
	    assert(0);
	  break;

	case CATENATION:
	  /* The path must go through both children. */
	  cat = (tre_catenation_t *)node->obj;
	  assert(cat->left->nullable);
	  assert(cat->right->nullable);
	  STACK_PUSHX(stack, voidptr, cat->left);
	  STACK_PUSHX(stack, voidptr, cat->right);
	  break;

	case ITERATION:
	  /* A match with an empty string is preferred over no match at
	     all, so we go through the argument if possible. */
	  iter = (tre_iteration_t *)node->obj;
	  if (iter->arg->nullable)
	    STACK_PUSHX(stack, voidptr, iter->arg);
	  break;

	default:
	  assert(0);
	  break;
	}
    }

  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, 0x10(%rsp)
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
callq 0x970a3
movl %eax, %ebp
testq %rbx, %rbx
je 0x925e0
movl $0x0, (%rbx)
movq %rbx, 0x8(%rsp)
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x925f5
movl $0x0, (%rax)
movq %r13, %rdi
movq %r15, %rsi
callq 0x97147
testl %eax, %eax
jne 0x92767
leaq 0x64a25(%rip), %r15     # 0xf7034
movq %r13, %rdi
callq 0x970a3
cmpl %ebp, %eax
jle 0x92765
movq %r13, %rdi
callq 0x97160
movl (%rax), %ecx
cmpq $0x3, %rcx
ja 0x92776
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movq 0x8(%rax), %rcx
movq (%rcx), %rdx
addq $0x5, %rdx
cmpq $0x4, %rdx
ja 0x927f2
xorl %eax, %eax
leaq 0x649ea(%rip), %rsi     # 0xf7044
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
testq %r14, %r14
je 0x9267e
xorl %edx, %edx
movq 0x18(%rcx), %rsi
movl (%rsi,%rdx,4), %esi
movl %esi, (%r14,%rdx,4)
incq %rdx
cmpq $0x9, %rdx
jne 0x9266a
movq 0x50(%rsp), %rcx
testq %rcx, %rcx
je 0x92706
movl $0x1, (%rcx)
jmp 0x92706
movq 0x8(%rax), %rax
movq (%rax), %rsi
cmpl $0x0, 0x10(%rsi)
jne 0x926bc
xorl %eax, %eax
jmp 0x92706
movq 0x8(%rax), %rax
movq (%rax), %rsi
cmpl $0x0, 0x10(%rsi)
jne 0x926bc
movq 0x8(%rax), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x927d3
movq %r13, %rdi
callq 0x97147
jmp 0x92706
movq %r12, %rbx
movq 0x8(%rax), %r12
movq (%r12), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x927b4
movq 0x8(%r12), %rax
cmpl $0x0, 0x10(%rax)
je 0x92795
movq %r13, %rdi
callq 0x97147
testl %eax, %eax
jne 0x92767
movq 0x8(%r12), %rsi
movq %r13, %rdi
callq 0x97147
movq %rbx, %r12
testl %eax, %eax
je 0x9260f
jmp 0x92767
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
js 0x92706
testq %r12, %r12
je 0x92757
movl (%r12), %esi
xorl %edx, %edx
testl %esi, %esi
js 0x9274a
movl %esi, %esi
cmpq %rsi, %rcx
je 0x92757
movl 0x4(%r12,%rdx,4), %esi
incq %rdx
jmp 0x92724
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0x92706
movl 0x8(%rcx), %ecx
orl %ecx, (%rdx)
jmp 0x92706
movl %ecx, (%r12,%rdx,4)
movl $0xffffffff, 0x4(%r12,%rdx,4) # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x92706
incl (%rcx)
jmp 0x92706
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5fb5f(%rip), %rdi     # 0xf22dc
leaq 0x648ff(%rip), %rsi     # 0xf7083
leaq 0x64ad6(%rip), %rcx     # 0xf7261
movl $0x513, %edx            # imm = 0x513
callq 0xb400
leaq 0x64b3b(%rip), %rdi     # 0xf72d7
leaq 0x648e0(%rip), %rsi     # 0xf7083
leaq 0x64ab7(%rip), %rcx     # 0xf7261
movl $0x505, %edx            # imm = 0x505
callq 0xb400
leaq 0x64b08(%rip), %rdi     # 0xf72c3
leaq 0x648c1(%rip), %rsi     # 0xf7083
leaq 0x64a98(%rip), %rcx     # 0xf7261
movl $0x504, %edx            # imm = 0x504
callq 0xb400
leaq 0x5fb02(%rip), %rdi     # 0xf22dc
leaq 0x648a2(%rip), %rsi     # 0xf7083
leaq 0x64a79(%rip), %rcx     # 0xf7261
movl $0x4fe, %edx            # imm = 0x4FE
callq 0xb400
leaq 0x5fae3(%rip), %rdi     # 0xf22dc
leaq 0x64883(%rip), %rsi     # 0xf7083
leaq 0x64a5a(%rip), %rcx     # 0xf7261
movl $0x4ef, %edx            # imm = 0x4EF
callq 0xb400