// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/tre/lib/regexec.c
// Function: tre_fill_pmatch
void
tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags,
		const tre_tnfa_t *tnfa, int *tags, int match_eo)
{
  tre_submatch_data_t *submatch_data;
  unsigned int i, j;
  int *parents;

  i = 0;
  if (match_eo >= 0 && !(cflags & REG_NOSUB))
    {
      /* Construct submatch offsets from the tags. */
      DPRINT(("end tag = t%d = %d\n", tnfa->end_tag, match_eo));
      submatch_data = tnfa->submatch_data;
      while (i < tnfa->num_submatches && i < nmatch)
	{
	  if (submatch_data[i].so_tag == tnfa->end_tag)
	    pmatch[i].rm_so = match_eo;
	  else
	    pmatch[i].rm_so = tags[submatch_data[i].so_tag];

	  if (submatch_data[i].eo_tag == tnfa->end_tag)
	    pmatch[i].rm_eo = match_eo;
	  else
	    pmatch[i].rm_eo = tags[submatch_data[i].eo_tag];

	  /* If either of the endpoints were not used, this submatch
	     was not part of the match. */
	  if (pmatch[i].rm_so == -1 || pmatch[i].rm_eo == -1)
	    pmatch[i].rm_so = pmatch[i].rm_eo = -1;

	  DPRINT(("pmatch[%d] = {t%d = %d, t%d = %d}\n", i,
		  submatch_data[i].so_tag, pmatch[i].rm_so,
		  submatch_data[i].eo_tag, pmatch[i].rm_eo));
	  i++;
	}
      /* Reset all submatches that are not within all of their parent
	 submatches. */
      i = 0;
      while (i < tnfa->num_submatches && i < nmatch)
	{
	  if (pmatch[i].rm_eo == -1)
	    assert(pmatch[i].rm_so == -1);
	  assert(pmatch[i].rm_so <= pmatch[i].rm_eo);

	  parents = submatch_data[i].parents;
	  if (parents != NULL)
	    for (j = 0; parents[j] >= 0; j++)
	      {
		DPRINT(("pmatch[%d] parent %d\n", i, parents[j]));
		if (pmatch[i].rm_so < pmatch[parents[j]].rm_so
		    || pmatch[i].rm_eo > pmatch[parents[j]].rm_eo)
		  pmatch[i].rm_so = pmatch[i].rm_eo = -1;
	      }
	  i++;
	}
    }

  while (i < nmatch)
    {
      pmatch[i].rm_so = -1;
      pmatch[i].rm_eo = -1;
      i++;
    }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movl %edx, 0x44(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movl %r9d, 0x2c(%rsp)
movl $0x0, 0x1c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jl 0xb90ef
movl 0x44(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0xb90ef
jmp 0xb8e26
jmp 0xb8e28
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x20(%rsp)
movl 0x1c(%rsp), %ecx
movq 0x38(%rsp), %rdx
xorl %eax, %eax
cmpl 0x34(%rdx), %ecx
movb %al, 0xf(%rsp)
jae 0xb8e5a
movl 0x1c(%rsp), %eax
cmpq 0x50(%rsp), %rax
setb %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xb8e67
jmp 0xb8f69
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq 0x38(%rsp), %rcx
cmpl 0x50(%rcx), %eax
jne 0xb8e95
movl 0x2c(%rsp), %edx
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %edx, (%rax,%rcx,8)
jmp 0xb8ebc
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movl 0x1c(%rsp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %edx
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %edx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq 0x38(%rsp), %rcx
cmpl 0x50(%rcx), %eax
jne 0xb8eec
movl 0x2c(%rsp), %edx
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %edx, 0x4(%rax,%rcx,8)
jmp 0xb8f15
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movl 0x1c(%rsp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
movl (%rax,%rcx,4), %edx
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %edx, 0x4(%rax,%rcx,8)
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
cmpl $-0x1, (%rax,%rcx,8)
je 0xb8f34
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
cmpl $-0x1, 0x4(%rax,%rcx,8)
jne 0xb8f55
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl $0xffffffff, 0x4(%rax,%rcx,8) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl $0xffffffff, (%rax,%rcx,8) # imm = 0xFFFFFFFF
jmp 0xb8f57
jmp 0xb8f59
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xb8e36
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %ecx
movq 0x38(%rsp), %rdx
xorl %eax, %eax
cmpl 0x34(%rdx), %ecx
movb %al, 0xe(%rsp)
jae 0xb8f95
movl 0x1c(%rsp), %eax
cmpq 0x50(%rsp), %rax
setb %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0xb8fa2
jmp 0xb90ed
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
cmpl $-0x1, 0x4(%rax,%rcx,8)
jne 0xb8fe4
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
cmpl $-0x1, (%rax,%rcx,8)
jne 0xb8fc3
jmp 0xb8fe2
leaq 0xbc0aa(%rip), %rdi     # 0x175074
leaq 0xbc0b9(%rip), %rsi     # 0x17508a
movl $0x60, %edx
leaq 0xbc0cc(%rip), %rcx     # 0x1750a9
callq 0xb3e0
jmp 0xb8fe4
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl (%rax,%rcx,8), %eax
movq 0x48(%rsp), %rcx
movl 0x1c(%rsp), %edx
cmpl 0x4(%rcx,%rdx,8), %eax
jg 0xb9001
jmp 0xb9020
leaq 0xbc0f1(%rip), %rdi     # 0x1750f9
leaq 0xbc07b(%rip), %rsi     # 0x17508a
movl $0x61, %edx
leaq 0xbc08e(%rip), %rcx     # 0x1750a9
callq 0xb3e0
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0xb90dd
movl $0x0, 0x18(%rsp)
movq 0x10(%rsp), %rax
movl 0x18(%rsp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jl 0xb90db
jmp 0xb905e
jmp 0xb9060
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl (%rax,%rcx,8), %eax
movq 0x48(%rsp), %rcx
movq 0x10(%rsp), %rdx
movl 0x18(%rsp), %esi
movslq (%rdx,%rsi,4), %rdx
cmpl (%rcx,%rdx,8), %eax
jl 0xb90a8
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl 0x4(%rax,%rcx,8), %eax
movq 0x48(%rsp), %rcx
movq 0x10(%rsp), %rdx
movl 0x18(%rsp), %esi
movslq (%rdx,%rsi,4), %rdx
cmpl 0x4(%rcx,%rdx,8), %eax
jle 0xb90c9
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl $0xffffffff, 0x4(%rax,%rcx,8) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl $0xffffffff, (%rax,%rcx,8) # imm = 0xFFFFFFFF
jmp 0xb90cb
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xb904d
jmp 0xb90dd
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xb8f71
jmp 0xb90ef
jmp 0xb90f1
movl 0x1c(%rsp), %eax
cmpq 0x50(%rsp), %rax
jae 0xb912a
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl $0xffffffff, (%rax,%rcx,8) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl $0xffffffff, 0x4(%rax,%rcx,8) # imm = 0xFFFFFFFF
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xb90f1
addq $0x58, %rsp
retq
nop