// File: Luthaf[P]zeopp/voro++/src/cell.cc
// Function: void voro::voronoicell_base::add_memory<voro::voronoicell>(voro::voronoicell&, int)
void voronoicell_base::add_memory(vc_class &vc,int i) {
	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) {
					for(dsp=xse;dsp<stackp3;dsp++) {
						if(ed[*dsp]==mep[i]+j) {
							ed[*dsp]=l+j;
							vc.n_set_to_aux1_offset(*dsp,m);
							break;
						}
					}
					if(dsp==stackp3) 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 $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x14(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, -0x18(%rbp)
movq 0x60(%rax), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x14e70
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x8, %edx
callq 0x1b240
movl -0x18(%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 0x2030
movq %rax, %rsi
movq -0x40(%rbp), %rax
movq 0x70(%rax), %rcx
movslq -0x14(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x60(%rax), %rax
movslq -0x14(%rbp), %rcx
movl $0x8, (%rax,%rcx,4)
movq 0x51189(%rip), %rax     # 0x65fe0
movq (%rax), %rdi
movl -0x14(%rbp), %edx
leaq 0x42e56(%rip), %rsi     # 0x57cba
movb $0x0, %al
callq 0x21a0
jmp 0x151c8
movq -0x40(%rbp), %rax
movl $0x0, -0x1c(%rbp)
movq 0x60(%rax), %rcx
movslq -0x14(%rbp), %rdx
movl (%rcx,%rdx,4), %esi
shll %esi
movl %esi, (%rcx,%rdx,4)
movq 0x60(%rax), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x1000000, (%rax,%rcx,4) # imm = 0x1000000
jle 0x14ead
leaq 0x42e37(%rip), %rdi     # 0x57cda
movl $0x2, %esi
callq 0x1b690
movq -0x40(%rbp), %rax
movq 0x51128(%rip), %rcx     # 0x65fe0
movq (%rcx), %rdi
movl -0x14(%rbp), %edx
movq 0x60(%rax), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
leaq 0x42e3c(%rip), %rsi     # 0x57d0c
movb $0x0, %al
callq 0x21a0
movq -0x40(%rbp), %rcx
movl -0x18(%rbp), %eax
movq 0x60(%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 0x2030
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1b250
movq -0x40(%rbp), %rdx
movl -0x1c(%rbp), %eax
movl -0x18(%rbp), %ecx
movq 0x68(%rdx), %rdx
movslq -0x14(%rbp), %rsi
imull (%rdx,%rsi,4), %ecx
cmpl %ecx, %eax
jge 0x15185
movq -0x40(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rbp), %ecx
movl -0x14(%rbp), %edx
shll %edx
addl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0x14f9e
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rdx
movslq -0x1c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rdx
movq 0x28(%rax), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x1b260
jmp 0x15109
movq -0x40(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
cmpq 0x98(%rcx), %rax
jae 0x15036
movq -0x40(%rbp), %rcx
movq 0x28(%rcx), %rax
movq -0x38(%rbp), %rdx
movslq (%rdx), %rdx
movq (%rax,%rdx,8), %rax
movq 0x70(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x1c(%rbp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x15023
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rdx
movslq -0x1c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rdx
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movslq (%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movl (%rax), %esi
movl -0x2c(%rbp), %edx
callq 0x1b260
jmp 0x15036
jmp 0x15025
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
jmp 0x14fad
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
cmpq 0x98(%rcx), %rax
jne 0x15107
movq -0x40(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
cmpq 0xb0(%rcx), %rax
jae 0x150e3
movq -0x40(%rbp), %rcx
movq 0x28(%rcx), %rax
movq -0x38(%rbp), %rdx
movslq (%rdx), %rdx
movq (%rax,%rdx,8), %rax
movq 0x70(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x1c(%rbp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x150d0
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rdx
movslq -0x1c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rdx
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movslq (%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movl (%rax), %esi
movl -0x2c(%rbp), %edx
callq 0x1b260
jmp 0x150e3
jmp 0x150d2
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
jmp 0x1505a
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
cmpq 0xb0(%rcx), %rax
jne 0x15105
leaq 0x42c39(%rip), %rdi     # 0x57d34
movl $0x3, %esi
callq 0x1b690
jmp 0x15107
jmp 0x15109
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x1514e
movq -0x40(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x15110
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x15180
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x1b270
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x15155
jmp 0x14f24
movq -0x40(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x151a8
movq -0x48(%rbp), %rdi
callq 0x2180
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rdx
movq 0x70(%rax), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1b280
addq $0x50, %rsp
popq %rbp
retq
nop