// File: /workspace/github_cpp_makefile_star2_O2/icemiliang[P]vot/src/vot/cell.cc
// Function: void voro::voronoicell_base::add_memory<voro::voronoicell_neighbor>(voro::voronoicell_neighbor&, int, int*)
void voronoicell_base::add_memory(vc_class &vc,int i,int *stackp2) {
    int s=(i<<1)+1;
    if(mem[i]==0) {
        vc.n_allocate(i,init_n_vertices);
        mep[i]=new int[init_n_vertices*s];
        mem[i]=init_n_vertices;
#if VOROPP_VERBOSE >=2
        fprintf(stderr,"Order %d vertex memory created\n",i);
#endif
    } else {
        int j=0,k,*l;
        mem[i]<<=1;
        if(mem[i]>max_n_vertices) voro_fatal_error("Point memory allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR);
#if VOROPP_VERBOSE >=2
        fprintf(stderr,"Order %d vertex memory scaled up to %d\n",i,mem[i]);
#endif
        l=new int[s*mem[i]];
        int m=0;
        vc.n_allocate_aux1(i);
        while(j<s*mec[i]) {
            k=mep[i][j+(i<<1)];
            if(k>=0) {
                ed[k]=l+j;
                vc.n_set_to_aux1_offset(k,m);
            } else {
                int *dsp;
                for(dsp=ds2;dsp<stackp2;dsp++) {
                    if(ed[*dsp]==mep[i]+j) {
                        ed[*dsp]=l+j;
                        vc.n_set_to_aux1_offset(*dsp,m);
                        break;
                    }
                }
                if(dsp==stackp2) voro_fatal_error("Couldn't relocate dangling pointer",VOROPP_INTERNAL_ERROR);
#if VOROPP_VERBOSE >=3
                fputs("Relocated dangling pointer",stderr);
#endif
            }
            for(k=0;k<s;k++,j++) l[j]=mep[i][j];
            for(k=0;k<i;k++,m++) vc.n_copy_to_aux1(i,m);
        }
        delete [] mep[i];
        mep[i]=l;
        vc.n_switch_to_aux1(i);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x38(%rsp)
movl %edx, %ebx
movq %rdi, %r8
leal (%rbx,%rbx), %r9d
leal 0x1(%rbx,%rbx), %r10d
movq 0x38(%rdi), %rcx
movslq %edx, %rbp
movl (%rcx,%rbp,4), %eax
testl %eax, %eax
je 0x1e624
movq %r9, 0x30(%rsp)
movq %rsi, 0x8(%rsp)
movq %r8, 0x18(%rsp)
addl %eax, %eax
movl %eax, (%rcx,%rbp,4)
cmpl $0x1000001, %eax        # imm = 0x1000001
movl %r10d, (%rsp)
jl 0x1e41d
leaq 0x26867(%rip), %rdi     # 0x44c6c
pushq $0x2
popq %rsi
callq 0x1c1ae
movl (%rsp), %r10d
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movl (%rax,%rbp,4), %eax
imull %r10d, %eax
cltq
leaq (,%rax,4), %rcx
testl %eax, %eax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x7030
movq %rax, %r13
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x1ffde
movl (%rsp), %r10d
xorl %r14d, %r14d
movq 0x30(%rsp), %r9
movl %r9d, %r11d
orl $0x1, %r11d
cmovlel %r14d, %r11d
testl %ebx, %ebx
movl $0x0, %r15d
movq %rbx, 0x40(%rsp)
cmovgl %ebx, %r15d
leal 0x1(%r9), %eax
testl %eax, %eax
cmovlel %r14d, %eax
movl %r15d, 0x14(%rsp)
movl %eax, 0x28(%rsp)
movl %eax, 0x4(%rsp)
xorl %r12d, %r12d
movq 0x18(%rsp), %r8
movl %r11d, 0x24(%rsp)
movl %r15d, 0x2c(%rsp)
movq 0x40(%r8), %rcx
movq 0x48(%r8), %rax
movl (%rcx,%rbp,4), %ecx
imull %r10d, %ecx
movq (%rax,%rbp,8), %rdi
cmpl %ecx, %r14d
jge 0x1e5f2
leal (%r14,%r9), %eax
cltq
movslq (%rdi,%rax,4), %rax
movslq %r12d, %rbx
testq %rax, %rax
movl %r12d, %esi
js 0x1e506
movslq %r14d, %r15
leaq (,%r15,4), %rcx
addq %r13, %rcx
movq 0x20(%r8), %rdx
movq %rcx, (%rdx,%rax,8)
movl %esi, %r12d
movslq %esi, %rcx
shlq $0x2, %rcx
movq 0x8(%rsp), %rdi
addq 0xb0(%rdi), %rcx
movq 0xa8(%rdi), %rdx
movq %rcx, (%rdx,%rax,8)
jmp 0x1e58a
movl %esi, %r12d
movslq %r14d, %r15
movq 0x20(%r8), %rcx
movq 0x60(%r8), %rax
leaq (%rdi,%r15,4), %rdx
movq 0x8(%rsp), %rdi
cmpq 0x38(%rsp), %rax
jae 0x1e55c
movslq (%rax), %rsi
cmpq %rdx, (%rcx,%rsi,8)
je 0x1e533
addq $0x4, %rax
jmp 0x1e51d
leaq (,%r15,4), %rdx
addq %r13, %rdx
movq %rdx, (%rcx,%rsi,8)
leaq (,%rbx,4), %rcx
addq 0xb0(%rdi), %rcx
movq 0xa8(%rdi), %rdx
movq %rcx, (%rdx,%rsi,8)
cmpq 0x38(%rsp), %rax
jne 0x1e58a
leaq 0x26734(%rip), %rdi     # 0x44c9e
pushq $0x3
popq %rsi
callq 0x1c1ae
movl 0x24(%rsp), %r11d
movl (%rsp), %r10d
movq 0x30(%rsp), %r9
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %r8
movslq 0x14(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq 0x48(%r8), %rdx
addl %r11d, %r14d
cmpq %r15, %rcx
je 0x1e5b2
movq (%rdx,%rbp,8), %rsi
movl (%rsi,%r15,4), %esi
movl %esi, (%r13,%r15,4)
incq %r15
jmp 0x1e59b
movq 0xa0(%rdi), %rcx
movq 0xb0(%rdi), %rdx
movl 0x2c(%rsp), %r15d
addl %r15d, %r12d
cmpq %rbx, %rax
je 0x1e5dc
movq (%rcx,%rbp,8), %rsi
movl (%rsi,%rbx,4), %esi
movl %esi, (%rdx,%rbx,4)
incq %rbx
jmp 0x1e5c8
movl 0x4(%rsp), %eax
addl 0x28(%rsp), %eax
movl %eax, 0x4(%rsp)
addl %r15d, 0x14(%rsp)
jmp 0x1e499
testq %rdi, %rdi
je 0x1e603
movq %r8, %rbx
callq 0x7470
movq 0x48(%rbx), %rax
movq %r13, (%rax,%rbp,8)
movq 0x8(%rsp), %rdi
movq 0x40(%rsp), %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20010
pushq $0x8
popq %rdx
movq %rsi, %rdi
movl %ebx, %esi
movq %r8, %rbx
movq %r9, %r14
movl %r10d, %r15d
callq 0x1ffa6
shll $0x3, %r15d
movslq %r15d, %rax
shlq $0x2, %rax
testl %r14d, %r14d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x7030
movq 0x48(%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x38(%rbx), %rax
movl $0x8, (%rax,%rbp,4)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq