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

```asm
<cmdln_get_nsec_or_help>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  movabs $0x3736353433323130,%rax
  mov    %rax,0xe(%rsp)
  mov    $0x3938,%eax
  mov    %ax,0x16(%rsp)
  cmp    $0x2,%esi
  je     L48
  jg     L60
L98:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L110
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L128:
  movslq %ecx,%rcx
  cmp    %rcx,%rax
  je     L17
  lea    D4(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L60
  lea    D30(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L60
  lea    D6(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L31
  nopl   0x0(%rax)
L60:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L110
  mov    0x0(%rbp),%rsi
  add    $0x20,%rsp
  lea    D8(%rip),%rdi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    10c0 <printf@plt>
  xchg   %ax,%ax
L48:
  mov    0x8(%rdx),%r12
  mov    %rdi,%rbx
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%r9
  xor    %ecx,%ecx
  lea    0x18(%rsp),%r8
  lea    (%r12,%rax,1),%r10
  nopl   (%rax)
L53:
  cmp    %r9,%r10
  je     L128
  movzbl (%r9),%edi
  lea    0xf(%rsp),%rdx
  mov    $0x30,%esi
  jmp    L16
  nopl   0x0(%rax)
L36:
  movzbl (%rdx),%esi
  add    $0x1,%rdx
L16:
  cmp    %sil,%dil
  sete   %sil
  movzbl %sil,%esi
  add    %esi,%ecx
  cmp    %r8,%rdx
  jne    L36
  add    $0x1,%r9
  jmp    L53
L17:
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    %eax,(%rbx)
  jmp    L98
L31:
  lea    D24(%rip),%rdi
  mov    %r12,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L110:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D4
type_guessed: string
name: read_data
arguments: tag: D30
type_guessed: string
name: read_data
arguments: tag: D6
type_guessed: string
name: read_data
arguments: tag: D8
type_guessed: string
name: read_data
arguments: tag: D24
type_guessed: string

tool: D4: help

tool: D30: -help

tool: D6: --help

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


tool: D24:  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]);
}
```