user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  jmp    L146
L35:
  cmpl   $0x3d,-0x8(%rbp)
  je     L184
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  jmp    L146
L184:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x8(%rbp)
  mov    D15(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  je     L162
  cmpl   $0xa,-0x8(%rbp)
  jne    L60
  jmp    L146
L60:
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %eax,%eax
  jne    L77
  mov    $0x3d,%edi
  call   <putchar@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  jmp    L146
L77:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x4(%rbp)
  mov    D15(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L102
  mov    $0x3d,%edi
  call   <putchar@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  jmp    L82
L102:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %eax,%eax
  jne    L75
  mov    $0x3d,%edi
  call   <putchar@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  jmp    L146
L75:
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L24
  mov    -0x8(%rbp),%eax
  sub    $0x30,%eax
  jmp    L154
L24:
  mov    -0x8(%rbp),%eax
  sub    $0x57,%eax
L154:
  mov    %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L124
  mov    -0x4(%rbp),%eax
  sub    $0x30,%eax
  jmp    L66
L124:
  mov    -0x4(%rbp),%eax
  sub    $0x57,%eax
L66:
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edi
  call   <putchar@plt>
L146:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x8(%rbp)
  mov    D15(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jne    L35
  jmp    L82
L162:
  nop
L82:
  mov    D43(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L118
  mov    D45(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ferror@plt>
  test   %rax,%rax
  je     L178
L118:
  mov    $0x1,%edi
  call   <exit@plt>
L178:
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main() {
  int ch1, ch2;
  while ((ch1 = getchar()) != EOF) {
    if (ch1 != '=') {
      putchar(ch1);
      continue;
    }
    if ((ch1 = getchar()) == EOF)
      break;
    if (ch1 == '\n')
      continue;
    if (!isxdigit(ch1)) {
      putchar('=');
      putchar(ch1);
      continue;
    }
    if ((ch2 = getchar()) == EOF) {
      putchar('=');
      putchar(ch1);
      break;
    }
    if (!isxdigit(ch2)) {
      putchar('=');
      putchar(ch1);
      putchar(ch2);
      continue;
    }
    ch1 = tolower(ch1);
    ch1 = isdigit(ch1) ? (ch1 - '0') : (ch1 - 'a' + 10);
    ch2 = tolower(ch2);
    ch2 = isdigit(ch2) ? (ch2 - '0') : (ch2 - 'a' + 10);
    putchar((ch1 << 4) + ch2);
  }
  if (ferror(stdin) || ferror(stdout))
    exit(1);
  return (0);
}
```