// File: jingdao[P]PointCloudApp/pcd.cpp
// Function: PCD::filterPlane(std::vector<int, std::allocator<int>>*, PCD::Plane, float, bool)
void PCD::filterPlane(std::vector<int> *ind,Plane p, float threshold,bool positiveOrNegative) {
	float distanceThreshold = threshold * sqrt( p.a * p.a + p.b * p.b + p.c * p.c);
	if (positiveOrNegative) {
		for (int j=0;j<numPoints;j++) {
			if ( fabs( p.a * float_data[j * 4] +
				 p.b * float_data[j * 4 + 1] +
				 p.c * float_data[j * 4 + 2] +
				 p.d )
				 < distanceThreshold)	
				ind->push_back(j);
		}
	} else {
		for (int j=0;j<numPoints;j++) {
			if ( fabs( p.a * float_data[j * 4] +
				 p.b * float_data[j * 4 + 1] +
				 p.c * float_data[j * 4 + 2] +
				 p.d )
				 > distanceThreshold)	
				ind->push_back(j);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %dl, %al
movlpd %xmm0, -0x10(%rbp)
movlpd %xmm1, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movss %xmm2, -0x24(%rbp)
andb $0x1, %al
movb %al, -0x25(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
movss -0x10(%rbp), %xmm1
movss -0x10(%rbp), %xmm2
movss -0xc(%rbp), %xmm0
mulss -0xc(%rbp), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0x8(%rbp), %xmm0
movss -0x8(%rbp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0xae10
movaps %xmm0, %xmm1
movss -0x38(%rbp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, -0x2c(%rbp)
testb $0x1, -0x25(%rbp)
je 0x99d5
movl $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rcx
movl -0x30(%rbp), %eax
cmpl 0x60(%rcx), %eax
jge 0x99d0
movq -0x40(%rbp), %rax
movss -0x10(%rbp), %xmm1
movq 0x58(%rax), %rcx
movl -0x30(%rbp), %edx
shll $0x2, %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm2
movss -0xc(%rbp), %xmm0
movq 0x58(%rax), %rcx
movl -0x30(%rbp), %edx
shll $0x2, %edx
addl $0x1, %edx
movslq %edx, %rdx
mulss (%rcx,%rdx,4), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0x8(%rbp), %xmm0
movq 0x58(%rax), %rax
movl -0x30(%rbp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
addss -0x4(%rbp), %xmm0
callq 0xad70
movaps %xmm0, %xmm1
movss -0x2c(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x99c0
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xae30
jmp 0x99c2
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x992d
jmp 0x9a7a
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl 0x60(%rcx), %eax
jge 0x9a78
movq -0x40(%rbp), %rax
movss -0x10(%rbp), %xmm1
movq 0x58(%rax), %rcx
movl -0x34(%rbp), %edx
shll $0x2, %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm2
movss -0xc(%rbp), %xmm0
movq 0x58(%rax), %rcx
movl -0x34(%rbp), %edx
shll $0x2, %edx
addl $0x1, %edx
movslq %edx, %rdx
mulss (%rcx,%rdx,4), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0x8(%rbp), %xmm0
movq 0x58(%rax), %rax
movl -0x34(%rbp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
addss -0x4(%rbp), %xmm0
callq 0xad70
ucomiss -0x2c(%rbp), %xmm0
jbe 0x9a68
movq -0x20(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xae30
jmp 0x9a6a
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x99dc
jmp 0x9a7a
addq $0x40, %rsp
popq %rbp
retq