// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/voro++/src/cell.cc
// Function: void voro::voronoicell_base::add_memory<voro::voronoicell_neighbor>(voro::voronoicell_neighbor&, 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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
leal (%rdx,%rdx), %r8d
movslq %r8d, %r9
incq %r9
movq 0x60(%rdi), %rax
movslq %edx, %rbx
movl (%rax,%rbx,4), %ecx
testl %ecx, %ecx
jne 0xdbb0
pushq $0x8
popq %rdx
movq %rsi, %rdi
movl %ebx, %esi
movq %r8, %r15
movq %r9, %r12
callq 0xfc4a
leal (,%r12,8), %eax
cltq
shlq $0x2, %rax
testl %r15d, %r15d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq 0x70(%r14), %rcx
movq %rax, (%rcx,%rbx,8)
movq 0x60(%r14), %rax
movl $0x8, (%rax,%rbx,4)
movq 0x31451(%rip), %rax     # 0x3efe0
movq (%rax), %rdi
leaq 0x23415(%rip), %rsi     # 0x30fae
movl %ebx, %edx
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21a0
movq %r9, 0x28(%rsp)
movq %r8, 0x30(%rsp)
movq %rsi, 0x8(%rsp)
addl %ecx, %ecx
movl %ecx, (%rax,%rbx,4)
cmpl $0x1000001, %ecx        # imm = 0x1000001
jl 0xdbe2
leaq 0x233fb(%rip), %rdi     # 0x30fce
pushq $0x2
popq %rsi
callq 0xfdaf
movq 0x60(%r14), %rax
movl (%rax,%rbx,4), %ecx
movq 0x313f7(%rip), %rax     # 0x3efe0
movq (%rax), %rdi
leaq 0x2340d(%rip), %rsi     # 0x31000
xorl %r13d, %r13d
movl %ebx, %edx
xorl %eax, %eax
callq 0x21a0
movq 0x60(%r14), %rax
movslq (%rax,%rbx,4), %rax
movq 0x28(%rsp), %r15
imulq %r15, %rax
movq %rax, %rcx
shlq $0x2, %rcx
testl %eax, %eax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x2030
movq %rax, %r12
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0xfc82
movq %r15, %r11
movq 0x30(%rsp), %r10
movl %r10d, %eax
orl $0x1, %eax
cmovlel %r13d, %eax
movl %eax, 0x20(%rsp)
testl %ebx, %ebx
movl $0x0, %r8d
cmovgl %ebx, %r8d
leal 0x1(%r10), %eax
testl %eax, %eax
cmovlel %r13d, %eax
movl %r8d, 0x14(%rsp)
movl %eax, 0x18(%rsp)
movl %eax, 0x4(%rsp)
xorl %r9d, %r9d
movl %r8d, 0x1c(%rsp)
movq 0x68(%r14), %rcx
movq 0x70(%r14), %rax
movl (%rcx,%rbx,4), %ecx
imull %r11d, %ecx
movq (%rax,%rbx,8), %rdi
cmpl %ecx, %r13d
jge 0xde28
leal (%r10,%r13), %eax
cltq
movslq (%rdi,%rax,4), %rax
movq 0x28(%r14), %rcx
movslq %r9d, %r15
testq %rax, %rax
movl %r9d, 0x24(%rsp)
movslq %r13d, %rbp
js 0xdcda
leaq (%r12,%rbp,4), %rdx
movq %rdx, (%rcx,%rax,8)
movslq %r9d, %rcx
shlq $0x2, %rcx
movq 0x8(%rsp), %r9
addq 0xf8(%r9), %rcx
movq 0xf0(%r9), %rdx
movq %rcx, (%rdx,%rax,8)
jmp 0xddb9
movq 0x90(%r14), %rax
movq 0x98(%r14), %rdx
leaq (%rdi,%rbp,4), %rsi
movq 0x8(%rsp), %r9
cmpq %rdx, %rax
jae 0xdd2e
movslq (%rax), %rdi
cmpq %rsi, (%rcx,%rdi,8)
je 0xdd05
addq $0x4, %rax
jmp 0xdcf1
leaq (%r12,%rbp,4), %rdx
movq %rdx, (%rcx,%rdi,8)
leaq (,%r15,4), %rcx
addq 0xf8(%r9), %rcx
movq 0xf0(%r9), %rdx
movq %rcx, (%rdx,%rdi,8)
movq 0x98(%r14), %rdx
cmpq %rdx, %rax
jne 0xddb9
movq 0xa8(%r14), %rax
movq 0xb0(%r14), %rcx
movq 0x28(%r14), %rdx
movq 0x70(%r14), %rsi
cmpq %rcx, %rax
jae 0xdd96
movslq (%rax), %rdi
leaq (,%rbp,4), %r8
addq (%rsi,%rbx,8), %r8
cmpq %r8, (%rdx,%rdi,8)
je 0xdd6d
addq $0x4, %rax
jmp 0xdd4d
leaq (%r12,%rbp,4), %rcx
movq %rcx, (%rdx,%rdi,8)
leaq (,%r15,4), %rcx
addq 0xf8(%r9), %rcx
movq 0xf0(%r9), %rdx
movq %rcx, (%rdx,%rdi,8)
movq 0xb0(%r14), %rcx
cmpq %rcx, %rax
jne 0xddb9
leaq 0x23286(%rip), %rdi     # 0x31028
pushq $0x3
popq %rsi
callq 0xfdaf
movq 0x28(%rsp), %r11
movq 0x30(%rsp), %r10
movq 0x8(%rsp), %r9
movslq 0x14(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq 0x70(%r14), %rdx
addl 0x20(%rsp), %r13d
cmpq %rbp, %rcx
je 0xdde1
movq (%rdx,%rbx,8), %rsi
movl (%rsi,%rbp,4), %esi
movl %esi, (%r12,%rbp,4)
incq %rbp
jmp 0xddcc
movq 0xe8(%r9), %rcx
movq 0xf8(%r9), %rdx
movl 0x1c(%rsp), %r8d
movl 0x24(%rsp), %r9d
addl %r8d, %r9d
cmpq %r15, %rax
je 0xde12
movq (%rcx,%rbx,8), %rsi
movl (%rsi,%r15,4), %esi
movl %esi, (%rdx,%r15,4)
incq %r15
jmp 0xddfc
movl 0x4(%rsp), %eax
addl 0x18(%rsp), %eax
movl %eax, 0x4(%rsp)
addl %r8d, 0x14(%rsp)
jmp 0xdc75
testq %rdi, %rdi
je 0xde36
callq 0x2170
movq 0x70(%r14), %rax
movq %r12, (%rax,%rbx,8)
movq 0x8(%rsp), %rdi
movl %ebx, %esi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfcb4