// File: /workspace/github_cpp_makefile_star2_O3/nmmmnu[P]HM3/net/worker/keyvalueworker_impl.h
// Function: net::WorkerStatus net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>::process_request_<net::ClientBuffer>(net::ClientBuffer&)
WorkerStatus KeyValueWorker<PROTOCOL, DB_ADAPTER>::process_request_(CONNECTION &buffer){
	protocol_.print();

	const auto &p = protocol_.getParams();
	const auto &cmd = p[0];

	if (cmp__(cmd, SHUTDOWN)){
		return WorkerStatus::SHUTDOWN;
	}

	if (cmp__(cmd, EXIT)){
		return WorkerStatus::DISCONNECT;
	}

	if (cmp__(cmd, REFRESH)){
		db_.refresh();

		return sendResponseString_(buffer, "OK");
	}

	if (cmp__(cmd, INFO)){
		if (p.size() != 1)
			return sendResponseError_(buffer, "Bad request");

		return sendResponseString_(buffer, db_.info() );
	}

	if (cmp__(cmd, GET)){
		if (p.size() != 2)
			return sendResponseError_(buffer, "Bad request");

		const auto &key = p[1];

		return sendResponseString_(buffer, db_.get(key));
	}

	if (cmp__(cmd, GETALL)){
		if (p.size() != 2)
			return sendResponseError_(buffer, "Bad request");

		const auto &key = p[1];
		(void) key;

		return sendResponseMulti_(buffer, db_.getall(key) );
	}

	return sendResponseError_(buffer, "Not Implemented");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x41ec
movq (%r14), %r15
leaq 0x4981(%rip), %rsi      # 0x7cf8
movq %r15, %rdi
callq 0x360e
movl %eax, %ecx
movl $0x5, %eax
testb %cl, %cl
jne 0x35c5
leaq 0x4943(%rip), %rsi      # 0x7cd8
movq %r15, %rdi
callq 0x360e
movl %eax, %ecx
movl $0x3, %eax
testb %cl, %cl
jne 0x35c5
leaq 0x4985(%rip), %rsi      # 0x7d38
movq %r15, %rdi
callq 0x365e
testb %al, %al
je 0x33f3
leaq 0x20(%rsp), %rsi
movq $0x2, (%rsi)
leaq 0x1d33(%rip), %rax      # 0x5105
movq %rax, 0x8(%rsi)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rcx
movb $0x0, (%rcx)
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x36e2
jmp 0x35c0
leaq 0x491e(%rip), %rsi      # 0x7d18
movq %r15, %rdi
callq 0x360e
testb %al, %al
je 0x346d
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x10, %rax
jne 0x357c
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movabsq $0x616441206b636f4d, %rax # imm = 0x616441206B636F4D
movq %rax, (%r14)
movabsq $0xa72657470616441, %rax # imm = 0xA72657470616441
movq %rax, 0x5(%r14)
movl $0xd, %eax
movq %rax, -0x8(%r14)
xorl %ecx, %ecx
movb %cl, 0xd(%r14)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, 0x8(%rsi)
movq %rcx, 0x10(%rbx)
movq 0x8(%rbx), %rax
movb %cl, (%rax)
movq %rcx, (%rbx)
movq %rbx, %rdi
callq 0x36e2
jmp 0x34d5
leaq 0x4904(%rip), %rsi      # 0x7d78
movq %r15, %rdi
callq 0x360e
testb %al, %al
je 0x34f5
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x20, %rax
jne 0x357c
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movl $0x756c6176, (%r14)     # imm = 0x756C6176
movw $0x65, 0x4(%r14)
movl $0x5, %eax
movq %rax, -0x8(%r14)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, 0x8(%rsi)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rcx
movb $0x0, (%rcx)
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x36e2
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x35c0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x35c0
leaq 0x489c(%rip), %rsi      # 0x7d98
movq %r15, %rdi
callq 0x360e
testb %al, %al
je 0x3591
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x20, %rax
jne 0x357c
leaq 0x4738(%rip), %rsi      # 0x7c58
leaq 0x20(%rsp), %rax
movl $0x10, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rcx
movl $0x8, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x3a40
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rcx
movb $0x0, (%rcx)
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x38f0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x35c0
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
jmp 0x34eb
leaq 0x20(%rsp), %rsi
movq $0xb, (%rsi)
leaq 0x1b79(%rip), %rax      # 0x5108
jmp 0x35a4
leaq 0x20(%rsp), %rsi
movq $0xf, (%rsi)
leaq 0x1b70(%rip), %rax      # 0x5114
movq %rax, 0x8(%rsi)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rcx
movb $0x0, (%rcx)
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x3b08
movl $0x2, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3605
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
jmp 0x3600
jmp 0x35eb
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x3605
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
nop