// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movl %edx, %r13d
movq %rdi, %r15
leal (,%r13,2), %r8d
movslq %r8d, %r14
incq %r14
movq 0x60(%rdi), %rax
movslq %edx, %rbx
movl (%rax,%rbx,4), %ecx
testl %ecx, %ecx
jne 0x111a4
leal (,%r13,8), %edi
shlq $0x2, %rdi
testl %r13d, %r13d
movq $-0x1, %rax
cmovsq %rax, %rdi
movq %rsi, %r12
movq %r8, %rbp
callq 0x2030
movq 0xe8(%r12), %rcx
movq %rax, (%rcx,%rbx,8)
leal (,%r14,8), %eax
movslq %eax, %rdi
shlq $0x2, %rdi
testl %ebp, %ebp
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x2030
movq 0x70(%r15), %rcx
movq %rax, (%rcx,%rbx,8)
movq 0x60(%r15), %rax
movl $0x8, (%rax,%rbx,4)
movq 0x33e5e(%rip), %rax     # 0x44fe0
movq (%rax), %rdi
leaq 0x27e52(%rip), %rsi     # 0x38fde
movl %r13d, %edx
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
movq %r14, 0x8(%rsp)
movq %r8, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %rsi, 0x10(%rsp)
addl %ecx, %ecx
movl %ecx, (%rax,%rbx,4)
cmpl $0x1000001, %ecx        # imm = 0x1000001
jl 0x111dd
leaq 0x27e32(%rip), %rdi     # 0x38ffe
movl $0x2, %esi
callq 0x133c5
movq 0x60(%r15), %rax
movl (%rax,%rbx,4), %ecx
movq 0x33dfc(%rip), %rax     # 0x44fe0
movq (%rax), %rdi
leaq 0x27e42(%rip), %rsi     # 0x39030
xorl %r12d, %r12d
movl %ebx, %edx
xorl %eax, %eax
callq 0x21b0
movq 0x60(%r15), %rax
movslq (%rax,%rbx,4), %rax
movq 0x8(%rsp), %rbp
imulq %rbp, %rax
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x2030
movq %rax, %r14
movq 0x10(%rsp), %r13
movq 0x60(%r13), %rax
movslq (%rax,%rbx,4), %rax
imulq %rbx, %rax
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x2030
movq %r14, %r8
movq %rbp, %rdi
movq %r13, %r9
movq %rax, 0xf8(%r13)
movq 0x68(%r15), %rax
movl (%rax,%rbx,4), %eax
imull %edi, %eax
testl %eax, %eax
movq 0x20(%rsp), %r10
movq 0x18(%rsp), %r11
movq %r14, (%rsp)
jle 0x11467
movl %r11d, %r13d
incq %r13
movl %r10d, %ebp
xorl %r14d, %r14d
movq 0x70(%r15), %rax
movq (%rax,%rbx,8), %rsi
leal (%r14,%r11), %eax
cltq
movslq (%rsi,%rax,4), %rax
testq %rax, %rax
js 0x112d1
movslq %r14d, %rcx
leaq (%r8,%rcx,4), %rcx
movq 0x28(%r15), %rdx
movq %rcx, (%rdx,%rax,8)
movslq %r12d, %rcx
shlq $0x2, %rcx
addq 0xf8(%r9), %rcx
movq 0xf0(%r9), %rdx
movq %rcx, (%rdx,%rax,8)
jmp 0x113f2
movq 0x90(%r15), %rax
movq 0x98(%r15), %rcx
cmpq %rcx, %rax
jae 0x11340
movq 0x28(%r15), %rdx
movslq %r14d, %rdi
leaq (%rsi,%rdi,4), %rsi
movslq (%rax), %r8
cmpq %rsi, (%rdx,%r8,8)
je 0x1130c
addq $0x4, %rax
cmpq %rcx, %rax
jb 0x112ef
movq 0x8(%rsp), %rdi
movq (%rsp), %r8
jmp 0x11340
movq (%rsp), %rsi
leaq (%rsi,%rdi,4), %rcx
movq %rcx, (%rdx,%r8,8)
movslq %r12d, %rcx
shlq $0x2, %rcx
addq 0xf8(%r9), %rcx
movq 0xf0(%r9), %rdx
movq %rcx, (%rdx,%r8,8)
movq %rsi, %r8
movq 0x98(%r15), %rcx
movq 0x8(%rsp), %rdi
cmpq %rcx, %rax
jne 0x113f2
movq 0xa8(%r15), %rax
movq 0xb0(%r15), %rcx
cmpq %rcx, %rax
jae 0x113c4
movq 0x28(%r15), %rdx
movq 0x70(%r15), %r8
movslq %r14d, %rsi
leaq (,%rsi,4), %rdi
addq (%r8,%rbx,8), %rdi
movslq (%rax), %r8
cmpq %rdi, (%rdx,%r8,8)
je 0x11390
addq $0x4, %rax
cmpq %rcx, %rax
jb 0x11373
movq 0x8(%rsp), %rdi
movq (%rsp), %r8
jmp 0x113c4
movq (%rsp), %rdi
leaq (%rdi,%rsi,4), %rcx
movq %rcx, (%rdx,%r8,8)
movslq %r12d, %rcx
shlq $0x2, %rcx
addq 0xf8(%r9), %rcx
movq 0xf0(%r9), %rdx
movq %rcx, (%rdx,%r8,8)
movq %rdi, %r8
movq 0xb0(%r15), %rcx
movq 0x8(%rsp), %rdi
cmpq %rcx, %rax
jne 0x113f2
leaq 0x27c88(%rip), %rdi     # 0x39058
movl $0x3, %esi
callq 0x133c5
movq (%rsp), %r8
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x10(%rsp), %r9
testl %r11d, %r11d
js 0x11421
movq 0x70(%r15), %rcx
movslq %r14d, %rdx
leaq (,%rdx,4), %rax
addq (%rcx,%rbx,8), %rax
leaq (%r8,%rdx,4), %rdx
xorl %ecx, %ecx
movl (%rax,%rcx,4), %esi
movl %esi, (%rdx,%rcx,4)
incq %rcx
cmpl %ecx, %r13d
jne 0x11410
addl %ecx, %r14d
testl %r10d, %r10d
jle 0x11454
movq 0xe8(%r9), %rcx
movslq %r12d, %rax
shlq $0x2, %rax
movq (%rcx,%rbx,8), %rcx
addq %rax, %rcx
addq 0xf8(%r9), %rax
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
cmpl %edx, %ebp
jne 0x11444
addl %edx, %r12d
movq 0x68(%r15), %rax
movl (%rax,%rbx,4), %eax
imull %edi, %eax
cmpl %eax, %r14d
jl 0x1128d
movq 0x70(%r15), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x11486
callq 0x2180
movq (%rsp), %r8
movq 0x10(%rsp), %r9
movq 0x70(%r15), %rax
movq %r8, (%rax,%rbx,8)
movq 0xe8(%r9), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x114ab
callq 0x2180
movq 0x10(%rsp), %r9
movq 0xe8(%r9), %rax
movq 0xf8(%r9), %rcx
movq %rcx, (%rax,%rbx,8)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop