// File: /workspace/github_cpp_makefile_star2_O3/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 $0x18, %rsp
movq %rcx, %r12
movq %rsi, %rbx
movq %rdi, %r14
leal (%rdx,%rdx), %r15d
leal 0x1(%rdx,%rdx), %r13d
movq 0x38(%rdi), %rcx
movslq %edx, %rbp
movl (%rcx,%rbp,4), %eax
testl %eax, %eax
je 0x25592
movq %rdx, 0x10(%rsp)
addl %eax, %eax
movl %eax, (%rcx,%rbp,4)
cmpl $0x1000001, %eax        # imm = 0x1000001
jge 0x255f8
imull %r13d, %eax
cltq
leaq (,%rax,4), %rdi
testl %eax, %eax
movq $-0x1, %rax
cmovsq %rax, %rdi
movl %r13d, 0xc(%rsp)
callq 0x7030
movq %rax, %r13
movq 0x38(%rbx), %rax
movslq (%rax,%rbp,4), %rax
imulq %rbp, %rax
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x7030
movl 0xc(%rsp), %r11d
movq %rax, 0xb0(%rbx)
movq 0x40(%r14), %rax
movl (%rax,%rbp,4), %eax
imull %r11d, %eax
testl %eax, %eax
jle 0x2554f
movl %r15d, %eax
incq %rax
movl 0x10(%rsp), %ecx
xorl %edx, %edx
xorl %esi, %esi
movq 0x48(%r14), %rdi
movq (%rdi,%rbp,8), %r10
leal (%rsi,%r15), %edi
movslq %edi, %rdi
movslq (%r10,%rdi,4), %rdi
testq %rdi, %rdi
js 0x2546c
movslq %esi, %r8
leaq (,%r8,4), %r8
addq %r13, %r8
movq 0x20(%r14), %r9
movq %r8, (%r9,%rdi,8)
movslq %edx, %r8
shlq $0x2, %r8
addq 0xb0(%rbx), %r8
movq 0xa8(%rbx), %r9
movq %r8, (%r9,%rdi,8)
jmp 0x254ca
movq 0x60(%r14), %rdi
cmpq %r12, %rdi
jae 0x254bc
movq 0x20(%r14), %r8
movslq %esi, %r9
leaq (%r10,%r9,4), %r10
movslq (%rdi), %r11
cmpq %r10, (%r8,%r11,8)
je 0x25494
addq $0x4, %rdi
cmpq %r12, %rdi
jb 0x25480
jmp 0x254bc
leaq (,%r9,4), %r9
addq %r13, %r9
movq %r9, (%r8,%r11,8)
movslq %edx, %r8
shlq $0x2, %r8
addq 0xb0(%rbx), %r8
movq 0xa8(%rbx), %r9
movq %r8, (%r9,%r11,8)
cmpq %r12, %rdi
movl 0xc(%rsp), %r11d
je 0x255f3
testl %r15d, %r15d
js 0x25503
movq 0x48(%r14), %r8
movslq %esi, %r9
leaq (,%r9,4), %rdi
addq (%r8,%rbp,8), %rdi
leaq (,%r9,4), %r9
addq %r13, %r9
xorl %r8d, %r8d
movl (%rdi,%r8,4), %r10d
movl %r10d, (%r9,%r8,4)
incq %r8
cmpl %r8d, %eax
jne 0x254f0
addl %r8d, %esi
cmpl $0x0, 0x10(%rsp)
jle 0x2553c
movq 0xa0(%rbx), %r8
movslq %edx, %rdi
shlq $0x2, %rdi
movq (%r8,%rbp,8), %r8
addq %rdi, %r8
addq 0xb0(%rbx), %rdi
xorl %r9d, %r9d
movl (%r8,%r9,4), %r10d
movl %r10d, (%rdi,%r9,4)
incq %r9
cmpl %r9d, %ecx
jne 0x25529
addl %r9d, %edx
movq 0x40(%r14), %rdi
movl (%rdi,%rbp,4), %edi
imull %r11d, %edi
cmpl %edi, %esi
jl 0x25423
movq 0x48(%r14), %rax
movq (%rax,%rbp,8), %rdi
testq %rdi, %rdi
je 0x25565
callq 0x7490
movq 0x48(%r14), %rax
movq %r13, (%rax,%rbp,8)
movq 0xa0(%rbx), %rax
movq (%rax,%rbp,8), %rdi
testq %rdi, %rdi
je 0x25585
callq 0x7490
movq 0xa0(%rbx), %rax
movq 0xb0(%rbx), %rcx
movq %rcx, (%rax,%rbp,8)
jmp 0x255e4
leal (,%rdx,8), %edi
shlq $0x2, %rdi
testl %edx, %edx
movq $-0x1, %r12
cmovsq %r12, %rdi
callq 0x7030
movq 0xa0(%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
shll $0x3, %r13d
movslq %r13d, %rdi
shlq $0x2, %rdi
testl %r15d, %r15d
cmovsq %r12, %rdi
callq 0x7030
movq 0x48(%r14), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x38(%r14), %rax
movl $0x8, (%rax,%rbp,4)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7a7e
callq 0x7aa6
nop