// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/kvserver.c
// Function: kv_worker
static void *
kv_worker(void * const ptr)
{
  if (ptr == NULL) return NULL;
  struct server_wi * const wi = (typeof(wi))ptr;
  struct stream2 * const s2 = server_wi_stream2(wi);
  struct kvmap_api * const api = (typeof(api))server_wi_private(wi);
  while ((!feof(s2->r)) && (!ferror(s2->r)) && (!ferror(s2->w))) {
    char opcode;
    if (fread(&opcode, sizeof(opcode), 1, s2->r) != 1) break;
    bool r = false;
    switch(opcode) {
    case 'G':
      r = kv_get(s2, api); break;
    case 'P':
      r = kv_probe(s2, api); break;
    case 'S':
      r = kv_set(s2, api); break;
    case 'D':
      r = kv_del(s2, api); break;
    case 'C':
      r = kv_clean(s2, api); break;
    default:
      break;
    }
    if (r == false) break;
  }
  server_wi_destroy(wi);
  return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x71ca
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xb51c
movq %rax, %r14
movq %rbx, %rdi
callq 0xb526
movq %rax, %r15
movq 0x8(%r14), %rdi
callq 0x6330
testl %eax, %eax
jne 0x71b4
movq 0x8(%r14), %r13
movq %r13, %rdi
callq 0x60c0
testl %eax, %eax
jne 0x71b4
movq (%r14), %rdi
callq 0x60c0
testl %eax, %eax
jne 0x71b4
movl $0x1, %esi
movl $0x1, %edx
leaq -0x29(%rbp), %rdi
movq %r13, %rcx
callq 0x60f0
cmpq $0x1, %rax
jne 0x71b4
movzbl -0x29(%rbp), %eax
cmpl $0x46, %eax
jle 0x7082
cmpl $0x53, %eax
je 0x7150
cmpl $0x50, %eax
je 0x70d9
cmpl $0x47, %eax
jne 0x71b4
movq %r14, %rdi
xorl %esi, %esi
callq 0x71dc
testq %rax, %rax
je 0x71b4
movq %rax, %r12
movq (%r15), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq *0x8(%r15)
movq %rax, %r13
movq %r12, %rdi
callq 0x6060
testq %r13, %r13
setne -0x2a(%rbp)
movq (%r14), %rcx
movl $0x1, %esi
movl $0x1, %edx
leaq -0x2a(%rbp), %rdi
callq 0x6550
cmpq $0x1, %rax
jne 0x71cd
testq %r13, %r13
je 0x719e
movq %r13, %rdi
callq 0xb6eb
movq (%r14), %rcx
movl $0x1, %edx
movq %r13, %rdi
movq %rax, %rsi
callq 0x6550
movq %rax, %r12
movq %r13, %rdi
callq 0x6060
cmpq $0x1, %r12
je 0x719e
jmp 0x71b4
cmpl $0x43, %eax
je 0x711b
cmpl $0x44, %eax
jne 0x71b4
movq %r14, %rdi
xorl %esi, %esi
callq 0x71dc
testq %rax, %rax
je 0x71b4
movq %rax, %r12
movq (%r15), %rdi
movq %rax, %rsi
callq *0x20(%r15)
movl %eax, %r13d
movq %r12, %rdi
callq 0x6060
movb %r13b, -0x2d(%rbp)
movq (%r14), %rcx
movl $0x1, %esi
movl $0x1, %edx
leaq -0x2d(%rbp), %rdi
jmp 0x718f
movq %r14, %rdi
xorl %esi, %esi
callq 0x71dc
testq %rax, %rax
je 0x71b4
movq %rax, %r12
movq (%r15), %rdi
movq %rax, %rsi
callq *0x10(%r15)
movl %eax, %r13d
movq %r12, %rdi
callq 0x6060
movb %r13b, -0x2b(%rbp)
movq (%r14), %rcx
movl $0x1, %esi
movl $0x1, %edx
leaq -0x2b(%rbp), %rdi
jmp 0x718f
movq (%r15), %rdi
callq *0x28(%r15)
movb $0x1, -0x2e(%rbp)
movq (%r14), %rcx
movl $0x1, %esi
movl $0x1, %edx
leaq -0x2e(%rbp), %rdi
callq 0x6550
cmpq $0x1, %rax
sete %r12b
jne 0x71ab
movq (%r14), %rdi
callq 0x63b0
jmp 0x71ab
movq %r14, %rdi
movl $0x1, %esi
callq 0x71dc
testq %rax, %rax
je 0x71b4
movq %rax, %r12
movq (%r15), %rdi
movq %rax, %rsi
callq *0x18(%r15)
movl %eax, %r13d
movq %r12, %rdi
callq 0x6060
movb %r13b, -0x2c(%rbp)
movq (%r14), %rcx
movl $0x1, %esi
movl $0x1, %edx
leaq -0x2c(%rbp), %rdi
callq 0x6550
cmpq $0x1, %rax
sete %r12b
jne 0x71ab
movq (%r14), %rdi
callq 0x63b0
jmp 0x6f73
testb %r12b, %r12b
jne 0x6f73
movq %rbx, %rdi
callq 0xb530
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
testq %r13, %r13
je 0x71b4
movq %r13, %rdi
callq 0x6060
jmp 0x71b4