user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<to8bit>:
  endbr64
  push   %r12
  push   %rbp
  sub    $0x8,%rsp
L132:
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0x80,%eax
  je     L56
L223:
  movzbl %al,%edi
  cmp    $0x5c,%al
  je     L257
L90:
  call   <putchar@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0x80,%eax
  jne    L223
L56:
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L257:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    $0x78,%eax
  je     L150
  jg     L213
  cmp    $0x37,%eax
  jg     L145
  cmp    $0x2f,%eax
  jle    L108
  xor    %eax,%eax
  sub    $0x30,%ebp
  call   <getchar@plt>
  lea    -0x30(%rax),%edi
  mov    %eax,%r12d
  cmp    $0x7,%edi
  ja     L253
  shl    $0x3,%ebp
  xor    %eax,%eax
  or     %edi,%ebp
  call   <getchar@plt>
  lea    -0x30(%rax),%edi
  mov    %eax,%r12d
  cmp    $0x7,%edi
  ja     L253
  shl    $0x3,%ebp
  or     %ebp,%edi
  call   <putchar@plt>
  jmp    L132
  nopl   0x0(%rax)
L213:
  cmp    $0x80,%eax
  jne    L108
  add    $0x8,%rsp
  mov    $0x5c,%edi
  pop    %rbp
  pop    %r12
  jmp    1060 <putchar@plt>
L145:
  cmp    $0x58,%eax
  jne    L108
L150:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%r12d
  lea    -0x30(%rax),%eax
  cmp    $0x9,%eax
  ja     L245
  mov    %eax,%r12d
L15:
  xor    %eax,%eax
  call   <getchar@plt>
  lea    -0x30(%rax),%edi
  mov    %eax,%ebp
  cmp    $0x9,%edi
  ja     L239
  mov    %r12d,%eax
  shl    $0x4,%eax
  or     %eax,%edi
  jmp    L90
  nopl   0x0(%rax,%rax,1)
L108:
  mov    $0x5c,%edi
  call   <putchar@plt>
  mov    %ebp,%edi
  jmp    L90
  nopl   0x0(%rax)
L253:
  mov    %ebp,%edi
  call   <putchar@plt>
  mov    %r12d,%edi
  call   <putchar@plt>
  jmp    L132
  nopl   0x0(%rax)
L245:
  lea    -0x61(%r12),%eax
  cmp    $0x5,%eax
  jbe    L146
  lea    -0x41(%r12),%eax
  cmp    $0x5,%eax
  ja     L203
  sub    $0x37,%r12d
  jmp    L15
  nopw   0x0(%rax,%rax,1)
L239:
  lea    -0x61(%rax),%eax
  cmp    $0x5,%eax
  jbe    L248
  lea    -0x41(%rbp),%eax
  cmp    $0x5,%eax
  ja     L98
  shl    $0x4,%ebp
  lea    -0x37(%rbp),%edi
  jmp    L90
  nopl   0x0(%rax,%rax,1)
L146:
  sub    $0x57,%r12d
  jmp    L15
  nopl   0x0(%rax)
L248:
  shl    $0x4,%ebp
  lea    -0x57(%rbp),%edi
  jmp    L90
L203:
  mov    $0x5c,%edi
  call   <putchar@plt>
  mov    %ebp,%edi
  call   <putchar@plt>
  mov    %r12d,%edi
  call   <putchar@plt>
  jmp    L132
L98:
  mov    %r12d,%edi
  call   <putchar@plt>
  mov    %ebp,%edi
  call   <putchar@plt>
  jmp    L132
```

assistant: ```c
void to8bit() {
  int backch;
  int ch;
  while ((ch = getchar()) != EOF) {
    ch &= 0xFF;
    if (ch != '\\')
      (void)putchar(ch);
    else {
      ch = getchar();
      switch (ch) {
      case EOF:
        (void)putchar('\\');
        return;
      case 'x':
      case 'X':
        backch = ch;
        ch = getchar();
        if (ch >= '0' && ch <= '9')
          backch = ch - '0';
        else if (ch >= 'a' && ch <= 'f')
          backch = ch - 'a' + 0xA;
        else if (ch >= 'A' && ch <= 'F')
          backch = ch - 'A' + 0xA;
        else {
          (void)putchar('\\');
          (void)putchar(backch);
          (void)putchar(ch);
          break;
        }
        ch = getchar();
        if (ch >= '0' && ch <= '9')
          backch = (backch << 4) | (ch - '0');
        else if (ch >= 'a' && ch <= 'f')
          backch = (ch << 4) - 'a' + 0xA;
        else if (ch >= 'A' && ch <= 'F')
          backch = (ch << 4) - 'A' + 0xA;
        else {
          (void)putchar(backch);
          (void)putchar(ch);
          break;
        }
        (void)putchar(backch);
        break;
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
        backch = ch - '0';
        ch = getchar();
        if (ch >= '0' && ch <= '7')
          backch = (backch << 3) | (ch - '0');
        else {
          (void)putchar(backch);
          (void)putchar(ch);
          break;
        }
        ch = getchar();
        if (ch >= '0' && ch <= '7')
          backch = (backch << 3) | (ch - '0');
        else {
          (void)putchar(backch);
          (void)putchar(ch);
          break;
        }
        (void)putchar(backch);
        break;
        break;
      default:
        (void)putchar('\\');
        (void)putchar(ch);
        break;
      }
    }
  }
}
```