// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdx, (%rsp)
movq %rsi, %r12
movq %rdi, %r13
callq 0x97b6b
movl %eax, %ebp
testq %rbx, %rbx
je 0x92ca0
movl $0x0, (%rbx)
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x92cb0
movl $0x0, (%rax)
movq %r13, %rdi
movq %r12, %rsi
callq 0x97c0f
movl %eax, %r12d
testl %eax, %eax
jne 0x92e2c
movq %r15, 0x10(%rsp)
movq %rbx, 0x8(%rsp)
movq %r13, %rdi
callq 0x97b6b
cmpl %ebp, %eax
jle 0x92e2c
leaq 0x643c9(%rip), %r15     # 0xf70b0
movq %r13, %rdi
callq 0x97c28
movl (%rax), %ecx
cmpq $0x3, %rcx
ja 0x92e7c
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movq 0x8(%rax), %rax
movq (%rax), %rcx
addq $0x5, %rcx
cmpq $0x4, %rcx
ja 0x92eba
xorl %r12d, %r12d
leaq 0x6439d(%rip), %rdx     # 0xf70c0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testq %r14, %r14
je 0x92d47
xorl %ecx, %ecx
movq 0x18(%rax), %rdx
movl (%rdx,%rcx,4), %edx
movl %edx, (%r14,%rcx,4)
incq %rcx
cmpq $0x9, %rcx
jne 0x92d33
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x92dc4
movl $0x1, (%rax)
jmp 0x92dc4
movq 0x8(%rax), %rax
movq (%rax), %rsi
cmpl $0x0, 0x10(%rsi)
jne 0x92db9
xorl %r12d, %r12d
jmp 0x92dc4
movq 0x8(%rax), %rax
movq (%rax), %rsi
cmpl $0x0, 0x10(%rsi)
jne 0x92db9
movq 0x8(%rax), %rsi
cmpl $0x0, 0x10(%rsi)
jne 0x92db9
jmp 0x92e9b
movq 0x8(%rax), %rbx
movq (%rbx), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x92e5d
movq 0x8(%rbx), %rax
cmpl $0x0, 0x10(%rax)
je 0x92e3e
movq %r13, %rdi
callq 0x97c0f
movl %eax, %r12d
testl %eax, %eax
jne 0x92dc4
movq 0x8(%rbx), %rsi
movq %r13, %rdi
callq 0x97c0f
movl %eax, %r12d
testl %r12d, %r12d
jne 0x92e2c
movq %r13, %rdi
callq 0x97b6b
cmpl %ebp, %eax
jg 0x92ce7
jmp 0x92e2c
movq 0x8(%rax), %rax
testq %rax, %rax
js 0x92dc4
cmpq $0x0, (%rsp)
movq 0x8(%rsp), %rsi
je 0x92e12
movq (%rsp), %rcx
movslq (%rcx), %rdx
addq $0x4, %rcx
testq %rdx, %rdx
js 0x92e05
cmpq %rdx, %rax
jne 0x92df4
testl %edx, %edx
jns 0x92e12
movl %eax, -0x4(%rcx)
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x92dc4
incl (%rsi)
jmp 0x92dc4
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x92dc4
movl 0x8(%rax), %eax
orl %eax, (%rcx)
jmp 0x92dc4
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x64512(%rip), %rdi     # 0xf7357
leaq 0x642b7(%rip), %rsi     # 0xf7103
leaq 0x6448e(%rip), %rcx     # 0xf72e1
movl $0x505, %edx            # imm = 0x505
callq 0xb400
leaq 0x644df(%rip), %rdi     # 0xf7343
leaq 0x64298(%rip), %rsi     # 0xf7103
leaq 0x6446f(%rip), %rcx     # 0xf72e1
movl $0x504, %edx            # imm = 0x504
callq 0xb400
leaq 0x5f4a9(%rip), %rdi     # 0xf232c
leaq 0x64279(%rip), %rsi     # 0xf7103
leaq 0x64450(%rip), %rcx     # 0xf72e1
movl $0x513, %edx            # imm = 0x513
callq 0xb400
leaq 0x5f48a(%rip), %rdi     # 0xf232c
leaq 0x6425a(%rip), %rsi     # 0xf7103
leaq 0x64431(%rip), %rcx     # 0xf72e1
movl $0x4fe, %edx            # imm = 0x4FE
callq 0xb400
leaq 0x5f46b(%rip), %rdi     # 0xf232c
leaq 0x6423b(%rip), %rsi     # 0xf7103
leaq 0x64412(%rip), %rcx     # 0xf72e1
movl $0x4ef, %edx            # imm = 0x4EF
callq 0xb400