// File: /workspace/github_cpp_makefile_star2_O2/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 $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3fcc
movq (%r14), %r15
leaq 0x58e2(%rip), %rsi      # 0x8cf8
movq %r15, %rdi
callq 0x3608
testb %al, %al
je 0x3426
pushq $0x5
jmp 0x343b
leaq 0x58ab(%rip), %rsi      # 0x8cd8
movq %r15, %rdi
callq 0x3608
testb %al, %al
je 0x3441
pushq $0x3
popq %rbx
jmp 0x35b8
leaq 0x58f0(%rip), %rsi      # 0x8d38
movq %r15, %rdi
callq 0x363c
testb %al, %al
je 0x3479
movq %rsp, %rdx
movq $0x2, (%rdx)
leaq 0x1ca0(%rip), %rax      # 0x5105
movq %rax, 0x8(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3690
jmp 0x35b6
leaq 0x5898(%rip), %rsi      # 0x8d18
movq %r15, %rdi
callq 0x3608
testb %al, %al
je 0x34cc
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x10, %rax
jne 0x3583
movq 0x18(%r14), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x36b2
movq (%r15), %rax
movq 0x8(%r15), %rcx
leaq 0x20(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3690
jmp 0x3524
leaq 0x58a5(%rip), %rsi      # 0x8d78
movq %r15, %rdi
callq 0x3608
testb %al, %al
je 0x3533
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
cmpq $0x20, %rax
jne 0x3583
addq $0x10, %rdx
movq 0x18(%r14), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x36d4
movq (%r15), %rax
movq 0x8(%r15), %rcx
leaq 0x20(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3690
movl %eax, %ebx
movq %rsp, %rdi
callq 0x2100
jmp 0x35b8
leaq 0x585e(%rip), %rsi      # 0x8d98
movq %r15, %rdi
callq 0x3608
testb %al, %al
je 0x3596
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
cmpq $0x20, %rax
jne 0x3583
addq $0x10, %rdx
movq 0x18(%r14), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x3718
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x36f6
movl %eax, %ebx
movq %rsp, %rdi
callq 0x2778
jmp 0x35b8
movq %rsp, %rdx
movq $0xb, (%rdx)
leaq 0x1b74(%rip), %rax      # 0x5108
jmp 0x35a7
movq %rsp, %rdx
movq $0xf, (%rdx)
leaq 0x1b6d(%rip), %rax      # 0x5114
movq %rax, 0x8(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x35e6
movl %eax, %ebx
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2778
jmp 0x35de
jmp 0x35d3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x22a0