// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movaps %xmm0, %xmm5
shufps $0x55, %xmm0, %xmm5     # xmm5 = xmm5[1,1],xmm0[1,1]
movaps %xmm5, %xmm4
mulss %xmm5, %xmm4
movaps %xmm0, %xmm3
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
movaps %xmm1, %xmm4
mulss %xmm1, %xmm4
addss %xmm3, %xmm4
sqrtss %xmm4, %xmm4
mulss %xmm2, %xmm4
testl %edx, %edx
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm5, 0x20(%rsp)
movss %xmm4, 0xc(%rsp)
je 0x6ec7
movl $0x0, 0x8(%rsp)
cmpl $0x0, 0x60(%r14)
jle 0x6f9b
movaps %xmm1, %xmm6
shufps $0x55, %xmm1, %xmm6     # xmm6 = xmm6[1,1],xmm1[1,1]
xorl %eax, %eax
movaps 0x467f(%rip), %xmm7     # 0xb490
leaq 0x8(%rsp), %r15
movaps %xmm6, 0x10(%rsp)
movq 0x58(%r14), %rcx
leal (,%rax,4), %edx
movslq %edx, %rdx
leal 0x1(,%rax,4), %esi
movslq %esi, %rsi
movss (%rcx,%rsi,4), %xmm3
mulss %xmm5, %xmm3
movss (%rcx,%rdx,4), %xmm2
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
leal 0x2(,%rax,4), %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
addss %xmm6, %xmm3
andps %xmm7, %xmm3
ucomiss %xmm3, %xmm4
jbe 0x6eae
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6e82
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6eae
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8112
movaps 0x45fc(%rip), %xmm7     # 0xb490
movaps 0x10(%rsp), %xmm6
movss 0xc(%rsp), %xmm4
movaps 0x20(%rsp), %xmm5
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpl 0x60(%r14), %eax
jl 0x6e1b
jmp 0x6f9b
movl $0x0, 0x4(%rsp)
cmpl $0x0, 0x60(%r14)
jle 0x6f9b
movaps %xmm1, %xmm6
shufps $0x55, %xmm1, %xmm6     # xmm6 = xmm6[1,1],xmm1[1,1]
xorl %eax, %eax
movaps 0x45a6(%rip), %xmm7     # 0xb490
leaq 0x4(%rsp), %r15
movaps %xmm6, 0x10(%rsp)
movq 0x58(%r14), %rcx
leal (,%rax,4), %edx
movslq %edx, %rdx
leal 0x1(,%rax,4), %esi
movslq %esi, %rsi
movss (%rcx,%rsi,4), %xmm3
mulss %xmm5, %xmm3
movss (%rcx,%rdx,4), %xmm2
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
leal 0x2(,%rax,4), %edx
movslq %edx, %rdx
movss (%rcx,%rdx,4), %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
addss %xmm6, %xmm3
andps %xmm7, %xmm3
ucomiss %xmm4, %xmm3
jbe 0x6f87
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6f5b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6f87
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8112
movaps 0x4523(%rip), %xmm7     # 0xb490
movaps 0x10(%rsp), %xmm6
movss 0xc(%rsp), %xmm4
movaps 0x20(%rsp), %xmm5
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movl 0x4(%rsp), %eax
incl %eax
movl %eax, 0x4(%rsp)
cmpl 0x60(%r14), %eax
jl 0x6ef4
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop