user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<genericMemcachedCommand>:
  endbr64
  push   %r15
  mov    %edi,%eax
  push   %r14
  mov    %r9,%r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  movslq %ecx,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    %edx,0x8(%rsp)
  cmp    $0x2,%edi
  jle    L60
  sub    $0x3,%eax
  mov    $0xffffffff,%r8d
  cmp    $0x2,%eax
  ja     L254
  mov    %rsi,%r8
  xor    %ebp,%ebp
  cmp    $0x1,%r12d
  jle    L296
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  je     L249
  test   %r9,%r9
  je     L241
  lea    -0x2(%r12),%eax
  xor    %r15d,%r15d
  xor    %ebp,%ebp
  mov    %rax,0x10(%rsp)
  xchg   %ax,%ax
L129:
  mov    (%r14,%r15,8),%rdx
  mov    0x0(%r13,%r15,8),%rsi
  movslq %ebp,%rdi
  add    %rbx,%rdi
  mov    %rdx,(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rdx
  mov    %r15,%rax
  add    $0x1,%r15
  add    %ebp,%edx
  lea    0x1(%rdx),%ebp
  movslq %edx,%rdx
  movb   $0x20,(%rbx,%rdx,1)
  cmp    %rax,0x10(%rsp)
  jne    L129
L280:
  movslq %ebp,%r8
  add    %rbx,%r8
L296:
  shl    $0x3,%r12
  mov    0x8(%rsp),%eax
  lea    -0x8(%r13,%r12,1),%r13
  mov    0x0(%r13),%rsi
  test   %eax,%eax
  je     L288
  test   %r14,%r14
  je     L86
  mov    -0x8(%r14,%r12,1),%r12
L67:
  add    %r12d,%ebp
  mov    %r8,%rdi
  mov    %r12,%rdx
  call   <memcpy@plt>
  movslq %ebp,%rax
  lea    0x2(%rbp),%r8d
  add    $0x1,%ebp
  movslq %ebp,%rbp
  movb   $0xd,(%rbx,%rax,1)
  movb   $0xa,(%rbx,%rbp,1)
  jmp    L254
  nopl   0x0(%rax,%rax,1)
L60:
  mov    $0xffffffff,%r8d
  test   %edi,%edi
  jg     L195
L254:
  add    $0x28,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L195:
  cmp    $0x1,%r12d
  jle    L231
  mov    0x8(%rsp),%esi
  test   %esi,%esi
  je     L222
  test   %r9,%r9
  je     L232
  lea    -0x2(%r12),%eax
  xor    %ebp,%ebp
  xor    %r15d,%r15d
  mov    %rax,0x10(%rsp)
  xchg   %ax,%ax
L43:
  mov    (%r14,%rbp,8),%rdx
  mov    0x0(%r13,%rbp,8),%rsi
  movslq %r15d,%rdi
  add    %rbx,%rdi
  mov    %rdx,(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rdx
  mov    %rbp,%rax
  add    $0x1,%rbp
  add    %r15d,%edx
  lea    0x1(%rdx),%r15d
  movslq %edx,%rdx
  movb   $0x20,(%rbx,%rdx,1)
  cmp    %rax,0x10(%rsp)
  jne    L43
L199:
  movslq %r15d,%rsi
  lea    0x1(%r15),%eax
  lea    0x2(%r15),%ebp
  add    %rbx,%rsi
  cltq
  movslq %ebp,%r15
L251:
  mov    0x8(%rsp),%ecx
  shl    $0x3,%r12
  movb   $0xd,(%rsi)
  lea    -0x8(%r13,%r12,1),%r13
  movb   $0xa,(%rbx,%rax,1)
  test   %ecx,%ecx
  je     L100
  mov    0x0(%r13),%rsi
  test   %r14,%r14
  je     L2
  mov    -0x8(%r14,%r12,1),%r12
L208:
  lea    (%rbx,%r15,1),%rdi
  mov    %r12,%rdx
  call   <memcpy@plt>
  lea    0x0(%rbp,%r12,1),%ecx
  movslq %ecx,%rax
  lea    0x2(%rcx),%r8d
  add    $0x1,%ecx
  movslq %ecx,%rcx
  movb   $0xd,(%rbx,%rax,1)
  movb   $0xa,(%rbx,%rcx,1)
  jmp    L254
  nopl   0x0(%rax)
L249:
  lea    -0x2(%r12),%eax
  mov    %r13,%r15
  xor    %ebp,%ebp
  lea    0x8(%r13,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax)
L262:
  mov    (%r15),%rdi
  add    $0x8,%r15
  call   <sdslen@plt>
  movslq %ebp,%rdi
  mov    -0x8(%r15),%rsi
  mov    %rax,%rdx
  add    %rbx,%rdi
  mov    %rax,(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rdx
  add    %ebp,%edx
  lea    0x1(%rdx),%ebp
  movslq %edx,%rdx
  movb   $0x20,(%rbx,%rdx,1)
  cmp    %r15,0x10(%rsp)
  jne    L262
  jmp    L280
  xchg   %ax,%ax
L222:
  lea    -0x2(%r12),%eax
  mov    %r13,%rbp
  xor    %r15d,%r15d
  lea    0x8(%r13,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  nopl   (%rax)
L228:
  mov    0x0(%rbp),%rdi
  add    $0x8,%rbp
  call   <sdslen@plt>
  movslq %r15d,%rdi
  mov    -0x8(%rbp),%rsi
  mov    %rax,%rdx
  add    %rbx,%rdi
  mov    %rax,(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rdx
  add    %r15d,%edx
  lea    0x1(%rdx),%r15d
  movslq %edx,%rdx
  movb   $0x20,(%rbx,%rdx,1)
  cmp    0x10(%rsp),%rbp
  jne    L228
  jmp    L199
  nopl   0x0(%rax)
L86:
  mov    %rsi,%rdi
  mov    %r8,0x8(%rsp)
  mov    %rsi,(%rsp)
  call   <strlen@plt>
  mov    (%rsp),%rsi
  mov    0x8(%rsp),%r8
  mov    %rax,%r12
  jmp    L67
  nopw   0x0(%rax,%rax,1)
L100:
  mov    0x0(%r13),%rdi
  call   <sdslen@plt>
  mov    0x0(%r13),%rsi
  mov    %rax,%r12
  jmp    L208
  nopl   (%rax)
L288:
  mov    %rsi,%rdi
  mov    %r8,(%rsp)
  call   <sdslen@plt>
  mov    0x0(%r13),%rsi
  mov    (%rsp),%r8
  mov    %rax,%r12
  jmp    L67
  nopl   0x0(%rax)
L2:
  mov    %rsi,%rdi
  mov    %rsi,(%rsp)
  call   <strlen@plt>
  mov    (%rsp),%rsi
  mov    %rax,%r12
  jmp    L208
  nopl   0x0(%rax,%rax,1)
L241:
  lea    -0x2(%r12),%eax
  mov    %r13,%r15
  xor    %ebp,%ebp
  lea    0x8(%r13,%rax,8),%rax
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax)
L158:
  mov    (%r15),%rsi
  add    $0x8,%r15
  mov    %rsi,%rdi
  mov    %rsi,0x10(%rsp)
  call   <strlen@plt>
  movslq %ebp,%rdi
  mov    0x10(%rsp),%rsi
  mov    %rax,%rdx
  add    %rbx,%rdi
  mov    %rax,(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rdx
  add    %ebp,%edx
  lea    0x1(%rdx),%ebp
  movslq %edx,%rdx
  movb   $0x20,(%rbx,%rdx,1)
  cmp    %r15,0x18(%rsp)
  jne    L158
  jmp    L280
  nop
L232:
  lea    -0x2(%r12),%eax
  mov    %r13,%rbp
  xor    %r15d,%r15d
  lea    0x8(%r13,%rax,8),%rax
  mov    %rax,0x18(%rsp)
  nopl   (%rax)
L264:
  mov    0x0(%rbp),%rsi
  add    $0x8,%rbp
  mov    %rsi,%rdi
  mov    %rsi,0x10(%rsp)
  call   <strlen@plt>
  movslq %r15d,%rdi
  mov    0x10(%rsp),%rsi
  mov    %rax,%rdx
  add    %rbx,%rdi
  mov    %rax,(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rdx
  add    %r15d,%edx
  lea    0x1(%rdx),%r15d
  movslq %edx,%rdx
  movb   $0x20,(%rbx,%rdx,1)
  cmp    0x18(%rsp),%rbp
  jne    L264
  jmp    L199
  nopw   0x0(%rax,%rax,1)
L231:
  mov    $0x2,%r15d
  mov    $0x2,%ebp
  mov    $0x1,%eax
  jmp    L251
```

assistant: ```c
int genericMemcachedCommand(int cmdtype, char *cmd, int argtype, int argc, char **argv, size_t *argvlen) {
  int j;
  size_t len;
  int pos = 0;
  switch (cmdtype) {
  case 1:
  case 2:
    for (j = 0; j < argc - 1; j++) {
      len = (argtype == 0 ? sdslen(argv[j]) : (argvlen == NULL ? strlen(argv[j]) : argvlen[j]));
      memcpy(cmd + pos, argv[j], len);
      pos += (int)len;
      cmd[pos++] = ' ';
    }
    cmd[pos++] = '\r';
    cmd[pos++] = '\n';
    len = (argtype == 0 ? sdslen(argv[argc - 1]) : (argvlen == NULL ? strlen(argv[argc - 1]) : argvlen[argc - 1]));
    memcpy(cmd + pos, argv[argc - 1], len);
    pos += (int)len;
    cmd[pos++] = '\r';
    cmd[pos++] = '\n';
    break;
  case 4:
  case 3:
  case 5:
    for (j = 0; j < argc - 1; j++) {
      len = (argtype == 0 ? sdslen(argv[j]) : (argvlen == NULL ? strlen(argv[j]) : argvlen[j]));
      memcpy(cmd + pos, argv[j], len);
      pos += len;
      cmd[pos++] = ' ';
    }
    len = (argtype == 0 ? sdslen(argv[argc - 1]) : (argvlen == NULL ? strlen(argv[argc - 1]) : argvlen[argc - 1]));
    memcpy(cmd + pos, argv[argc - 1], len);
    pos += (int)len;
    cmd[pos++] = '\r';
    cmd[pos++] = '\n';
    break;
  default:
    pos = -1;
    break;
  }
  return pos;
}
```