user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<Cmd_BotAdd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <Cmd_Argc@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x2,-0x1c(%rbp)
  jle    L78
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  call   <Com_Printf@plt>
  jmp    L41
L78:
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <GetCvarInt@plt>
  test   %eax,%eax
  jg     L39
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  call   <Com_Printf@plt>
  jmp    L41
L39:
  cmpl   $0x1,-0x1c(%rbp)
  jne    L63
  mov    $0x0,%eax
  call   <AddTestClient@plt>
  jmp    L41
L63:
  mov    $0x1,%edi
  call   <Cmd_Argv@plt>
  mov    %eax,%edi
  call   <atoi@plt>
  mov    %eax,-0x24(%rbp)
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  call   <GetCvarInt@plt>
  mov    %eax,-0x18(%rbp)
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <GetCvarInt@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x40,-0x24(%rbp)
  jle    L100
  movl   $0x40,-0x24(%rbp)
L100:
  cmpl   $0x0,-0x24(%rbp)
  jg     L33
  movl   $0x1,-0x24(%rbp)
L33:
  mov    -0x24(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L26
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L26:
  movl   $0x0,-0x20(%rbp)
  jmp    L86
L6:
  mov    $0x0,%eax
  call   <AddTestClient@plt>
  addl   $0x1,-0x20(%rbp)
L86:
  mov    -0x20(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L6
  mov    -0x24(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%edx
  lea    -0xa(%rbp),%rax
  mov    %edx,%ecx
  lea    D67(%rip),%rdx
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0xa(%rbp),%rax
  mov    %rax,%rsi
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  call   <SetCvar@plt>
L41:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L57
  call   <__stack_chk_fail@plt>
L57:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D56
data_type: string
name: extract_symbolic_data
arguments: data_label: D16
data_type: string
name: extract_symbolic_data
arguments: data_label: D44
data_type: string
name: extract_symbolic_data
arguments: data_label: D59
data_type: string
name: extract_symbolic_data
arguments: data_label: D52
data_type: string
name: extract_symbolic_data
arguments: data_label: D67
data_type: string

tool: D56: Usage: bot_add <amount> or just bot_add


tool: D16: sv_running

tool: D44: Server is not running.


tool: D59: bot_count

tool: D52: bot_maxcount

tool: D67: %d

assistant: ```c
void Cmd_BotAdd() {
  int argc = Cmd_Argc();
  if (argc > 2) {
    Com_Printf("Usage: bot_add <amount> or just bot_add\n");
    return;
  }
  if (GetCvarInt("sv_running") < 1) {
    Com_Printf("Server is not running.\n");
    return;
  }
  if (argc == 1) {
    AddTestClient();
    return;
  }
  int amount = atoi(Cmd_Argv(1));
  int botcount = GetCvarInt("bot_count");
  int botmax = GetCvarInt("bot_maxcount");
  if (amount > 64)
    amount = 64;
  if (amount < 1)
    amount = 1;
  if (amount > botmax)
    amount = botmax;
  int i;
  for (i = 0; i < amount; i++)
    AddTestClient();
  int total = amount + botcount;
  char str[2];
  snprintf(str, 2, "%d", total);
  SetCvar("bot_count", str);
}
```