// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
leal (,%r13,2), %r8d
movslq %r8d, %r15
incq %r15
movq 0x60(%rdi), %rax
movslq %edx, %rbx
movl (%rax,%rbx,4), %ecx
testl %ecx, %ecx
jne 0x11245
leal (,%r13,8), %eax
movslq %eax, %rdi
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 (,%r15,8), %eax
movslq %eax, %rdi
shlq $0x2, %rdi
testl %ebp, %ebp
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x2030
movq 0x70(%r14), %rcx
movq %rax, (%rcx,%rbx,8)
movq 0x60(%r14), %rax
movl $0x8, (%rax,%rbx,4)
movq 0x34dbd(%rip), %rax     # 0x45fe0
movq (%rax), %rdi
leaq 0x27d41(%rip), %rsi     # 0x38f6e
movl %r13d, %edx
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
movq %r15, 0x10(%rsp)
movq %r8, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %rsi, 0x8(%rsp)
addl %ecx, %ecx
movl %ecx, (%rax,%rbx,4)
cmpl $0x1000001, %ecx        # imm = 0x1000001
jl 0x11277
leaq 0x27d21(%rip), %rdi     # 0x38f8e
movl $0x2, %esi
callq 0x1318d
movq 0x34d62(%rip), %rax     # 0x45fe0
movq (%rax), %rdi
movq 0x60(%r14), %rax
movl (%rax,%rbx,4), %ecx
leaq 0x27d31(%rip), %rsi     # 0x38fc0
xorl %r12d, %r12d
movl %ebx, %edx
xorl %eax, %eax
callq 0x21b0
movq 0x60(%r14), %rax
movslq (%rax,%rbx,4), %rax
movq 0x10(%rsp), %rbp
imulq %rbp, %rax
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
movq $-0x1, %r15
cmovsq %r15, %rdi
callq 0x2030
movq %rax, (%rsp)
movq 0x8(%rsp), %r13
movq 0x60(%r13), %rax
movslq (%rax,%rbx,4), %rax
imulq %rbx, %rax
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
cmovsq %r15, %rdi
callq 0x2030
movq %rbp, %r8
movq %r13, %r9
movq %rax, 0xf8(%r13)
movq 0x68(%r14), %rax
movl (%rax,%rbx,4), %eax
imull %r8d, %eax
testl %eax, %eax
movq 0x20(%rsp), %r10
movq 0x18(%rsp), %r11
jle 0x114e3
movl %r11d, %r13d
incq %r13
movl %r10d, %ebp
xorl %r15d, %r15d
movq 0x70(%r14), %rax
movq (%rax,%rbx,8), %rdi
leal (%r15,%r11), %eax
cltq
movslq (%rdi,%rax,4), %rax
testq %rax, %rax
js 0x1136a
movslq %r15d, %rcx
movq (%rsp), %rdx
leaq (%rdx,%rcx,4), %rcx
movq 0x28(%r14), %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 0x11469
movq 0x90(%r14), %rax
movq 0x98(%r14), %rcx
cmpq %rcx, %rax
jae 0x113c1
movq 0x28(%r14), %rdx
movslq %r15d, %rsi
leaq (%rdi,%rsi,4), %rdi
movslq (%rax), %r8
cmpq %rdi, (%rdx,%r8,8)
je 0x1139c
addq $0x4, %rax
cmpq %rcx, %rax
jb 0x11388
jmp 0x113c1
movq (%rsp), %rcx
leaq (%rcx,%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)
cmpq 0x98(%r14), %rax
movq 0x10(%rsp), %r8
jne 0x11469
movq 0xa8(%r14), %rax
movq 0xb0(%r14), %rcx
cmpq %rcx, %rax
jae 0x11436
movq 0x28(%r14), %rdx
movq 0x70(%r14), %r8
movslq %r15d, %rsi
leaq (,%rsi,4), %rdi
addq (%r8,%rbx,8), %rdi
movslq (%rax), %r8
cmpq %rdi, (%rdx,%r8,8)
je 0x11411
addq $0x4, %rax
cmpq %rcx, %rax
jb 0x113fd
jmp 0x11436
movq (%rsp), %rcx
leaq (%rcx,%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)
cmpq 0xb0(%r14), %rax
movq 0x10(%rsp), %r8
jne 0x11469
leaq 0x27b9d(%rip), %rdi     # 0x38fe8
movl $0x3, %esi
callq 0x1318d
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
testl %r11d, %r11d
js 0x1149c
movq 0x70(%r14), %rcx
movslq %r15d, %rdx
leaq (,%rdx,4), %rax
addq (%rcx,%rbx,8), %rax
movq (%rsp), %rcx
leaq (%rcx,%rdx,4), %rdx
xorl %ecx, %ecx
movl (%rax,%rcx,4), %esi
movl %esi, (%rdx,%rcx,4)
incq %rcx
cmpl %ecx, %r13d
jne 0x1148b
addl %ecx, %r15d
testl %r10d, %r10d
jle 0x114cf
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 0x114bf
addl %edx, %r12d
movq 0x68(%r14), %rax
movl (%rax,%rbx,4), %eax
imull %r8d, %eax
cmpl %eax, %r15d
jl 0x11322
movq 0x70(%r14), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x114fa
callq 0x2180
movq 0x8(%rsp), %r9
movq 0x70(%r14), %rax
movq (%rsp), %rcx
movq %rcx, (%rax,%rbx,8)
movq 0xe8(%r9), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x11520
callq 0x2180
movq 0x8(%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