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)
L687:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L636
  cmp    $0x2,%r13d
  je     L340
  jbe    L228
  cmp    $0x3,%r13d
  je     L575
L444:
  mov    0x8(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x8(%rsp)
  mov    %al,(%rdx)
  cmp    $0x27,%eax
  je     L391
  cmp    $0x5c,%eax
  jne    L433
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L190
  cmpb   $0xa,-0x1(%rax)
  je     L588
  nopl   0x0(%rax)
L190:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  jne    L444
  nop
L636:
  mov    0x1018(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L667
  add    $0x1028,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L228:
  cmp    $0x1,%r13d
  jne    L36
  cmp    $0x2a,%eax
  je     L519
L117:
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L329
L493:
  cmpb   $0xa,-0x1(%rax)
  mov    $0x1,%r13d
  je     L456
L329:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L636
  cmp    $0x2a,%eax
  jne    L117
L519:
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    %eax,%edi
  cmp    $0x2f,%eax
  jne    L99
  nopl   0x0(%rax)
L391:
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L563
  cmpb   $0xa,-0x1(%rax)
  je     L121
L563:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L636
L36:
  cmp    $0x27,%eax
  je     L39
  cmp    $0x2f,%eax
  je     L652
  cmp    $0x22,%eax
  je     L231
  mov    0x8(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x8(%rsp)
  mov    %al,(%rdx)
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L563
L301:
  xor    %r13d,%r13d
  cmpb   $0xa,-0x1(%rax)
  jne    L563
  nopl   (%rax)
L456:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L687
L124:
  cmpb   $0xa,-0x1(%rdx)
  je     L267
L605:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L636
L340:
  mov    0x8(%rsp),%rdx
  cmp    $0xa,%eax
  je     L332
  cmp    %rbp,%rdx
  ja     L124
  mov    $0x2,%r13d
  jmp    L687
  nopl   0x0(%rax,%rax,1)
L552:
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L609
  cmpb   $0xa,-0x1(%rax)
  mov    $0x3,%r13d
  je     L456
  cs nopw 0x0(%rax,%rax,1)
L609:
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  je     L636
L575:
  mov    0x8(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x8(%rsp)
  mov    %al,(%rdx)
  cmp    $0x22,%eax
  je     L391
  cmp    $0x5c,%eax
  jne    L552
  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    L609
  cmpb   $0xa,-0x1(%rax)
  mov    $0x3,%r13d
  jne    L609
  jmp    L456
  nopl   0x0(%rax,%rax,1)
L332:
  cmp    %rbp,%rdx
  jbe    L563
  cmpb   $0xa,-0x1(%rdx)
  jne    L563
L121:
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <blankline@plt>
  mov    %rbx,%rdi
  call   <getc@plt>
  cmp    $0x80,%eax
  jne    L36
  jmp    L636
  cs nopw 0x0(%rax,%rax,1)
L433:
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L190
  cmpb   $0xa,-0x1(%rax)
  jne    L190
  jmp    L588
  nopl   (%rax)
L39:
  mov    0x8(%rsp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,0x8(%rsp)
  movb   $0x27,(%rax)
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L190
  cmpb   $0xa,-0x1(%rax)
  jne    L190
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L190
  nopl   0x0(%rax)
L231:
  mov    0x8(%rsp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,0x8(%rsp)
  movb   $0x22,(%rax)
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  jbe    L609
  cmpb   $0xa,-0x1(%rax)
  jne    L609
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L609
  nopl   0x0(%rax)
L652:
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    %eax,%edi
  mov    0x8(%rsp),%rax
  cmp    $0x2f,%edi
  je     L491
  cmp    $0x80,%edi
  je     L280
  cmp    $0x2a,%edi
  je     L451
  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     L301
  jmp    L563
L99:
  mov    %rbx,%rsi
  call   <ungetc@plt>
  mov    0x8(%rsp),%rax
  cmp    %rbp,%rax
  ja     L493
  jmp    L329
  nopl   0x0(%rax,%rax,1)
L588:
  mov    $0x4,%r13d
  jmp    L456
L267:
  mov    $0x2,%r13d
  jmp    L456
  cs nopw 0x0(%rax,%rax,1)
L451:
  cmp    %rbp,%rax
  jbe    L329
  cmpb   $0xa,-0x1(%rax)
  jne    L329
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L329
  nopl   0x0(%rax,%rax,1)
L280:
  cmp    %rbp,%rax
  jbe    L563
  jmp    L301
L491:
  cmp    %rbp,%rax
  jbe    L605
  cmpb   $0xa,-0x1(%rax)
  jne    L605
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <blankline@plt>
  jmp    L605
L667:
  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);
    }
  };
}
```