// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movslq (%rcx), %r12
movl 0x4(%rcx), %eax
cmpl %eax, %r12d
jg 0x4d56
movq %rdi, 0x8(%rsp)
movq %r15, %rsi
movl %r12d, %edx
movq %rdi, %rbp
movq 0x10(%rsp), %r13
movq %r13, %rcx
callq 0x2140
movq (%r13), %rax
movl (%rax,%r12,4), %ecx
movslq (%r15), %rdx
movl %ecx, -0x4(%rax,%rdx,4)
movq (%rbp), %r13
cmpl %r12d, (%r14)
jne 0x4c45
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 (%rbp), %rdx
movq -0x28(%rdx,%rcx), %rcx
movl %eax, (%rcx)
movq %rbp, %rdi
jmp 0x4cbc
movq %r12, %rbp
shlq $0x6, %rbp
movl 0x20(%r13,%rbp), %eax
movslq (%r15), %rcx
shlq $0x6, %rcx
movl %eax, -0x20(%r13,%rcx)
movslq 0x20(%r13,%rbp), %rdi
shlq $0x2, %rdi
callq 0x22a0
movslq (%r15), %rcx
shlq $0x6, %rcx
movq %rax, -0x28(%r13,%rcx)
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
cmpl $0x0, 0x20(%rax,%rbp)
jle 0x4cbc
addq %rax, %rbp
addq $-0x28, %rax
movq 0x18(%rbp), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movl (%rbx), %r8d
subl (%r14), %esi
addl %r8d, %esi
incl %esi
movslq (%r15), %r8
shlq $0x6, %r8
movq (%rax,%r8), %r8
movl %esi, (%r8,%rdx,4)
incq %rdx
movslq 0x20(%rbp), %rsi
cmpq %rsi, %rdx
jl 0x4c93
cmpl %r12d, 0x4(%r14)
je 0x4d41
movq 0x8(%rsp), %rax
movq (%rax), %r13
movq %r12, %rbp
shlq $0x6, %rbp
movl 0x10(%r13,%rbp), %eax
movslq (%r15), %rcx
shlq $0x6, %rcx
movl %eax, -0x30(%r13,%rcx)
movslq 0x10(%r13,%rbp), %rdi
shlq $0x2, %rdi
callq 0x22a0
movslq (%r15), %rcx
shlq $0x6, %rcx
movq %rax, -0x38(%r13,%rcx)
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
cmpl $0x0, 0x10(%rax,%rbp)
jle 0x4d41
addq %rax, %rbp
addq $-0x38, %rax
movq 0x8(%rbp), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movl (%rbx), %r8d
subl (%r14), %esi
addl %r8d, %esi
incl %esi
movslq (%r15), %r8
shlq $0x6, %r8
movq (%rax,%r8), %r8
movl %esi, (%r8,%rdx,4)
incq %rdx
movslq 0x10(%rbp), %rsi
cmpq %rsi, %rdx
jl 0x4d18
leaq 0x1(%r12), %rcx
movslq 0x4(%r14), %rax
cmpq %rax, %r12
movq %rcx, %r12
jl 0x4bdd
incl %eax
movl %eax, (%r14)
movl (%r15), %eax
decl %eax
movl %eax, 0x4(%r14)
movl %eax, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq