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

```asm
<checkCmdValidAndGetTotalLen>:
  endbr64
  cmp    $0x5,%edi
  ja     L540
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %esi,%r12d
  mov    %edx,%r13d
  mov    %rcx,%r14
  mov    %r8,%rbp
  mov    %edi,%edi
  lea    D19(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    -0x6(%r13),%eax
  cmp    $0x1,%eax
  ja     L126
  cmp    $0x7,%r13d
  je     L66
L375:
  lea    -0x1(%r13),%eax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%r15d
  movl   $0x0,0x4(%rsp)
  jmp    L656
L66:
  test   %esi,%esi
  je     L533
  test   %r8,%r8
  je     L680
  cmpq   $0x7,0x28(%r8)
  jne    L276
L180:
  mov    0x28(%r14),%rdi
  mov    $0x7,%edx
  lea    D33(%rip),%rsi
  call   <strncasecmp@plt>
  test   %eax,%eax
  je     L375
  mov    $0xffffffff,%eax
  jmp    L775
L533:
  mov    0x28(%rcx),%rdi
  call   <sdslen@plt>
  cmp    $0x7,%rax
  je     L180
  mov    $0xffffffff,%eax
  jmp    L775
L680:
  mov    0x28(%rcx),%rdi
  call   <strlen@plt>
  cmp    $0x7,%rax
  je     L180
  mov    $0xffffffff,%eax
  jmp    L775
L821:
  mov    (%r14,%r15,8),%rdi
  call   <sdslen@plt>
  lea    0x1(%rax),%rbx
L298:
  add    0x4(%rsp),%ebx
  mov    %ebx,0x4(%rsp)
  add    $0x1,%r15
  cmp    0x8(%rsp),%r15
  je     L141
L656:
  test   %r12d,%r12d
  je     L821
  test   %rbp,%rbp
  je     L352
  mov    0x0(%rbp,%r15,8),%rax
  lea    0x1(%rax),%rbx
  jmp    L298
L352:
  mov    (%r14,%r15,8),%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rbx
  jmp    L298
L141:
  test   %r12d,%r12d
  je     L784
  test   %rbp,%rbp
  je     L615
  movslq %r13d,%r13
  mov    -0x8(%rbp,%r13,8),%rax
  add    $0x4,%rax
L70:
  add    %ebx,%eax
  jmp    L775
L784:
  movslq %r13d,%r13
  mov    -0x8(%r14,%r13,8),%rdi
  call   <sdslen@plt>
  add    $0x4,%rax
  jmp    L70
L615:
  movslq %r13d,%r13
  mov    -0x8(%r14,%r13,8),%rdi
  call   <strlen@plt>
  add    $0x4,%rax
  jmp    L70
  lea    -0x7(%r13),%eax
  cmp    $0x1,%eax
  ja     L289
  cmp    $0x8,%r13d
  je     L286
L543:
  lea    -0x1(%r13),%eax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%r15d
  movl   $0x0,0x4(%rsp)
  jmp    L100
L286:
  test   %esi,%esi
  je     L300
  test   %r8,%r8
  je     L45
  cmpq   $0x7,0x30(%r8)
  jne    L450
L33:
  mov    0x30(%r14),%rdi
  mov    $0x7,%edx
  lea    D33(%rip),%rsi
  call   <strncasecmp@plt>
  test   %eax,%eax
  je     L543
  mov    $0xffffffff,%eax
  jmp    L775
L300:
  mov    0x30(%rcx),%rdi
  call   <sdslen@plt>
  cmp    $0x7,%rax
  je     L33
  mov    $0xffffffff,%eax
  jmp    L775
L45:
  mov    0x30(%rcx),%rdi
  call   <strlen@plt>
  cmp    $0x7,%rax
  je     L33
  mov    $0xffffffff,%eax
  jmp    L775
L661:
  mov    (%r14,%r15,8),%rdi
  call   <sdslen@plt>
  lea    0x1(%rax),%rbx
L664:
  add    0x4(%rsp),%ebx
  mov    %ebx,0x4(%rsp)
  add    $0x1,%r15
  cmp    0x8(%rsp),%r15
  je     L136
L100:
  test   %r12d,%r12d
  je     L661
  test   %rbp,%rbp
  je     L653
  mov    0x0(%rbp,%r15,8),%rax
  lea    0x1(%rax),%rbx
  jmp    L664
L653:
  mov    (%r14,%r15,8),%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rbx
  jmp    L664
L136:
  test   %r12d,%r12d
  je     L212
  test   %rbp,%rbp
  je     L705
  movslq %r13d,%r13
  mov    -0x8(%rbp,%r13,8),%rax
  add    $0x4,%rax
L810:
  add    %ebx,%eax
  jmp    L775
L212:
  movslq %r13d,%r13
  mov    -0x8(%r14,%r13,8),%rdi
  call   <sdslen@plt>
  add    $0x4,%rax
  jmp    L810
L705:
  movslq %r13d,%r13
  mov    -0x8(%r14,%r13,8),%rdi
  call   <strlen@plt>
  add    $0x4,%rax
  jmp    L810
  cmp    $0x3,%r13d
  jne    L669
  test   %esi,%esi
  je     L123
  test   %r8,%r8
  je     L5
  mov    0x8(%r8),%rbx
  add    (%r8),%ebx
  add    $0x1,%ebx
  mov    0x10(%r8),%eax
L505:
  lea    0x3(%rbx,%rax,1),%eax
  jmp    L775
L123:
  mov    (%rcx),%rdi
  call   <sdslen@plt>
  mov    %rax,%rbx
  mov    0x8(%r14),%rdi
  call   <sdslen@plt>
  lea    0x1(%rbx,%rax,1),%ebx
  mov    0x10(%r14),%rdi
  call   <sdslen@plt>
  jmp    L505
L5:
  mov    (%rcx),%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    0x8(%r14),%rdi
  call   <strlen@plt>
  lea    0x1(%rbx,%rax,1),%ebx
  mov    0x10(%r14),%rdi
  call   <strlen@plt>
  jmp    L505
  cmp    $0x1,%r13d
  jle    L602
  lea    -0x1(%r13),%eax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%r15d
  movl   $0x0,0x4(%rsp)
  jmp    L553
L214:
  mov    (%r14,%r15,8),%rdi
  call   <sdslen@plt>
  lea    0x1(%rax),%rbx
L304:
  add    0x4(%rsp),%ebx
  mov    %ebx,0x4(%rsp)
  add    $0x1,%r15
  cmp    0x8(%rsp),%r15
  je     L271
L553:
  test   %r12d,%r12d
  je     L214
  test   %rbp,%rbp
  je     L338
  mov    0x0(%rbp,%r15,8),%rax
  lea    0x1(%rax),%rbx
  jmp    L304
L338:
  mov    (%r14,%r15,8),%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rbx
  jmp    L304
L271:
  test   %r12d,%r12d
  je     L748
  test   %rbp,%rbp
  je     L835
  movslq %r13d,%r13
  mov    -0x8(%rbp,%r13,8),%rax
  add    $0x2,%rax
L532:
  add    %ebx,%eax
L775:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L748:
  movslq %r13d,%r13
  mov    -0x8(%r14,%r13,8),%rdi
  call   <sdslen@plt>
  add    $0x2,%rax
  jmp    L532
L835:
  movslq %r13d,%r13
  mov    -0x8(%r14,%r13,8),%rdi
  call   <strlen@plt>
  add    $0x2,%rax
  jmp    L532
  lea    -0x2(%r13),%eax
  cmp    $0x1,%eax
  ja     L415
  test   %esi,%esi
  je     L42
  test   %r8,%r8
  je     L577
  mov    (%r8),%eax
  lea    0x1(%rax),%ebx
  mov    0x8(%r8),%r15d
L499:
  add    %ebx,%r15d
  mov    %r15d,%ebx
  cmp    $0x3,%r13d
  je     L541
L108:
  lea    0x2(%rbx),%eax
  jmp    L775
L42:
  mov    (%rcx),%rdi
  call   <sdslen@plt>
  lea    0x1(%rax),%ebx
  mov    0x8(%r14),%rdi
  call   <sdslen@plt>
  mov    %eax,%r15d
  jmp    L499
L577:
  mov    (%rcx),%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%ebx
  mov    0x8(%r14),%rdi
  call   <strlen@plt>
  mov    %eax,%r15d
  jmp    L499
L541:
  mov    0x10(%r14),%rdi
  mov    $0x7,%edx
  lea    D33(%rip),%rsi
  call   <strncasecmp@plt>
  test   %eax,%eax
  jne    L8
  test   %r12d,%r12d
  je     L550
  test   %rbp,%rbp
  je     L556
  mov    0x10(%rbp),%rbx
  add    $0x1,%rbx
L801:
  add    %r15d,%ebx
  jmp    L108
L550:
  mov    0x10(%r14),%rdi
  call   <sdslen@plt>
  lea    0x1(%rax),%rbx
  jmp    L801
L556:
  mov    0x10(%r14),%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rbx
  jmp    L801
  mov    $0xffffffff,%eax
  jmp    L775
L126:
  mov    $0xffffffff,%eax
  jmp    L775
L276:
  mov    $0xffffffff,%eax
  jmp    L775
L289:
  mov    $0xffffffff,%eax
  jmp    L775
L450:
  mov    $0xffffffff,%eax
  jmp    L775
L669:
  mov    $0xffffffff,%eax
  jmp    L775
L602:
  mov    $0xffffffff,%eax
  jmp    L775
L415:
  mov    $0xffffffff,%eax
  jmp    L775
L8:
  mov    $0xffffffff,%eax
  jmp    L775
L540:
  mov    $0xffffffff,%eax
  ret
```

tool_calls: name: unpack_data
arguments: tag: D33
type: string

tool: D33: noreply

assistant: ```c
int checkCmdValidAndGetTotalLen(int cmdtype, int argtype, int argc, char **argv, size_t *argvlen) {
  size_t len;
  int totlen, j;
  switch (cmdtype) {
  case 1:
    if (argc != 6 && argc != 7) {
      return -1;
    }
    if (argc == 7 && ((argtype == 0 ? sdslen(argv[5]) : (argvlen == NULL ? strlen(argv[5]) : argvlen[5])) != 7 || strncasecmp(argv[5], "noreply", 7))) {
      return -1;
    }
    totlen = 0;
    for (j = 0; j < argc - 1; j++) {
      totlen += (argtype == 0 ? sdslen(argv[j]) : (argvlen == NULL ? strlen(argv[j]) : argvlen[j])) + 1;
    }
    totlen += 2 + (argtype == 0 ? sdslen(argv[argc - 1]) : (argvlen == NULL ? strlen(argv[argc - 1]) : argvlen[argc - 1])) + 2;
    break;
  case 2:
    if (argc != 7 && argc != 8) {
      return -1;
    }
    if (argc == 8 && ((argtype == 0 ? sdslen(argv[6]) : (argvlen == NULL ? strlen(argv[6]) : argvlen[6])) != 7 || strncasecmp(argv[6], "noreply", 7))) {
      return -1;
    }
    totlen = 0;
    for (j = 0; j < argc - 1; j++) {
      totlen += (argtype == 0 ? sdslen(argv[j]) : (argvlen == NULL ? strlen(argv[j]) : argvlen[j])) + 1;
    }
    totlen += 2 + (argtype == 0 ? sdslen(argv[argc - 1]) : (argvlen == NULL ? strlen(argv[argc - 1]) : argvlen[argc - 1])) + 2;
    break;
  case 4:
    if (argc != 3) {
      return -1;
    }
    totlen = (argtype == 0 ? sdslen(argv[0]) : (argvlen == NULL ? strlen(argv[0]) : argvlen[0])) + 1 + (argtype == 0 ? sdslen(argv[1]) : (argvlen == NULL ? strlen(argv[1]) : argvlen[1])) + 1 + (argtype == 0 ? sdslen(argv[2]) : (argvlen == NULL ? strlen(argv[2]) : argvlen[2])) + 2;
    break;
  case 3:
    if (argc <= 1) {
      return -1;
    }
    totlen = 0;
    for (j = 0; j < argc - 1; j++) {
      totlen += (argtype == 0 ? sdslen(argv[j]) : (argvlen == NULL ? strlen(argv[j]) : argvlen[j])) + 1;
    }
    totlen += (argtype == 0 ? sdslen(argv[argc - 1]) : (argvlen == NULL ? strlen(argv[argc - 1]) : argvlen[argc - 1])) + 2;
    break;
  case 5:
    if (argc != 2 && argc != 3) {
      return -1;
    }
    totlen = (argtype == 0 ? sdslen(argv[0]) : (argvlen == NULL ? strlen(argv[0]) : argvlen[0])) + 1 + (argtype == 0 ? sdslen(argv[1]) : (argvlen == NULL ? strlen(argv[1]) : argvlen[1]));
    if (argc == 3) {
      if (strncasecmp(argv[2], "noreply", 7)) {
        return -1;
      }
      totlen += 1 + (argtype == 0 ? sdslen(argv[2]) : (argvlen == NULL ? strlen(argv[2]) : argvlen[2]));
    }
    totlen += 2;
    break;
  default:
    totlen = -1;
    break;
  }
  return totlen;
}
```