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

```asm
<UTF2Lat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L556
L641:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xf0,%eax
  cmp    $0xe0,%eax
  jne    L598
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L598
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L598
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0xe2,%eax
  jne    L300
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0x84,%eax
  je     L66
  cmp    $0x84,%eax
  jg     L458
  cmp    $0x80,%eax
  je     L424
  cmp    $0x82,%eax
  je     L412
  jmp    L458
L424:
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  sub    $0x93,%eax
  cmp    $0x27,%eax
  ja     L450
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D2(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D2(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x10(%rbp),%rax
  movb   $0x96,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x97,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x91,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x27,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x82,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x93,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x94,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x84,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x86,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x87,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x95,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x85,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x89,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x8b,(%rax)
  jmp    L235
  mov    -0x10(%rbp),%rax
  movb   $0x9b,(%rax)
  nop
L235:
  jmp    L450
L412:
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0xac,%eax
  jne    L90
  mov    -0x10(%rbp),%rax
  movb   $0x80,(%rax)
  nop
  jmp    L90
L66:
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0xa2,%eax
  jne    L196
  mov    -0x10(%rbp),%rax
  movb   $0x99,(%rax)
  nop
  jmp    L196
L450:
  nop
  jmp    L458
L90:
  nop
  jmp    L458
L196:
  nop
L458:
  nop
L300:
  addq   $0x3,-0x18(%rbp)
  jmp    L587
L598:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xe0,%eax
  cmp    $0xc0,%eax
  jne    L394
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L394
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  sub    $0xc2,%eax
  cmp    $0x9,%eax
  ja     L451
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D17(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D17(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa0,%al
  jne    L14
  mov    -0x10(%rbp),%rax
  movb   $0x20,(%rax)
  jmp    L14
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0xb3,%eax
  jne    L159
  mov    -0x10(%rbp),%rax
  movb   $0xa2,(%rax)
  jmp    L363
L159:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  or     $0xffffffc0,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  nop
L363:
  jmp    L451
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  sub    $0x92,%eax
  cmp    $0x2c,%eax
  ja     L226
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D29(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D29(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x10(%rbp),%rax
  movb   $0x8c,(%rax)
  jmp    L648
  mov    -0x10(%rbp),%rax
  movb   $0x9c,(%rax)
  jmp    L648
  mov    -0x10(%rbp),%rax
  movb   $0x8a,(%rax)
  jmp    L648
  mov    -0x10(%rbp),%rax
  movb   $0x9a,(%rax)
  jmp    L648
  mov    -0x10(%rbp),%rax
  movb   $0x8f,(%rax)
  jmp    L648
  mov    -0x10(%rbp),%rax
  movb   $0x8e,(%rax)
  jmp    L648
  mov    -0x10(%rbp),%rax
  movb   $0x9e,(%rax)
  nop
L648:
  jmp    L226
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0x92,%eax
  jne    L372
  mov    -0x10(%rbp),%rax
  movb   $0x83,(%rax)
  nop
  jmp    L372
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cmp    $0x86,%eax
  je     L71
  cmp    $0x9c,%eax
  je     L486
  jmp    L451
L71:
  mov    -0x10(%rbp),%rax
  movb   $0x88,(%rax)
  jmp    L247
L486:
  mov    -0x10(%rbp),%rax
  movb   $0x98,(%rax)
  nop
L247:
  jmp    L451
L14:
  nop
  jmp    L451
L226:
  nop
  jmp    L451
L372:
  nop
L451:
  addq   $0x2,-0x18(%rbp)
  jmp    L587
L394:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    -0x10(%rbp),%rdx
  mov    %al,(%rdx)
L587:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L540
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <filtre@plt>
  test   %rax,%rax
  jne    L198
L540:
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  sub    -0x30(%rbp),%rax
  jmp    L164
L198:
  addq   $0x1,-0x10(%rbp)
  subl   $0x1,-0x1c(%rbp)
L556:
  mov    -0x18(%rbp),%rax
  sub    -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x34(%rbp),%eax
  cltq
  cmp    %rax,%rdx
  jge    L601
  cmpl   $0x0,-0x1c(%rbp)
  jle    L601
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L641
L601:
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  sub    -0x30(%rbp),%rax
L164:
  leave
  ret
```

