// File: icemiliang[P]vot/src/vot/cell.cc
// Function: void voro::voronoicell_base::add_memory<voro::voronoicell>(voro::voronoicell&, 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x14(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x4bc59
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x8, %edx
callq 0x54490
movl -0x24(%rbp), %eax
shll $0x3, %eax
cltq
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xa030
movq %rax, %rsi
movq -0x50(%rbp), %rax
movq 0x48(%rax), %rcx
movslq -0x14(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
movl $0x8, (%rax,%rcx,4)
jmp 0x4bec4
movq -0x50(%rbp), %rax
movl $0x0, -0x28(%rbp)
movq 0x38(%rax), %rcx
movslq -0x14(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
shll %esi
movl %esi, (%rcx,%rdx,4)
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x1000000, (%rax,%rcx,4) # imm = 0x1000000
jle 0x4bc96
leaq 0x489e4(%rip), %rdi     # 0x94670
movl $0x2, %esi
callq 0x4c000
movq -0x50(%rbp), %rcx
movl -0x24(%rbp), %eax
movq 0x38(%rcx), %rcx
movslq -0x14(%rbp), %rdx
imull (%rcx,%rdx,4), %eax
cltq
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xa030
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x544a0
movq -0x50(%rbp), %rdx
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
movq 0x40(%rdx), %rdx
movslq -0x14(%rbp), %rsi
imull (%rdx,%rsi,4), %ecx
cmpl %ecx, %eax
jge 0x4be81
movq -0x50(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x28(%rbp), %ecx
movl -0x14(%rbp), %edx
shll %edx
addl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x4bd5d
movq -0x50(%rbp), %rax
movq -0x38(%rbp), %rdx
movslq -0x28(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rdx
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x544b0
jmp 0x4be05
movq -0x50(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x4bde8
movq -0x50(%rbp), %rcx
movq 0x20(%rcx), %rax
movq -0x48(%rbp), %rdx
movslq (%rdx), %rdx
movq (%rax,%rdx,8), %rax
movq 0x48(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x28(%rbp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x4bdd8
movq -0x50(%rbp), %rax
movq -0x38(%rbp), %rdx
movslq -0x28(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rdx
movq 0x20(%rax), %rax
movq -0x48(%rbp), %rcx
movslq (%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rax
movl (%rax), %esi
movl -0x3c(%rbp), %edx
callq 0x544b0
jmp 0x4bde8
jmp 0x4bdda
movq -0x48(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x48(%rbp)
jmp 0x4bd69
movq -0x48(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x4be03
leaq 0x488a9(%rip), %rdi     # 0x946a2
movl $0x3, %esi
callq 0x4c000
jmp 0x4be05
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x4be4a
movq -0x50(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x4be0c
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4be7c
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x544c0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x4be51
jmp 0x4bce3
movq -0x50(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x4bea4
movq -0x58(%rbp), %rdi
callq 0xa660
movq -0x50(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x48(%rax), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x544d0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)