// File: /workspace/github_cpp_makefile_star2_O1/ADAPTLab[P]MuDBSCAN/partition.cpp
// Function: update_points(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&, int*, int, std::vector<int, std::allocator<int>>&, std::vector<double, std::allocator<double>>&)
void update_points(vector< vector< double> >& objects, int* num_points, int s_count, vector <int>& invalid_pos_as, vector <double>& recv_buf)
{
	int i, j, k, l, r_count = recv_buf.size() / DIMENSION;

	if(r_count >= s_count)
	{
		invalid_pos_as.resize(*num_points + r_count - s_count, 1);

		objects.resize(*num_points + r_count - s_count);
		for(int ll = 0; ll < *num_points + r_count - s_count; ll++)
			objects[ll].resize(DIMENSION);

		j = 0;
		for(i = 0; i < invalid_pos_as.size(); i++)
		{
			if(invalid_pos_as[i] == 1)
			{
				for(k = 0; k < DIMENSION; k++)
					objects[i][k] = recv_buf[j++];
			}
		}			

		*num_points = *num_points + r_count - s_count;
	}
	else
	{
		j = 0;
		i = 0;	
		if(recv_buf.size() > 0)
		{
			for(i = 0; i < *num_points; i++)
			{
				if(invalid_pos_as[i] == 1)
				{
					for(k = 0; k < DIMENSION; k++)
						objects[i][k] = recv_buf[j++];

					if(j == recv_buf.size())
					{
						i++;
						break;
					}
				}
			}
		}

		l = *num_points;
		for( ; i < invalid_pos_as.size(); i++)
		{
			if(invalid_pos_as[i] == 1)
			{
				while(l > i)
				{
					l--;
					if(invalid_pos_as[l] == 0)
						break;
				}

				if(invalid_pos_as[l] == 0)	
					for(k = 0; k < DIMENSION; k++)
						objects[i][k] = objects[l][k];
			}
		}

		objects.resize(*num_points + r_count - s_count);
		for(int ll = 0; ll < *num_points + r_count - s_count; ll++)
			objects[ll].resize(DIMENSION);

		*num_points = *num_points + r_count - s_count;
	}		
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r10d
movq %rsi, %rbx
movq %rdi, %r12
movq (%r8), %rsi
movq 0x8(%r8), %rdi
movq %rdi, %r14
subq %rsi, %r14
sarq $0x3, %r14
leaq 0xd492(%rip), %rax      # 0x17364
movslq (%rax), %r9
movq %r14, %rax
xorl %edx, %edx
divq %r9
movq %rax, %r15
subl %r10d, %r15d
movq %rcx, -0x38(%rbp)
jge 0x9f62
movq %r12, -0x30(%rbp)
movl %r9d, %eax
cmpq %rsi, %rdi
je 0xa063
movslq (%rbx), %rdx
xorl %r8d, %r8d
testq %rdx, %rdx
jle 0xa063
movq (%rcx), %r9
movq -0x30(%rbp), %rcx
movq (%rcx), %r10
xorl %edi, %edi
cmpl $0x1, (%r9,%rdi,4)
jne 0x9f55
testl %eax, %eax
jle 0x9f49
leaq (%rdi,%rdi,2), %r11
movq (%r10,%r11,8), %r11
movslq %r8d, %r12
leaq (%rsi,%r12,8), %r13
xorl %r12d, %r12d
movsd (%r13,%r12,8), %xmm0
movsd %xmm0, (%r11,%r12,8)
incq %r12
cmpq %r12, %rax
jne 0x9f31
addl %r12d, %r8d
movslq %r8d, %r11
cmpq %r11, %r14
je 0xa166
incq %rdi
cmpq %rdx, %rdi
jne 0x9f14
jmp 0xa065
movq %r8, -0x40(%rbp)
movl (%rbx), %eax
addl %r15d, %eax
movslq %eax, %rsi
leaq -0x44(%rbp), %rdx
movl $0x1, (%rdx)
movq %rcx, %rdi
callq 0xb594
movl (%rbx), %eax
addl %r15d, %eax
movslq %eax, %rsi
movq %r12, %rdi
callq 0xb3ae
movl (%rbx), %eax
addl %r15d, %eax
testl %eax, %eax
movq %r12, %r14
movq %r15, %rdx
movq %rbx, %rsi
leaq 0xd3bd(%rip), %r15      # 0x17364
jle 0x9fe4
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %r14, -0x30(%rbp)
movq (%r14), %rdi
addq %r13, %rdi
movq %rsi, %r14
movslq (%r15), %rsi
movq %rdx, %rbx
callq 0xb42c
movq %r14, %rsi
movq -0x30(%rbp), %r14
movq %rbx, %rdx
incq %r12
movl (%rsi), %eax
addl %edx, %eax
movslq %eax, %rcx
addq $0x18, %r13
cmpq %rcx, %r12
jl 0x9fb3
movq %rsi, %r12
movq -0x38(%rbp), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
je 0xa05b
sarq $0x2, %rdx
movl (%r15), %esi
movq -0x40(%rbp), %rdi
movq (%rdi), %rdi
movq (%r14), %r8
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %r9d, %r9d
xorl %r10d, %r10d
testl %esi, %esi
setle %r11b
cmpl $0x1, (%rcx,%r9,4)
setne %r14b
orb %r11b, %r14b
jne 0xa053
leaq (%r9,%r9,2), %r11
movq (%r8,%r11,8), %r11
movslq %r10d, %r14
leaq (%rdi,%r14,8), %r15
xorl %r14d, %r14d
movsd (%r15,%r14,8), %xmm0
movsd %xmm0, (%r11,%r14,8)
incq %r14
cmpq %r14, %rsi
jne 0xa03c
addl %r14d, %r10d
incq %r9
cmpq %rdx, %r9
jne 0xa016
movq %r12, %r15
jmp 0xa154
xorl %edi, %edi
movl (%rbx), %ecx
movq -0x38(%rbp), %rsi
movq (%rsi), %rdx
movq 0x8(%rsi), %rsi
subq %rdx, %rsi
sarq $0x2, %rsi
movslq %edi, %rdi
cmpq %rdi, %rsi
movq -0x30(%rbp), %r14
jbe 0xa0fb
movq (%r14), %r8
movl %ecx, %r9d
cmpl $0x1, (%rdx,%rdi,4)
jne 0xa0f3
movslq %r9d, %r10
cmpl %edi, %r10d
movl %edi, %r9d
cmovll %r10d, %r9d
cmpq %rdi, %r10
jle 0xa0b5
leaq -0x1(%r10), %r11
cmpl $0x0, -0x4(%rdx,%r10,4)
movq %r11, %r10
jne 0xa09e
movl %r11d, %r9d
testl %eax, %eax
setle %r11b
movslq %r9d, %r10
cmpl $0x0, (%rdx,%r10,4)
setne %r12b
orb %r11b, %r12b
jne 0xa0f3
leaq (%r10,%r10,2), %r10
movq (%r8,%r10,8), %r10
leaq (%rdi,%rdi,2), %r11
movq (%r8,%r11,8), %r11
xorl %r12d, %r12d
movsd (%r10,%r12,8), %xmm0
movsd %xmm0, (%r11,%r12,8)
incq %r12
cmpq %r12, %rax
jne 0xa0df
incq %rdi
cmpq %rdi, %rsi
ja 0xa08b
addl %r15d, %ecx
movslq %ecx, %rsi
movq %r14, %rdi
callq 0xb3ae
movl (%rbx), %eax
addl %r15d, %eax
testl %eax, %eax
movq %r15, %rdx
movq %rbx, %r15
leaq 0xd247(%rip), %rbx      # 0x17364
jle 0xa154
xorl %r13d, %r13d
xorl %r12d, %r12d
movq (%r14), %rdi
addq %r13, %rdi
movslq (%rbx), %rsi
movq %rdx, %rbx
callq 0xb42c
movq %rbx, %rdx
incq %r12
movl (%r15), %eax
addl %edx, %eax
movslq %eax, %rcx
addq $0x18, %r13
cmpq %rcx, %r12
leaq 0xd212(%rip), %rbx      # 0x17364
jl 0xa125
movl %eax, (%r15)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq %rdi
jmp 0xa065