user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <gets@plt>
  lea    -0x40(%rbp),%rax
  mov    %rax,-0x78(%rbp)
  lea    -0x70(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  movl   $0x0,-0x84(%rbp)
  movl   $0x0,-0x9c(%rbp)
  movl   $0x0,-0x98(%rbp)
  jmp    L56
L47:
  mov    -0x9c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L41
  mov    -0x9c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L41
  addl   $0x1,-0x98(%rbp)
  jmp    L79
L41:
  cmpl   $0x0,-0x98(%rbp)
  jle    L79
  mov    -0x9c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x88(%rbp)
  movl   $0x1,-0x94(%rbp)
  jmp    L165
L108:
  movl   $0x1,-0x8c(%rbp)
  movl   $0x1,-0x90(%rbp)
  jmp    L103
L29:
  mov    -0x8c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0x8c(%rbp)
  addl   $0x1,-0x90(%rbp)
L103:
  mov    -0x90(%rbp),%eax
  cmp    -0x94(%rbp),%eax
  jle    L29
  mov    -0x9c(%rbp),%eax
  cltq
  mov    -0x94(%rbp),%edx
  movslq %edx,%rdx
  sub    %rdx,%rax
  lea    -0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  imul   -0x8c(%rbp),%eax
  add    %eax,-0x88(%rbp)
  addl   $0x1,-0x94(%rbp)
L165:
  mov    -0x94(%rbp),%eax
  cmp    -0x98(%rbp),%eax
  jl     L108
  mov    -0x80(%rbp),%rax
  mov    -0x88(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x80(%rbp)
  addl   $0x1,-0x84(%rbp)
  movl   $0x0,-0x98(%rbp)
L79:
  addl   $0x1,-0x9c(%rbp)
L56:
  mov    -0x9c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L47
  cmpl   $0x0,-0x98(%rbp)
  jle    L72
  mov    -0x9c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x88(%rbp)
  movl   $0x1,-0x94(%rbp)
  jmp    L63
L54:
  movl   $0x1,-0x8c(%rbp)
  movl   $0x1,-0x90(%rbp)
  jmp    L77
L71:
  mov    -0x8c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0x8c(%rbp)
  addl   $0x1,-0x90(%rbp)
L77:
  mov    -0x90(%rbp),%eax
  cmp    -0x94(%rbp),%eax
  jle    L71
  mov    -0x9c(%rbp),%eax
  cltq
  mov    -0x94(%rbp),%edx
  movslq %edx,%rdx
  sub    %rdx,%rax
  lea    -0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  imul   -0x8c(%rbp),%eax
  add    %eax,-0x88(%rbp)
  addl   $0x1,-0x94(%rbp)
L63:
  mov    -0x94(%rbp),%eax
  cmp    -0x98(%rbp),%eax
  jl     L54
  mov    -0x80(%rbp),%rax
  mov    -0x88(%rbp),%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x84(%rbp)
  movl   $0x0,-0x98(%rbp)
L72:
  mov    -0x84(%rbp),%eax
  mov    %eax,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x98(%rbp)
  lea    -0x70(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  movl   $0x0,-0x98(%rbp)
  jmp    L8
L97:
  mov    -0x98(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x98(%rbp)
L8:
  mov    -0x98(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L97
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L74
  call   <__stack_chk_fail@plt>
L74:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D23
data_type: string
name: disassemble_data
arguments: data_tag: D6
data_type: string
name: disassemble_data
arguments: data_tag: D27
data_type: string

tool: D23: input a string:

tool: D6: There are %d numbers in this line.They are :


tool: D27: %d 

assistant: ```c
int main() {
  char str[50], *pstr;
  int i, j, k, m, e10, digit, ndigit, a[10], *pa;
  printf("input a string:\n");
  gets(str);
  pstr = &str[0];
  pa = &a[0];
  ndigit = 0;
  i = 0;
  j = 0;
  while (*(pstr + i) != '\0') {
    if (*(pstr + i) >= '0' && *(pstr + i) <= '9')
      j++;
    else {
      if (j > 0) {
        digit = *(pstr + i - 1) - 48;
        k = 1;
        while (k < j) {
          e10 = 1;
          for (m = 1; m <= k; m++)
            e10 = e10 * 10;
          digit = digit + (*(pstr + i - 1 - k) - 48) * e10;
          k++;
        }
        *pa = digit;
        pa++;
        ndigit++;
        j = 0;
      }
    }
    i++;
  }
  if (j > 0) {
    digit = *(pstr + i - 1) - 48;
    k = 1;
    while (k < j) {
      e10 = 1;
      for (m = 1; m <= k; m++)
        e10 = e10 * 10;
      digit = digit + (*(pstr + i - 1 - k) - 48) * e10;
      k++;
    }
    *pa = digit;
    ndigit++;
    j = 0;
  }
  printf("There are %d numbers in this line.They are :\n", ndigit);
  j = 0;
  pa = &a[0];
  for (j = 0; j < ndigit; j++)
    printf("%d ", *(pa + j));
  printf("\n");
  return 0;
}
```