// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq 0x80(%rsp), %rax
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x48(%rsp)
movq 0x70(%rsp), %rdi
callq 0xc7920
movl %eax, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0xbeee3
movq 0x48(%rsp), %rax
movl $0x0, (%rax)
cmpq $0x0, 0x80(%rsp)
je 0xbeefc
movq 0x80(%rsp), %rax
movl $0x0, (%rax)
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0xc7aa0
movl %eax, 0x1c(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x1c(%rsp)
movb %al, 0x1b(%rsp)
jne 0xbef31
movq 0x70(%rsp), %rdi
callq 0xc7920
cmpl 0x20(%rsp), %eax
setg %al
movb %al, 0x1b(%rsp)
movb 0x1b(%rsp), %al
testb $0x1, %al
jne 0xbef3e
jmp 0xbf301
movq 0x70(%rsp), %rdi
callq 0xc7b00
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x10(%rsp)
subq $0x3, %rax
ja 0xbf2dd
movq 0x10(%rsp), %rax
leaq 0xb623d(%rip), %rcx     # 0x1751ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
addq $0x5, %rax
movq %rax, 0x8(%rsp)
subq $0x4, %rax
ja 0xbf12f
movq 0x8(%rsp), %rax
leaq 0xb620f(%rip), %rcx     # 0x1751bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x40(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jl 0xbf06a
cmpq $0x0, 0x60(%rsp)
je 0xbf054
movl $0x0, 0x24(%rsp)
movq 0x60(%rsp), %rax
movslq 0x24(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jl 0xbf014
movq 0x60(%rsp), %rax
movslq 0x24(%rsp), %rcx
movslq (%rax,%rcx,4), %rax
movq 0x40(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xbf005
jmp 0xbf014
jmp 0xbf007
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xbefda
movq 0x60(%rsp), %rax
movslq 0x24(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jge 0xbf052
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movl %eax, %edx
movq 0x60(%rsp), %rax
movslq 0x24(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x60(%rsp), %rax
movl 0x24(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
jmp 0xbf054
cmpq $0x0, 0x48(%rsp)
je 0xbf068
movq 0x48(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xbf06a
jmp 0xbf14e
movq 0x40(%rsp), %rax
cmpq $0x1, 0x8(%rax)
jge 0xbf08a
movq 0x40(%rsp), %rax
cmpq $0x100, 0x8(%rax)       # imm = 0x100
jg 0xbf08c
jmp 0xbf0ab
leaq 0xb6356(%rip), %rdi     # 0x1753e9
leaq 0xb6171(%rip), %rsi     # 0x17520b
movl $0x4e1, %edx            # imm = 0x4E1
leaq 0xb6376(%rip), %rcx     # 0x17541c
callq 0xb3e0
cmpq $0x0, 0x58(%rsp)
je 0xbf0c9
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x58(%rsp), %rax
movslq (%rax), %rcx
orq %rdx, %rcx
movl %ecx, (%rax)
jmp 0xbf14e
cmpq $0x0, 0x50(%rsp)
je 0xbf112
movl $0x0, 0x24(%rsp)
cmpl $0x9, 0x24(%rsp)
jge 0xbf110
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x24(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x50(%rsp), %rax
movslq 0x24(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xbf0de
jmp 0xbf112
cmpq $0x0, 0x80(%rsp)
je 0xbf12b
movq 0x80(%rsp), %rax
movl $0x1, (%rax)
jmp 0xbf14e
jmp 0xbf14e
leaq 0xb0d85(%rip), %rdi     # 0x16febb
leaq 0xb60ce(%rip), %rsi     # 0x17520b
movl $0x4ef, %edx            # imm = 0x4EF
leaq 0xb62d3(%rip), %rcx     # 0x17541c
callq 0xb3e0
jmp 0xbf2fc
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x10(%rax)
je 0xbf193
movq 0x70(%rsp), %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rsi
callq 0xc7aa0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0xbf191
jmp 0xbf2fc
jmp 0xbf1e8
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x10(%rax)
je 0xbf1c7
movq 0x70(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0xc7aa0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0xbf1c5
jmp 0xbf2fc
jmp 0xbf1e6
leaq 0xb0ced(%rip), %rdi     # 0x16febb
leaq 0xb6036(%rip), %rsi     # 0x17520b
movl $0x4fe, %edx            # imm = 0x4FE
leaq 0xb623b(%rip), %rcx     # 0x17541c
callq 0xb3e0
jmp 0xbf1e8
jmp 0xbf2fc
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x10(%rax)
je 0xbf20b
jmp 0xbf22a
leaq 0xb626c(%rip), %rdi     # 0x17547e
leaq 0xb5ff2(%rip), %rsi     # 0x17520b
movl $0x504, %edx            # imm = 0x504
leaq 0xb61f7(%rip), %rcx     # 0x17541c
callq 0xb3e0
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x10(%rax)
je 0xbf23b
jmp 0xbf25a
leaq 0xb6250(%rip), %rdi     # 0x175492
leaq 0xb5fc2(%rip), %rsi     # 0x17520b
movl $0x505, %edx            # imm = 0x505
leaq 0xb61c7(%rip), %rcx     # 0x17541c
callq 0xb3e0
movq 0x70(%rsp), %rdi
movq 0x30(%rsp), %rax
movq (%rax), %rsi
callq 0xc7aa0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0xbf27c
jmp 0xbf2fc
movq 0x70(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0xc7aa0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0xbf29c
jmp 0xbf2fc
jmp 0xbf2fc
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x10(%rax)
je 0xbf2db
movq 0x70(%rsp), %rdi
movq 0x28(%rsp), %rax
movq (%rax), %rsi
callq 0xc7aa0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0xbf2d9
jmp 0xbf2fc
jmp 0xbf2db
jmp 0xbf2fc
leaq 0xb0bd7(%rip), %rdi     # 0x16febb
leaq 0xb5f20(%rip), %rsi     # 0x17520b
movl $0x513, %edx            # imm = 0x513
leaq 0xb6125(%rip), %rcx     # 0x17541c
callq 0xb3e0
jmp 0xbef0f
movl 0x1c(%rsp), %eax
addq $0x78, %rsp
retq
nopw (%rax,%rax)