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

```asm
<decomment_c>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x28,%rsp
  xor    %r13d,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x1018(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  mov    %rsi,%rbx
  lea    0x8(%rsp),%r12
  mov    %rbp,0x8(%rsp)
L292:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L232
  cmp    $0x2,%r13d
  je     L426
  jbe    L231
  cmp    $0x3,%r13d
  je     L351
L334:
  mov    0x8(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x8(%rsp)
  mov    %al,(%rdx)
  cmp    $0x27,%eax
  je     L160
  cmp    $0x5c,%eax
  jne    L493
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L101
  cmpb   $0xa,-0x1(%rax)
  je     L628
  nopl   0x0(%rax)
L101:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  jne    L334
  nop
L232:
  mov    0x1018(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L646
  add    $0x1028,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L231:
  cmp    $0x1,%r13d
  jne    L380
  cmp    $0x2a,%eax
  je     L129
L532:
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L433
L107:
  cmpb   $0xa,-0x1(%rax)
  mov    $0x1,%r13d
  je     L431
L433:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L232
  cmp    $0x2a,%eax
  jne    L532
L129:
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    %eax,%edi
  cmp    $0x2f,%eax
  jne    L591
  nopl   0x0(%rax)
L160:
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L429
  cmpb   $0xa,-0x1(%rax)
  je     L229
L429:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L232
L380:
  cmp    $0x27,%eax
  je     L139
  cmp    $0x2f,%eax
  je     L478
  cmp    $0x22,%eax
  je     L466
  mov    0x8(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x8(%rsp)
  mov    %al,(%rdx)
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L429
L631:
  xor    %r13d,%r13d
  cmpb   $0xa,-0x1(%rax)
  jne    L429
  nopl   (%rax)
L431:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L292
L366:
  cmpb   $0xa,-0x1(%rdx)
  je     L77
L477:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L232
L426:
  mov    0x8(%rsp),%rdx
  cmp    $0xa,%eax
  je     L96
  cmp    %rbp,%rdx
  ja     L366
  mov    $0x2,%r13d
  jmp    L292
  nopl   0x0(%rax,%rax,1)
L669:
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L309
  cmpb   $0xa,-0x1(%rax)
  mov    $0x3,%r13d
  je     L431
  cs nopw 0x0(%rax,%rax,1)
L309:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L232
L351:
  mov    0x8(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x8(%rsp)
  mov    %al,(%rdx)
  cmp    $0x22,%eax
  je     L160
  cmp    $0x5c,%eax
  jne    L669
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    %eax,%r8d
  mov    0x8(%rsp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,0x8(%rsp)
  mov    %r8b,(%rax)
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L309
  cmpb   $0xa,-0x1(%rax)
  mov    $0x3,%r13d
  jne    L309
  jmp    L431
  nopl   0x0(%rax,%rax,1)
L96:
  cmp    %rbp,%rdx
  jbe    L429
  cmpb   $0xa,-0x1(%rdx)
  jne    L429
L229:
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <blankline@plt>
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  jne    L380
  jmp    L232
  cs nopw 0x0(%rax,%rax,1)
L493:
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L101
  cmpb   $0xa,-0x1(%rax)
  jne    L101
  jmp    L628
  nopl   (%rax)
L139:
  mov    0x8(%rsp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,0x8(%rsp)
  movb   $0x27,(%rax)
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L101
  cmpb   $0xa,-0x1(%rax)
  jne    L101
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L101
  nopl   0x0(%rax)
L466:
  mov    0x8(%rsp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,0x8(%rsp)
  movb   $0x22,(%rax)
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L309
  cmpb   $0xa,-0x1(%rax)
  jne    L309
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L309
  nopl   0x0(%rax)
L478:
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    %eax,%edi
  mov    0x8(%rsp),%rax
  cmp    $0x2f,%edi
  je     L393
  cmp    $0x80,%edi
  je     L585
  cmp    $0x2a,%edi
  je     L621
  lea    0x1(%rax),%rdx
  mov    %rbx,%rsi
  mov    %rdx,0x8(%rsp)
  movb   $0x2f,(%rax)
  call   <ungetc@plt>
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  ja     L631
  jmp    L429
L591:
  mov    %rbx,%rsi
  call   <ungetc@plt>
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  ja     L107
  jmp    L433
  nopl   0x0(%rax,%rax,1)
L628:
  mov    $0x4,%r13d
  jmp    L431
L77:
  mov    $0x2,%r13d
  jmp    L431
  cs nopw 0x0(%rax,%rax,1)
L621:
  cmp    %rbp,%rax
  jbe    L433
  cmpb   $0xa,-0x1(%rax)
  jne    L433
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L433
  nopl   0x0(%rax,%rax,1)
L585:
  cmp    %rbp,%rax
  jbe    L429
  jmp    L631
L393:
  cmp    %rbp,%rax
  jbe    L477
  cmpb   $0xa,-0x1(%rax)
  jne    L477
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L477
L646:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void decomment_c(const char *fname, FILE *in) {
  register int c, c1;
  char outbuf[4 * 1024];
  char *op = outbuf;
  enum { NORMAL, C_COMMENT, CC_COMMENT, STRINGLITERAL, CHARLITERAL } state = NORMAL;
  while ((c = getc(in)) != EOF) {
    switch (state) {
    case NORMAL:
      switch (c) {
      case '\'':
        state = CHARLITERAL;
        *op++ = c;
        break;
      case '"':
        state = STRINGLITERAL;
        *op++ = c;
        break;
      case '/':
        c1 = getc(in);
        switch (c1) {
        case '/':
          state = CC_COMMENT;
          break;
        case '*':
          state = C_COMMENT;
          break;
        case EOF:
          break;
        default:
          *op++ = c;
          ungetc(c1, in);
          break;
        }
        break;
      default:
        *op++ = c;
        break;
      }
      break;
    case C_COMMENT:
      if (c == '*') {
        c1 = getc(in);
        if (c1 == '/') {
          state = NORMAL;
        } else {
          ungetc(c1, in);
        }
      }
      break;
    case CC_COMMENT:
      if (c == '\n') {
        state = NORMAL;
      }
      break;
    case STRINGLITERAL:
      *op++ = c;
      switch (c) {
      case '"':
        state = NORMAL;
        break;
      case '\\':
        c1 = getc(in);
        *op++ = c1;
        break;
      }
      break;
    case CHARLITERAL:
      *op++ = c;
      switch (c) {
      case '\'':
        state = NORMAL;
        break;
      case '\\':
        getc(in);
        break;
      }
      break;
    }
    if (op > outbuf && op[-1] == '\n') {
      blankline(outbuf, &op);
    }
  };
}
```