// File: /workspace/github_cpp_makefile_star2_O1/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 0x426c
movq (%r14), %r15
leaq 0x4905(%rip), %rsi      # 0x7cf8
movq %r15, %rdi
callq 0x368a
movl %eax, %ecx
movl $0x5, %eax
testb %cl, %cl
jne 0x3641
leaq 0x48c7(%rip), %rsi      # 0x7cd8
movq %r15, %rdi
callq 0x368a
movl %eax, %ecx
movl $0x3, %eax
testb %cl, %cl
jne 0x3641
leaq 0x4909(%rip), %rsi      # 0x7d38
movq %r15, %rdi
callq 0x36da
testb %al, %al
je 0x346f
leaq 0x20(%rsp), %rsi
movq $0x2, (%rsi)
leaq 0x1cb7(%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 0x375e
jmp 0x363c
leaq 0x48a2(%rip), %rsi      # 0x7d18
movq %r15, %rdi
callq 0x368a
testb %al, %al
je 0x34e9
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x10, %rax
jne 0x35f8
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 0x375e
jmp 0x3551
leaq 0x4888(%rip), %rsi      # 0x7d78
movq %r15, %rdi
callq 0x368a
testb %al, %al
je 0x3571
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x20, %rax
jne 0x35f8
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 0x375e
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x363c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x363c
leaq 0x4820(%rip), %rsi      # 0x7d98
movq %r15, %rdi
callq 0x368a
testb %al, %al
je 0x360d
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x20, %rax
jne 0x35f8
leaq 0x46bc(%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 0x3ab2
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rcx
movb $0x0, (%rcx)
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3966
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x363c
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
jmp 0x3567
leaq 0x20(%rsp), %rsi
movq $0xb, (%rsi)
leaq 0x1afd(%rip), %rax      # 0x5108
jmp 0x3620
leaq 0x20(%rsp), %rsi
movq $0xf, (%rsi)
leaq 0x1af4(%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 0x3b74
movl $0x2, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3681
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
jmp 0x367c
jmp 0x3667
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x3681
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
nop