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

```asm
<cmdln_get_nsec_or_help>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movabs $0x3736353433323130,%rax
  mov    %rax,-0x22(%rbp)
  movw   $0x3938,-0x1a(%rbp)
  movl   $0x0,-0x28(%rbp)
  cmpl   $0x2,-0x3c(%rbp)
  jne    L50
  movl   $0x0,-0x2c(%rbp)
  jmp    L12
L14:
  movl   $0x0,-0x30(%rbp)
  jmp    L18
L28:
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x30(%rbp),%eax
  cltq
  movzbl -0x22(%rbp,%rax,1),%eax
  cmp    %al,%dl
  jne    L13
  addl   $0x1,-0x28(%rbp)
L13:
  addl   $0x1,-0x30(%rbp)
L18:
  cmpl   $0x9,-0x30(%rbp)
  jle    L28
  addl   $0x1,-0x2c(%rbp)
L12:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rbx
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jb     L14
  mov    -0x28(%rbp),%eax
  movslq %eax,%rbx
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jne    L71
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    -0x38(%rbp),%rdx
  mov    %eax,(%rdx)
  jmp    L50
L71:
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D22(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L42
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D20(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L42
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D44(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L29
L42:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L50
L29:
  mov    -0x48(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L50:
  cmpl   $0x2,-0x3c(%rbp)
  jle    L32
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L32:
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L49
  call   <__stack_chk_fail@plt>
L49:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D22
datatype: string
name: extract_symbolic_data
arguments: label: D20
datatype: string
name: extract_symbolic_data
arguments: label: D44
datatype: string
name: extract_symbolic_data
arguments: label: D30
datatype: string
name: extract_symbolic_data
arguments: label: D49
datatype: string

tool: D22: help

tool: D20: -help

tool: D44: --help

tool: D30: Usage: %s [ string [-[-]]help | int seconds] 


tool: D49:  Did not understand argument " %s ".


assistant: ```c
void cmdln_get_nsec_or_help(int *nsec, int argc, char *argv[]) {
  int i, j;
  char digits[10] = {"0"
                     "1"
                     "2"
                     "3"
                     "4"
                     "5"
                     "6"
                     "7"
                     "8"
                     "9"};
  int knt = 0;
  if (argc == 2) {
    for (j = 0; j < strlen(argv[1]); j++)
      for (i = 0; i < 10; i++)
        if (argv[1][j] == digits[i]) {
          knt++;
        };
    if (knt == strlen(argv[1])) {
      *nsec = atoi(argv[1]);
    } else if (!strcmp(argv[1], "help") || !strcmp(argv[1], "-help") || !strcmp(argv[1], "--help"))
      printf("Usage: %s [ string [-[-]]help | int seconds] \n", argv[0]);
    else {
      printf(" Did not understand argument \" %s \".\n", argv[1]);
      exit(1);
    }
  }
  if (argc > 2)
    printf("Usage: %s [ string [-[-]]help | int seconds] \n", argv[0]);
}
```