assistant: ```c
int UTF2Lat(unsigned char *buffer_lower, const unsigned char *buffer, const int buf_len) {
  const unsigned char *p;
  unsigned char *q;
  int i;
  for (i = buf_len, p = buffer, q = buffer_lower; p - buffer < buf_len && i > 0 && *p != '\0';) {
    const unsigned char *p_org = p;
    if ((*p & 0xf0) == 0xe0 && (*(p + 1) & 0xc0) == 0x80 && (*(p + 2) & 0xc0) == 0x80) {
      *q = '\0';
      switch (*p) {
      case 0xE2:
        switch (*(p + 1)) {
        case 0x80:
          switch (*(p + 2)) {
          case 0x93:
            (*q) = 150;
            break;
          case 0x94:
            (*q) = 151;
            break;
          case 0x98:
            (*q) = 145;
            break;
          case 0x99:
            (*q) = '\'';
            break;
          case 0x9A:
            (*q) = 130;
            break;
          case 0x9C:
            (*q) = 147;
            break;
          case 0x9D:
            (*q) = 148;
            break;
          case 0x9E:
            (*q) = 132;
            break;
          case 0xA0:
            (*q) = 134;
            break;
          case 0xA1:
            (*q) = 135;
            break;
          case 0xA2:
            (*q) = 149;
            break;
          case 0xA6:
            (*q) = 133;
            break;
          case 0xB0:
            (*q) = 137;
            break;
          case 0xB9:
            (*q) = 139;
            break;
          case 0xBA:
            (*q) = 155;
            break;
          }
          break;
        case 0x82:
          switch (*(p + 2)) {
          case 0xAC:
            (*q) = 128;
            break;
          }
          break;
        case 0x84:
          switch (*(p + 2)) {
          case 0xA2:
            (*q) = 153;
            break;
          }
          break;
        }
        break;
      }
      p += 3;
    } else if ((*p & 0xe0) == 0xc0 && (*(p + 1) & 0xc0) == 0x80) {
      *q = '\0';
      switch (*p) {
      case 0xC2:
        (*q) = ((*(p + 1)) | 0x80) & 0xBF;
        if ((*q) == 0xA0)
          (*q) = ' ';
        break;
      case 0xC3:
        switch (*(p + 1)) {
        case 0xB3:
          (*q) = 162;
          break;
        default:
          (*q) = (*(p + 1)) | 0xC0;
          break;
        }
        break;
      case 0xC5:
        switch (*(p + 1)) {
        case 0x92:
          (*q) = 140;
          break;
        case 0x93:
          (*q) = 156;
          break;
        case 0xA0:
          (*q) = 138;
          break;
        case 0xA1:
          (*q) = 154;
          break;
        case 0xB8:
          (*q) = 143;
          break;
        case 0xBD:
          (*q) = 142;
          break;
        case 0xBE:
          (*q) = 158;
          break;
        }
        break;
      case 0xC6:
        switch (*(p + 1)) {
        case 0x92:
          (*q) = 131;
          break;
        }
        break;
      case 0xCB:
        switch (*(p + 1)) {
        case 0x86:
          (*q) = 136;
          break;
        case 0x9C:
          (*q) = 152;
          break;
        }
        break;
      }
      p += 2;
    } else {
      *q = tolower(*p++);
    }
    if (*q == '\0' || filtre(*q) == 0) {
      *q = '\0';
      return (p_org - buffer);
    }
    q++;
    i--;
  }
  *q = '\0';
  return (p - buffer);
}
```