// File: /workspace/github_c_makefile_star2_O3/jondurbin[P]dre2/src/dre2_parse.c
// Function: dre2_duplicate_group
void dre2_duplicate_group( struct dre2_node **v, int *node_count, int *last_node, struct dre2_parse_return *res, int **minimal )
{
  int i, j, diff;
  int o, c;

  for ( i = res->open; i <= res->close; i++ )
  {
    dre2_duplicate_node( v, node_count, i, minimal );
    ( *minimal )[*node_count - 1] = ( *minimal )[i];
    if ( i != res->open )
    {
      ( *v )[*node_count - 1].p_count = ( *v )[i].p_count;
      ( *v )[*node_count - 1].p = ( int * )malloc( sizeof( int ) * ( *v )[i].p_count );
      for ( j = 0; j < ( *v )[i].p_count; j++ )
      {
        diff = ( *v )[i].p[j] - res->open;
        ( *v )[*node_count - 1].p[j] = *last_node + diff + 1;
      }
    } else
    {
      ( *v )[*node_count - 1].p_count = 1;
      ( *v )[*node_count - 1].p = ( int * )malloc( sizeof( int ) );
      ( *v )[*node_count - 1].p[0] = res->close;
    }

    if ( i != res->close )
    {
      ( *v )[*node_count - 1].n_count = ( *v )[i].n_count;
      ( *v )[*node_count - 1].n = ( int * )malloc( sizeof( int ) * ( *v )[i].n_count );
      for ( j = 0; j < ( *v )[i].n_count; j++ )
      {
        diff = ( *v )[i].n[j] - res->open;
        ( *v )[*node_count - 1].n[j] = *last_node + diff + 1;
      }
    }
  }
  res->open = res->close + 1;
  res->close = *node_count - 1;
  *last_node = res->close;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x20(%rsp)
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movslq (%rcx), %r13
movl 0x4(%rcx), %esi
cmpl %esi, %r13d
jg 0x4cb0
movq %rdi, 0x8(%rsp)
movl %r13d, %ebp
movq %r15, %rsi
movl %r13d, %edx
movq 0x20(%rsp), %r12
movq %r12, %rcx
callq 0x2140
movq (%r12), %rax
movl (%rax,%r13,4), %ecx
movslq (%r15), %rdx
movl %ecx, -0x4(%rax,%rdx,4)
movq %r13, %r12
movq 0x8(%rsp), %rax
movq (%rax), %r13
movl %ebp, 0x14(%rsp)
cmpl %ebp, (%r14)
movq %r12, 0x18(%rsp)
jne 0x4ba1
movslq (%r15), %rax
shlq $0x6, %rax
movl $0x1, -0x20(%r13,%rax)
movl $0x4, %edi
callq 0x22a0
movslq (%r15), %rcx
shlq $0x6, %rcx
movq %rax, -0x28(%r13,%rcx)
movl 0x4(%r14), %eax
movq 0x8(%rsp), %rdx
movq (%rdx), %r13
movq -0x28(%r13,%rcx), %rcx
movl %eax, (%rcx)
jmp 0x4c10
shlq $0x6, %r12
movslq 0x20(%r13,%r12), %rdi
movslq (%r15), %rax
shlq $0x6, %rax
movl %edi, -0x20(%r13,%rax)
shlq $0x2, %rdi
callq 0x22a0
movslq (%r15), %rcx
shlq $0x6, %rcx
movq %rax, -0x28(%r13,%rcx)
movq 0x8(%rsp), %rax
movq (%rax), %r13
cmpl $0x0, 0x20(%r13,%r12)
jle 0x4c10
addq %r13, %r12
leaq -0x28(%r13), %rax
movq 0x18(%r12), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movl (%rbx), %edi
subl (%r14), %esi
addl %edi, %esi
incl %esi
movslq (%r15), %rdi
shlq $0x6, %rdi
movq (%rax,%rdi), %rdi
movl %esi, (%rdi,%rdx,4)
incq %rdx
movslq 0x20(%r12), %rsi
cmpq %rsi, %rdx
jl 0x4be9
movl 0x4(%r14), %ebp
movl 0x14(%rsp), %esi
cmpl %esi, %ebp
je 0x4c96
movq 0x18(%rsp), %r12
shlq $0x6, %r12
movslq 0x10(%r13,%r12), %rdi
movslq (%r15), %rax
shlq $0x6, %rax
movl %edi, -0x30(%r13,%rax)
shlq $0x2, %rdi
callq 0x22a0
movslq (%r15), %rcx
shlq $0x6, %rcx
movq %rax, -0x38(%r13,%rcx)
movq 0x8(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x10(%rax,%r12)
movl %ebp, %esi
jle 0x4c96
addq %rax, %r12
addq $-0x38, %rax
movq 0x8(%r12), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movl (%rbx), %edi
subl (%r14), %esi
addl %edi, %esi
incl %esi
movslq (%r15), %rdi
shlq $0x6, %rdi
movq (%rax,%rdi), %rdi
movl %esi, (%rdi,%rdx,4)
incq %rdx
movslq 0x10(%r12), %rsi
cmpq %rsi, %rdx
jl 0x4c6b
movl 0x4(%r14), %esi
movq 0x18(%rsp), %rdx
leaq 0x1(%rdx), %r13
movslq %esi, %rcx
cmpq %rcx, %rdx
movq 0x8(%rsp), %rdi
jl 0x4b28
incl %esi
movl %esi, (%r14)
movl (%r15), %eax
decl %eax
movl %eax, 0x4(%r14)
movl %eax, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq