// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
movq %rsi, %rdi
callq 0x97b6b
movl %eax, %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x97c0f
movl %eax, %r13d
testl %eax, %eax
jne 0x9211a
movq %rbx, %rdi
xorl %esi, %esi
callq 0x97b6f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x9211a
movl %r15d, 0x8(%rsp)
movq %rbx, %rdi
callq 0x97b6b
cmpl %r15d, %eax
jle 0x92117
movq %rbx, %rdi
callq 0x97c14
movl %eax, %ebp
movq %rbx, %rdi
callq 0x97c28
cmpl $0x3, %ebp
ja 0x9212c
movq %rax, %r12
movl %ebp, %eax
leaq 0x65629(%rip), %rcx     # 0xf706c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl (%r12), %eax
cmpq $0x3, %rax
ja 0x92100
leaq 0x6561b(%rip), %rcx     # 0xf707c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r12), %r14
movq (%r14), %r15
cmpq $-0x4, %r15
jne 0x91e17
movl $0x0, 0x10(%r12)
movl 0x10(%r14), %ebp
movl $0x80, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x955ee
movl $0x0, %ecx
testq %rax, %rax
je 0x91ad9
movl %ebp, (%rax)
movabsq $0xff00000000, %rcx     # imm = 0xFF00000000
movq %rcx, 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, %rcx
movq %rcx, 0x20(%r12)
testq %rcx, %rcx
movl 0x8(%rsp), %r15d
je 0x92049
movl 0x10(%r14), %ebp
movq 0x8(%r14), %r14
movl $0x80, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x955ee
movl $0x0, %ecx
testq %rax, %rax
je 0x91efe
movl %ebp, (%rax)
movabsq $0xff00000000, %rcx     # imm = 0xFF00000000
movq %rcx, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movl %r14d, 0x30(%rax)
movq $-0x1, 0x40(%rax)
movl $0xffffffff, 0x48(%rax) # imm = 0xFFFFFFFF
jmp 0x91efb
movq 0x8(%r12), %r14
movq (%r14), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x91c1b
movq 0x8(%r14), %rcx
xorl %eax, %eax
cmpl $0x0, 0x10(%rcx)
setne %al
jmp 0x91c1d
movq 0x8(%r12), %rax
cmpl $0x0, 0x8(%rax)
je 0x91cf6
movq (%rax), %rdx
xorl %ecx, %ecx
cmpl $0x0, 0x10(%rdx)
setne %cl
jmp 0x91cfb
movq 0x8(%r12), %r14
movq (%r14), %rax
movl $0x1, %ecx
cmpl $0x0, 0x10(%rax)
jne 0x91bae
movq 0x8(%r14), %rdx
xorl %ecx, %ecx
cmpl $0x0, 0x10(%rdx)
setne %cl
movl %ecx, 0x10(%r12)
movq 0x20(%rax), %rsi
movq 0x8(%r14), %rax
movq 0x20(%rax), %rdx
xorl %r15d, %r15d
movq 0x10(%rsp), %rbp
movq %rbp, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x92884
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0x920f0
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x28(%rax), %rsi
movq 0x28(%rcx), %rdx
movq %rbp, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x92884
movq %rax, 0x28(%r12)
testq %rax, %rax
setne %r15b
je 0x920f0
jmp 0x920f6
xorl %eax, %eax
movl %eax, 0x10(%r12)
cmpl $0x0, 0x10(%rsi)
je 0x91caf
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x1c(%rsp), %r9
callq 0x92c6d
testl %eax, %eax
jne 0x91cee
movslq 0x1c(%rsp), %rax
leaq 0x4(,%rax,4), %rdi
callq 0xb810
testq %rax, %rax
je 0x920ed
movq %rax, %r15
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x0, 0xc(%rsp)
cmpl $0x0, 0x18(%rsp)
je 0x91f76
movl $0x24, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x955ee
testq %rax, %rax
jne 0x91f78
jmp 0x91f69
movq 0x20(%rsi), %rax
movq %rax, 0x20(%r12)
movq 0x8(%r14), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x91e06
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x1c(%rsp), %r9
callq 0x92c6d
testl %eax, %eax
je 0x91f13
movl %eax, %r13d
jmp 0x920f6
movl $0x1, %ecx
movl %ecx, 0x10(%r12)
movq (%rax), %rax
movups 0x20(%rax), %xmm0
movups %xmm0, 0x20(%r12)
jmp 0x92100
movq %rbx, %rdi
movq %r12, %rsi
callq 0x97c0f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x92059
movq %rbx, %rdi
movl $0x3, %esi
callq 0x97b6f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x92059
jmp 0x91dcd
movq %rbx, %rdi
movq %r12, %rsi
callq 0x97c0f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x92059
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x91d87
movq %rbx, %rdi
movq %r12, %rsi
callq 0x97c0f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x92059
movq %rbx, %rdi
movl $0x2, %esi
callq 0x97b6f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x92059
movq 0x8(%r12), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x97c0f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x92059
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x97b6f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x9210c
movq 0x8(%r12), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x97c0f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x92059
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x97b6f
testl %eax, %eax
cmovnel %eax, %r13d
jne 0x9210c
jmp 0x92100
movq 0x28(%rsi), %rax
movq %rax, 0x28(%r12)
movb $0x1, %r15b
jmp 0x920f6
testq %r15, %r15
movq 0x10(%rsp), %rdi
js 0x91fea
movl $0x0, 0x10(%r12)
movl 0x10(%r14), %ebp
movq 0x8(%r14), %rax
movq %rax, 0x20(%rsp)
movl $0x80, %r8d
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x955ee
movl $0x0, %ecx
testq %rax, %rax
je 0x91e84
movl %ebp, (%rax)
movl %r15d, 0x4(%rax)
movq 0x20(%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, %rcx
movq %rcx, 0x20(%r12)
testq %rcx, %rcx
je 0x92060
movl 0x10(%r14), %ebp
movups (%r14), %xmm0
movaps %xmm0, 0x30(%rsp)
movups 0x18(%r14), %xmm0
movaps %xmm0, 0x20(%rsp)
movl $0x80, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x955ee
movl $0x0, %ecx
testq %rax, %rax
movl 0x8(%rsp), %r15d
je 0x91efe
pshufd $0xe8, 0x30(%rsp), %xmm0 # xmm0 = mem[0,2,2,3]
movl %ebp, (%rax)
movq %xmm0, 0x4(%rax)
movaps 0x20(%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, %rcx
movq %rcx, 0x28(%r12)
testq %rcx, %rcx
je 0x92049
movb $0x1, %al
jmp 0x92051
movslq 0x1c(%rsp), %rax
leaq 0x4(,%rax,4), %rdi
callq 0xb810
testq %rax, %rax
je 0x920ed
movq %rax, %r15
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x0, 0xc(%rsp)
cmpl $0x0, 0x18(%rsp)
je 0x9206f
movl $0x24, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x955ee
testq %rax, %rax
jne 0x92071
movq %r15, %rdi
callq 0xb790
jmp 0x920ed
xorl %eax, %eax
movq (%r14), %rsi
movq $0x0, (%rsp)
movq %rbx, %rdi
movq %r15, %rdx
leaq 0xc(%rsp), %rcx
movq %rax, 0x20(%rsp)
movq %rax, %r8
xorl %r9d, %r9d
callq 0x92c6d
testl %eax, %eax
jne 0x9209c
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x20(%rcx), %rsi
movq 0x20(%rax), %rdx
movl 0xc(%rsp), %r8d
movq 0x10(%rsp), %rdi
movq %r15, %rcx
movq 0x20(%rsp), %r9
callq 0x92884
movq %rax, 0x20(%r12)
movq %r15, %rdi
callq 0xb790
cmpq $0x0, 0x20(%r12)
jne 0x91cb8
jmp 0x920ed
movl $0x1, 0x10(%r12)
movl $0x40, %r8d
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x955ee
movl $0x0, %ecx
testq %rax, %rax
movl 0x8(%rsp), %r15d
je 0x92027
movq $-0x1, (%rax)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq %rax, %rcx
movq %rcx, 0x20(%r12)
testq %rcx, %rcx
je 0x92049
movq 0x10(%rsp), %rdi
callq 0x92852
movq %rax, 0x28(%r12)
testq %rax, %rax
jne 0x91f0c
xorl %eax, %eax
movl $0xc, %r13d
testb %al, %al
jne 0x92100
xorl %ebp, %ebp
jmp 0x9210c
xorl %eax, %eax
movl $0xc, %r13d
movl 0x8(%rsp), %r15d
jmp 0x92051
xorl %eax, %eax
movq 0x8(%r14), %rsi
movq $0x0, (%rsp)
movq %rbx, %rdi
movq %r15, %rdx
leaq 0xc(%rsp), %rcx
movq %rax, 0x20(%rsp)
movq %rax, %r8
xorl %r9d, %r9d
callq 0x92c6d
testl %eax, %eax
je 0x920ae
movl %eax, %ebp
movq %r15, %rdi
callq 0xb790
xorl %r15d, %r15d
movl %ebp, %r13d
jmp 0x920f6
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x28(%rax), %rsi
movq 0x28(%rcx), %rdx
movl 0xc(%rsp), %r8d
movq 0x10(%rsp), %rdi
movq %r15, %rcx
movq 0x20(%rsp), %r9
callq 0x92884
movq %rax, 0x28(%r12)
movq %r15, %rdi
callq 0xb790
cmpq $0x0, 0x28(%r12)
jne 0x91e0f
xorl %r15d, %r15d
movl $0xc, %r13d
testb %r15b, %r15b
je 0x92105
movl 0x8(%rsp), %r15d
movb $0x1, %bpl
jmp 0x9210c
xorl %ebp, %ebp
movl 0x8(%rsp), %r15d
testb %bpl, %bpl
jne 0x91a0b
jmp 0x9211a
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x601f9(%rip), %rdi     # 0xf232c
leaq 0x64fc9(%rip), %rsi     # 0xf7103
leaq 0x65156(%rip), %rcx     # 0xf7297
movl $0x617, %edx            # imm = 0x617
callq 0xb400