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

```asm
<getnum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movl   $0x0,-0x34(%rbp)
  movl   $0x15,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L30:
  cmp    %rdx,%rsp
  je     L149
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L30
L149:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L134
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L134:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x20(%rbp)
  nop
L110:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x2c(%rbp)
  mov    D12(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2c(%rbp)
  je     L24
  cmpl   $0x2d,-0x2c(%rbp)
  je     L24
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <isnumber@plt>
  test   %rax,%rax
  je     L110
L24:
  mov    D12(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2c(%rbp)
  jne    L12
  mov    $0x0,%eax
  jmp    L74
L12:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  mov    %cl,(%rdx,%rax,1)
  addl   $0x1,-0x34(%rbp)
  jmp    L39
L130:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  mov    %cl,(%rdx,%rax,1)
  addl   $0x1,-0x34(%rbp)
L39:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x2c(%rbp)
  mov    D12(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2c(%rbp)
  je     L82
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <isnumber@plt>
  test   %rax,%rax
  je     L82
  mov    -0x34(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L130
L82:
  mov    -0x20(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  movb   $0x0,(%rdx,%rax,1)
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L120
  mov    D12(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2c(%rbp)
  jne    L47
L120:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strtoi@plt>
  mov    -0x48(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    $0x1,%eax
  jmp    L74
L47:
  mov    $0x0,%eax
L74:
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int getnum(int num[]) {
  int c, i = 0;
  int maxstr = 1 + 20;
  char numstr[maxstr + 1];
  while ((c = getchar()) != EOF && c != '-' && !isnumber(c))
    ;
  if (c == EOF)
    return 0;
  numstr[i] = c;
  for (++i; (c = getchar()) != EOF && isnumber(c) && i < maxstr; ++i)
    numstr[i] = c;
  numstr[i] = '\0';
  if (isspace(c) || c == EOF) {
    num[0] = strtoi(numstr);
    return 1;
  } else
    return 0;
}
```