// File: /workspace/github_cpp_makefile_star2_O1/metopa[P]HTTP_Server/src/network/CSocketIO.cpp
// Function: CSocketIO::recvData[abi:cxx11]() const
string CSocketIO::recvData() const {
	char buf[1024];
	ssize_t bytesRecvd;
	int errNo;
	string data;

	while ( 1 ) {
		bytesRecvd = recv( sockfd_m, buf, sizeof( buf ), 0 );

		errNo = errno;
		if ( bytesRecvd == 0 )
			break;
		else if ( bytesRecvd < 0 ) {
			if ( errNo == EINTR )
				continue;
			else
				throw SocketReceiverException( "recv()", strerror( errNo ), port_m, sockfd_m );
		}

		data.insert( data.end(), buf, buf + bytesRecvd );

		if ( data.size() >= 4 &&
			 data[data.size() - 4] == 13 &&
			 data[data.size() - 3] == 10 &&
			 data[data.size() - 2] == 13 &&
			 data[data.size() - 1] == 10 )
			break;

		/** An RFC2616 recommendation since someone may want to break the standard.*/
		if ( data.size() >= 2 &&
			 data[data.size() - 2] == 10 &&
			 data[data.size() - 1] == 10 )
			break;


	}

	if ( data.size() == 0 )
		throw EmptyDataException();

	return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x50(%rsp), %r14
movl (%r15), %edi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x5190
movq %rax, %r12
callq 0x5060
testq %r12, %r12
je 0x13a25
js 0x13992
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movq %r14, %rcx
movq %r12, %r8
callq 0x5440
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq $0x4, %rcx
jb 0x13979
cmpb $0xd, -0x4(%rax,%rcx)
jne 0x13979
cmpb $0xa, -0x3(%rax,%rcx)
jne 0x13979
cmpb $0xd, -0x2(%rax,%rcx)
jne 0x13979
cmpb $0xa, -0x1(%rax,%rcx)
je 0x13a25
cmpq $0x2, %rcx
jb 0x13913
cmpb $0xa, -0x2(%rax,%rcx)
jne 0x13913
cmpb $0xa, -0x1(%rax,%rcx)
jne 0x13913
jmp 0x13a25
movl (%rax), %ebp
cmpl $0x4, %ebp
je 0x13913
movl $0x50, %edi
callq 0x5200
movq %rax, %r14
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x5166(%rip), %rsi      # 0x18b21
leaq 0x5165(%rip), %rdx      # 0x18b27
leaq 0x10(%rsp), %rdi
callq 0x8f0e
movl %ebp, %edi
callq 0x51b0
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x7bea
movl (%r15), %r8d
movl 0x4(%r15), %ecx
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %r14, %rdi
callq 0x13480
leaq 0xe098(%rip), %rax      # 0x21aa0
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xe01c(%rip), %rsi      # 0x21a30
leaq -0xd61(%rip), %rdx      # 0x12cba
movq %r14, %rdi
callq 0x5700
jmp 0x13a6b
cmpq $0x0, 0x8(%rbx)
je 0x13a41
movq %rbx, %rax
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x5200
leaq 0xe07e(%rip), %rcx      # 0x21ad0
movq %rcx, (%rax)
leaq 0xdfec(%rip), %rsi      # 0x21a48
leaq 0x1b5(%rip), %rdx       # 0x13c18
movq %rax, %rdi
callq 0x5700
jmp 0x13ac3
movq %rax, %r15
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13a93
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0x13a93
movq %rax, %r15
movb $0x1, %bpl
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x13ab2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x53f0
jmp 0x13ab2
movq %rax, %r15
movb $0x1, %bpl
testb %bpl, %bpl
je 0x13ac6
movq %r14, %rdi
callq 0x52e0
jmp 0x13ac6
jmp 0x13ac3
movq %rax, %r15
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x13ada
movq (%r13), %rsi
incq %rsi
callq 0x53f0
movq %r15, %rdi
callq 0x5730