// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/tre/lib/tre-compile.c
// Function: tre_compute_nfl
static reg_errcode_t
tre_compute_nfl(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree)
{
  int bottom = tre_stack_num_objects(stack);

  STACK_PUSHR(stack, voidptr, tree);
  STACK_PUSHR(stack, int, NFL_RECURSE);

  while (tre_stack_num_objects(stack) > bottom)
    {
      tre_nfl_stack_symbol_t symbol;
      tre_ast_node_t *node;

      symbol = (tre_nfl_stack_symbol_t)tre_stack_pop_int(stack);
      node = tre_stack_pop_voidptr(stack);
      switch (symbol)
	{
	case NFL_RECURSE:
	  switch (node->type)
	    {
	    case LITERAL:
	      {
		tre_literal_t *lit = (tre_literal_t *)node->obj;
		if (IS_BACKREF(lit))
		  {
		    /* Back references: nullable = false, firstpos = {i},
		       lastpos = {i}. */
		    node->nullable = 0;
		    node->firstpos = tre_set_one(mem, lit->position, 0,
					     TRE_CHAR_MAX, 0, NULL, -1);
		    if (!node->firstpos)
		      return REG_ESPACE;
		    node->lastpos = tre_set_one(mem, lit->position, 0,
						TRE_CHAR_MAX, 0, NULL,
						(int)lit->code_max);
		    if (!node->lastpos)
		      return REG_ESPACE;
		  }
		else if (lit->code_min < 0)
		  {
		    /* Tags, empty strings, params, and zero width assertions:
		       nullable = true, firstpos = {}, and lastpos = {}. */
		    node->nullable = 1;
		    node->firstpos = tre_set_empty(mem);
		    if (!node->firstpos)
		      return REG_ESPACE;
		    node->lastpos = tre_set_empty(mem);
		    if (!node->lastpos)
		      return REG_ESPACE;
		  }
		else
		  {
		    /* Literal at position i: nullable = false, firstpos = {i},
		       lastpos = {i}. */
		    node->nullable = 0;
		    node->firstpos =
		      tre_set_one(mem, lit->position, (int)lit->code_min,
				  (int)lit->code_max, 0, NULL, -1);
		    if (!node->firstpos)
		      return REG_ESPACE;
		    node->lastpos = tre_set_one(mem, lit->position,
						(int)lit->code_min,
						(int)lit->code_max,
						lit->u.class, lit->neg_classes,
						-1);
		    if (!node->lastpos)
		      return REG_ESPACE;
		  }
		break;
	      }

	    case UNION:
	      /* Compute the attributes for the two subtrees, and after that
		 for this node. */
	      STACK_PUSHR(stack, voidptr, node);
	      STACK_PUSHR(stack, int, NFL_POST_UNION);
	      STACK_PUSHR(stack, voidptr, ((tre_union_t *)node->obj)->right);
	      STACK_PUSHR(stack, int, NFL_RECURSE);
	      STACK_PUSHR(stack, voidptr, ((tre_union_t *)node->obj)->left);
	      STACK_PUSHR(stack, int, NFL_RECURSE);
	      break;

	    case CATENATION:
	      /* Compute the attributes for the two subtrees, and after that
		 for this node. */
	      STACK_PUSHR(stack, voidptr, node);
	      STACK_PUSHR(stack, int, NFL_POST_CATENATION);
	      STACK_PUSHR(stack, voidptr, ((tre_catenation_t *)node->obj)->right);
	      STACK_PUSHR(stack, int, NFL_RECURSE);
	      STACK_PUSHR(stack, voidptr, ((tre_catenation_t *)node->obj)->left);
	      STACK_PUSHR(stack, int, NFL_RECURSE);
	      break;

	    case ITERATION:
	      /* Compute the attributes for the subtree, and after that for
		 this node. */
	      STACK_PUSHR(stack, voidptr, node);
	      STACK_PUSHR(stack, int, NFL_POST_ITERATION);
	      STACK_PUSHR(stack, voidptr, ((tre_iteration_t *)node->obj)->arg);
	      STACK_PUSHR(stack, int, NFL_RECURSE);
	      break;
	    }
	  break; /* end case: NFL_RECURSE */

	case NFL_POST_UNION:
	  {
	    tre_union_t *uni = (tre_union_t *)node->obj;
	    node->nullable = uni->left->nullable || uni->right->nullable;
	    node->firstpos = tre_set_union(mem, uni->left->firstpos,
					   uni->right->firstpos, NULL, 0, NULL);
	    if (!node->firstpos)
	      return REG_ESPACE;
	    node->lastpos = tre_set_union(mem, uni->left->lastpos,
					  uni->right->lastpos, NULL, 0, NULL);
	    if (!node->lastpos)
	      return REG_ESPACE;
	    break;
	  }

	case NFL_POST_ITERATION:
	  {
	    tre_iteration_t *iter = (tre_iteration_t *)node->obj;

	    if (iter->min == 0 || iter->arg->nullable)
	      node->nullable = 1;
	    else
	      node->nullable = 0;
	    node->firstpos = iter->arg->firstpos;
	    node->lastpos = iter->arg->lastpos;
	    break;
	  }

	case NFL_POST_CATENATION:
	  {
	    int num_tags, *tags, assertions, params_seen;
	    int *params;
	    reg_errcode_t status;
	    tre_catenation_t *cat = node->obj;
	    node->nullable = cat->left->nullable && cat->right->nullable;

	    /* Compute firstpos. */
	    if (cat->left->nullable)
	      {
		/* The left side matches the empty string.  Make a first pass
		   with tre_match_empty() to get the number of tags and
		   parameters. */
		status = tre_match_empty(stack, cat->left,
					 NULL, NULL, NULL, &num_tags,
					 &params_seen);
		if (status != REG_OK)
		  return status;
		/* Allocate arrays for the tags and parameters. */
		tags = xmalloc(sizeof(*tags) * (num_tags + 1));
		if (!tags)
		  return REG_ESPACE;
		tags[0] = -1;
		assertions = 0;
		params = NULL;
		if (params_seen)
		  {
		    params = tre_mem_alloc(mem, sizeof(*params)
					   * TRE_PARAM_LAST);
		    if (!params)
		      {
			xfree(tags);
			return REG_ESPACE;
		      }
		  }
		/* Second pass with tre_mach_empty() to get the list of
		   tags and parameters. */
		status = tre_match_empty(stack, cat->left, tags,
					 &assertions, params, NULL, NULL);
		if (status != REG_OK)
		  {
		    xfree(tags);
		    return status;
		  }
		node->firstpos =
		  tre_set_union(mem, cat->right->firstpos, cat->left->firstpos,
				tags, assertions, params);
		xfree(tags);
		if (!node->firstpos)
		  return REG_ESPACE;
	      }
	    else
	      {
		node->firstpos = cat->left->firstpos;
	      }

	    /* Compute lastpos. */
	    if (cat->right->nullable)
	      {
		/* The right side matches the empty string.  Make a first pass
		   with tre_match_empty() to get the number of tags and
		   parameters. */
		status = tre_match_empty(stack, cat->right,
					 NULL, NULL, NULL, &num_tags,
					 &params_seen);
		if (status != REG_OK)
		  return status;
		/* Allocate arrays for the tags and parameters. */
		tags = xmalloc(sizeof(int) * (num_tags + 1));
		if (!tags)
		  return REG_ESPACE;
		tags[0] = -1;
		assertions = 0;
		params = NULL;
		if (params_seen)
		  {
		    params = tre_mem_alloc(mem, sizeof(*params)
					   * TRE_PARAM_LAST);
		    if (!params)
		      {
			xfree(tags);
			return REG_ESPACE;
		      }
		  }
		/* Second pass with tre_mach_empty() to get the list of
		   tags and parameters. */
		status = tre_match_empty(stack, cat->right, tags,
					 &assertions, params, NULL, NULL);
		if (status != REG_OK)
		  {
		    xfree(tags);
		    return status;
		  }
		node->lastpos =
		  tre_set_union(mem, cat->left->lastpos, cat->right->lastpos,
				tags, assertions, params);
		xfree(tags);
		if (!node->lastpos)
		  return REG_ESPACE;
	      }
	    else
	      {
		node->lastpos = cat->right->lastpos;
	      }
	    break;
	  }

	default:
	  assert(0);
	  break;
	}
    }

  return REG_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x970a3
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x97147
testl %eax, %eax
jne 0x91409
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x970a7
testl %eax, %eax
je 0x9141e
movl %eax, %r12d
movl %r12d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x970a3
cmpl %ebp, %eax
jle 0x9140c
movq %r15, 0x18(%rsp)
movl %ebp, 0x14(%rsp)
movq %rbx, %rdi
callq 0x9714c
movl %eax, %r14d
movq %rbx, %rdi
callq 0x97160
cmpl $0x3, %r14d
ja 0x91a7e
movq %rax, %r13
movl %r14d, %eax
leaq 0x65b93(%rip), %rcx     # 0xf6ff0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl (%r13), %eax
cmpq $0x3, %rax
ja 0x919e3
leaq 0x65b85(%rip), %rcx     # 0xf7000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r13), %r14
movq (%r14), %r15
cmpq $-0x4, %r15
jne 0x91908
movl $0x0, 0x10(%r13)
movl 0x10(%r14), %ebp
movl $0x80, %r8d
movq 0x18(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x95072
testq %rax, %rax
movabsq $0xff00000000, %r12     # imm = 0xFF00000000
je 0x91a61
movl %ebp, (%rax)
movq %r12, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0x30(%rax)
movq $-0x1, 0x40(%rax)
movl %ecx, 0x48(%rax)
movq %rax, 0x20(%r13)
movl 0x10(%r14), %ebp
movq 0x8(%r14), %r14
movl $0x80, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x95072
testq %rax, %rax
je 0x91a6b
movl %ebp, (%rax)
movq %r12, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movl %r14d, 0x30(%rax)
movq $-0x1, 0x40(%rax)
movl $0xffffffff, 0x48(%rax) # imm = 0xFFFFFFFF
jmp 0x919db
movq 0x8(%r13), %r14
movq (%r14), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x91602
movq 0x8(%r14), %rcx
xorl %eax, %eax
cmpl $0x0, 0x10(%rcx)
setne %al
jmp 0x91604
movq 0x8(%r13), %rax
cmpl $0x0, 0x8(%rax)
movq (%rax), %rax
je 0x916a5
xorl %ecx, %ecx
cmpl $0x0, 0x10(%rax)
setne %cl
jmp 0x916aa
movq 0x8(%r13), %r14
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpl $0x0, 0x10(%rax)
movl $0x1, %edx
jne 0x915a2
xorl %edx, %edx
cmpl $0x0, 0x10(%rcx)
setne %dl
movl %edx, 0x10(%r13)
movq 0x20(%rax), %rsi
movq 0x20(%rcx), %rdx
movq %r15, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x921c8
movq %rax, 0x20(%r13)
movl $0xc, %r12d
testq %rax, %rax
je 0x9140c
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x28(%rax), %rsi
movq 0x28(%rcx), %rdx
movq %r15, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x921c8
movq %rax, 0x28(%r13)
testq %rax, %rax
jne 0x919e3
jmp 0x9140c
xorl %eax, %eax
movl %eax, 0x10(%r13)
cmpl $0x0, 0x10(%rsi)
movq %r13, 0x28(%rsp)
je 0x91698
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x24(%rsp), %r9
callq 0x925ac
testl %eax, %eax
jne 0x91409
movslq 0x24(%rsp), %rax
leaq 0x4(,%rax,4), %rdi
callq 0xb810
movl $0xc, %r12d
testq %rax, %rax
je 0x9140c
movq %rax, %r15
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x0, 0x10(%rsp)
cmpl $0x0, 0x20(%rsp)
je 0x916bc
movl $0x24, %r8d
movq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x95072
movq %rax, %r13
testq %rax, %rax
jne 0x916bf
jmp 0x91a4e
movq 0x20(%rsi), %rax
movq %rax, 0x20(%r13)
jmp 0x91732
movl $0x1, %ecx
movl %ecx, 0x10(%r13)
movups 0x20(%rax), %xmm0
movups %xmm0, 0x20(%r13)
jmp 0x919e3
xorl %r13d, %r13d
movq (%r14), %rsi
movq $0x0, (%rsp)
movq %rbx, %rdi
movq %r15, %rdx
leaq 0x10(%rsp), %rcx
movq %r13, %r8
xorl %r9d, %r9d
callq 0x925ac
testl %eax, %eax
jne 0x91a49
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x20(%rcx), %rsi
movq 0x20(%rax), %rdx
movl 0x10(%rsp), %r8d
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rcx
movq %r13, %r9
callq 0x921c8
movq 0x28(%rsp), %r13
movq %rax, 0x20(%r13)
movq %r15, %rdi
movq %rbp, %r15
movl 0x14(%rsp), %ebp
callq 0xb790
cmpq $0x0, 0x20(%r13)
je 0x9140c
movq 0x8(%r14), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x917c4
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x24(%rsp), %r9
callq 0x925ac
testl %eax, %eax
jne 0x91409
movslq 0x24(%rsp), %rax
leaq 0x4(,%rax,4), %rdi
callq 0xb810
movl $0xc, %r12d
testq %rax, %rax
je 0x9140c
movq %rax, %r15
movq %r14, %r13
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x0, 0x10(%rsp)
cmpl $0x0, 0x20(%rsp)
je 0x917d1
movl $0x24, %r8d
movq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x95072
movq %rax, %r14
testq %rax, %rax
jne 0x917d4
jmp 0x91a4e
movq 0x28(%rsi), %rax
movq %rax, 0x28(%r13)
jmp 0x919e3
xorl %r14d, %r14d
movq 0x8(%r13), %rsi
movq $0x0, (%rsp)
movq %rbx, %rdi
movq %r15, %rdx
leaq 0x10(%rsp), %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x925ac
testl %eax, %eax
jne 0x91a49
movq (%r13), %rax
movq 0x8(%r13), %rcx
movq 0x28(%rax), %rsi
movq 0x28(%rcx), %rdx
movl 0x10(%rsp), %r8d
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rcx
movq %r14, %r9
callq 0x921c8
movq 0x28(%rsp), %r14
movq %rax, 0x28(%r14)
movq %r15, %rdi
movq %rbp, %r15
movl 0x14(%rsp), %ebp
callq 0xb790
cmpq $0x0, 0x28(%r14)
jne 0x919e3
jmp 0x9140c
movq %rbx, %rdi
movq %r13, %rsi
callq 0x97147
testl %eax, %eax
jne 0x91409
movq %rbx, %rdi
movl $0x3, %esi
jmp 0x918cd
movq %rbx, %rdi
movq %r13, %rsi
callq 0x97147
testl %eax, %eax
jne 0x91409
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x918a3
movq %rbx, %rdi
movq %r13, %rsi
callq 0x97147
testl %eax, %eax
jne 0x91409
movq %rbx, %rdi
movl $0x2, %esi
callq 0x970a7
testl %eax, %eax
jne 0x91409
movq 0x8(%r13), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x97147
testl %eax, %eax
jne 0x91409
movq %rbx, %rdi
xorl %esi, %esi
callq 0x970a7
testl %eax, %eax
jne 0x91409
movq 0x8(%r13), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x97147
testl %eax, %eax
jne 0x91409
movq %rbx, %rdi
xorl %esi, %esi
callq 0x970a7
testl %eax, %eax
je 0x919e3
jmp 0x91409
testq %r15, %r15
js 0x919fb
movl $0x0, 0x10(%r13)
movl 0x10(%r14), %ebp
movq 0x8(%r14), %rax
movq %rax, 0x30(%rsp)
movl $0x80, %r8d
movq 0x18(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x95072
testq %rax, %rax
je 0x91a61
movl %ebp, (%rax)
movl %r15d, 0x4(%rax)
movq 0x30(%rsp), %rcx
movl %ecx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0x30(%rax)
movq $-0x1, 0x40(%rax)
movl %ecx, 0x48(%rax)
movq %rax, 0x20(%r13)
movl 0x10(%r14), %ebp
movups (%r14), %xmm0
movaps %xmm0, 0x40(%rsp)
movups 0x18(%r14), %xmm0
movaps %xmm0, 0x30(%rsp)
movl $0x80, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x95072
testq %rax, %rax
je 0x91a6b
movq %r12, %r15
pshufd $0xe8, 0x40(%rsp), %xmm0 # xmm0 = mem[0,2,2,3]
movl %ebp, (%rax)
movq %xmm0, 0x4(%rax)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x20(%rax)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0x30(%rax)
movq $-0x1, 0x40(%rax)
movl %ecx, 0x48(%rax)
movq %rax, 0x28(%r13)
movl 0x14(%rsp), %ebp
movq %rbx, %rdi
callq 0x970a3
xorl %r12d, %r12d
cmpl %ebp, %eax
jg 0x91433
jmp 0x9140c
movl $0x1, 0x10(%r13)
movl $0x40, %r8d
movq 0x18(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x95072
testq %rax, %rax
je 0x91a61
movq $-0x1, (%rax)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq %rax, 0x20(%r13)
movq %r15, %rdi
callq 0x9219e
movq %rax, 0x28(%r13)
testq %rax, %rax
jne 0x919e3
jmp 0x91a73
movl %eax, %r12d
jmp 0x91a54
movl $0xc, %r12d
movq %r15, %rdi
callq 0xb790
jmp 0x9140c
movq $0x0, 0x20(%r13)
jmp 0x91a73
movq $0x0, 0x28(%r13)
movl $0xc, %r12d
jmp 0x9140c
leaq 0x60857(%rip), %rdi     # 0xf22dc
leaq 0x655f7(%rip), %rsi     # 0xf7083
leaq 0x65784(%rip), %rcx     # 0xf7217
movl $0x617, %edx            # imm = 0x617
callq 0xb400