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

```asm
<explodegophermapline>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x40(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x48(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x50(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x58(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x60(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L212
  mov    -0x40(%rbp),%rax
  movb   $0x69,(%rax)
  mov    $0x0,%eax
  jmp    L68
L212:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x38(%rbp)
  movl   $0x0,-0x24(%rbp)
L131:
  cmpl   $0x3ff,-0x24(%rbp)
  jne    L187
  mov    $0xffffffff,%eax
  jmp    L68
L187:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L232
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L223
  mov    $0x0,%eax
  jmp    L68
L223:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addq   $0x1,-0x38(%rbp)
  jmp    L131
L232:
  nop
  addq   $0x1,-0x38(%rbp)
  movl   $0x0,-0x24(%rbp)
L69:
  cmpl   $0x3ff,-0x24(%rbp)
  jne    L121
  mov    $0xffffffff,%eax
  jmp    L68
L121:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L1
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L275
  mov    $0x0,%eax
  jmp    L68
L275:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addq   $0x1,-0x38(%rbp)
  jmp    L69
L1:
  nop
  addq   $0x1,-0x38(%rbp)
  movl   $0x0,-0x24(%rbp)
L146:
  cmpl   $0x3f,-0x24(%rbp)
  jne    L242
  mov    $0xffffffff,%eax
  jmp    L68
L242:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L238
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L120
  mov    $0x0,%eax
  jmp    L68
L120:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addq   $0x1,-0x38(%rbp)
  jmp    L146
L238:
  nop
  addq   $0x1,-0x38(%rbp)
  movl   $0x0,-0x24(%rbp)
L271:
  cmpl   $0x8,-0x24(%rbp)
  jne    L204
  mov    $0xffffffff,%eax
  jmp    L68
L204:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L216
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L113
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x24(%rbp),%eax
  cltq
  mov    %dl,-0x20(%rbp,%rax,1)
  addl   $0x1,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  movb   $0x0,-0x20(%rbp,%rax,1)
  addq   $0x1,-0x38(%rbp)
  jmp    L271
L216:
  nop
  jmp    L87
L113:
  nop
L87:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <atol@plt>
  mov    -0x60(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jle    L118
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  cmp    $0xffff,%rax
  jle    L33
L118:
  mov    -0x60(%rbp),%rax
  movq   $0x0,(%rax)
L33:
  mov    $0x0,%eax
L68:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L23
  call   <__stack_chk_fail@plt>
L23:
  leave
  ret
```

assistant: ```c
int explodegophermapline(char *linebuff, char *itemtype, char *itemdesc, char *itemselector, char *itemserver, long *itemport) {
  int x;
  char tmpstring[16];
  *itemtype = 0;
  itemdesc[0] = 0;
  itemselector[0] = 0;
  itemserver[0] = 0;
  *itemport = 0;
  if (*linebuff == 0) {
    *itemtype = 'i';
    return (0);
  }
  *itemtype = *linebuff;
  linebuff += 1;
  for (x = 0;;) {
    if (x == 1023)
      return (-1);
    if (*linebuff == '\t')
      break;
    if (*linebuff == 0)
      return (0);
    itemdesc[x] = *linebuff;
    itemdesc[++x] = 0;
    linebuff += 1;
  }
  linebuff += 1;
  for (x = 0;;) {
    if (x == 1023)
      return (-1);
    if (*linebuff == '\t')
      break;
    if (*linebuff == 0)
      return (0);
    itemselector[x] = *linebuff;
    itemselector[++x] = 0;
    linebuff += 1;
  }
  linebuff += 1;
  for (x = 0;;) {
    if (x == 63)
      return (-1);
    if (*linebuff == '\t')
      break;
    if (*linebuff == 0)
      return (0);
    itemserver[x] = *linebuff;
    itemserver[++x] = 0;
    linebuff += 1;
  }
  linebuff += 1;
  for (x = 0;;) {
    if (x == 8)
      return (-1);
    if (*linebuff == '\t')
      break;
    if (*linebuff == 0)
      break;
    tmpstring[x] = *linebuff;
    tmpstring[++x] = 0;
    linebuff += 1;
  }
  *itemport = atol(tmpstring);
  if ((*itemport < 1) || (*itemport > 65535))
    *itemport = 0;
  return (0);
}
```