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

```asm
<json_str_read_char>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L124
  mov    $0xffffffff,%eax
  jmp    L249
L124:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  je     L275
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <utf8_get@plt>
  jmp    L249
L275:
  addq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  movl   $0x0,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  test   %eax,%eax
  je     L42
  test   %eax,%eax
  js     L193
  cmp    $0x75,%eax
  jg     L193
  cmp    $0x62,%eax
  jl     L193
  sub    $0x62,%eax
  cmp    $0x13,%eax
  ja     L193
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D10(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D10(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L193:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  jmp    L249
L42:
  mov    $0xffffffff,%eax
  jmp    L249
  mov    $0x8,%eax
  jmp    L249
  mov    $0xc,%eax
  jmp    L249
  mov    $0xa,%eax
  jmp    L249
  mov    $0xd,%eax
  jmp    L249
  mov    $0x9,%eax
  jmp    L249
  addq   $0x1,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L131
L117:
  shll   $0x4,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L257
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L257
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  or     %eax,-0x10(%rbp)
  jmp    L108
L257:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L92
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jg     L92
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x57,%eax
  or     %eax,-0x10(%rbp)
  jmp    L108
L92:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L231
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jg     L231
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x3c,%eax
  or     %eax,-0x10(%rbp)
  jmp    L108
L231:
  mov    $0xfffffffe,%eax
  jmp    L249
L108:
  addq   $0x1,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L131:
  cmpl   $0x3,-0xc(%rbp)
  jle    L117
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%eax
L249:
  leave
  ret
```

assistant: ```c
int json_str_read_char(const char **ptr) {
  const char *s = *ptr;
  if (*s == 0)
    return -1;
  if (*s != '\\')
    return utf8_get(ptr);
  s++;
  *ptr = s + 1;
  int v = 0, i;
  switch (*s) {
  default:
    return *s;
  case 0:
    return -1;
  case 'b':
    return '\b';
  case 'f':
    return '\f';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  case 'u':
    s++;
    for (i = 0; i < 4; i++) {
      v = v << 4;
      if (*s >= '0' && *s <= '9')
        v |= *s - '0';
      else if (*s >= 'a' && *s <= 'f')
        v |= *s - 'a' + 10;
      else if (*s >= 'A' && *s <= 'F')
        v |= *s - 'F' + 10;
      else
        return -2;
      s++;
    }
    *ptr = s;
    return v;
  }
}
```