// File: 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
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1c240
leaq 0x1e7c6(%rip), %rcx     # 0x387d4
movslq (%rcx), %rcx
xorl %edx, %edx
divq %rcx
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x1a170
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl -0x3c(%rbp), %eax
subl -0x14(%rbp), %eax
movslq %eax, %rsi
movl $0x1, -0x40(%rbp)
leaq -0x40(%rbp), %rdx
callq 0x1c100
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl -0x3c(%rbp), %eax
subl -0x14(%rbp), %eax
movslq %eax, %rsi
callq 0x1bcb0
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl -0x3c(%rbp), %ecx
subl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1a0a4
movq -0x8(%rbp), %rdi
movslq -0x44(%rbp), %rsi
callq 0xf850
movq %rax, %rdi
leaq 0x1e743(%rip), %rax     # 0x387d4
movslq (%rax), %rsi
callq 0x1bd40
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1a067
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x11f90
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0x1a159
movq -0x20(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x1c1b0
cmpl $0x1, (%rax)
jne 0x1a149
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
leaq 0x1e6de(%rip), %rcx     # 0x387d4
cmpl (%rcx), %eax
jge 0x1a147
movq -0x28(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x30(%rbp)
movslq %eax, %rsi
callq 0xf870
movsd (%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0xf850
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0xf870
movsd -0x58(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1a0ec
jmp 0x1a149
jmp 0x1a14b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1a0b2
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl -0x3c(%rbp), %ecx
subl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
jmp 0x1a3bc
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1c240
cmpq $0x0, %rax
jbe 0x1a25b
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x1a259
movq -0x20(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x1c1b0
cmpl $0x1, (%rax)
jne 0x1a249
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
leaq 0x1e606(%rip), %rcx     # 0x387d4
cmpl (%rcx), %eax
jge 0x1a21f
movq -0x28(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x30(%rbp)
movslq %eax, %rsi
callq 0xf870
movsd (%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0xf850
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0xf870
movsd -0x60(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1a1c4
movslq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1c240
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
jne 0x1a247
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1a259
jmp 0x1a249
jmp 0x1a24b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1a198
jmp 0x1a25b
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movslq -0x2c(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x11f90
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0x1a34e
movq -0x20(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x1c1b0
cmpl $0x1, (%rax)
jne 0x1a33e
jmp 0x1a29d
movl -0x38(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jle 0x1a2c4
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x38(%rbp), %rsi
callq 0x1c1b0
cmpl $0x0, (%rax)
jne 0x1a2c2
jmp 0x1a2c4
jmp 0x1a29d
movq -0x20(%rbp), %rdi
movslq -0x38(%rbp), %rsi
callq 0x1c1b0
cmpl $0x0, (%rax)
jne 0x1a33c
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
leaq 0x1e4ed(%rip), %rcx     # 0x387d4
cmpl (%rcx), %eax
jge 0x1a33a
movq -0x8(%rbp), %rdi
movslq -0x38(%rbp), %rsi
callq 0xf850
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0xf870
movsd (%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0xf850
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0xf870
movsd -0x78(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1a2dd
jmp 0x1a33c
jmp 0x1a33e
jmp 0x1a340
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1a264
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl -0x3c(%rbp), %eax
subl -0x14(%rbp), %eax
movslq %eax, %rsi
callq 0x1bcb0
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
addl -0x3c(%rbp), %ecx
subl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1a3aa
movq -0x8(%rbp), %rdi
movslq -0x48(%rbp), %rsi
callq 0xf850
movq %rax, %rdi
leaq 0x1e43d(%rip), %rax     # 0x387d4
movslq (%rax), %rsi
callq 0x1bd40
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1a36d
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl -0x3c(%rbp), %ecx
subl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)