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

```asm
<u8_read_escape_sequence>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x50(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x30(%rbp)
  movq   $0x1,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
  movsbl -0x31(%rbp),%eax
  mov    %eax,%edi
  call   <octal_digit@plt>
  test   %rax,%rax
  je     L108
  movq   $0x0,-0x20(%rbp)
L148:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    -0x48(%rbp),%rdx
  lea    (%rax,%rdx,1),%rcx
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  movzbl (%rcx),%edx
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
  mov    -0x20(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jae    L10
  mov    -0x48(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <octal_digit@plt>
  test   %rax,%rax
  je     L10
  cmpl   $0x2,-0x30(%rbp)
  jle    L148
L10:
  mov    -0x30(%rbp),%eax
  cltq
  movb   $0x0,-0x12(%rbp,%rax,1)
  lea    -0x12(%rbp),%rax
  mov    $0x8,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %rax,-0x28(%rbp)
  jmp    L175
L108:
  cmpb   $0x78,-0x31(%rbp)
  jne    L149
  movl   $0x2,-0x2c(%rbp)
  jmp    L89
L149:
  cmpb   $0x75,-0x31(%rbp)
  jne    L1
  movl   $0x4,-0x2c(%rbp)
  jmp    L89
L1:
  cmpb   $0x55,-0x31(%rbp)
  jne    L3
  movl   $0x8,-0x2c(%rbp)
  jmp    L89
L145:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    -0x48(%rbp),%rdx
  lea    (%rax,%rdx,1),%rcx
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  movzbl (%rcx),%edx
  cltq
  mov    %dl,-0x12(%rbp,%rax,1)
L89:
  mov    -0x20(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jae    L152
  mov    -0x48(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <hex_digit@plt>
  test   %rax,%rax
  je     L152
  mov    -0x30(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L145
L152:
  cmpl   $0x0,-0x30(%rbp)
  jne    L97
  mov    $0x0,%eax
  jmp    L118
L97:
  mov    -0x30(%rbp),%eax
  cltq
  movb   $0x0,-0x12(%rbp,%rax,1)
  lea    -0x12(%rbp),%rax
  mov    $0x10,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %rax,-0x28(%rbp)
  jmp    L175
L3:
  movsbl -0x31(%rbp),%eax
  mov    %eax,%edi
  call   <read_escape_control_char@plt>
  mov    %rax,-0x28(%rbp)
L175:
  mov    -0x58(%rbp),%rax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x20(%rbp),%rax
L118:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L104
  call   <__stack_chk_fail@plt>
L104:
  leave
  ret
```

assistant: ```c
size_t u8_read_escape_sequence(const char *str, size_t ssz, uint32_t *dest) {
  assert(ssz > 0);
  uint32_t ch;
  char digs[10];
  int dno = 0, ndig;
  size_t i = 1;
  char c0 = str[0];
  if (octal_digit(c0)) {
    i = 0;
    do {
      digs[dno++] = str[i++];
    } while (i < ssz && octal_digit(str[i]) && dno < 3);
    digs[dno] = '\0';
    ch = strtol(digs, NULL, 8);
  } else if ((c0 == 'x' && (ndig = 2)) || (c0 == 'u' && (ndig = 4)) || (c0 == 'U' && (ndig = 8))) {
    while (i < ssz && hex_digit(str[i]) && dno < ndig) {
      digs[dno++] = str[i++];
    }
    if (dno == 0)
      return 0;
    digs[dno] = '\0';
    ch = strtol(digs, NULL, 16);
  } else {
    ch = (uint32_t)read_escape_control_char(c0);
  }
  *dest = ch;
  return i;
}
```