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

```asm
<getop>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L2:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %al,(%rbx)
  mov    %eax,%r12d
  cmp    $0x20,%al
  je     L2
  cmp    $0x9,%eax
  je     L2
  movb   $0x0,0x1(%rbx)
  movsbl %al,%ebp
  mov    %ebp,%edi
  call   <islower@plt>
  test   %rax,%rax
  jne    L41
  mov    %ebp,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L48
  lea    -0x2d(%r12),%eax
  cmp    $0x1,%eax
  ja     L148
L48:
  xor    %r13d,%r13d
  cmp    $0x2d,%r12d
  je     L169
L103:
  mov    %ebp,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L66
  lea    0x1(%r13),%ebp
  movslq %ebp,%rbp
  nopw   0x0(%rax,%rax,1)
L18:
  xor    %eax,%eax
  movslq %ebp,%r13
  call   <getch@plt>
  mov    %al,(%rbx,%rbp,1)
  movsbl %al,%edi
  mov    %eax,%r12d
  add    $0x1,%rbp
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L18
L66:
  lea    (%rbx,%r13,1),%rbp
  cmp    $0x2e,%r12d
  je     L95
L52:
  mov    D10(%rip),%rax
  movb   $0x0,0x0(%rbp)
  cmp    %r12d,(%rax)
  je     L35
  mov    %r12d,%edi
  mov    $0x30,%r12d
  call   <ungetch@plt>
L148:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L41:
  add    $0x1,%rbx
  nopl   0x0(%rax)
L61:
  xor    %eax,%eax
  mov    %rbx,%r12
  add    $0x1,%rbx
  call   <getch@plt>
  mov    %al,-0x1(%rbx)
  movsbl %al,%edi
  mov    %eax,%ebp
  call   <islower@plt>
  test   %rax,%rax
  jne    L61
  mov    D10(%rip),%rax
  movb   $0x0,(%r12)
  mov    $0x31,%r12d
  cmp    %ebp,(%rax)
  je     L148
  mov    %ebp,%edi
  call   <ungetch@plt>
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L35:
  add    $0x8,%rsp
  mov    $0x30,%r12d
  pop    %rbx
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L169:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %al,0x1(%rbx)
  movsbl %al,%ebp
  mov    %eax,%r13d
  mov    %ebp,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L142
  mov    %r13d,%r12d
  mov    $0x1,%r13d
  jmp    L103
  nopw   0x0(%rax,%rax,1)
L95:
  lea    0x1(%rbx,%r13,1),%rbx
  nopl   (%rax)
L50:
  xor    %eax,%eax
  mov    %rbx,%rbp
  add    $0x1,%rbx
  call   <getch@plt>
  mov    %al,-0x1(%rbx)
  movsbl %al,%edi
  mov    %eax,%r12d
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L50
  jmp    L52
L142:
  mov    %r13d,%edi
  call   <ungetch@plt>
  jmp    L148
```

assistant: ```c
int getop(char s[]) {
  int i, c;
  while ((s[0] = c = getch()) == ' ' || c == '\t')
    ;
  s[1] = '\0';
  i = 0;
  if (islower(c)) {
    while (islower(s[++i] = c = getch()))
      ;
    s[i] = '\0';
    if (c != EOF)
      ungetch(c);
    return '1';
  }
  if (!isdigit(c) && c != '.' && c != '-')
    return c;
  if (c == '-')
    if (!isdigit(s[++i] = c = getch())) {
      ungetch(c);
      return '-';
    }
  if (isdigit(c))
    while (isdigit(s[++i] = c = getch()))
      ;
  if (c == '.')
    while (isdigit(s[++i] = c = getch()))
      ;
  s[i] = '\0';
  if (c != EOF)
    ungetch(c);
  return '0';
}
```