// File: Luthaf[P]zeopp/v_network.cc
// Function: voronoi_network::add_particular_vertex_memory(int)
void voronoi_network::add_particular_vertex_memory(int l) {
	numem[l]<<=1;

	// Check that the vertex allocation does not exceed a maximum safe
	// limit
	if(numem[l]>max_vertex_order)
		voro_fatal_error("Particular vertex maximum memory allocation exceeded",VOROPP_MEMORY_ERROR);
	
	// Allocate new arrays
	int *ned(new int[2*numem[l]]);
	int *nne(ned+numem[l]);
	block *nraded(new block[numem[l]]);
	unsigned int *npered(new unsigned int[numem[l]]);

	// Copy the contents of the old arrays into the new ones 
	for(int i=0;i<nu[l];i++) {
		ned[i]=ed[l][i];
		nraded[i]=raded[l][i];
		npered[i]=pered[l][i];
	}
	for(int i=0;i<nec[l];i++) nne[i]=ne[l][i];
	
	// Delete old arrays and update pointers to the new ones
	delete [] ed[l];ed[l]=ned;ne[l]=nne;
	delete [] raded[l];raded[l]=nraded;
	delete [] pered[l];pered[l]=npered;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq 0xb8(%rax), %rcx
movslq -0xc(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
shll %esi
movl %esi, (%rcx,%rdx,4)
movq 0xb8(%rax), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x800, (%rax,%rcx,4)   # imm = 0x800
jle 0xe374f
leaq 0x1184f2(%rip), %rdi    # 0x1fbc37
movl $0x2, %esi
callq 0x1bd150
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shll %eax
cltq
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq 0xb8(%rax), %rdx
movslq -0xc(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movq %rcx, -0x20(%rbp)
movq 0xb8(%rax), %rax
movslq -0xc(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movl $0x10, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq 0xb8(%rax), %rax
movslq -0xc(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %rcx
movl -0x34(%rbp), %eax
movq 0xa8(%rcx), %rcx
movslq -0xc(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xe38cb
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x34(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
movq -0x18(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0x90(%rax), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
movslq -0x34(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rdx
movq -0x28(%rbp), %rcx
movslq -0x34(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rcx
movq (%rdx), %rsi
movq %rsi, (%rcx)
movq 0x8(%rdx), %rdx
movq %rdx, 0x8(%rcx)
movq 0x98(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xe3825
movl $0x0, -0x38(%rbp)
movq -0x40(%rbp), %rcx
movl -0x38(%rbp), %eax
movq 0xb0(%rcx), %rcx
movslq -0xc(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xe3919
movq -0x40(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xe38d2
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0xe393f
movq -0x48(%rbp), %rdi
callq 0x56c0
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rsi
movq 0x80(%rax), %rcx
movslq -0xc(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq -0x20(%rbp), %rsi
movq 0x88(%rax), %rcx
movslq -0xc(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x90(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0xe398b
movq -0x50(%rbp), %rdi
callq 0x56c0
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rsi
movq 0x90(%rax), %rcx
movslq -0xc(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x98(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0xe39c4
movq -0x58(%rbp), %rdi
callq 0x56c0
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rdx
movq 0x98(%rax), %rax
movslq -0xc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)