// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %r9d, %r9d
setns %al
testb $0x8, %dl
sete %dl
xorl %r10d, %r10d
testb %al, %dl
je 0x70d50
movq 0x20(%rcx), %rax
movl 0x34(%rcx), %edx
cmpq %rdx, %rdi
movq %rdx, %r10
cmovbq %rdi, %r10
shlq $0x3, %r10
xorl %r11d, %r11d
cmpq %r11, %r10
je 0x70cd2
movslq (%rax,%r11,2), %r14
movl 0x50(%rcx), %ebp
movl %r9d, %ebx
cmpl %ebp, %r14d
je 0x70ca2
movl (%r8,%r14,4), %ebx
movl %ebx, (%rsi,%r11)
movslq 0x4(%rax,%r11,2), %r15
movl %r9d, %r14d
cmpl %ebp, %r15d
je 0x70cb7
movl (%r8,%r15,4), %r14d
movl %r14d, 0x4(%rsi,%r11)
cmpl $-0x1, %ebx
je 0x70cc7
cmpl $-0x1, %r14d
jne 0x70ccc
orq $-0x1, (%rsi,%r11)
addq $0x8, %r11
jmp 0x70c8a
xorl %r10d, %r10d
pushq $-0x1
popq %rcx
cmpl %edx, %r10d
jae 0x70d50
movl %r10d, %r8d
cmpq %rdi, %r8
jae 0x70d50
movl (%rsi,%r8,8), %r11d
movl 0x4(%rsi,%r8,8), %r9d
cmpl $-0x1, %r9d
setne %bl
cmpl $-0x1, %r11d
sete %bpl
orb %bl, %bpl
je 0x70d63
cmpl %r9d, %r11d
jg 0x70d7c
movq %r8, %rbx
shlq $0x4, %rbx
movq 0x8(%rax,%rbx), %rbx
testq %rbx, %rbx
je 0x70d42
xorl %ebp, %ebp
movl %ebp, %r14d
movslq (%rbx,%r14,4), %r14
testq %r14, %r14
js 0x70d42
cmpl (%rsi,%r14,8), %r11d
jl 0x70d33
cmpl 0x4(%rsi,%r14,8), %r9d
jle 0x70d3e
orq $-0x1, (%rsi,%r8,8)
movl %ecx, %r9d
movl %ecx, %r11d
incl %ebp
jmp 0x70d1a
incl %r10d
jmp 0x70cd8
orq $-0x1, (%rsi,%rax,8)
leal 0x1(%rax), %r10d
movl %r10d, %eax
cmpq %rdi, %rax
jb 0x70d47
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6f4ef(%rip), %rdi     # 0xe0259
leaq 0x6f4fe(%rip), %rsi     # 0xe026f
leaq 0x6f516(%rip), %rcx     # 0xe028e
pushq $0x60
jmp 0x70d93
leaq 0x6f55b(%rip), %rdi     # 0xe02de
leaq 0x6f4e5(%rip), %rsi     # 0xe026f
leaq 0x6f4fd(%rip), %rcx     # 0xe028e
pushq $0x61
popq %rdx
callq 0xb400