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

```asm
<getop>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  nopl   (%rax)
L259:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %al,(%rbx)
  mov    %eax,%r12d
  cmp    $0x9,%eax
  je     L259
  cmp    $0x20,%al
  je     L259
  movb   $0x0,0x1(%rbx)
  cmp    $0x2d,%eax
  je     L178
  movsbl %al,%ebp
  mov    %ebp,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L212
  cmp    $0x2e,%r12d
  jne    L214
L212:
  mov    %r12d,%edi
  xor    %r13d,%r13d
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L249
L127:
  mov    %ebp,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L77
  lea    0x1(%r13),%ebp
  movslq %ebp,%rbp
  nopw   0x0(%rax,%rax,1)
L231:
  xor    %eax,%eax
  mov    %ebp,%r13d
  call   <getch@plt>
  mov    %al,(%rbx,%rbp,1)
  movsbl %al,%edi
  mov    %eax,%r12d
  add    $0x1,%rbp
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L231
L77:
  movslq %r13d,%r14
  add    %rbx,%r14
  cmp    $0x2e,%r12d
  je     L171
  mov    D15(%rip),%rax
  movb   $0x0,(%r14)
  cmp    %r12d,(%rax)
  jne    L167
L99:
  cmpb   $0x2d,(%rbx)
  jne    L242
L143:
  mov    $0x2d,%r12d
  cmp    $0x1,%r13d
  je     L35
L242:
  mov    $0x30,%r12d
L35:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L167:
  mov    %r12d,%edi
  call   <ungetch@plt>
  cmpb   $0x2d,(%rbx)
  je     L143
  jmp    L242
  nop
L171:
  movslq %r13d,%rax
  lea    0x1(%r13),%r15d
  lea    0x1(%rbx,%rax,1),%rbp
  sub    %ebp,%r15d
  nop
L217:
  xor    %eax,%eax
  lea    (%r15,%rbp,1),%r13d
  mov    %rbp,%r14
  add    $0x1,%rbp
  call   <getch@plt>
  mov    %al,-0x1(%rbp)
  movsbl %al,%edi
  mov    %eax,%r12d
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L217
  mov    D15(%rip),%rax
  movb   $0x0,(%r14)
  cmp    %r12d,(%rax)
  je     L99
  jmp    L167
  nopl   0x0(%rax,%rax,1)
L178:
  mov    $0x2d,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L193
L249:
  mov    %rbx,%rbp
  xor    %r14d,%r14d
  nopl   0x0(%rax)
L23:
  mov    %r12d,%edi
  lea    0x1(%r14),%r13d
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L91
  cmp    $0xa,%r12d
  jne    L148
  movslq %r14d,%rax
  lea    0x2(%r14),%r13d
  movb   $0xa,(%rbx,%rax,1)
L148:
  movslq %r13d,%r13
  mov    $0x61,%r12d
  movb   $0x0,(%rbx,%r13,1)
  jmp    L35
  nopl   (%rax)
L91:
  mov    %r12b,0x0(%rbp)
  add    $0x1,%rbp
  cmp    $0xa,%r12d
  je     L59
  xor    %eax,%eax
  mov    %r13d,%r14d
  call   <getch@plt>
  mov    %eax,%r12d
  jmp    L23
  nopl   (%rax)
L214:
  mov    %r12d,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L212
  jmp    L35
  xchg   %ax,%ax
L193:
  xor    %eax,%eax
  mov    $0x1,%r13d
  call   <getch@plt>
  mov    %al,0x1(%rbx)
  mov    %eax,%r12d
  movsbl %al,%ebp
  jmp    L127
L59:
  lea    0x2(%r14),%r13d
  jmp    L148
```

assistant: ```c
int getop(char s[]) {
  int i, c;
  while ((s[0] = c = getch()) == ' ' || c == '\t') {
  }
  s[1] = '\0';
  if (c != '-' && !isdigit(c) && c != '.' && !isalpha(c)) {
    return c;
  }
  i = 0;
  if (isalpha(c)) {
    while (isalpha(c) || c == '\n') {
      s[i++] = c;
      if (c == '\n') {
        break;
      }
      c = getch();
    }
    s[++i] = '\0';
    return 'a';
  }
  if (c == '-') {
    s[++i] = c = getch();
  }
  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);
  }
  if (s[0] == '-' && i == 1) {
    return '-';
  }
  return '0';
}
```